Commit 62dd656d authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH

Code cleanup. This was a Broadcom specific acronym.
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 avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 41134db1
This diff is collapsed.
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
/** /**
* SDIO Host Controller info * SDIO Host Controller info
*/ */
struct bcmsdh_hc { struct sdio_hc {
struct bcmsdh_hc *next; struct sdio_hc *next;
struct device *dev; /* platform device handle */ struct device *dev; /* platform device handle */
void *regs; /* SDIO Host Controller address */ void *regs; /* SDIO Host Controller address */
struct brcmf_sdio *sdh; /* SDIO Host Controller handle */ struct brcmf_sdio *sdh; /* SDIO Host Controller handle */
...@@ -49,7 +49,7 @@ struct bcmsdh_hc { ...@@ -49,7 +49,7 @@ struct bcmsdh_hc {
as edge and etc */ as edge and etc */
bool oob_irq_registered; bool oob_irq_registered;
}; };
static struct bcmsdh_hc *sdhcinfo; static struct sdio_hc *sdhcinfo;
/* driver info, initialized when brcmf_sdio_register is called */ /* driver info, initialized when brcmf_sdio_register is called */
static struct brcmf_sdioh_driver drvinfo = { NULL, NULL }; static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
...@@ -111,7 +111,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove); ...@@ -111,7 +111,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove);
int brcmf_sdio_probe(struct device *dev) int brcmf_sdio_probe(struct device *dev)
{ {
struct bcmsdh_hc *sdhc = NULL; struct sdio_hc *sdhc = NULL;
unsigned long regs = 0; unsigned long regs = 0;
struct brcmf_sdio *sdh = NULL; struct brcmf_sdio *sdh = NULL;
int irq = 0; int irq = 0;
...@@ -119,7 +119,7 @@ int brcmf_sdio_probe(struct device *dev) ...@@ -119,7 +119,7 @@ int brcmf_sdio_probe(struct device *dev)
unsigned long irq_flags = 0; unsigned long irq_flags = 0;
/* allocate SDIO Host Controller state info */ /* allocate SDIO Host Controller state info */
sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC); sdhc = kzalloc(sizeof(struct sdio_hc), GFP_ATOMIC);
if (!sdhc) { if (!sdhc) {
SDLX_MSG(("%s: out of memory\n", __func__)); SDLX_MSG(("%s: out of memory\n", __func__));
goto err; goto err;
...@@ -128,7 +128,7 @@ int brcmf_sdio_probe(struct device *dev) ...@@ -128,7 +128,7 @@ int brcmf_sdio_probe(struct device *dev)
sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq); sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
if (!sdh) { if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__)); SDLX_MSG(("%s: attach failed\n", __func__));
goto err; goto err;
} }
...@@ -166,7 +166,7 @@ int brcmf_sdio_probe(struct device *dev) ...@@ -166,7 +166,7 @@ int brcmf_sdio_probe(struct device *dev)
int brcmf_sdio_remove(struct device *dev) int brcmf_sdio_remove(struct device *dev)
{ {
struct bcmsdh_hc *sdhc, *prev; struct sdio_hc *sdhc, *prev;
sdhc = sdhcinfo; sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch); drvinfo.detach(sdhc->ch);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <brcmu_utils.h> #include <brcmu_utils.h>
#include <brcmu_wifi.h> #include <brcmu_wifi.h>
#include "sdio_host.h" #include "sdio_host.h"
#include "bcmsdbus.h" /* bcmsdh to/from specific controller APIs */ #include "bcmsdbus.h"
#include "sdiovar.h" /* ioctl/iovars */ #include "sdiovar.h" /* ioctl/iovars */
#include "dngl_stats.h" #include "dngl_stats.h"
#include "dhd.h" #include "dhd.h"
...@@ -83,8 +83,8 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd) ...@@ -83,8 +83,8 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
err_ret = sdio_enable_func(gInstance->func[1]); err_ret = sdio_enable_func(gInstance->func[1]);
sdio_release_host(gInstance->func[1]); sdio_release_host(gInstance->func[1]);
if (err_ret) { if (err_ret) {
sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x", sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 "
err_ret)); "Err: 0x%08x", err_ret));
} }
return false; return false;
...@@ -128,7 +128,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq) ...@@ -128,7 +128,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
sd->client_block_size[1] = 64; sd->client_block_size[1] = 64;
err_ret = sdio_set_block_size(gInstance->func[1], 64); err_ret = sdio_set_block_size(gInstance->func[1], 64);
if (err_ret) if (err_ret)
sd_err(("bcmsdh_sdmmc: Failed to set F1 blocksize\n")); sd_err(("brcmf_sdioh_attach: Failed to set F1 blocksize\n"));
/* Release host controller F1 */ /* Release host controller F1 */
sdio_release_host(gInstance->func[1]); sdio_release_host(gInstance->func[1]);
...@@ -141,8 +141,8 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq) ...@@ -141,8 +141,8 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
err_ret = err_ret =
sdio_set_block_size(gInstance->func[2], sd_f2_blocksize); sdio_set_block_size(gInstance->func[2], sd_f2_blocksize);
if (err_ret) if (err_ret)
sd_err(("bcmsdh_sdmmc: Failed to set F2 blocksize " sd_err(("brcmf_sdioh_attach: Failed to set F2 blocksize"
"to %d\n", sd_f2_blocksize)); " to %d\n", sd_f2_blocksize));
/* Release host controller F2 */ /* Release host controller F2 */
sdio_release_host(gInstance->func[2]); sdio_release_host(gInstance->func[2]);
...@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_enable_func sdio_enable_func
(gInstance->func[2]); (gInstance->func[2]);
if (err_ret) if (err_ret)
sd_err(("bcmsdh_sdmmc: enable F2 failed:%d", sd_err(("request_byte: "
"enable F2 "
"failed:%d",
err_ret)); err_ret));
} else { } else {
/* Disable Function 2 */ /* Disable Function 2 */
...@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_disable_func sdio_disable_func
(gInstance->func[2]); (gInstance->func[2]);
if (err_ret) if (err_ret)
sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d", sd_err(("request_byte: "
"Disab F2 "
"failed:%d",
err_ret)); err_ret));
} }
sdio_release_host(gInstance->func[2]); sdio_release_host(gInstance->func[2]);
...@@ -577,7 +581,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -577,7 +581,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_release_host(gInstance->func[func]); sdio_release_host(gInstance->func[func]);
} }
else if (regaddr < 0xF0) { else if (regaddr < 0xF0) {
sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write " sd_err(("brcmf: F0 Wr:0x%02x: write "
"disallowed\n", regaddr)); "disallowed\n", regaddr));
} else { } else {
/* Claim host controller, perform F0 write, /* Claim host controller, perform F0 write,
...@@ -613,7 +617,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, ...@@ -613,7 +617,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
} }
if (err_ret) if (err_ret)
sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, " sd_err(("brcmf: Failed to %s byte F%d:@0x%05x=%02x, "
"Err: %d\n", rw ? "Write" : "Read", func, regaddr, "Err: %d\n", rw ? "Write" : "Read", func, regaddr,
*byte, err_ret)); *byte, err_ret));
...@@ -666,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw, ...@@ -666,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
sdio_release_host(gInstance->func[func]); sdio_release_host(gInstance->func[func]);
if (err_ret) { if (err_ret) {
sd_err(("bcmsdh_sdmmc: Failed to %s word, Err: 0x%08x", sd_err(("brcmf: Failed to %s word, Err: 0x%08x",
rw ? "Write" : "Read", err_ret)); rw ? "Write" : "Read", err_ret));
} }
...@@ -896,12 +900,11 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr, ...@@ -896,12 +900,11 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
return SUCCESS; return SUCCESS;
} }
/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func) static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{ {
struct sdioh_info *sd; struct sdioh_info *sd;
sd_trace(("bcmsdh_sdmmc: ***IRQHandler\n")); sd_trace(("brcmf: ***IRQHandler\n"));
sd = gInstance->sd; sd = gInstance->sd;
ASSERT(sd != NULL); ASSERT(sd != NULL);
...@@ -913,7 +916,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func) ...@@ -913,7 +916,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
ASSERT(sd->intr_handler_arg); ASSERT(sd->intr_handler_arg);
(sd->intr_handler) (sd->intr_handler_arg); (sd->intr_handler) (sd->intr_handler_arg);
} else { } else {
sd_err(("bcmsdh_sdmmc: ***IRQHandler\n")); sd_err(("brcmf: ***IRQHandler\n"));
sd_err(("%s: Not ready for intr: enabled %d, handler %p\n", sd_err(("%s: Not ready for intr: enabled %d, handler %p\n",
__func__, sd->client_intr_enabled, sd->intr_handler)); __func__, sd->client_intr_enabled, sd->intr_handler));
...@@ -922,12 +925,12 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func) ...@@ -922,12 +925,12 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
sdio_claim_host(gInstance->func[0]); sdio_claim_host(gInstance->func[0]);
} }
/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */ /* interrupt handler for F2 (dummy handler) */
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func) static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
{ {
struct sdioh_info *sd; struct sdioh_info *sd;
sd_trace(("bcmsdh_sdmmc: ***IRQHandlerF2\n")); sd_trace(("brcmf: ***IRQHandlerF2\n"));
sd = gInstance->sd; sd = gInstance->sd;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
/* /*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel * BRCMF SDIO Function Driver for the native SDIO/MMC driver in the Linux Kernel
*/ */
#ifndef __BCMSDH_SDMMC_H__ #ifndef __BCMSDH_SDMMC_H__
...@@ -97,10 +97,6 @@ struct sdioh_info { ...@@ -97,10 +97,6 @@ struct sdioh_info {
/* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */ /* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
}; };
/************************************************************
* Internal interfaces: per-port references into bcmsdh_sdmmc.c
*/
/* Global message bits */ /* Global message bits */
extern uint sd_msglevel; extern uint sd_msglevel;
...@@ -115,10 +111,6 @@ extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd); ...@@ -115,10 +111,6 @@ extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd); extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd); extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
/**************************************************************
* Internal interfaces: bcmsdh_sdmmc.c references to per-port code
*/
/* Register mapping routines */ /* Register mapping routines */
extern u32 *brcmf_sdioh_reg_map(s32 addr, int size); extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
extern void brcmf_sdioh_reg_unmap(s32 addr, int size); extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
...@@ -127,12 +119,12 @@ extern void brcmf_sdioh_reg_unmap(s32 addr, int size); ...@@ -127,12 +119,12 @@ extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq); extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd); extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
typedef struct _BCMSDH_SDMMC_INSTANCE { struct brcmf_sdmmc_instance {
struct sdioh_info *sd; struct sdioh_info *sd;
struct sdio_func *func[SDIOD_MAX_IOFUNCS]; struct sdio_func *func[SDIOD_MAX_IOFUNCS];
u32 host_claimed; u32 host_claimed;
} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE; };
extern PBCMSDH_SDMMC_INSTANCE gInstance; extern struct brcmf_sdmmc_instance *gInstance;
#endif /* __BCMSDH_SDMMC_H__ */ #endif /* __BCMSDH_SDMMC_H__ */
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <brcmu_utils.h> #include <brcmu_utils.h>
#include <brcmu_wifi.h> #include <brcmu_wifi.h>
#include "sdio_host.h" #include "sdio_host.h"
#include "bcmsdbus.h" /* bcmsdh to/from specific controller APIs */ #include "bcmsdbus.h"
#include "sdiovar.h" /* to get msglevel bit values */ #include "sdiovar.h" /* to get msglevel bit values */
#include "dngl_stats.h" #include "dngl_stats.h"
#include "dhd.h" #include "dhd.h"
...@@ -62,10 +62,7 @@ static int clockoverride; ...@@ -62,10 +62,7 @@ static int clockoverride;
module_param(clockoverride, int, 0644); module_param(clockoverride, int, 0644);
MODULE_PARM_DESC(clockoverride, "SDIO card clock override"); MODULE_PARM_DESC(clockoverride, "SDIO card clock override");
PBCMSDH_SDMMC_INSTANCE gInstance; struct brcmf_sdmmc_instance *gInstance;
/* Maximum number of bcmsdh_sdmmc devices supported by driver */
#define BCMSDH_SDMMC_MAX_DEVICES 1
struct device sdmmc_dev; struct device sdmmc_dev;
...@@ -74,8 +71,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -74,8 +71,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
{ {
int ret = 0; int ret = 0;
static struct sdio_func sdio_func_0; static struct sdio_func sdio_func_0;
sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__)); sd_trace(("sdio_probe: %s Enter\n", __func__));
sd_trace(("sdio_bcmsdh: func->class=%x\n", func->class)); sd_trace(("sdio_probe: func->class=%x\n", func->class));
sd_trace(("sdio_vendor: 0x%04x\n", func->vendor)); sd_trace(("sdio_vendor: 0x%04x\n", func->vendor));
sd_trace(("sdio_device: 0x%04x\n", func->device)); sd_trace(("sdio_device: 0x%04x\n", func->device));
sd_trace(("Function#: 0x%04x\n", func->num)); sd_trace(("Function#: 0x%04x\n", func->num));
...@@ -117,7 +114,7 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func) ...@@ -117,7 +114,7 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func)
} }
/* devices we support, null terminated */ /* devices we support, null terminated */
static const struct sdio_device_id bcmsdh_sdmmc_ids[] = { static const struct sdio_device_id brcmf_sdmmc_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)}, {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)},
{SDIO_DEVICE {SDIO_DEVICE
(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)}, (SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)},
...@@ -127,7 +124,7 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = { ...@@ -127,7 +124,7 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
{ /* end: all zeroes */ }, { /* end: all zeroes */ },
}; };
MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids); MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int brcmf_sdio_suspend(struct device *dev) static int brcmf_sdio_suspend(struct device *dev)
...@@ -166,11 +163,11 @@ static const struct dev_pm_ops brcmf_sdio_pm_ops = { ...@@ -166,11 +163,11 @@ static const struct dev_pm_ops brcmf_sdio_pm_ops = {
}; };
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static struct sdio_driver bcmsdh_sdmmc_driver = { static struct sdio_driver brcmf_sdmmc_driver = {
.probe = brcmf_ops_sdio_probe, .probe = brcmf_ops_sdio_probe,
.remove = brcmf_ops_sdio_remove, .remove = brcmf_ops_sdio_remove,
.name = "brcmfmac", .name = "brcmfmac",
.id_table = bcmsdh_sdmmc_ids, .id_table = brcmf_sdmmc_ids,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.drv = { .drv = {
.pm = &brcmf_sdio_pm_ops, .pm = &brcmf_sdio_pm_ops,
...@@ -243,14 +240,14 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable) ...@@ -243,14 +240,14 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
int brcmf_sdio_function_init(void) int brcmf_sdio_function_init(void)
{ {
int error = 0; int error = 0;
sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__)); sd_trace(("brcmf_sdio_function_init: %s Enter\n", __func__));
gInstance = kzalloc(sizeof(BCMSDH_SDMMC_INSTANCE), GFP_KERNEL); gInstance = kzalloc(sizeof(struct brcmf_sdmmc_instance), GFP_KERNEL);
if (!gInstance) if (!gInstance)
return -ENOMEM; return -ENOMEM;
memset(&sdmmc_dev, 0, sizeof(sdmmc_dev)); memset(&sdmmc_dev, 0, sizeof(sdmmc_dev));
error = sdio_register_driver(&bcmsdh_sdmmc_driver); error = sdio_register_driver(&brcmf_sdmmc_driver);
return error; return error;
} }
...@@ -262,7 +259,7 @@ void brcmf_sdio_function_cleanup(void) ...@@ -262,7 +259,7 @@ void brcmf_sdio_function_cleanup(void)
{ {
sd_trace(("%s Enter\n", __func__)); sd_trace(("%s Enter\n", __func__));
sdio_unregister_driver(&bcmsdh_sdmmc_driver); sdio_unregister_driver(&brcmf_sdmmc_driver);
kfree(gInstance); kfree(gInstance);
} }
...@@ -458,7 +458,7 @@ struct chip_info { ...@@ -458,7 +458,7 @@ struct chip_info {
typedef struct dhd_bus { typedef struct dhd_bus {
struct brcmf_pub *dhd; struct brcmf_pub *dhd;
struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */ struct brcmf_sdio *sdh; /* Handle for sdio card calls */
struct chip_info *ci; /* Chip info struct */ struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */ char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */ uint varsz; /* Size of variables buffer */
...@@ -529,7 +529,7 @@ typedef struct dhd_bus { ...@@ -529,7 +529,7 @@ typedef struct dhd_bus {
s32 idletime; /* Control for activity timeout */ s32 idletime; /* Control for activity timeout */
s32 idlecount; /* Activity timeout counter */ s32 idlecount; /* Activity timeout counter */
s32 idleclock; /* How to set bus driver when idle */ s32 idleclock; /* How to set bus driver when idle */
s32 sd_rxchain; /* If bcmsdh api accepts PKT chains */ s32 sd_rxchain;
bool use_rxchain; /* If dhd should use PKT chains */ bool use_rxchain; /* If dhd should use PKT chains */
bool sleeping; /* Is SDIO bus sleeping? */ bool sleeping; /* Is SDIO bus sleeping? */
bool rxflow_mode; /* Rx flow control mode */ bool rxflow_mode; /* Rx flow control mode */
...@@ -805,8 +805,8 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len); ...@@ -805,8 +805,8 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len);
static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size); static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size);
static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, uint flags, u8 *buf, uint nbytes,
struct sk_buff *pkt, bcmsdh_cmplt_fn_t complete, struct sk_buff *pkt,
void *handle); brcmf_sdio_cmplt_fn_t complete, void *handle);
static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh); static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus); static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
...@@ -3210,8 +3210,6 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex) ...@@ -3210,8 +3210,6 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
/* Set bus state according to enable result */ /* Set bus state according to enable result */
dhdp->busstate = DHD_BUS_DATA; dhdp->busstate = DHD_BUS_DATA;
/* bcmsdh_intr_unmask(bus->sdh); */
bus->intdis = false; bus->intdis = false;
if (bus->intr) { if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n", DHD_INTR(("%s: enable SDIO device interrupts\n",
...@@ -3844,7 +3842,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -3844,7 +3842,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
u16 rdlen; /* Total number of bytes to read */ u16 rdlen; /* Total number of bytes to read */
u8 rxseq; /* Next sequence number to expect */ u8 rxseq; /* Next sequence number to expect */
uint rxleft = 0; /* Remaining number of frames allowed */ uint rxleft = 0; /* Remaining number of frames allowed */
int sdret; /* Return code from bcmsdh calls */ int sdret; /* Return code from calls */
u8 txmax; /* Maximum tx sequence offered */ u8 txmax; /* Maximum tx sequence offered */
bool len_consistent; /* Result of comparing readahead len and bool len_consistent; /* Result of comparing readahead len and
len from hw-hdr */ len from hw-hdr */
...@@ -4857,7 +4855,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus) ...@@ -4857,7 +4855,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
/* Allocate an appropriate-sized packet */ /* Allocate an appropriate-sized packet */
len = bus->pktgen_len; len = bus->pktgen_len;
pkt = brcmu_pkt_buf_get_skb( pkt = brcmu_pkt_buf_get_skb(
(len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN), len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN,
true); true);
if (!pkt) { if (!pkt) {
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n", DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
...@@ -5268,7 +5266,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no, ...@@ -5268,7 +5266,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
/* We make assumptions about address window mappings */ /* We make assumptions about address window mappings */
ASSERT((unsigned long)regsva == SI_ENUM_BASE); ASSERT((unsigned long)regsva == SI_ENUM_BASE);
/* BCMSDH passes venid and devid based on CIS parsing -- but /* SDIO car passes venid and devid based on CIS parsing -- but
* low-power start * low-power start
* means early parse could fail, so here we should get either an ID * means early parse could fail, so here we should get either an ID
* we recognize OR (-1) indicating we must request power first. * we recognize OR (-1) indicating we must request power first.
...@@ -5402,7 +5400,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no, ...@@ -5402,7 +5400,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
brcmf_sdcard_intr_disable(sdh); brcmf_sdcard_intr_disable(sdh);
ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus); ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus);
if (ret != 0) { if (ret != 0) {
DHD_ERROR(("%s: FAILED: bcmsdh_intr_reg returned %d\n", DHD_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
__func__, ret)); __func__, ret));
goto fail; goto fail;
} }
...@@ -5510,7 +5508,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, ...@@ -5510,7 +5508,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN); brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
/* Locate an appropriately-aligned portion of hdrbuf */ /* Locate an appropriately-aligned portion of hdrbuf */
bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], BRCMF_SDALIGN); bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0],
BRCMF_SDALIGN);
/* Set the poll and/or interrupt flags */ /* Set the poll and/or interrupt flags */
bus->intr = (bool) brcmf_intr; bus->intr = (bool) brcmf_intr;
...@@ -5553,9 +5552,8 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh) ...@@ -5553,9 +5552,8 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
/* Align the buffer */ /* Align the buffer */
if ((unsigned long)bus->databuf % BRCMF_SDALIGN) if ((unsigned long)bus->databuf % BRCMF_SDALIGN)
bus->dataptr = bus->dataptr = bus->databuf + (BRCMF_SDALIGN -
bus->databuf + (BRCMF_SDALIGN - ((unsigned long)bus->databuf % BRCMF_SDALIGN));
((unsigned long)bus->databuf % BRCMF_SDALIGN));
else else
bus->dataptr = bus->databuf; bus->dataptr = bus->databuf;
...@@ -5612,7 +5610,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh) ...@@ -5612,7 +5610,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
false) != 0) { false) != 0) {
bus->sd_rxchain = false; bus->sd_rxchain = false;
} else { } else {
DHD_INFO(("%s: bus module (through bcmsdh API) %s chaining\n", DHD_INFO(("%s: bus module (through sdiocard API) %s chaining\n",
__func__, __func__,
(bus->sd_rxchain ? "supports" : "does not support"))); (bus->sd_rxchain ? "supports" : "does not support")));
} }
...@@ -5773,8 +5771,8 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus) ...@@ -5773,8 +5771,8 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus)
goto err; goto err;
} }
if ((u32)(unsigned long)memblock % BRCMF_SDALIGN) if ((u32)(unsigned long)memblock % BRCMF_SDALIGN)
memptr += memptr += (BRCMF_SDALIGN -
(BRCMF_SDALIGN - ((u32)(unsigned long)memblock % BRCMF_SDALIGN)); ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
/* Download image */ /* Download image */
while ((len = while ((len =
...@@ -5946,7 +5944,7 @@ static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus) ...@@ -5946,7 +5944,7 @@ static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus)
static int static int
brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags, brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt, u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle) brcmf_sdio_cmplt_fn_t complete, void *handle)
{ {
return brcmf_sdcard_send_buf return brcmf_sdcard_send_buf
(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete, (bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete,
......
...@@ -18,24 +18,26 @@ ...@@ -18,24 +18,26 @@
#define _BRCM_SDH_H_ #define _BRCM_SDH_H_
#include <linux/skbuff.h> #include <linux/skbuff.h>
#define BCMSDH_ERROR_VAL 0x0001 /* Error */ #define BRCMF_SD_ERROR_VAL 0x0001 /* Error */
#define BCMSDH_INFO_VAL 0x0002 /* Info */ #define BRCMF_SD_INFO_VAL 0x0002 /* Info */
extern const uint bcmsdh_msglevel; extern const uint brcmf_sdio_msglevel;
#ifdef BCMDBG #ifdef BCMDBG
#define BCMSDH_ERROR(x) \ #define BRCMF_SD_ERROR(x) \
do { \ do { \
if ((bcmsdh_msglevel & BCMSDH_ERROR_VAL) && net_ratelimit()) \ if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
net_ratelimit()) \
printk x; \ printk x; \
} while (0) } while (0)
#define BCMSDH_INFO(x) \ #define BRCMF_SD_INFO(x) \
do { \ do { \
if ((bcmsdh_msglevel & BCMSDH_INFO_VAL) && net_ratelimit()) \ if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
net_ratelimit()) \
printk x; \ printk x; \
} while (0) } while (0)
#else /* BCMDBG */ #else /* BCMDBG */
#define BCMSDH_ERROR(x) #define BRCMF_SD_ERROR(x)
#define BCMSDH_INFO(x) #define BRCMF_SD_INFO(x)
#endif /* BCMDBG */ #endif /* BCMDBG */
#define SDIO_FUNC_0 0 #define SDIO_FUNC_0 0
...@@ -61,11 +63,12 @@ extern const uint bcmsdh_msglevel; ...@@ -61,11 +63,12 @@ extern const uint bcmsdh_msglevel;
/* forward declarations */ /* forward declarations */
struct brcmf_sdio; struct brcmf_sdio;
typedef void (*bcmsdh_cb_fn_t) (void *); typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver. /* Attach and build an interface to the underlying SD host driver.
* - Allocates resources (structs, arrays, mem, OS handles, etc) needed by bcmsdh. * - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
* - Returns the bcmsdh handle and virtual address base for register access. * brcmf_sdcard.
* - Returns the sdio card handle and virtual address base for register access.
* The returned handle should be used in all subsequent calls, but the bcmsh * The returned handle should be used in all subsequent calls, but the bcmsh
* implementation may maintain a single "default" handle (e.g. the first or * implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL. * most recent one) to enable single-instance implementations to pass NULL.
...@@ -84,20 +87,21 @@ extern int brcmf_sdcard_intr_enable(void *sdh); ...@@ -84,20 +87,21 @@ extern int brcmf_sdcard_intr_enable(void *sdh);
extern int brcmf_sdcard_intr_disable(void *sdh); extern int brcmf_sdcard_intr_disable(void *sdh);
/* Register/deregister device interrupt handler. */ /* Register/deregister device interrupt handler. */
extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh); extern int
brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
extern int brcmf_sdcard_intr_dereg(void *sdh); extern int brcmf_sdcard_intr_dereg(void *sdh);
#if defined(BCMDBG) #if defined(BCMDBG)
/* Query pending interrupt status from the host controller */ /* Query pending interrupt status from the host controller */
extern bool brcmf_sdcard_intr_pending(void *sdh); extern bool brcmf_sdcard_intr_pending(void *sdh);
#endif #endif
extern int bcmsdh_claim_host_and_lock(void *sdh);
extern int bcmsdh_release_host_and_unlock(void *sdh);
/* Register a callback to be called if and when bcmsdh detects /* Register a callback to be called on device removal.
* device removal. No-op in the case of non-removable/hardwired devices. * No-op in the case of non-removable/hardwired devices.
*/ */
extern int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh); extern int
brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface). /* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number * fn: function number
...@@ -147,13 +151,14 @@ extern bool brcmf_sdcard_regfail(void *sdh); ...@@ -147,13 +151,14 @@ extern bool brcmf_sdcard_regfail(void *sdh);
* Returns 0 or error code. * Returns 0 or error code.
* NOTE: Async operation is not currently supported. * NOTE: Async operation is not currently supported.
*/ */
typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting); typedef void (*brcmf_sdio_cmplt_fn_t)
(void *handle, int status, bool sync_waiting);
extern int brcmf_sdcard_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, u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle); brcmf_sdio_cmplt_fn_t complete, void *handle);
extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn, extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt, uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle); brcmf_sdio_cmplt_fn_t complete, void *handle);
/* Flags bits */ /* Flags bits */
#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */ #define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
......
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