diff options
Diffstat (limited to 'drivers/staging/brcm80211/brcmfmac/bcmsdh.c')
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c index 473f57d9f00b..3750fcf5a871 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c @@ -17,11 +17,11 @@ #include <linux/types.h> #include <linux/netdevice.h> +#include <linux/pci_ids.h> #include <bcmdefs.h> #include <bcmdevs.h> #include <bcmutils.h> #include <hndsoc.h> -#include <siutils.h> #include <bcmsdh.h> /* BRCM API for SDIO clients (such as wl, dhd) */ @@ -29,6 +29,8 @@ #include <sbsdio.h> /* BRCM sdio device core */ #include <sdio.h> /* sdio spec */ +#include "dngl_stats.h" +#include "dhd.h" #define SDIOH_API_ACCESS_RETRY_LIMIT 2 const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL; @@ -126,7 +128,7 @@ int bcmsdh_intr_enable(void *sdh) ASSERT(bcmsdh); status = sdioh_interrupt_set(bcmsdh->sdioh, true); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int bcmsdh_intr_disable(void *sdh) @@ -136,7 +138,7 @@ int bcmsdh_intr_disable(void *sdh) ASSERT(bcmsdh); status = sdioh_interrupt_set(bcmsdh->sdioh, false); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh) @@ -146,7 +148,7 @@ int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh) ASSERT(bcmsdh); status = sdioh_interrupt_register(bcmsdh->sdioh, fn, argh); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int bcmsdh_intr_dereg(void *sdh) @@ -156,7 +158,7 @@ int bcmsdh_intr_dereg(void *sdh) ASSERT(bcmsdh); status = sdioh_interrupt_deregister(bcmsdh->sdioh); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } #if defined(DHD_DEBUG) @@ -174,7 +176,7 @@ int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh) ASSERT(sdh); /* don't support yet */ - return BCME_UNSUPPORTED; + return -ENOTSUPP; } u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err) @@ -204,7 +206,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err) && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT)); #endif if (err) - *err = (SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR); + *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n", __func__, fnc_num, addr, data)); @@ -239,7 +241,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err) && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT)); #endif if (err) - *err = SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR; + *err = SDIOH_API_SUCCESS(status) ? 0 : -EIO; BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n", __func__, fnc_num, addr, data)); @@ -261,7 +263,7 @@ u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err) fnc_num, addr, &data, 4); if (err) - *err = (SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR); + *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n", __func__, fnc_num, addr, data)); @@ -286,7 +288,7 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data, SDIOH_WRITE, fnc_num, addr, &data, 4); if (err) - *err = (SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR); + *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO); BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n", __func__, fnc_num, addr, data)); @@ -317,7 +319,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length) tmp_buf = kmalloc(length, GFP_ATOMIC); if (tmp_buf == NULL) { BCMSDH_ERROR(("%s: out of memory\n", __func__)); - return BCME_NOMEM; + return -ENOMEM; } memcpy(tmp_buf, cis, length); for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4); @@ -329,7 +331,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length) kfree(tmp_buf); } - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } static int bcmsdhsdio_set_sbaddr_window(void *sdh, u32 address) @@ -467,7 +469,7 @@ bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags, /* Async not implemented yet */ ASSERT(!(flags & SDIO_REQ_ASYNC)); if (flags & SDIO_REQ_ASYNC) - return BCME_UNSUPPORTED; + return -ENOTSUPP; if (bar0 != bcmsdh->sbwad) { err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0); @@ -488,7 +490,7 @@ bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags, SDIOH_READ, fn, addr, width, nbytes, buf, pkt); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int @@ -512,7 +514,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags, /* Async not implemented yet */ ASSERT(!(flags & SDIO_REQ_ASYNC)); if (flags & SDIO_REQ_ASYNC) - return BCME_UNSUPPORTED; + return -ENOTSUPP; if (bar0 != bcmsdh->sbwad) { err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0); @@ -533,7 +535,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes) @@ -553,7 +555,7 @@ int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes) (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1, addr, 4, nbytes, buf, NULL); - return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR; + return SDIOH_API_SUCCESS(status) ? 0 : -EIO; } int bcmsdh_abort(void *sdh, uint fn) @@ -580,7 +582,7 @@ int bcmsdh_stop(void *sdh) int bcmsdh_query_device(void *sdh) { bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh; - bcmsdh->vendevid = (VENDOR_BROADCOM << 16) | 0; + bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0; return bcmsdh->vendevid; } |