staging: brcm80211: replace error codes part 1

Replacing part of the proprietary error code values with native error
code values.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Roland Vossen 2011-05-03 11:35:19 +02:00 committed by Greg Kroah-Hartman
parent c2be548d3d
commit e10d82d47d
15 changed files with 128 additions and 142 deletions

View file

@ -174,7 +174,7 @@ int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
ASSERT(sdh); ASSERT(sdh);
/* don't support yet */ /* don't support yet */
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err) u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
@ -317,7 +317,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
tmp_buf = kmalloc(length, GFP_ATOMIC); tmp_buf = kmalloc(length, GFP_ATOMIC);
if (tmp_buf == NULL) { if (tmp_buf == NULL) {
BCMSDH_ERROR(("%s: out of memory\n", __func__)); BCMSDH_ERROR(("%s: out of memory\n", __func__));
return -BCME_NOMEM; return -ENOMEM;
} }
memcpy(tmp_buf, cis, length); memcpy(tmp_buf, cis, length);
for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4); for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4);
@ -467,7 +467,7 @@ bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags,
/* Async not implemented yet */ /* Async not implemented yet */
ASSERT(!(flags & SDIO_REQ_ASYNC)); ASSERT(!(flags & SDIO_REQ_ASYNC));
if (flags & SDIO_REQ_ASYNC) if (flags & SDIO_REQ_ASYNC)
return -BCME_UNSUPPORTED; return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) { if (bar0 != bcmsdh->sbwad) {
err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0); err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
@ -512,7 +512,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
/* Async not implemented yet */ /* Async not implemented yet */
ASSERT(!(flags & SDIO_REQ_ASYNC)); ASSERT(!(flags & SDIO_REQ_ASYNC));
if (flags & SDIO_REQ_ASYNC) if (flags & SDIO_REQ_ASYNC)
return -BCME_UNSUPPORTED; return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) { if (bar0 != bcmsdh->sbwad) {
err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0); err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);

View file

@ -423,7 +423,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
vi = bcm_iovar_lookup(sdioh_iovars, name); vi = bcm_iovar_lookup(sdioh_iovars, name);
if (vi == NULL) { if (vi == NULL) {
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
goto exit; goto exit;
} }
@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
case IOV_GVAL(IOV_BLOCKSIZE): case IOV_GVAL(IOV_BLOCKSIZE):
if ((u32) int_val > si->num_funcs) { if ((u32) int_val > si->num_funcs) {
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
int_val = (s32) si->client_block_size[int_val]; int_val = (s32) si->client_block_size[int_val];
@ -486,7 +486,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
uint maxsize; uint maxsize;
if (func > si->num_funcs) { if (func > si->num_funcs) {
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
@ -504,7 +504,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
maxsize = 0; maxsize = 0;
} }
if (blksize > maxsize) { if (blksize > maxsize) {
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
if (!blksize) if (!blksize)
@ -607,7 +607,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|| sd_ptr->offset > SD_MaxCurCap) { || sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__, sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset)); sd_ptr->offset));
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
@ -637,7 +637,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
|| sd_ptr->offset > SD_MaxCurCap) { || sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__, sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset)); sd_ptr->offset));
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
@ -679,7 +679,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
} }
default: default:
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
break; break;
} }
exit: exit:

View file

@ -151,7 +151,7 @@ int sdioh_sdmmc_osinit(sdioh_info_t *sd)
sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC); sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC);
sd->sdos_info = (void *)sdos; sd->sdos_info = (void *)sdos;
if (sdos == NULL) if (sdos == NULL)
return -BCME_NOMEM; return -ENOMEM;
sdos->sd = sd; sdos->sd = sd;
spin_lock_init(&sdos->lock); spin_lock_init(&sdos->lock);

View file

@ -309,7 +309,7 @@ int
dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name, dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set) void *params, int plen, void *arg, int len, bool set)
{ {
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf) void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
@ -416,7 +416,7 @@ int dhd_prot_attach(dhd_pub_t *dhd)
fail: fail:
kfree(cdc); kfree(cdc);
return -BCME_NOMEM; return -ENOMEM;
} }
/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */ /* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */

View file

@ -189,7 +189,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
/* Add any bus info */ /* Add any bus info */
dhd_bus_dump(dhdp, strbuf); dhd_bus_dump(dhdp, strbuf);
return !strbuf->size ? -BCME_BUFTOOSHORT : 0; return !strbuf->size ? -EOVERFLOW : 0;
} }
static int static int
@ -242,7 +242,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
case IOV_SVAL(IOV_WDTICK): case IOV_SVAL(IOV_WDTICK):
if (!dhd_pub->up) { if (!dhd_pub->up) {
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
break; break;
} }
dhd_os_wd_timer(dhd_pub, (uint) int_val); dhd_os_wd_timer(dhd_pub, (uint) int_val);
@ -289,7 +289,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
case IOV_SVAL(IOV_IOCTLTIMEOUT):{ case IOV_SVAL(IOV_IOCTLTIMEOUT):{
if (int_val <= 0) if (int_val <= 0)
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
else else
dhd_os_set_ioctl_resp_timeout((unsigned int) dhd_os_set_ioctl_resp_timeout((unsigned int)
int_val); int_val);
@ -297,7 +297,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
} }
default: default:
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
break; break;
} }
@ -381,7 +381,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
vi = bcm_iovar_lookup(dhd_iovars, name); vi = bcm_iovar_lookup(dhd_iovars, name);
if (vi == NULL) { if (vi == NULL) {
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
goto exit; goto exit;
} }
@ -420,19 +420,19 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
if (!buf) if (!buf)
return -BCME_BADARG; return -EINVAL;
switch (ioc->cmd) { switch (ioc->cmd) {
case DHD_GET_MAGIC: case DHD_GET_MAGIC:
if (buflen < sizeof(int)) if (buflen < sizeof(int))
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
else else
*(int *)buf = DHD_IOCTL_MAGIC; *(int *)buf = DHD_IOCTL_MAGIC;
break; break;
case DHD_GET_VERSION: case DHD_GET_VERSION:
if (buflen < sizeof(int)) if (buflen < sizeof(int))
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
else else
*(int *)buf = DHD_IOCTL_VERSION; *(int *)buf = DHD_IOCTL_VERSION;
break; break;
@ -448,7 +448,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
; ;
if (*arg) { if (*arg) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -464,7 +464,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
bcmerror = bcmerror =
dhd_iovar_op(dhd_pub, buf, NULL, 0, arg, dhd_iovar_op(dhd_pub, buf, NULL, 0, arg,
arglen, IOV_SET); arglen, IOV_SET);
if (bcmerror != -BCME_UNSUPPORTED) if (bcmerror != -ENOTSUPP)
break; break;
/* not in generic table, try protocol module */ /* not in generic table, try protocol module */
@ -476,7 +476,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
bcmerror = dhd_prot_iovar_op(dhd_pub, buf, bcmerror = dhd_prot_iovar_op(dhd_pub, buf,
NULL, 0, arg, NULL, 0, arg,
arglen, IOV_SET); arglen, IOV_SET);
if (bcmerror != -BCME_UNSUPPORTED) if (bcmerror != -ENOTSUPP)
break; break;
/* if still not found, try bus module */ /* if still not found, try bus module */
@ -493,7 +493,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
} }
default: default:
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
} }
return bcmerror; return bcmerror;

