Commit 54ca2969 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: replaced prefix of SDIO related functions

Code cleanup. Prefixed functions with brcmf_ for unique namespace. In addition
to that, prefix has been changed to categorize functions depending on their
place in the drivers SDIO stack.
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7faf8c5b
......@@ -48,68 +48,70 @@ typedef void (*sdioh_cb_fn_t) (void *);
* The handler shall be provided by all subsequent calls. No local cache
* cfghdl points to the starting address of pci device mapped memory
*/
extern sdioh_info_t *sdioh_attach(void *cfghdl, uint irq);
extern SDIOH_API_RC sdioh_detach(sdioh_info_t *si);
extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si,
extern sdioh_info_t *brcmf_sdioh_attach(void *cfghdl, uint irq);
extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *si);
extern SDIOH_API_RC brcmf_sdioh_interrupt_register(sdioh_info_t *si,
sdioh_cb_fn_t fn, void *argh);
extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si);
extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *si);
/* query whether SD interrupt is enabled or not */
extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
/* enable or disable SD interrupt */
extern SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
extern SDIOH_API_RC
brcmf_sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
#if defined(DHD_DEBUG)
extern bool sdioh_interrupt_pending(sdioh_info_t *si);
extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *si);
#endif
extern int sdioh_claim_host_and_lock(sdioh_info_t *si);
extern int sdioh_release_host_and_unlock(sdioh_info_t *si);
extern int brcmf_sdioh_claim_host_and_lock(sdioh_info_t *si);
extern int brcmf_sdioh_release_host_and_unlock(sdioh_info_t *si);
/* read or write one byte using cmd52 */
extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc,
uint addr, u8 *byte);
extern SDIOH_API_RC
brcmf_sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr,
u8 *byte);
/* read or write 2/4 bytes using cmd53 */
extern SDIOH_API_RC sdioh_request_word(sdioh_info_t *si, uint cmd_type,
extern SDIOH_API_RC brcmf_sdioh_request_word(sdioh_info_t *si, uint cmd_type,
uint rw, uint fnc, uint addr,
u32 *word, uint nbyte);
/* read or write any buffer using cmd53 */
extern SDIOH_API_RC sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
extern SDIOH_API_RC brcmf_sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
uint fix_inc, uint rw, uint fnc_num,
u32 addr, uint regwidth,
u32 buflen, u8 *buffer,
struct sk_buff *pkt);
/* get cis data */
extern SDIOH_API_RC sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
extern SDIOH_API_RC brcmf_sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
u32 length);
extern SDIOH_API_RC sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
extern SDIOH_API_RC brcmf_sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
u8 *data);
extern SDIOH_API_RC sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
extern SDIOH_API_RC brcmf_sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
u8 *data);
/* query number of io functions */
extern uint sdioh_query_iofnum(sdioh_info_t *si);
extern uint brcmf_sdioh_query_iofnum(sdioh_info_t *si);
/* handle iovars */
extern int sdioh_iovar_op(sdioh_info_t *si, const char *name,
extern int brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
void *params, int plen, void *arg, int len, bool set);
/* Issue abort to the specified function and clear controller as needed */
extern int sdioh_abort(sdioh_info_t *si, uint fnc);
extern int brcmf_sdioh_abort(sdioh_info_t *si, uint fnc);
/* Start and Stop SDIO without re-enumerating the SD card. */
extern int sdioh_start(sdioh_info_t *si, int stage);
extern int sdioh_stop(sdioh_info_t *si);
extern int brcmf_sdioh_start(sdioh_info_t *si, int stage);
extern int brcmf_sdioh_stop(sdioh_info_t *si);
/* Reset and re-initialize the device */
extern int sdioh_sdio_reset(sdioh_info_t *si);
extern int brcmf_sdioh_reset(sdioh_info_t *si);
/* Helper function */
void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
#endif /* _sdio_api_h_ */
This diff is collapsed.
......@@ -33,7 +33,7 @@
#if defined(OOB_INTR_ONLY)
#include <linux/irq.h>
extern void dhdsdio_isr(void *args);
extern void brcmf_sdbrcm_isr(void *args);
#endif /* defined(OOB_INTR_ONLY) */
#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
#if !defined(BCMPLATFORM_BUS)
......@@ -71,7 +71,7 @@ struct bcmsdh_hc {
};
static bcmsdh_hc_t *sdhcinfo;
/* driver info, initialized when bcmsdh_register is called */
/* driver info, initialized when brcmf_sdio_register is called */
static bcmsdh_driver_t drvinfo = { NULL, NULL };
/* debugging macros */
......@@ -80,7 +80,7 @@ static bcmsdh_driver_t drvinfo = { NULL, NULL };
/**
* Checks to see if vendor and device IDs match a supported SDIO Host Controller.
*/
bool bcmsdh_chipmatch(u16 vendor, u16 device)
bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
{
/* Add other vendors and devices as required */
......@@ -125,22 +125,22 @@ bool bcmsdh_chipmatch(u16 vendor, u16 device)
#if defined(BCMPLATFORM_BUS)
#if defined(BCMLXSDMMC)
/* forward declarations */
int bcmsdh_probe(struct device *dev);
EXPORT_SYMBOL(bcmsdh_probe);
int brcmf_sdio_probe(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_probe);
int bcmsdh_remove(struct device *dev);
EXPORT_SYMBOL(bcmsdh_remove);
int brcmf_sdio_remove(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_remove);
#else
/* forward declarations */
static int __devinit bcmsdh_probe(struct device *dev);
static int __devexit bcmsdh_remove(struct device *dev);
static int __devinit brcmf_sdio_probe(struct device *dev);
static int __devexit brcmf_sdio_remove(struct device *dev);
#endif /* BCMLXSDMMC */
#ifndef BCMLXSDMMC
static
#endif /* BCMLXSDMMC */
int bcmsdh_probe(struct device *dev)
int brcmf_sdio_probe(struct device *dev)
{
bcmsdh_hc_t *sdhc = NULL;
unsigned long regs = 0;
......@@ -184,13 +184,13 @@ int bcmsdh_probe(struct device *dev)
sdhc->dev = (void *)dev;
#ifdef BCMLXSDMMC
sdh = bcmsdh_attach((void *)0, (void **)&regs, irq);
sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
#else
sdh = bcmsdh_attach((void *)r->start, (void **)&regs, irq);
sdh = brcmf_sdcard_attach((void *)r->start, (void **)&regs, irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
......@@ -208,7 +208,7 @@ int bcmsdh_probe(struct device *dev)
sdhc->next = sdhcinfo;
sdhcinfo = sdhc;
/* Read the vendor/device ID from the CIS */
vendevid = bcmsdh_query_device(sdh);
vendevid = brcmf_sdcard_query_device(sdh);
/* try to attach to the target device */
sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
......@@ -224,7 +224,7 @@ int bcmsdh_probe(struct device *dev)
err:
if (sdhc) {
if (sdhc->sdh)
bcmsdh_detach(sdhc->sdh);
brcmf_sdcard_detach(sdhc->sdh);
kfree(sdhc);
}
......@@ -234,13 +234,13 @@ int bcmsdh_probe(struct device *dev)
#ifndef BCMLXSDMMC
static
#endif /* BCMLXSDMMC */
int bcmsdh_remove(struct device *dev)
int brcmf_sdio_remove(struct device *dev)
{
bcmsdh_hc_t *sdhc, *prev;
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
bcmsdh_detach(sdhc->sdh);
brcmf_sdcard_detach(sdhc->sdh);
/* find the SDIO Host Controller state for this pdev
and take it out from the list */
for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
......@@ -269,25 +269,25 @@ int bcmsdh_remove(struct device *dev)
}
#endif /* BCMPLATFORM_BUS */
extern int sdio_function_init(void);
extern int brcmf_sdio_function_init(void);
int bcmsdh_register(bcmsdh_driver_t *driver)
int brcmf_sdio_register(bcmsdh_driver_t *driver)
{
drvinfo = *driver;
SDLX_MSG(("Linux Kernel SDIO/MMC Driver\n"));
return sdio_function_init();
return brcmf_sdio_function_init();
}
extern void sdio_function_cleanup(void);
extern void brcmf_sdio_function_cleanup(void);
void bcmsdh_unregister(void)
void brcmf_sdio_unregister(void)
{
sdio_function_cleanup();
brcmf_sdio_function_cleanup();
}
#if defined(OOB_INTR_ONLY)
void bcmsdh_oob_intr_set(bool enable)
void brcmf_sdio_oob_intr_set(bool enable)
{
static bool curstate = 1;
unsigned long flags;
......@@ -303,25 +303,25 @@ void bcmsdh_oob_intr_set(bool enable)
spin_unlock_irqrestore(&sdhcinfo->irq_lock, flags);
}
static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
static irqreturn_t brcmf_sdio_oob_irq(int irq, void *dev_id)
{
dhd_pub_t *dhdp;
dhdp = (dhd_pub_t *) dev_get_drvdata(sdhcinfo->dev);
bcmsdh_oob_intr_set(0);
brcmf_sdio_oob_intr_set(0);
if (dhdp == NULL) {
SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
return IRQ_HANDLED;
}
dhdsdio_isr((void *)dhdp->bus);
brcmf_sdbrcm_isr((void *)dhdp->bus);
return IRQ_HANDLED;
}
int bcmsdh_register_oob_intr(void *dhdp)
int brcmf_sdio_register_oob_intr(void *dhdp)
{
int error = 0;
......@@ -338,7 +338,7 @@ int bcmsdh_register_oob_intr(void *dhdp)
/* Refer to customer Host IRQ docs about
proper irqflags definition */
error =
request_irq(sdhcinfo->oob_irq, wlan_oob_irq,
request_irq(sdhcinfo->oob_irq, brcmf_sdio_oob_irq,
sdhcinfo->oob_flags, "bcmsdh_sdmmc", NULL);
if (error)
return -ENODEV;
......@@ -350,7 +350,7 @@ int bcmsdh_register_oob_intr(void *dhdp)
return 0;
}
void bcmsdh_unregister_oob_intr(void)
void brcmf_sdio_unregister_oob_intr(void)
{
SDLX_MSG(("%s: Enter\n", __func__));
......
......@@ -14,6 +14,10 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*/
#ifndef __BCMSDH_SDMMC_H__
#define __BCMSDH_SDMMC_H__
......@@ -58,8 +62,8 @@
#endif
/* Allocate/init/free per-OS private data */
extern int sdioh_sdmmc_osinit(sdioh_info_t *sd);
extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
extern int brcmf_sdioh_osinit(sdioh_info_t *sd);
extern void brcmf_sdioh_osfree(sdioh_info_t *sd);
#define BLOCK_SIZE_64 64
#define BLOCK_SIZE_512 512
......@@ -105,23 +109,23 @@ struct sdioh_info {
extern uint sd_msglevel;
/* OS-independent interrupt handler */
extern bool check_client_intr(sdioh_info_t *sd);
extern bool brcmf_sdioh_check_client_intr(sdioh_info_t *sd);
/* Core interrupt enable/disable of device interrupts */
extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
/**************************************************************
* Internal interfaces: bcmsdh_sdmmc.c references to per-port code
*/
/* Register mapping routines */
extern u32 *sdioh_sdmmc_reg_map(s32 addr, int size);
extern void sdioh_sdmmc_reg_unmap(s32 addr, int size);
extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
/* Interrupt (de)registration routines */
extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);
extern void sdioh_sdmmc_free_irq(uint irq, sdioh_info_t *sd);
extern int brcmf_sdioh_register_irq(sdioh_info_t *sd, uint irq);
extern void brcmf_sdioh_free_irq(uint irq, sdioh_info_t *sd);
typedef struct _BCMSDH_SDMMC_INSTANCE {
sdioh_info_t *sd;
......
......@@ -55,11 +55,11 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
int sdio_function_init(void);
void sdio_function_cleanup(void);
int brcmf_sdio_function_init(void);
void brcmf_sdio_function_cleanup(void);
/* module param defaults */
static int clockoverride;
......@@ -72,11 +72,11 @@ PBCMSDH_SDMMC_INSTANCE gInstance;
/* Maximum number of bcmsdh_sdmmc devices supported by driver */
#define BCMSDH_SDMMC_MAX_DEVICES 1
extern int bcmsdh_probe(struct device *dev);
extern int bcmsdh_remove(struct device *dev);
extern int brcmf_sdio_probe(struct device *dev);
extern int brcmf_sdio_remove(struct device *dev);
struct device sdmmc_dev;
static int bcmsdh_sdmmc_probe(struct sdio_func *func,
static int brcmf_ops_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
int ret = 0;
......@@ -93,8 +93,8 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
gInstance->func[0] = &sdio_func_0;
if (func->device == 0x4) { /* 4318 */
gInstance->func[2] = NULL;
sd_trace(("NIC found, calling bcmsdh_probe...\n"));
ret = bcmsdh_probe(&sdmmc_dev);
sd_trace(("NIC found, calling brcmf_sdio_probe...\n"));
ret = brcmf_sdio_probe(&sdmmc_dev);
}
}
......@@ -102,24 +102,24 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
if (func->num == 2) {
wl_cfg80211_sdio_func(func);
sd_trace(("F2 found, calling bcmsdh_probe...\n"));
ret = bcmsdh_probe(&sdmmc_dev);
sd_trace(("F2 found, calling brcmf_sdio_probe...\n"));
ret = brcmf_sdio_probe(&sdmmc_dev);
}
return ret;
}
static void bcmsdh_sdmmc_remove(struct sdio_func *func)
static void brcmf_ops_sdio_remove(struct sdio_func *func)
{
sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
sd_info(("sdio_bcmsdh: func->class=%x\n", func->class));
sd_trace(("%s Enter\n", __func__));
sd_info(("func->class=%x\n", func->class));
sd_info(("sdio_vendor: 0x%04x\n", func->vendor));
sd_info(("sdio_device: 0x%04x\n", func->device));
sd_info(("Function#: 0x%04x\n", func->num));
if (func->num == 2) {
sd_trace(("F2 found, calling bcmsdh_remove...\n"));
bcmsdh_remove(&sdmmc_dev);
sd_trace(("F2 found, calling brcmf_sdio_remove...\n"));
brcmf_sdio_remove(&sdmmc_dev);
}
}
......@@ -137,8 +137,8 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
static struct sdio_driver bcmsdh_sdmmc_driver = {
.probe = bcmsdh_sdmmc_probe,
.remove = bcmsdh_sdmmc_remove,
.probe = brcmf_ops_sdio_probe,
.remove = brcmf_ops_sdio_remove,
.name = "brcmfmac",
.id_table = bcmsdh_sdmmc_ids,
};
......@@ -148,7 +148,7 @@ struct sdos_info {
spinlock_t lock;
};
int sdioh_sdmmc_osinit(sdioh_info_t *sd)
int brcmf_sdioh_osinit(sdioh_info_t *sd)
{
struct sdos_info *sdos;
......@@ -162,7 +162,7 @@ int sdioh_sdmmc_osinit(sdioh_info_t *sd)
return 0;
}
void sdioh_sdmmc_osfree(sdioh_info_t *sd)
void brcmf_sdioh_osfree(sdioh_info_t *sd)
{
struct sdos_info *sdos;
ASSERT(sd && sd->sdos_info);
......@@ -172,7 +172,7 @@ void sdioh_sdmmc_osfree(sdioh_info_t *sd)
}
/* Interrupt enable/disable */
SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
SDIOH_API_RC brcmf_sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
{
unsigned long flags;
struct sdos_info *sdos;
......@@ -195,9 +195,9 @@ SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
sd->client_intr_enabled = enable;
if (enable)
sdioh_sdmmc_devintr_on(sd);
brcmf_sdioh_dev_intr_on(sd);
else
sdioh_sdmmc_devintr_off(sd);
brcmf_sdioh_dev_intr_off(sd);
spin_unlock_irqrestore(&sdos->lock, flags);
......@@ -207,7 +207,7 @@ SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
/*
* module init
*/
int sdio_function_init(void)
int brcmf_sdio_function_init(void)
{
int error = 0;
sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
......@@ -225,8 +225,8 @@ int sdio_function_init(void)
/*
* module cleanup
*/
extern int bcmsdh_remove(struct device *dev);
void sdio_function_cleanup(void)
extern int brcmf_sdio_remove(struct device *dev);
void brcmf_sdio_function_cleanup(void)
{
sd_trace(("%s Enter\n", __func__));
......
......@@ -30,26 +30,30 @@ extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
char *fw_path, char *nv_path);
/* Stop bus module: clear pending frames, disable data flow */
extern void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
/* Initialize bus module: prepare for communication w/dongle */
extern int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
/* Send a data frame to the dongle. Callee disposes of txp. */
extern int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
/* Send/receive a control message to/from the dongle.
* Expects caller to enforce a single outstanding transaction.
*/
extern int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
/* Watchdog timer function */
extern bool dhd_bus_watchdog(dhd_pub_t *dhd);
extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
#ifdef DHD_DEBUG
/* Device console input function */
extern int dhd_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
#endif /* DHD_DEBUG */
/* Deferred processing for the bus, return true requests reschedule */
......@@ -58,12 +62,12 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
/* Check for and handle local prot-specific iovar commands */
extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Add bus dump output to a buffer */
extern void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Clear any bus counters */
extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
......
......@@ -129,7 +129,8 @@ static int dhdcdc_msg(dhd_pub_t *dhd)
len = CDC_MAX_MSG_SIZE;
/* Send request */
return dhd_bus_txctl(dhd->bus, (unsigned char *)&prot->msg, len);
return brcmf_sdbrcm_bus_txctl(dhd->bus, (unsigned char *)&prot->msg,
len);
}
static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
......@@ -140,8 +141,8 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
DHD_TRACE(("%s: Enter\n", __func__));
do {
ret =
dhd_bus_rxctl(dhd->bus, (unsigned char *)&prot->msg,
ret = brcmf_sdbrcm_bus_rxctl(dhd->bus,
(unsigned char *)&prot->msg,
len + sizeof(struct cdc_ioctl));
if (ret < 0)
break;
......
......@@ -210,7 +210,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
brcmu_bprintf(strbuf, "\n");
/* Add any bus info */
dhd_bus_dump(dhdp, strbuf);
brcmf_sdbrcm_bus_dump(dhdp, strbuf);
return !strbuf->size ? -EOVERFLOW : 0;
}
......@@ -287,7 +287,8 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_CONS):
if (len > 0)
bcmerror = dhd_bus_console_in(dhd_pub, arg, len - 1);
bcmerror = brcmf_sdbrcm_bus_console_in(dhd_pub, arg,
len - 1);
break;
#endif
......@@ -504,13 +505,13 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* if still not found, try bus module */
if (ioc->cmd == DHD_GET_VAR)
bcmerror = dhd_bus_iovar_op(dhd_pub, buf,
arg, arglen, buf,
buflen, IOV_GET);
bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
buf, arg, arglen, buf, buflen,
IOV_GET);
else
bcmerror = dhd_bus_iovar_op(dhd_pub, buf,
NULL, 0, arg,
arglen, IOV_SET);
bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
buf, NULL, 0, arg, arglen,
IOV_SET);
break;
}
......@@ -1168,7 +1169,8 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
int retcode;
brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
......@@ -1184,7 +1186,8 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
int retcode;
brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
......@@ -1224,7 +1227,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
if (!ret) {
brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf,
sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
__func__, ret));
......
......@@ -175,7 +175,7 @@ DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#endif /* defined(CONFIG_PM_SLEEP) */
#if defined(OOB_INTR_ONLY)
extern void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable);
extern void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable);
#endif /* defined(OOB_INTR_ONLY) */
MODULE_AUTHOR("Broadcom Corporation");
......@@ -995,7 +995,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
#ifdef BCMDBUS
ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
#else
ret = dhd_bus_txdata(dhdp->bus, pktbuf);
ret = brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
#endif /* BCMDBUS */
return ret;
......@@ -1264,7 +1264,7 @@ static int dhd_watchdog_thread(void *data)
if (down_interruptible(&dhd->watchdog_sem) == 0) {
if (dhd->pub.dongle_reset == false) {
/* Call the bus module watchdog */
dhd_bus_watchdog(&dhd->pub);
brcmf_sdbrcm_bus_watchdog(&dhd->pub);
}
/* Count the tick for reference */
dhd->pub.tickcnt++;
......@@ -1290,7 +1290,7 @@ static void dhd_watchdog(unsigned long data)
}
/* Call the bus module watchdog */
dhd_bus_watchdog(&dhd->pub);
brcmf_sdbrcm_bus_watchdog(&dhd->pub);
/* Count the tick for reference */
dhd->pub.tickcnt++;
......@@ -1330,7 +1330,7 @@ static int dhd_dpc_thread(void *data)
up(&dhd->dpc_sem);
}
} else {
dhd_bus_stop(dhd->pub.bus, true);
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
}
} else
break;
......@@ -1349,7 +1349,7 @@ static void dhd_dpc(unsigned long data)
if (dhd_bus_dpc(dhd->pub.bus))
tasklet_schedule(&dhd->tasklet);
} else {
dhd_bus_stop(dhd->pub.bus, true);
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
}
}
......@@ -1990,7 +1990,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
if (dhd->pub.busstate == DHD_BUS_DOWN) {
if (!(dhd_bus_download_firmware(dhd->pub.bus,
fw_path, nv_path))) {
DHD_ERROR(("%s: dhdsdio_probe_download failed. "
DHD_ERROR(("%s: dhd_bus_download_firmware failed. "
"firmware = %s nvram = %s\n",
__func__, fw_path, nv_path));
return -1;
......@@ -2002,14 +2002,15 @@ int dhd_bus_start(dhd_pub_t *dhdp)
dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
/* Bring up the bus */
ret = dhd_bus_init(&dhd->pub, true);
ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
if (ret != 0) {
DHD_ERROR(("%s, dhd_bus_init failed %d\n", __func__, ret));
DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
ret));
return ret;
}
#if defined(OOB_INTR_ONLY)
/* Host registration for OOB interrupt */
if (bcmsdh_register_oob_intr(dhdp)) {
if (brcmf_sdio_register_oob_intr(dhdp)) {
del_timer_sync(&dhd->timer);
dhd->wd_timer_valid = false;
DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
......@@ -2017,7 +2018,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
}
/* Enable oob at firmware */
dhd_enable_oob_intr(dhd->pub.bus, true);
brcmf_sdbrcm_enable_oob_intr(dhd->pub.bus, true);
#endif /* defined(OOB_INTR_ONLY) */
/* If bus is not ready, can't come up */
......@@ -2173,9 +2174,9 @@ void dhd_bus_detach(dhd_pub_t *dhdp)
dhd_prot_stop(&dhd->pub);
/* Stop the bus module */
dhd_bus_stop(dhd->pub.bus, true);
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
#if defined(OOB_INTR_ONLY)
bcmsdh_unregister_oob_intr();
brcmf_sdio_unregister_oob_intr();
#endif /* defined(OOB_INTR_ONLY) */
/* Clear the watchdog timer */
......@@ -2305,7 +2306,7 @@ static int __init dhd_module_init(void)
error = dhd_bus_register();
if (error) {
DHD_ERROR(("%s: sdio_register_driver failed\n", __func__));
DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
goto failed;
}
return error;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -70,25 +70,26 @@ typedef void (*bcmsdh_cb_fn_t) (void *);
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
*/
extern bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq);
extern bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva,
uint irq);
/* Detach - freeup resources allocated in attach */
extern int bcmsdh_detach(void *sdh);
extern int brcmf_sdcard_detach(void *sdh);
/* Query if SD device interrupts are enabled */
extern bool bcmsdh_intr_query(void *sdh);
extern bool brcmf_sdcard_intr_query(void *sdh);
/* Enable/disable SD interrupt */
extern int bcmsdh_intr_enable(void *sdh);
extern int bcmsdh_intr_disable(void *sdh);
extern int brcmf_sdcard_intr_enable(void *sdh);
extern int brcmf_sdcard_intr_disable(void *sdh);
/* Register/deregister device interrupt handler. */
extern int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
extern int bcmsdh_intr_dereg(void *sdh);
extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
extern int brcmf_sdcard_intr_dereg(void *sdh);
#if defined(DHD_DEBUG)
/* Query pending interrupt status from the host controller */
extern bool bcmsdh_intr_pending(void *sdh);
extern bool brcmf_sdcard_intr_pending(void *sdh);
#endif
extern int bcmsdh_claim_host_and_lock(void *sdh);
extern int bcmsdh_release_host_and_unlock(void *sdh);
......@@ -96,7 +97,7 @@ extern int bcmsdh_release_host_and_unlock(void *sdh);
/* Register a callback to be called if and when bcmsdh detects
* device removal. No-op in the case of non-removable/hardwired devices.
*/
extern int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
extern int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
......@@ -104,14 +105,14 @@ extern int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
* data: data byte to write
* err: pointer to error code (or NULL)
*/
extern u8 bcmsdh_cfg_read(void *sdh, uint func, u32 addr, int *err);
extern void bcmsdh_cfg_write(void *sdh, uint func, u32 addr, u8 data,
extern u8 brcmf_sdcard_cfg_read(void *sdh, uint func, u32 addr, int *err);
extern void brcmf_sdcard_cfg_write(void *sdh, uint func, u32 addr, u8 data,
int *err);
/* Read/Write 4bytes from/to cfg space */
extern u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr,
extern u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr,
int *err);
extern void bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
extern void brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
u32 data, int *err);
/* Read CIS content for specified function.
......@@ -121,18 +122,18 @@ extern void bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
* Internally, this routine uses the values from the cis base regs (0x9-0xB)
* to form an SDIO-space address to read the data from.
*/
extern int bcmsdh_cis_read(void *sdh, uint func, u8 *cis, uint length);
extern int brcmf_sdcard_cis_read(void *sdh, uint func, u8 *cis, uint length);
/* Synchronous access to device (client) core registers via CMD53 to F1.
* addr: backplane address (i.e. >= regsva from attach)
* size: register width in bytes (2 or 4)
* data: data for register write
*/
extern u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size);
extern u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data);
extern u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size);
extern u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data);
/* Indicate if last reg read/write failed */
extern bool bcmsdh_regfail(void *sdh);
extern bool brcmf_sdcard_regfail(void *sdh);
/* Buffer transfer to/from device (client) core via cmd53.
* fn: function number
......@@ -147,11 +148,11 @@ extern bool bcmsdh_regfail(void *sdh);
* NOTE: Async operation is not currently supported.
*/
typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
extern int bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
extern int brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
extern int brcmf_sdcard_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
/* Flags bits */
......@@ -169,35 +170,35 @@ extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
* nbytes: number of bytes to transfer to/from buf
* Returns 0 or error code.
*/
extern int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf,
extern int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf,
uint nbytes);
/* Issue an abort to the specified function */
extern int bcmsdh_abort(void *sdh, uint fn);
extern int brcmf_sdcard_abort(void *sdh, uint fn);
/* Start SDIO Host Controller communication */
extern int bcmsdh_start(void *sdh, int stage);
extern int brcmf_sdcard_start(void *sdh, int stage);
/* Stop SDIO Host Controller communication */
extern int bcmsdh_stop(void *sdh);
extern int brcmf_sdcard_stop(void *sdh);
/* Returns the "Device ID" of target device on the SDIO bus. */
extern int bcmsdh_query_device(void *sdh);
extern int brcmf_sdcard_query_device(void *sdh);
/* Returns the number of IO functions reported by the device */
extern uint bcmsdh_query_iofnum(void *sdh);
extern uint brcmf_sdcard_query_iofnum(void *sdh);
/* Miscellaneous knob tweaker. */
extern int bcmsdh_iovar_op(void *sdh, const char *name,
extern int brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Reset and reinitialize the device */
extern int bcmsdh_reset(bcmsdh_info_t *sdh);
extern int brcmf_sdcard_reset(bcmsdh_info_t *sdh);
/* helper functions */
extern void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
extern void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
/* callback functions */
typedef struct {
......@@ -209,18 +210,18 @@ typedef struct {
} bcmsdh_driver_t;
/* platform specific/high level functions */
extern int bcmsdh_register(bcmsdh_driver_t *driver);
extern void bcmsdh_unregister(void);
extern bool bcmsdh_chipmatch(u16 vendor, u16 device);
extern void bcmsdh_device_remove(void *sdh);
extern int brcmf_sdio_register(bcmsdh_driver_t *driver);
extern void brcmf_sdio_unregister(void);
extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
extern void brcmf_sdio_device_remove(void *sdh);
/* Function to pass device-status bits to DHD. */
extern u32 bcmsdh_get_dstatus(void *sdh);
extern u32 brcmf_sdcard_get_dstatus(void *sdh);
/* Function to return current window addr */
extern u32 bcmsdh_cur_sbwad(void *sdh);
extern u32 brcmf_sdcard_cur_sbwad(void *sdh);
/* Function to pass chipid and rev to lower layers for controlling pr's */
extern void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev);
extern void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev);
#endif /* _BRCM_SDH_H_ */
......@@ -36,7 +36,7 @@
#include "dhd.h"
#include "wl_cfg80211.h"
void sdioh_sdio_set_host_pm_flags(int flag);
void brcmf_sdioh_set_host_pm_flags(int flag);
static struct sdio_func *cfg80211_sdio_func;
static struct wl_dev *wl_cfg80211_dev;
......@@ -2155,7 +2155,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
/* Inform SDIO stack not to switch off power to the chip */
sdioh_sdio_set_host_pm_flags(MMC_PM_KEEP_POWER);
brcmf_sdioh_set_host_pm_flags(MMC_PM_KEEP_POWER);
/* Turn off watchdog timer */
if (test_bit(WL_STATUS_READY, &wl->status)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment