Code cleanup.
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#define SDIOH_DATA_PIO 0 /* PIO mode */
#define SDIOH_DATA_DMA 1 /* DMA mode */
-typedef int SDIOH_API_RC;
-
/* callback function, taking one arg */
typedef void (*sdioh_cb_fn_t) (void *);
* cfghdl points to the starting address of pci device mapped memory
*/
extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *si);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+extern int brcmf_sdioh_detach(struct sdioh_info *si);
+extern int brcmf_sdioh_interrupt_register(struct sdioh_info *si,
sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
/* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
/* enable or disable SD interrupt */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
#if defined(DHD_DEBUG)
extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
/* read or write one byte using cmd52 */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
u8 *byte);
/* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_word(struct sdioh_info *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
+extern int
brcmf_sdioh_request_buffer(struct sdioh_info *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
+extern int
brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
/* query number of io functions */
bool brcmf_sdcard_intr_query(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
bool on;
ASSERT(bcmsdh);
int brcmf_sdcard_intr_enable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
int brcmf_sdcard_intr_disable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
int brcmf_sdcard_intr_dereg(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
u32 data = 0;
if (!bcmsdh)
int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
u8 *tmp_buf, *tmp_ptr;
u8 *ptr;
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int 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)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- SDIOH_API_RC status;
+ int status;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
bcmsdh_cmplt_fn_t complete, void *handle)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
ASSERT(bcmsdh->init_success);
return sd;
}
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
+extern int brcmf_sdioh_detach(struct sdioh_info *sd)
{
sd_trace(("%s\n", __func__));
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
+extern int brcmf_sdioh_enable_func_intr(void)
{
u8 reg;
int err;
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
+extern int brcmf_sdioh_disable_func_intr(void)
{
u8 reg;
int err;
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
/* Configure callback to client when we receive client interrupt */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
void *argh)
{
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
{
sd_trace(("%s: Entering\n", __func__));
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
{
- SDIOH_API_RC status;
+ int status;
u8 data;
if (enable)
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
- SDIOH_API_RC status;
+ int status;
/* 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
+extern int
brcmf_sdioh_cfg_write(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
/* No lock needed since brcmf_sdioh_request_byte does locking */
- SDIOH_API_RC status;
+ int status;
status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
return status;
}
return scratch;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
{
u32 count;
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
uint regaddr, u8 *byte)
{
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
uint func, uint addr, u32 *word, uint nbytes)
{
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
-static SDIOH_API_RC
+static int
brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
uint func, uint addr, struct sk_buff *pkt)
{
* aligned packet.
*
*/
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_buffer(struct sdioh_info *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;
+ int Status;
struct sk_buff *mypkt = NULL;
sd_trace(("%s: Enter\n", __func__));
}
/* Interrupt enable/disable */
-SDIOH_API_RC brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
{
unsigned long flags;
struct sdos_info *sdos;