View file

@ -1699,7 +1699,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
/* Copy the ioc control structure part of ioctl request */ /* Copy the ioc control structure part of ioctl request */
if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) { if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
goto done; goto done;
} }
@ -1715,11 +1715,11 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
{ {
buf = kmalloc(buflen, GFP_ATOMIC); buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) { if (!buf) {
bcmerror = -BCME_NOMEM; bcmerror = -ENOMEM;
goto done; goto done;
} }
if (copy_from_user(buf, ioc.buf, buflen)) { if (copy_from_user(buf, ioc.buf, buflen)) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
goto done; goto done;
} }
} }
@ -1728,12 +1728,12 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
/* To differentiate between wl and dhd read 4 more byes */ /* To differentiate between wl and dhd read 4 more byes */
if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t), if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
sizeof(uint)) != 0)) { sizeof(uint)) != 0)) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
goto done; goto done;
} }
if (!capable(CAP_NET_ADMIN)) { if (!capable(CAP_NET_ADMIN)) {
bcmerror = -BCME_EPERM; bcmerror = -EPERM;
goto done; goto done;
} }

View file

@ -819,7 +819,7 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
if (sleep) { if (sleep) {
/* Don't sleep if something is pending */ /* Don't sleep if something is pending */
if (bus->dpc_sched || bus->rxskip || pktq_len(&bus->txq)) if (bus->dpc_sched || bus->rxskip || pktq_len(&bus->txq))
return -BCME_BUSY; return -EBUSY;
/* Disable SDIO interrupts (no longer interested) */ /* Disable SDIO interrupts (no longer interested) */
bcmsdh_intr_disable(bus->sdh); bcmsdh_intr_disable(bus->sdh);
@ -961,7 +961,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
DHD_ERROR(("%s: couldn't allocate new %d-byte " DHD_ERROR(("%s: couldn't allocate new %d-byte "
"packet\n", "packet\n",
__func__, pkt->len + DHD_SDALIGN)); __func__, pkt->len + DHD_SDALIGN));
ret = -BCME_NOMEM; ret = -ENOMEM;
goto done; goto done;
} }
@ -1133,7 +1133,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
dhd_txcomplete(bus->dhd, pkt, false); dhd_txcomplete(bus->dhd, pkt, false);
pkt_buf_free_skb(pkt); pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__)); DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = -BCME_NORESOURCE; ret = -ENOSR;
} else { } else {
ret = 0; ret = 0;
} }
@ -1690,7 +1690,7 @@ static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg)
memcpy(&pktgen, arg, sizeof(pktgen)); memcpy(&pktgen, arg, sizeof(pktgen));
if (pktgen.version != DHD_PKTGEN_VERSION) if (pktgen.version != DHD_PKTGEN_VERSION)
return -BCME_BADARG; return -EINVAL;
oldcnt = bus->pktgen_count; oldcnt = bus->pktgen_count;
oldmode = bus->pktgen_mode; oldmode = bus->pktgen_mode;
@ -1851,7 +1851,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
if (mbuffer == NULL) { if (mbuffer == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__,
msize)); msize));
bcmerror = -BCME_NOMEM; bcmerror = -ENOMEM;
goto done; goto done;
} }
} }
@ -1859,7 +1859,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
str = kmalloc(maxstrlen, GFP_ATOMIC); str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) { if (str == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen)); DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
bcmerror = -BCME_NOMEM; bcmerror = -ENOMEM;
goto done; goto done;
} }
@ -2028,7 +2028,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
c->bufsize = le32_to_cpu(c->log.buf_size); c->bufsize = le32_to_cpu(c->log.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC); c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL) if (c->buf == NULL)
return -BCME_NOMEM; return -ENOMEM;
} }
idx = le32_to_cpu(c->log.idx); idx = le32_to_cpu(c->log.idx);
@ -2094,7 +2094,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
goto err; goto err;
} }
if (!len) { if (!len) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
goto err; goto err;
} }
@ -2104,7 +2104,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
bus->vars = kmalloc(len, GFP_ATOMIC); bus->vars = kmalloc(len, GFP_ATOMIC);
bus->varsz = bus->vars ? len : 0; bus->varsz = bus->vars ? len : 0;
if (bus->vars == NULL) { if (bus->vars == NULL) {
bcmerror = -BCME_NOMEM; bcmerror = -ENOMEM;
goto err; goto err;
} }
@ -2203,7 +2203,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_SVAL(IOV_IDLETIME): case IOV_SVAL(IOV_IDLETIME):
if ((int_val < 0) && (int_val != DHD_IDLE_IMMEDIATE)) if ((int_val < 0) && (int_val != DHD_IDLE_IMMEDIATE))
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
else else
bus->idletime = int_val; bus->idletime = int_val;
break; break;
@ -2249,7 +2249,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
"0x%08x size %d dsize %d\n", "0x%08x size %d dsize %d\n",
__func__, (set ? "set" : "get"), __func__, (set ? "set" : "get"),
address, size, dsize)); address, size, dsize));
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
@ -2264,7 +2264,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
DHD_ERROR(("%s: ramsize 0x%08x doesn't have %d " DHD_ERROR(("%s: ramsize 0x%08x doesn't have %d "
"bytes at 0x%08x\n", "bytes at 0x%08x\n",
__func__, bus->orig_ramsize, size, address)); __func__, bus->orig_ramsize, size, address));
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
break; break;
} }
@ -2322,7 +2322,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
case IOV_SVAL(IOV_SDRXCHAIN): case IOV_SVAL(IOV_SDRXCHAIN):
if (bool_val && !bus->sd_rxchain) if (bool_val && !bus->sd_rxchain)
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
else else
bus->use_rxchain = bool_val; bus->use_rxchain = bool_val;
break; break;
@ -2345,7 +2345,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
if (bus->varsz < (uint) len) if (bus->varsz < (uint) len)
memcpy(arg, bus->vars, bus->varsz); memcpy(arg, bus->vars, bus->varsz);
else else
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
#endif /* DHD_DEBUG */ #endif /* DHD_DEBUG */
@ -2509,7 +2509,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
break; break;
default: default:
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
break; break;
} }
@ -2546,7 +2546,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
if (bus->vars) { if (bus->vars) {
vbuffer = kzalloc(varsize, GFP_ATOMIC); vbuffer = kzalloc(varsize, GFP_ATOMIC);
if (!vbuffer) if (!vbuffer)
return -BCME_NOMEM; return -ENOMEM;
memcpy(vbuffer, bus->vars, bus->varsz); memcpy(vbuffer, bus->vars, bus->varsz);
@ -2558,7 +2558,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize)); DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = kmalloc(varsize, GFP_ATOMIC); nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
if (!nvram_ularray) if (!nvram_ularray)
return -BCME_NOMEM; return -ENOMEM;
/* Upload image to verify downloaded contents. */ /* Upload image to verify downloaded contents. */
memset(nvram_ularray, 0xaa, varsize); memset(nvram_ularray, 0xaa, varsize);
@ -4918,7 +4918,7 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
/* Address could be zero if CONSOLE := 0 in dongle Makefile */ /* Address could be zero if CONSOLE := 0 in dongle Makefile */
if (bus->console_addr == 0) if (bus->console_addr == 0)
return -BCME_UNSUPPORTED; return -ENOTSUPP;
/* Exclusive bus access */ /* Exclusive bus access */
dhd_os_sdlock(bus->dhd); dhd_os_sdlock(bus->dhd);
@ -5145,7 +5145,7 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
/* if firmware path present try to download and bring up bus */ /* if firmware path present try to download and bring up bus */
ret = dhd_bus_start(bus->dhd); ret = dhd_bus_start(bus->dhd);
if (ret != 0) { if (ret != 0) {
if (ret == -BCME_NOTUP) { if (ret == -ENOLINK) {
DHD_ERROR(("%s: dongle is not responding\n", __func__)); DHD_ERROR(("%s: dongle is not responding\n", __func__));
goto fail; goto fail;
} }
@ -5588,7 +5588,7 @@ static int dhdsdio_download_code_array(struct dhd_bus *bus)
ularray = kmalloc(bus->ramsize, GFP_ATOMIC); ularray = kmalloc(bus->ramsize, GFP_ATOMIC);
if (!ularray) { if (!ularray) {
bcmerror = -BCME_NOMEM; bcmerror = -ENOMEM;
goto err; goto err;
} }
/* Upload image to verify downloaded contents. */ /* Upload image to verify downloaded contents. */

View file

@ -528,14 +528,14 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
/* Let pressure continue to build ... */ /* Let pressure continue to build ... */
qlen = pktq_plen(&qi->q, prec); qlen = pktq_plen(&qi->q, prec);
if (ini->tx_in_transit > 0 && qlen < scb_ampdu->max_pdu) { if (ini->tx_in_transit > 0 && qlen < scb_ampdu->max_pdu) {
return -BCME_BUSY; return -EBUSY;
} }
wlc_ampdu_agg(ampdu, scb, p, tid); wlc_ampdu_agg(ampdu, scb, p, tid);
if (wlc->block_datafifo) { if (wlc->block_datafifo) {
wiphy_err(wiphy, "%s: Fifo blocked\n", __func__); wiphy_err(wiphy, "%s: Fifo blocked\n", __func__);
return -BCME_BUSY; return -EBUSY;
} }
rr_retry_limit = ampdu->rr_retry_limit_tid[tid]; rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
ampdu_len = 0; ampdu_len = 0;
@ -556,7 +556,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
} }
if (err) { if (err) {
if (err == BCME_BUSY) { if (err == -EBUSY) {
wiphy_err(wiphy, "wl%d: wlc_sendampdu: " wiphy_err(wiphy, "wl%d: wlc_sendampdu: "
"prep_xdu retry; seq 0x%x\n", "prep_xdu retry; seq 0x%x\n",
wlc->pub->unit, seq); wlc->pub->unit, seq);
@ -1198,12 +1198,12 @@ static int wlc_ampdu_set(struct ampdu_info *ampdu, bool on)
if (!N_ENAB(wlc->pub)) { if (!N_ENAB(wlc->pub)) {
WL_AMPDU_ERR("wl%d: driver not nmode enabled\n", WL_AMPDU_ERR("wl%d: driver not nmode enabled\n",
wlc->pub->unit); wlc->pub->unit);
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
if (!wlc_ampdu_cap(ampdu)) { if (!wlc_ampdu_cap(ampdu)) {
WL_AMPDU_ERR("wl%d: device not ampdu capable\n", WL_AMPDU_ERR("wl%d: device not ampdu capable\n",
wlc->pub->unit); wlc->pub->unit);
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
wlc->pub->_ampdu = on; wlc->pub->_ampdu = on;
} }

View file

@ -715,7 +715,7 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
} }
if (country == NULL) if (country == NULL)
return -BCME_BADARG; return -EINVAL;
/* set the driver state for the country */ /* set the driver state for the country */
wlc_set_country_common(wlc_cm, country_abbrev, mapped_ccode, wlc_set_country_common(wlc_cm, country_abbrev, mapped_ccode,

View file

@ -830,7 +830,7 @@ static int wlc_get_current_txpwr(struct wlc_info *wlc, void *pwr, uint len)
if (len == sizeof(tx_power_legacy_t)) if (len == sizeof(tx_power_legacy_t))
old_power = (tx_power_legacy_t *) pwr; old_power = (tx_power_legacy_t *) pwr;
else if (len < sizeof(tx_power_t)) else if (len < sizeof(tx_power_t))
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
memset(&power, 0, sizeof(tx_power_t)); memset(&power, 0, sizeof(tx_power_t));
@ -2555,7 +2555,7 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)
* Gmode is not GMODE_LEGACY_B * Gmode is not GMODE_LEGACY_B
*/ */
if (N_ENAB(wlc->pub) && gmode == GMODE_LEGACY_B) if (N_ENAB(wlc->pub) && gmode == GMODE_LEGACY_B)
return -BCME_UNSUPPORTED; return -ENOTSUPP;
/* verify that we are dealing with 2G band and grab the band pointer */ /* verify that we are dealing with 2G band and grab the band pointer */
if (wlc->band->bandtype == WLC_BAND_2G) if (wlc->band->bandtype == WLC_BAND_2G)
@ -2564,7 +2564,7 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)
(wlc->bandstate[OTHERBANDUNIT(wlc)]->bandtype == WLC_BAND_2G)) (wlc->bandstate[OTHERBANDUNIT(wlc)]->bandtype == WLC_BAND_2G))
band = wlc->bandstate[OTHERBANDUNIT(wlc)]; band = wlc->bandstate[OTHERBANDUNIT(wlc)];
else else
return -BCME_BADBAND; return -EINVAL;
/* Legacy or bust when no OFDM is supported by regulatory */ /* Legacy or bust when no OFDM is supported by regulatory */
if ((wlc_channel_locale_flags_in_band(wlc->cmi, band->bandunit) & if ((wlc_channel_locale_flags_in_band(wlc->cmi, band->bandunit) &
@ -2619,7 +2619,7 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)
/* Error */ /* Error */
wiphy_err(wlc->wiphy, "wl%d: %s: invalid gmode %d\n", wiphy_err(wlc->wiphy, "wl%d: %s: invalid gmode %d\n",
wlc->pub->unit, __func__, gmode); wlc->pub->unit, __func__, gmode);
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
/* /*
@ -2698,7 +2698,7 @@ static int wlc_nmode_validate(struct wlc_info *wlc, s32 nmode)
case WL_11N_2x2: case WL_11N_2x2:
case WL_11N_3x3: case WL_11N_3x3:
if (!(WLC_PHY_11N_CAP(wlc->band))) if (!(WLC_PHY_11N_CAP(wlc->band)))
err = -BCME_BADBAND; err = -EINVAL;
break; break;
default: default:
@ -2774,7 +2774,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
/* check for bad count value */ /* check for bad count value */
if ((rs.count == 0) || (rs.count > WLC_NUMRATES)) if ((rs.count == 0) || (rs.count > WLC_NUMRATES))
return -BCME_BADRATESET; return -EINVAL;
/* try the current band */ /* try the current band */
bandunit = wlc->band->bandunit; bandunit = wlc->band->bandunit;
@ -2906,7 +2906,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wiphy_err(wlc->wiphy, "wl%d: %s: Command %d needs " wiphy_err(wlc->wiphy, "wl%d: %s: Command %d needs "
"arguments\n", "arguments\n",
wlc->pub->unit, __func__, cmd); wlc->pub->unit, __func__, cmd);
bcmerror = -BCME_BADARG; bcmerror = -EINVAL;
goto done; goto done;
} }
} }
@ -2931,7 +2931,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
channel_info_t *ci = (channel_info_t *) arg; channel_info_t *ci = (channel_info_t *) arg;
if (len <= (int)sizeof(ci)) { if (len <= (int)sizeof(ci)) {
bcmerror = BCME_BUFTOOSHORT; bcmerror = EOVERFLOW;
goto done; goto done;
} }
@ -2948,12 +2948,12 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
chanspec_t chspec = CH20MHZ_CHSPEC(val); chanspec_t chspec = CH20MHZ_CHSPEC(val);
if (val < 0 || val > MAXCHANNEL) { if (val < 0 || val > MAXCHANNEL) {
bcmerror = -BCME_OUTOFRANGECHAN; bcmerror = -EINVAL;
break; break;
} }
if (!wlc_valid_chanspec_db(wlc->cmi, chspec)) { if (!wlc_valid_chanspec_db(wlc->cmi, chspec)) {
bcmerror = -BCME_BADCHAN; bcmerror = -EINVAL;
break; break;
} }
@ -2980,7 +2980,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
#if defined(BCMDBG) #if defined(BCMDBG)
case WLC_GET_UCFLAGS: case WLC_GET_UCFLAGS:
if (!wlc->pub->up) { if (!wlc->pub->up) {
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
break; break;
} }
@ -3004,7 +3004,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
case WLC_SET_UCFLAGS: case WLC_SET_UCFLAGS:
if (!wlc->pub->up) { if (!wlc->pub->up) {
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
break; break;
} }
@ -3042,7 +3042,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
break; break;
if (val & 1) { if (val & 1) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
} }
@ -3063,7 +3063,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
break; break;
if (val & 1) { if (val & 1) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
} }
@ -3077,7 +3077,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
band = WLC_BAND_AUTO; band = WLC_BAND_AUTO;
if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) { if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3090,7 +3090,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
break; break;
if ((r->byteoff + r->size) > sizeof(d11regs_t)) { if ((r->byteoff + r->size) > sizeof(d11regs_t)) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
} }
if (r->size == sizeof(u32)) if (r->size == sizeof(u32))
@ -3102,7 +3102,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
R_REG((u16 *)((unsigned char *)(unsigned long)regs + R_REG((u16 *)((unsigned char *)(unsigned long)regs +
r->byteoff)); r->byteoff));
else else
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
case WLC_W_REG: case WLC_W_REG:
@ -3111,7 +3111,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
band = WLC_BAND_AUTO; band = WLC_BAND_AUTO;
if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) { if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3124,7 +3124,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
break; break;
if (r->byteoff + r->size > sizeof(d11regs_t)) { if (r->byteoff + r->size > sizeof(d11regs_t)) {
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
} }
if (r->size == sizeof(u32)) if (r->size == sizeof(u32))
@ -3134,7 +3134,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
W_REG((u16 *)((unsigned char *)(unsigned long) regs + W_REG((u16 *)((unsigned char *)(unsigned long) regs +
r->byteoff), r->val); r->byteoff), r->val);
else else
bcmerror = -BCME_BADADDR; bcmerror = -EINVAL;
break; break;
#endif /* BCMDBG */ #endif /* BCMDBG */
@ -3197,7 +3197,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
u16 rxstatus; u16 rxstatus;
if (!wlc->pub->up) { if (!wlc->pub->up) {
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
break; break;
} }
@ -3224,7 +3224,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
case WLC_SET_UCANTDIV:{ case WLC_SET_UCANTDIV:{
if (!wlc->pub->up) { if (!wlc->pub->up) {
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
break; break;
} }
@ -3355,7 +3355,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wsec_key_t *src_key = wlc->wsec_keys[val]; wsec_key_t *src_key = wlc->wsec_keys[val];
if (len < (int)sizeof(key)) { if (len < (int)sizeof(key)) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3375,7 +3375,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
memcpy(arg, &key, sizeof(key)); memcpy(arg, &key, sizeof(key));
} else } else
bcmerror = -BCME_BADKEYIDX; bcmerror = -EINVAL;
break; break;
#endif /* defined(BCMDBG) */ #endif /* defined(BCMDBG) */
@ -3389,7 +3389,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wsec_key_t *key; wsec_key_t *key;
if (len < DOT11_WPA_KEY_RSC_LEN) { if (len < DOT11_WPA_KEY_RSC_LEN) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3426,7 +3426,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
memcpy(arg, seq, sizeof(seq)); memcpy(arg, seq, sizeof(seq));
} else { } else {
bcmerror = -BCME_BADKEYIDX; bcmerror = -EINVAL;
} }
break; break;
} }
@ -3441,7 +3441,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
rs = &wlc->default_bss->rateset; rs = &wlc->default_bss->rateset;
if (len < (int)(rs->count + sizeof(rs->count))) { if (len < (int)(rs->count + sizeof(rs->count))) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3459,7 +3459,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wlc_default_rateset(wlc, (wlc_rateset_t *) &rs); wlc_default_rateset(wlc, (wlc_rateset_t *) &rs);
if (len < (int)(rs.count + sizeof(rs.count))) { if (len < (int)(rs.count + sizeof(rs.count))) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3474,7 +3474,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wl_rateset_t *in_rs = (wl_rateset_t *) arg; wl_rateset_t *in_rs = (wl_rateset_t *) arg;
if (len < (int)(in_rs->count + sizeof(in_rs->count))) { if (len < (int)(in_rs->count + sizeof(in_rs->count))) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3665,7 +3665,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
{ {
unsigned char *cp = arg; unsigned char *cp = arg;
if (len < 3) { if (len < 3) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
@ -3797,14 +3797,14 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
/* copyin */ /* copyin */
if (len < (int)sizeof(wlc_rateset_t)) { if (len < (int)sizeof(wlc_rateset_t)) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
memcpy(&rs, arg, sizeof(wlc_rateset_t)); memcpy(&rs, arg, sizeof(wlc_rateset_t));
/* check for bad count value */ /* check for bad count value */
if (rs.count > WLC_NUMRATES) { if (rs.count > WLC_NUMRATES) {
bcmerror = -BCME_BADRATESET; bcmerror = -EINVAL;
break; break;
} }
@ -3813,7 +3813,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
((NBANDS(wlc) > 1) ((NBANDS(wlc) > 1)
&& wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) { && wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) {
/* gmode only command when not in gmode */ /* gmode only command when not in gmode */
bcmerror = -BCME_BADBAND; bcmerror = -EINVAL;
break; break;
} }
@ -3836,7 +3836,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
false, false,
wlc->stf->txstreams); wlc->stf->txstreams);
if (rs.count != new.count) { if (rs.count != new.count) {
bcmerror = -BCME_BADRATESET; bcmerror = -EINVAL;
break; break;
} }
@ -3859,11 +3859,11 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
((NBANDS(wlc) > 1) ((NBANDS(wlc) > 1)
&& wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) { && wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) {
/* gmode only command when not in gmode */ /* gmode only command when not in gmode */
bcmerror = -BCME_BADBAND; bcmerror = -EINVAL;
break; break;
} }
if (len < (int)sizeof(wlc_rateset_t)) { if (len < (int)sizeof(wlc_rateset_t)) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
memcpy(arg, &wlc->sup_rates_override, sizeof(wlc_rateset_t)); memcpy(arg, &wlc->sup_rates_override, sizeof(wlc_rateset_t));
@ -3894,7 +3894,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
if (key != NULL) { if (key != NULL) {
*pval = key->id == val ? true : false; *pval = key->id == val ? true : false;
} else { } else {
bcmerror = -BCME_BADKEYIDX; bcmerror = -EINVAL;
} }
break; break;
} }
@ -3902,7 +3902,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
case WLC_SET_KEY_PRIMARY:{ case WLC_SET_KEY_PRIMARY:{
wsec_key_t *key, *old_key; wsec_key_t *key, *old_key;
bcmerror = -BCME_BADKEYIDX; bcmerror = -EINVAL;
/* treat the 'val' parm as the key id */ /* treat the 'val' parm as the key id */
for (i = 0; i < WSEC_MAX_DEFAULT_KEYS; i++) { for (i = 0; i < WSEC_MAX_DEFAULT_KEYS; i++) {
@ -3936,7 +3936,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
; ;
if (i == (uint) len) { if (i == (uint) len) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
break; break;
} }
i++; /* include the null in the string length */ i++; /* include the null in the string length */
@ -3957,13 +3957,13 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
} }
case WLC_SET_WSEC_PMK: case WLC_SET_WSEC_PMK:
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
break; break;
#if defined(BCMDBG) #if defined(BCMDBG)
case WLC_CURRENT_PWR: case WLC_CURRENT_PWR:
if (!wlc->pub->up) if (!wlc->pub->up)
bcmerror = -BCME_NOTUP; bcmerror = -ENOLINK;
else else
bcmerror = wlc_get_current_txpwr(wlc, arg, len); bcmerror = wlc_get_current_txpwr(wlc, arg, len);
break; break;
@ -3992,7 +3992,7 @@ int wlc_iocregchk(struct wlc_info *wlc, uint band)
{ {
/* if band is specified, it must be the current band */ /* if band is specified, it must be the current band */
if ((band != WLC_BAND_AUTO) && (band != (uint) wlc->band->bandtype)) if ((band != WLC_BAND_AUTO) && (band != (uint) wlc->band->bandtype))
return -BCME_BADBAND; return -EINVAL;
/* if multiband and band is not specified, band must be locked */ /* if multiband and band is not specified, band must be locked */
if ((band == WLC_BAND_AUTO) && IS_MBAND_UNLOCKED(wlc)) if ((band == WLC_BAND_AUTO) && IS_MBAND_UNLOCKED(wlc))
@ -4011,7 +4011,7 @@ int wlc_iocregchk(struct wlc_info *wlc, uint band)
int wlc_iocpichk(struct wlc_info *wlc, uint phytype) int wlc_iocpichk(struct wlc_info *wlc, uint phytype)
{ {
if (wlc->band->phytype != phytype) if (wlc->band->phytype != phytype)
return -BCME_BADBAND; return -EINVAL;
return 0; return 0;
} }
#endif #endif
@ -4094,7 +4094,7 @@ int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
} }
} }
return -BCME_NORESOURCE; return -ENOSR;
} }
/* unregister module callbacks */ /* unregister module callbacks */
@ -4155,7 +4155,7 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name,
!(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) { !(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) {
wiphy_err(wlc->wiphy, "wl%d: %s unaligned get ptr for %s\n", wiphy_err(wlc->wiphy, "wl%d: %s unaligned get ptr for %s\n",
wlc->pub->unit, __func__, name); wlc->pub->unit, __func__, name);
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
/* find the given iovar name */ /* find the given iovar name */
@ -4168,7 +4168,7 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name,
} }
/* iovar name not found */ /* iovar name not found */
if (i >= WLC_MAXMODULES) { if (i >= WLC_MAXMODULES) {
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
/* set up 'params' pointer in case this is a set command so that /* set up 'params' pointer in case this is a set command so that
@ -4208,7 +4208,7 @@ wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len,
if (set) { if (set) {
if (((vi->flags & IOVF_SET_DOWN) && wlc->pub->up) || if (((vi->flags & IOVF_SET_DOWN) && wlc->pub->up) ||
((vi->flags & IOVF_SET_UP) && !wlc->pub->up)) { ((vi->flags & IOVF_SET_UP) && !wlc->pub->up)) {
err = (wlc->pub->up ? -BCME_NOTDOWN : -BCME_NOTUP); err = (wlc->pub->up ? -BCME_NOTDOWN : -ENOLINK);
} else if ((vi->flags & IOVF_SET_BAND) } else if ((vi->flags & IOVF_SET_BAND)
&& IS_MBAND_UNLOCKED(wlc)) { && IS_MBAND_UNLOCKED(wlc)) {
err = -BCME_NOTBANDLOCKED; err = -BCME_NOTBANDLOCKED;
@ -4218,7 +4218,7 @@ wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len,
} else { } else {
if (((vi->flags & IOVF_GET_DOWN) && wlc->pub->up) || if (((vi->flags & IOVF_GET_DOWN) && wlc->pub->up) ||
((vi->flags & IOVF_GET_UP) && !wlc->pub->up)) { ((vi->flags & IOVF_GET_UP) && !wlc->pub->up)) {
err = (wlc->pub->up ? -BCME_NOTDOWN : -BCME_NOTUP); err = (wlc->pub->up ? -BCME_NOTDOWN : -ENOLINK);
} else if ((vi->flags & IOVF_GET_BAND) } else if ((vi->flags & IOVF_GET_BAND)
&& IS_MBAND_UNLOCKED(wlc)) { && IS_MBAND_UNLOCKED(wlc)) {
err = -BCME_NOTBANDLOCKED; err = -BCME_NOTBANDLOCKED;
@ -4366,7 +4366,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
default: default:
wiphy_err(wlc->wiphy, "wl%d: %s: unsupported\n", wiphy_err(wlc->wiphy, "wl%d: %s: unsupported\n",
wlc->pub->unit, __func__); wlc->pub->unit, __func__);
err = -BCME_UNSUPPORTED; err = -ENOTSUPP;
break; break;
} }
@ -4985,7 +4985,7 @@ void BCMFASTPATH wlc_send_q(struct wlc_info *wlc, struct wlc_txq_info *qi)
} }
} }
if (err == -BCME_BUSY) { if (err == -EBUSY) {
pktq_penq_head(q, prec, pkt[0]); pktq_penq_head(q, prec, pkt[0]);
/* If send failed due to any other reason than a change in /* If send failed due to any other reason than a change in
* HW FIFO condition, quit. Otherwise, read the new prec_map! * HW FIFO condition, quit. Otherwise, read the new prec_map!
@ -7481,7 +7481,7 @@ int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifop)
if (TXAVAIL(wlc, fifo) < MAX_DMA_SEGS) { if (TXAVAIL(wlc, fifo) < MAX_DMA_SEGS) {
/* Mark precedences related to this FIFO, unsendable */ /* Mark precedences related to this FIFO, unsendable */
WLC_TX_FIFO_CLEAR(wlc, fifo); WLC_TX_FIFO_CLEAR(wlc, fifo);
return -BCME_BUSY; return -EBUSY;
} }
if (!ieee80211_is_data(txh->MacFrameControl)) if (!ieee80211_is_data(txh->MacFrameControl))
@ -7516,7 +7516,7 @@ int wlc_get_revision_info(struct wlc_info *wlc, void *buf, uint len)
wlc_rev_info_t *rinfo = (wlc_rev_info_t *) buf; wlc_rev_info_t *rinfo = (wlc_rev_info_t *) buf;
if (len < WL_REV_INFO_LEGACY_LENGTH) if (len < WL_REV_INFO_LEGACY_LENGTH)
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
rinfo->vendorid = wlc->vendorid; rinfo->vendorid = wlc->vendorid;
rinfo->deviceid = wlc->deviceid; rinfo->deviceid = wlc->deviceid;

View file

@ -252,26 +252,12 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
*/ */
#define BCME_ERROR 1 /* Error generic */ #define BCME_ERROR 1 /* Error generic */
#define BCME_BADARG 2 /* Bad Argument */
#define BCME_NOTUP 4 /* Not up */
#define BCME_NOTDOWN 5 /* Not down */ #define BCME_NOTDOWN 5 /* Not down */
#define BCME_BADKEYIDX 8 /* BAD Key Index */
#define BCME_RADIOOFF 9 /* Radio Off */ #define BCME_RADIOOFF 9 /* Radio Off */
#define BCME_NOTBANDLOCKED 10 /* Not band locked */ #define BCME_NOTBANDLOCKED 10 /* Not band locked */
#define BCME_NOCLK 11 /* No Clock */ #define BCME_NOCLK 11 /* No Clock */
#define BCME_BADRATESET 12 /* BAD Rate valueset */
#define BCME_BADBAND 13 /* BAD Band */
#define BCME_BUFTOOSHORT 14 /* Buffer too short */
#define BCME_BUFTOOLONG 15 /* Buffer too long */ #define BCME_BUFTOOLONG 15 /* Buffer too long */
#define BCME_BUSY 16 /* Busy */
#define BCME_OUTOFRANGECHAN 19 /* Out of Range Channel */
#define BCME_BADCHAN 20 /* Bad Channel */
#define BCME_BADADDR 21 /* Bad Address */
#define BCME_NORESOURCE 22 /* Not Enough Resources */
#define BCME_UNSUPPORTED 23 /* Unsupported */
#define BCME_NOTREADY 25 /* Not Ready */ #define BCME_NOTREADY 25 /* Not Ready */
#define BCME_EPERM 26 /* Not Permitted */
#define BCME_NOMEM 27 /* No Memory */
#define BCME_ASSOCIATED 28 /* Associated */ #define BCME_ASSOCIATED 28 /* Associated */
#define BCME_RANGE 29 /* Not In Range */ #define BCME_RANGE 29 /* Not In Range */
#define BCME_NOTFOUND 30 /* Not Found */ #define BCME_NOTFOUND 30 /* Not Found */

View file

@ -388,7 +388,7 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
} }
if (*wlen < sz) { if (*wlen < sz) {
*wlen = sz; *wlen = sz;
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
} }
base = oi->hwbase; base = oi->hwbase;
break; break;
@ -400,7 +400,7 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
} }
if (*wlen < sz) { if (*wlen < sz) {
*wlen = sz; *wlen = sz;
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
} }
base = oi->swbase; base = oi->swbase;
break; break;
@ -412,7 +412,7 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
} }
if (*wlen < sz) { if (*wlen < sz) {
*wlen = sz; *wlen = sz;
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
} }
base = oi->otpgu_base + OTPGU_CI_OFF; base = oi->otpgu_base + OTPGU_CI_OFF;
break; break;
@ -424,7 +424,7 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
} }
if (*wlen < sz) { if (*wlen < sz) {
*wlen = sz; *wlen = sz;
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
} }
base = oi->fbase; base = oi->fbase;
break; break;
@ -436,12 +436,12 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
} }
if (*wlen < sz) { if (*wlen < sz) {
*wlen = sz; *wlen = sz;
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
} }
base = oi->hwbase; base = oi->hwbase;
break; break;
default: default:
return -BCME_BADARG; return -EINVAL;
} }
idx = si_coreidx(oi->sih); idx = si_coreidx(oi->sih);
@ -459,7 +459,7 @@ static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
static int ipxotp_nvread(void *oh, char *data, uint *len) static int ipxotp_nvread(void *oh, char *data, uint *len)
{ {
return -BCME_UNSUPPORTED; return -ENOTSUPP;
} }
static otp_fn_t ipxotp_fn = { static otp_fn_t ipxotp_fn = {

View file

@ -324,7 +324,7 @@ static int initvars_table(char *start, char *end,
char *vp = kmalloc(c, GFP_ATOMIC); char *vp = kmalloc(c, GFP_ATOMIC);
ASSERT(vp != NULL); ASSERT(vp != NULL);
if (!vp) if (!vp)
return -BCME_NOMEM; return -ENOMEM;
memcpy(vp, start, c); memcpy(vp, start, c);
*vars = vp; *vars = vp;
*count = c; *count = c;
@ -353,7 +353,7 @@ static int initvars_flash(si_t *sih, char **base, uint len)
/* allocate memory and read in flash */ /* allocate memory and read in flash */
flash = kmalloc(NVRAM_SPACE, GFP_ATOMIC); flash = kmalloc(NVRAM_SPACE, GFP_ATOMIC);
if (!flash) if (!flash)
return -BCME_NOMEM; return -ENOMEM;
err = nvram_getall(flash, NVRAM_SPACE); err = nvram_getall(flash, NVRAM_SPACE);
if (err) if (err)
goto exit; goto exit;
@ -372,7 +372,7 @@ static int initvars_flash(si_t *sih, char **base, uint len)
/* is there enough room to copy? */ /* is there enough room to copy? */
copy_len = l - dl + 1; copy_len = l - dl + 1;
if (len < copy_len) { if (len < copy_len) {
err = -BCME_BUFTOOSHORT; err = -EOVERFLOW;
goto exit; goto exit;
} }
@ -384,7 +384,7 @@ static int initvars_flash(si_t *sih, char **base, uint len)
/* add null string as terminator */ /* add null string as terminator */
if (len < 1) { if (len < 1) {
err = -BCME_BUFTOOSHORT; err = -EOVERFLOW;
goto exit; goto exit;
} }
*vp++ = '\0'; *vp++ = '\0';
@ -410,7 +410,7 @@ static int initvars_flash_si(si_t *sih, char **vars, uint *count)
base = vp = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC); base = vp = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
ASSERT(vp != NULL); ASSERT(vp != NULL);
if (!vp) if (!vp)
return -BCME_NOMEM; return -ENOMEM;
err = initvars_flash(sih, &vp, MAXSZ_NVRAM_VARS); err = initvars_flash(sih, &vp, MAXSZ_NVRAM_VARS);
if (err == 0) if (err == 0)

View file

@ -502,21 +502,21 @@ int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
case IOVT_UINT32: case IOVT_UINT32:
/* all integers are s32 sized args at the ioctl interface */ /* all integers are s32 sized args at the ioctl interface */
if (len < (int)sizeof(int)) { if (len < (int)sizeof(int)) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
} }
break; break;
case IOVT_BUFFER: case IOVT_BUFFER:
/* buffer must meet minimum length requirement */ /* buffer must meet minimum length requirement */
if (len < vi->minlen) { if (len < vi->minlen) {
bcmerror = -BCME_BUFTOOSHORT; bcmerror = -EOVERFLOW;
} }
break; break;
case IOVT_VOID: case IOVT_VOID:
if (!set) { if (!set) {
/* Cannot return nil... */ /* Cannot return nil... */
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
} else if (len) { } else if (len) {
/* Set is an action w/o parameters */ /* Set is an action w/o parameters */
bcmerror = -BCME_BUFTOOLONG; bcmerror = -BCME_BUFTOOLONG;
@ -526,7 +526,7 @@ int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
default: default:
/* unknown type for length check in iovar info */ /* unknown type for length check in iovar info */
ASSERT(0); ASSERT(0);
bcmerror = -BCME_UNSUPPORTED; bcmerror = -ENOTSUPP;
} }
return bcmerror; return bcmerror;

View file

@ -89,7 +89,7 @@ int nvram_append(void *si, char *varlst, uint varsz)
new = kmalloc(bufsz, GFP_ATOMIC); new = kmalloc(bufsz, GFP_ATOMIC);
if (new == NULL) if (new == NULL)
return -BCME_NOMEM; return -ENOMEM;
new->vars = varlst; new->vars = varlst;
new->bufsz = bufsz; new->bufsz = bufsz;
@ -188,7 +188,7 @@ int nvram_getall(char *buf, int count)
while ((from < lim) && (*from)) { while ((from < lim) && (*from)) {
len = strlen(from) + 1; len = strlen(from) + 1;
if (resid < (acc + len)) if (resid < (acc + len))
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
memcpy(to, from, len); memcpy(to, from, len);
acc += len; acc += len;
from += len; from += len;
@ -200,7 +200,7 @@ int nvram_getall(char *buf, int count)
this = this->next; this = this->next;
} }
if (resid < 1) if (resid < 1)
return -BCME_BUFTOOSHORT; return -EOVERFLOW;
*buf = '\0'; *buf = '\0';
return 0; return 0;
} }