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_ */
......@@ -45,15 +45,15 @@ struct bcmsdh_info {
bcmsdh_info_t *l_bcmsdh;
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
extern int sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
void bcmsdh_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
void brcmf_sdcard_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
{
sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
}
#endif
bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
bcmsdh_info_t *bcmsdh;
......@@ -66,9 +66,9 @@ bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
/* save the handler locally */
l_bcmsdh = bcmsdh;
bcmsdh->sdioh = sdioh_attach(cfghdl, irq);
bcmsdh->sdioh = brcmf_sdioh_attach(cfghdl, irq);
if (!bcmsdh->sdioh) {
bcmsdh_detach(bcmsdh);
brcmf_sdcard_detach(bcmsdh);
return NULL;
}
......@@ -81,13 +81,13 @@ bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
return bcmsdh;
}
int bcmsdh_detach(void *sdh)
int brcmf_sdcard_detach(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
if (bcmsdh != NULL) {
if (bcmsdh->sdioh) {
sdioh_detach(bcmsdh->sdioh);
brcmf_sdioh_detach(bcmsdh->sdioh);
bcmsdh->sdioh = NULL;
}
kfree(bcmsdh);
......@@ -98,78 +98,79 @@ int bcmsdh_detach(void *sdh)
}
int
bcmsdh_iovar_op(void *sdh, const char *name,
brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
return sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg, len, set);
return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
len, set);
}
bool bcmsdh_intr_query(void *sdh)
bool brcmf_sdcard_intr_query(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
bool on;
ASSERT(bcmsdh);
status = sdioh_interrupt_query(bcmsdh->sdioh, &on);
status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
if (SDIOH_API_SUCCESS(status))
return false;
else
return on;
}
int bcmsdh_intr_enable(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
status = sdioh_interrupt_set(bcmsdh->sdioh, true);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int bcmsdh_intr_disable(void *sdh)
int brcmf_sdcard_intr_disable(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
status = sdioh_interrupt_set(bcmsdh->sdioh, false);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
status = sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int bcmsdh_intr_dereg(void *sdh)
int brcmf_sdcard_intr_dereg(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
status = sdioh_interrupt_deregister(bcmsdh->sdioh);
status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
#if defined(DHD_DEBUG)
bool bcmsdh_intr_pending(void *sdh)
bool brcmf_sdcard_intr_pending(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
ASSERT(sdh);
return sdioh_interrupt_pending(bcmsdh->sdioh);
return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
}
#endif
int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
ASSERT(sdh);
......@@ -177,7 +178,7 @@ int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
return -ENOTSUPP;
}
u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -197,7 +198,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
udelay(1000);
#endif
status =
sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status)
......@@ -213,7 +214,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -232,7 +233,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
udelay(1000);
#endif
status =
sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status)
......@@ -245,7 +246,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
__func__, fnc_num, addr, data));
}
u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -256,9 +257,8 @@ u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
ASSERT(bcmsdh->init_success);
status =
sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL, SDIOH_READ,
fnc_num, addr, &data, 4);
status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, fnc_num, addr, &data, 4);
if (err)
*err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO);
......@@ -270,7 +270,7 @@ u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
......@@ -282,7 +282,7 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
ASSERT(bcmsdh->init_success);
status =
sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, fnc_num, addr, &data, 4);
if (err)
......@@ -292,7 +292,7 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
__func__, fnc_num, addr, data));
}
int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -309,7 +309,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
ASSERT(cis);
ASSERT(length <= SBSDIO_CIS_SIZE_LIMIT);
status = sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
status = brcmf_sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
if (ascii) {
/* Move binary bits to tmp and format them
......@@ -332,24 +332,27 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
static int bcmsdhsdio_set_sbaddr_window(void *sdh, u32 address)
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
{
int err = 0;
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRMID,
(address >> 16) & SBSDIO_SBADDRMID_MASK, &err);
brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRMID,
(address >> 16) & SBSDIO_SBADDRMID_MASK,
&err);
if (!err)
bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRHIGH,
brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRHIGH,
(address >> 24) & SBSDIO_SBADDRHIGH_MASK,
&err);
return err;
}
u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -364,7 +367,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
ASSERT(bcmsdh->init_success);
if (bar0 != bcmsdh->sbwad) {
if (bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0))
if (brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0))
return 0xFFFFFFFF;
bcmsdh->sbwad = bar0;
......@@ -374,7 +377,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status = sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
......@@ -402,7 +405,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
return 0xFFFFFFFF;
}
u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -418,7 +421,7 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
ASSERT(bcmsdh->init_success);
if (bar0 != bcmsdh->sbwad) {
err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
......@@ -429,7 +432,7 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status =
sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
......@@ -441,13 +444,13 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
return 0xFFFFFFFF;
}
bool bcmsdh_regfail(void *sdh)
bool brcmf_sdcard_regfail(void *sdh)
{
return ((bcmsdh_info_t *) sdh)->regfail;
}
int
bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
brcmf_sdcard_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
......@@ -469,7 +472,7 @@ bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) {
err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
......@@ -483,15 +486,14 @@ bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status = sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, incr_fix,
SDIOH_READ, fn, addr, width, nbytes, buf,
pkt);
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int
bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
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)
{
......@@ -514,7 +516,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) {
err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
......@@ -528,14 +530,13 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status = sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, incr_fix,
SDIOH_WRITE, fn, addr, width, nbytes, buf,
pkt);
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
......@@ -547,72 +548,71 @@ int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status =
sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, SDIOH_DATA_INC,
(rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
addr, 4, nbytes, buf, NULL);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int bcmsdh_abort(void *sdh, uint fn)
int brcmf_sdcard_abort(void *sdh, uint fn)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
return sdioh_abort(bcmsdh->sdioh, fn);
return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
}
int bcmsdh_start(void *sdh, int stage)
int brcmf_sdcard_start(void *sdh, int stage)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
return sdioh_start(bcmsdh->sdioh, stage);
return brcmf_sdioh_start(bcmsdh->sdioh, stage);
}
int bcmsdh_stop(void *sdh)
int brcmf_sdcard_stop(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
return sdioh_stop(bcmsdh->sdioh);
return brcmf_sdioh_stop(bcmsdh->sdioh);
}
int bcmsdh_query_device(void *sdh)
int brcmf_sdcard_query_device(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
return bcmsdh->vendevid;
}
uint bcmsdh_query_iofnum(void *sdh)
uint brcmf_sdcard_query_iofnum(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
return sdioh_query_iofnum(bcmsdh->sdioh);
return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
}
int bcmsdh_reset(bcmsdh_info_t *sdh)
int brcmf_sdcard_reset(bcmsdh_info_t *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
return sdioh_sdio_reset(bcmsdh->sdioh);
return brcmf_sdioh_reset(bcmsdh->sdioh);
}
void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh)
void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh)
{
ASSERT(sdh);
return sdh->sdioh;
}
/* Function to pass device-status bits to DHD. */
u32 bcmsdh_get_dstatus(void *sdh)
u32 brcmf_sdcard_get_dstatus(void *sdh)
{
return 0;
}
u32 bcmsdh_cur_sbwad(void *sdh)
u32 brcmf_sdcard_cur_sbwad(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
......@@ -622,7 +622,7 @@ u32 bcmsdh_cur_sbwad(void *sdh)
return bcmsdh->sbwad;
}
void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev)
void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev)
{
return;
}
......@@ -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__));
......
......@@ -32,15 +32,15 @@
#include "dhd.h"
#include "bcmsdh_sdmmc.h"
extern int sdio_function_init(void);
extern void sdio_function_cleanup(void);
extern int brcmf_sdio_function_init(void);
extern void brcmf_sdio_function_cleanup(void);
#if !defined(OOB_INTR_ONLY)
static void IRQHandler(struct sdio_func *func);
static void IRQHandlerF2(struct sdio_func *func);
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
#endif /* !defined(OOB_INTR_ONLY) */
static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr);
extern int sdio_reset_comm(struct mmc_card *card);
static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
extern PBCMSDH_SDMMC_INSTANCE gInstance;
......@@ -54,17 +54,17 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
#define DMA_ALIGN_MASK 0x03
int sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
int brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 *data);
void sdioh_sdio_set_host_pm_flags(int flag)
void brcmf_sdioh_set_host_pm_flags(int flag)
{
if (sdio_set_host_pm_flags(gInstance->func[1], flag))
printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\
__func__, (unsigned int)flag);
}
static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
static int brcmf_sdioh_enablefuncs(sdioh_info_t *sd)
{
int err_ret;
u32 fbraddr;
......@@ -73,7 +73,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
sd_trace(("%s\n", __func__));
/* Get the Card's common CIS address */
sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIO_CCCR_CIS);
sd->com_cis_ptr = brcmf_sdioh_get_cisaddr(sd, SDIO_CCCR_CIS);
sd->func_cis_ptr[0] = sd->com_cis_ptr;
sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__,
sd->com_cis_ptr));
......@@ -82,7 +82,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
for (fbraddr = SDIO_FBR_BASE(1), func = 1;
func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) {
sd->func_cis_ptr[func] =
sdioh_sdmmc_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
brcmf_sdioh_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func,
sd->func_cis_ptr[func]));
}
......@@ -106,7 +106,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
/*
* Public entry points & extern's
*/
sdioh_info_t *sdioh_attach(void *bar0, uint irq)
sdioh_info_t *brcmf_sdioh_attach(void *bar0, uint irq)
{
sdioh_info_t *sd;
int err_ret;
......@@ -123,7 +123,7 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
sd_err(("sdioh_attach: out of memory\n"));
return NULL;
}
if (sdioh_sdmmc_osinit(sd) != 0) {
if (brcmf_sdioh_osinit(sd) != 0) {
sd_err(("%s:sdioh_sdmmc_osinit() failed\n", __func__));
kfree(sd);
return NULL;
......@@ -161,13 +161,13 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
sdio_release_host(gInstance->func[2]);
}
sdioh_sdmmc_card_enablefuncs(sd);
brcmf_sdioh_enablefuncs(sd);
sd_trace(("%s: Done\n", __func__));
return sd;
}
extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *sd)
{
sd_trace(("%s\n", __func__));
......@@ -184,7 +184,7 @@ extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
sdio_release_host(gInstance->func[1]);
/* deregister irq */
sdioh_sdmmc_osfree(sd);
brcmf_sdioh_osfree(sd);
kfree(sd);
}
......@@ -193,7 +193,7 @@ extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
extern SDIOH_API_RC sdioh_enable_func_intr(void)
extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
{
u8 reg;
int err;
......@@ -227,7 +227,7 @@ extern SDIOH_API_RC sdioh_enable_func_intr(void)
return SDIOH_API_RC_SUCCESS;
}
extern SDIOH_API_RC sdioh_disable_func_intr(void)
extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
{
u8 reg;
int err;
......@@ -261,7 +261,7 @@ extern SDIOH_API_RC sdioh_disable_func_intr(void)
/* Configure callback to client when we receive client interrupt */
extern SDIOH_API_RC
sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
brcmf_sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
{
sd_trace(("%s: Entering\n", __func__));
if (fn == NULL) {
......@@ -277,22 +277,22 @@ sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
/* register and unmask irq */
if (gInstance->func[2]) {
sdio_claim_host(gInstance->func[2]);
sdio_claim_irq(gInstance->func[2], IRQHandlerF2);
sdio_claim_irq(gInstance->func[2], brcmf_sdioh_irqhandler_f2);
sdio_release_host(gInstance->func[2]);
}
if (gInstance->func[1]) {
sdio_claim_host(gInstance->func[1]);
sdio_claim_irq(gInstance->func[1], IRQHandler);
sdio_claim_irq(gInstance->func[1], brcmf_sdioh_irqhandler);
sdio_release_host(gInstance->func[1]);
}
#elif defined(HW_OOB)
sdioh_enable_func_intr();
brcmf_sdioh_enable_func_intr();
#endif /* defined(OOB_INTR_ONLY) */
return SDIOH_API_RC_SUCCESS;
}
extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *sd)
extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *sd)
{
sd_trace(("%s: Entering\n", __func__));
......@@ -316,12 +316,12 @@ extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *sd)
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
#elif defined(HW_OOB)
sdioh_disable_func_intr();
brcmf_sdioh_disable_func_intr();
#endif /* !defined(OOB_INTR_ONLY) */
return SDIOH_API_RC_SUCCESS;
}
extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
*onoff = sd->client_intr_enabled;
......@@ -329,13 +329,13 @@ extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
}
#if defined(DHD_DEBUG)
extern bool sdioh_interrupt_pending(sdioh_info_t *sd)
extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *sd)
{
return 0;
}
#endif
uint sdioh_query_iofnum(sdioh_info_t *sd)
uint brcmf_sdioh_query_iofnum(sdioh_info_t *sd)
{
return sd->num_funcs;
}
......@@ -365,7 +365,7 @@ const struct brcmu_iovar sdioh_iovars[] = {
};
int
sdioh_iovar_op(sdioh_info_t *si, const char *name,
brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
const struct brcmu_iovar *vi = NULL;
......@@ -499,7 +499,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sdreg_t *sd_ptr = (sdreg_t *) params;
u8 data = 0;
if (sdioh_cfg_read
if (brcmf_sdioh_cfg_read
(si, sd_ptr->func, sd_ptr->offset, &data)) {
bcmerror = -EIO;
break;
......@@ -515,7 +515,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sdreg_t *sd_ptr = (sdreg_t *) params;
u8 data = (u8) sd_ptr->value;
if (sdioh_cfg_write
if (brcmf_sdioh_cfg_write
(si, sd_ptr->func, sd_ptr->offset, &data)) {
bcmerror = -EIO;
break;
......@@ -534,7 +534,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
{
SDIOH_API_RC status;
u8 data;
......@@ -545,37 +545,37 @@ SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
data = 4; /* disable hw oob interrupt */
data |= 4; /* Active HIGH */
status = sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
return status;
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
extern SDIOH_API_RC
sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
brcmf_sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
{
SDIOH_API_RC status;
/* No lock needed since sdioh_request_byte does locking */
status = sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
/* No lock needed since brcmf_sdioh_request_byte does locking */
status = brcmf_sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
return status;
}
extern SDIOH_API_RC
sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
brcmf_sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
{
/* No lock needed since sdioh_request_byte does locking */
/* No lock needed since brcmf_sdioh_request_byte does locking */
SDIOH_API_RC status;
status = sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
return status;
}
static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
{
/* read 24 bits and return valid 17 bit addr */
int i;
u32 scratch, regdata;
u8 *ptr = (u8 *)&scratch;
for (i = 0; i < 3; i++) {
if ((sdioh_sdmmc_card_regread(sd, 0, regaddr, 1, &regdata)) !=
if ((brcmf_sdioh_card_regread(sd, 0, regaddr, 1, &regdata)) !=
SUCCESS)
sd_err(("%s: Can't read!\n", __func__));
......@@ -590,7 +590,7 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
}
extern SDIOH_API_RC
sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
brcmf_sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
{
u32 count;
int offset;
......@@ -610,7 +610,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
for (count = 0; count < length; count++) {
offset = sd->func_cis_ptr[func] + count;
if (sdioh_sdmmc_card_regread(sd, 0, offset, 1, &foo) < 0) {
if (brcmf_sdioh_card_regread(sd, 0, offset, 1, &foo) < 0) {
sd_err(("%s: regread failed: Can't read CIS\n",
__func__));
return SDIOH_API_RC_FAIL;
......@@ -624,7 +624,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
}
extern SDIOH_API_RC
sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
brcmf_sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
u8 *byte)
{
int err_ret;
......@@ -723,7 +723,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
}
extern SDIOH_API_RC
sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
brcmf_sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
uint addr, u32 *word, uint nbytes)
{
int err_ret = SDIOH_API_RC_FAIL;
......@@ -776,8 +776,8 @@ sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
}
static SDIOH_API_RC
sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
uint addr, struct sk_buff *pkt)
brcmf_sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write,
uint func, uint addr, struct sk_buff *pkt)
{
bool fifo = (fix_inc == SDIOH_DATA_FIX);
u32 SGCount = 0;
......@@ -807,7 +807,7 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
#endif /* CONFIG_MMC_MSM7X00A */
/* Make sure the packet is aligned properly.
* If it isn't, then this
* is the fault of sdioh_request_buffer() which
* is the fault of brcmf_sdioh_request_buffer() which
* is supposed to give
* us something we can work with.
*/
......@@ -872,9 +872,9 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
*
*/
extern SDIOH_API_RC
sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
uint func, uint addr, uint reg_width, uint buflen_u,
u8 *buffer, struct sk_buff *pkt)
brcmf_sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc,
uint write, uint func, uint addr, uint reg_width,
uint buflen_u, u8 *buffer, struct sk_buff *pkt)
{
SDIOH_API_RC Status;
struct sk_buff *mypkt = NULL;
......@@ -898,8 +898,8 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (write)
memcpy(mypkt->data, buffer, buflen_u);
Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
......@@ -925,8 +925,8 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (write)
memcpy(mypkt->data, pkt->data, pkt->len);
Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
......@@ -937,15 +937,15 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n",
__func__, write ? "Tx" : "Rx"));
Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, pkt);
Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
addr, pkt);
}
return Status;
}
/* this function performs "abort" for both of host & device */
extern int sdioh_abort(sdioh_info_t *sd, uint func)
extern int brcmf_sdioh_abort(sdioh_info_t *sd, uint func)
{
#if defined(MMC_SDIO_ABORT)
char t_func = (char)func;
......@@ -954,7 +954,7 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
#if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F0 */
sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
brcmf_sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func);
#endif /* defined(MMC_SDIO_ABORT) */
......@@ -963,7 +963,7 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
}
/* Reset and re-initialize the device */
int sdioh_sdio_reset(sdioh_info_t *si)
int brcmf_sdioh_reset(sdioh_info_t *si)
{
sd_trace(("%s: Enter\n", __func__));
sd_trace(("%s: Exit\n", __func__));
......@@ -971,14 +971,14 @@ int sdioh_sdio_reset(sdioh_info_t *si)
}
/* Disable device interrupt */
void sdioh_sdmmc_devintr_off(sdioh_info_t *sd)
void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask &= ~CLIENT_INTR;
}
/* Enable device interrupt */
void sdioh_sdmmc_devintr_on(sdioh_info_t *sd)
void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask |= CLIENT_INTR;
......@@ -986,19 +986,19 @@ void sdioh_sdmmc_devintr_on(sdioh_info_t *sd)
/* Read client card reg */
int
sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 *data)
{
if ((func == 0) || (regsize == 1)) {
u8 temp = 0;
sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
*data = temp;
*data &= 0xff;
sd_data(("%s: byte read data=0x%02x\n", __func__, *data));
} else {
sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, data,
brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, data,
regsize);
if (regsize == 2)
*data &= 0xffff;
......@@ -1011,7 +1011,7 @@ sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
#if !defined(OOB_INTR_ONLY)
/* bcmsdh_sdmmc interrupt handler */
static void IRQHandler(struct sdio_func *func)
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
sdioh_info_t *sd;
......@@ -1037,7 +1037,7 @@ static void IRQHandler(struct sdio_func *func)
}
/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */
static void IRQHandlerF2(struct sdio_func *func)
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
{
sdioh_info_t *sd;
......@@ -1052,7 +1052,7 @@ static void IRQHandlerF2(struct sdio_func *func)
#ifdef NOTUSED
/* Write client card reg */
static int
sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
brcmf_sdioh_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 data)
{
......@@ -1060,14 +1060,14 @@ sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
u8 temp;
temp = data & 0xff;
sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
sd_data(("%s: byte write data=0x%02x\n", __func__, data));
} else {
if (regsize == 2)
data &= 0xffff;
sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, &data,
regsize);
brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr,
&data, regsize);
sd_data(("%s: word write data=0x%08x\n", __func__, data));
}
......@@ -1076,12 +1076,12 @@ sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
}
#endif /* NOTUSED */
int sdioh_start(sdioh_info_t *si, int stage)
int brcmf_sdioh_start(sdioh_info_t *si, int stage)
{
return 0;
}
int sdioh_stop(sdioh_info_t *si)
int brcmf_sdioh_stop(sdioh_info_t *si)
{
return 0;
}
......@@ -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