#define SDIOH_API_ACCESS_RETRY_LIMIT 2
const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL;
-struct bcmsdh_info {
+struct brcmf_sdio {
bool init_success; /* underlying driver successfully attached */
void *sdioh; /* handler for sdioh */
u32 vendevid; /* Target Vendor and Device ID on SD bus */
u32 sbwad; /* Save backplane window address */
};
/* local copy of bcm sd handler */
-bcmsdh_info_t *l_bcmsdh;
+struct brcmf_sdio *l_bcmsdh;
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
-void brcmf_sdcard_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
+void brcmf_sdcard_enable_hw_oob_intr(struct brcmf_sdio *sdh, bool enable)
{
brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
}
#endif
-bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
+struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
- bcmsdh_info_t *bcmsdh;
+ struct brcmf_sdio *bcmsdh;
- bcmsdh = kzalloc(sizeof(bcmsdh_info_t), GFP_ATOMIC);
+ bcmsdh = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
if (bcmsdh == NULL) {
BCMSDH_ERROR(("bcmsdh_attach: out of memory"));
return NULL;
int brcmf_sdcard_detach(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (bcmsdh != NULL) {
if (bcmsdh->sdioh) {
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;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
len, set);
}
bool brcmf_sdcard_intr_query(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
bool on;
int brcmf_sdcard_intr_enable(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
int brcmf_sdcard_intr_disable(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
int brcmf_sdcard_intr_dereg(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
#if defined(DHD_DEBUG)
bool brcmf_sdcard_intr_pending(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
ASSERT(sdh);
return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
void
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u32 data = 0;
brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
if (!bcmsdh)
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u8 *tmp_buf, *tmp_ptr;
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
{
int err = 0;
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u32 word = 0;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
bool brcmf_sdcard_regfail(void *sdh)
{
- return ((bcmsdh_info_t *) sdh)->regfail;
+ return ((struct brcmf_sdio *) sdh)->regfail;
}
int
-brcmf_sdcard_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
uint incr_fix;
uint width;
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
int brcmf_sdcard_abort(void *sdh, uint fn)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
}
int brcmf_sdcard_start(void *sdh, int stage)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_start(bcmsdh->sdioh, stage);
}
int brcmf_sdcard_stop(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_stop(bcmsdh->sdioh);
}
int brcmf_sdcard_query_device(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
return bcmsdh->vendevid;
}
uint brcmf_sdcard_query_iofnum(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
}
-int brcmf_sdcard_reset(bcmsdh_info_t *sdh)
+int brcmf_sdcard_reset(struct brcmf_sdio *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_reset(bcmsdh->sdioh);
}
-void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh)
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh)
{
ASSERT(sdh);
return sdh->sdioh;
u32 brcmf_sdcard_cur_sbwad(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
typedef struct dhd_bus {
dhd_pub_t *dhd;
- bcmsdh_info_t *sdh; /* Handle for BCMSDH calls */
+ struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */
static int
brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
-static void brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
-static void brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
{
int err;
u8 clkctl, clkreq, devctl;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
DHD_TRACE(("%s: Enter\n", __func__));
int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
u16 len, pad = 0;
u32 swheader;
uint retries = 0;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
struct sk_buff *new;
int i;
u16 len;
u32 swheader;
uint retries = 0;
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
u8 doff = 0;
int ret = -1;
int i;
static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
u16 lastrbc;
static void
brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
uint rdlen, pad;
int sdret;
static uint
brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
u16 len, check; /* Extracted hardware header fields */
u8 chan, seq, doff; /* Extracted software header fields */
bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus, newstatus = 0;
uint retries = 0;
void brcmf_sdbrcm_isr(void *arg)
{
dhd_bus_t *bus = (dhd_bus_t *) arg;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
DHD_TRACE(("%s: Enter\n", __func__));
}
static int
-brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
+brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
void *regs)
{
u32 regdata;
}
static void
-brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase)
{
u32 regdata;
}
static void
-brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
{
u32 regdata;
#define SDIOD_MAX_IOFUNCS 7
/* forward declarations */
-typedef struct bcmsdh_info bcmsdh_info_t;
+struct brcmf_sdio;
typedef void (*bcmsdh_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver.
* 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 *brcmf_sdcard_attach(void *cfghdl, void **regsva,
+extern struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva,
uint irq);
/* Detach - freeup resources allocated in attach */
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 brcmf_sdcard_recv_buf(bcmsdh_info_t *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,
bcmsdh_cmplt_fn_t complete, void *handle);
bool set);
/* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(bcmsdh_info_t *sdh);
+extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
/* helper functions */
-extern void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
+extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
/* callback functions */
typedef struct {