ASSERT(sdh);
/* don't support yet */
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
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);
/* 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);
/* 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);
vi = bcm_iovar_lookup(sdioh_iovars, name);
if (vi == NULL) {
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
goto exit;
}
case IOV_GVAL(IOV_BLOCKSIZE):
if ((u32) int_val > si->num_funcs) {
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
int_val = (s32) si->client_block_size[int_val];
uint maxsize;
if (func > si->num_funcs) {
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
maxsize = 0;
}
if (blksize > maxsize) {
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
if (!blksize)
|| sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
|| sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
}
default:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
break;
}
exit:
sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC);
sd->sdos_info = (void *)sdos;
if (sdos == NULL)
- return -BCME_NOMEM;
+ return -ENOMEM;
sdos->sd = sd;
spin_lock_init(&sdos->lock);
dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
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)
fail:
kfree(cdc);
- return -BCME_NOMEM;
+ return -ENOMEM;
}
/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
/* Add any bus info */
dhd_bus_dump(dhdp, strbuf);
- return !strbuf->size ? -BCME_BUFTOOSHORT : 0;
+ return !strbuf->size ? -EOVERFLOW : 0;
}
static int
case IOV_SVAL(IOV_WDTICK):
if (!dhd_pub->up) {
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
break;
}
dhd_os_wd_timer(dhd_pub, (uint) int_val);
case IOV_SVAL(IOV_IOCTLTIMEOUT):{
if (int_val <= 0)
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
else
dhd_os_set_ioctl_resp_timeout((unsigned int)
int_val);
}
default:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
break;
}
vi = bcm_iovar_lookup(dhd_iovars, name);
if (vi == NULL) {
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
goto exit;
}
DHD_TRACE(("%s: Enter\n", __func__));
if (!buf)
- return -BCME_BADARG;
+ return -EINVAL;
switch (ioc->cmd) {
case DHD_GET_MAGIC:
if (buflen < sizeof(int))
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
else
*(int *)buf = DHD_IOCTL_MAGIC;
break;
case DHD_GET_VERSION:
if (buflen < sizeof(int))
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
else
*(int *)buf = DHD_IOCTL_VERSION;
break;
;
if (*arg) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
bcmerror =
dhd_iovar_op(dhd_pub, buf, NULL, 0, arg,
arglen, IOV_SET);
- if (bcmerror != -BCME_UNSUPPORTED)
+ if (bcmerror != -ENOTSUPP)
break;
/* not in generic table, try protocol module */
bcmerror = dhd_prot_iovar_op(dhd_pub, buf,
NULL, 0, arg,
arglen, IOV_SET);
- if (bcmerror != -BCME_UNSUPPORTED)
+ if (bcmerror != -ENOTSUPP)
break;
/* if still not found, try bus module */
}
default:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
}
return bcmerror;
/* Copy the ioc control structure part of ioctl request */
if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
goto done;
}
{
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto done;
}
if (copy_from_user(buf, ioc.buf, buflen)) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
goto done;
}
}
/* To differentiate between wl and dhd read 4 more byes */
if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
sizeof(uint)) != 0)) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
goto done;
}
if (!capable(CAP_NET_ADMIN)) {
- bcmerror = -BCME_EPERM;
+ bcmerror = -EPERM;
goto done;
}
if (sleep) {
/* Don't sleep if something is pending */
if (bus->dpc_sched || bus->rxskip || pktq_len(&bus->txq))
- return -BCME_BUSY;
+ return -EBUSY;
/* Disable SDIO interrupts (no longer interested) */
bcmsdh_intr_disable(bus->sdh);
DHD_ERROR(("%s: couldn't allocate new %d-byte "
"packet\n",
__func__, pkt->len + DHD_SDALIGN));
- ret = -BCME_NOMEM;
+ ret = -ENOMEM;
goto done;
}
dhd_txcomplete(bus->dhd, pkt, false);
pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
- ret = -BCME_NORESOURCE;
+ ret = -ENOSR;
} else {
ret = 0;
}
memcpy(&pktgen, arg, sizeof(pktgen));
if (pktgen.version != DHD_PKTGEN_VERSION)
- return -BCME_BADARG;
+ return -EINVAL;
oldcnt = bus->pktgen_count;
oldmode = bus->pktgen_mode;
if (mbuffer == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__,
msize));
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto done;
}
}
str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) {
DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto done;
}
c->bufsize = le32_to_cpu(c->log.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
- return -BCME_NOMEM;
+ return -ENOMEM;
}
idx = le32_to_cpu(c->log.idx);
goto err;
}
if (!len) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
goto err;
}
bus->vars = kmalloc(len, GFP_ATOMIC);
bus->varsz = bus->vars ? len : 0;
if (bus->vars == NULL) {
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto err;
}
case IOV_SVAL(IOV_IDLETIME):
if ((int_val < 0) && (int_val != DHD_IDLE_IMMEDIATE))
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
else
bus->idletime = int_val;
break;
"0x%08x size %d dsize %d\n",
__func__, (set ? "set" : "get"),
address, size, dsize));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
DHD_ERROR(("%s: ramsize 0x%08x doesn't have %d "
"bytes at 0x%08x\n",
__func__, bus->orig_ramsize, size, address));
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
break;
}
case IOV_SVAL(IOV_SDRXCHAIN):
if (bool_val && !bus->sd_rxchain)
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
else
bus->use_rxchain = bool_val;
break;
if (bus->varsz < (uint) len)
memcpy(arg, bus->vars, bus->varsz);
else
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
#endif /* DHD_DEBUG */
break;
default:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
break;
}
if (bus->vars) {
vbuffer = kzalloc(varsize, GFP_ATOMIC);
if (!vbuffer)
- return -BCME_NOMEM;
+ return -ENOMEM;
memcpy(vbuffer, bus->vars, bus->varsz);
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
if (!nvram_ularray)
- return -BCME_NOMEM;
+ return -ENOMEM;
/* Upload image to verify downloaded contents. */
memset(nvram_ularray, 0xaa, varsize);
/* Address could be zero if CONSOLE := 0 in dongle Makefile */
if (bus->console_addr == 0)
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
/* Exclusive bus access */
dhd_os_sdlock(bus->dhd);
/* if firmware path present try to download and bring up bus */
ret = dhd_bus_start(bus->dhd);
if (ret != 0) {
- if (ret == -BCME_NOTUP) {
+ if (ret == -ENOLINK) {
DHD_ERROR(("%s: dongle is not responding\n", __func__));
goto fail;
}
ularray = kmalloc(bus->ramsize, GFP_ATOMIC);
if (!ularray) {
- bcmerror = -BCME_NOMEM;
+ bcmerror = -ENOMEM;
goto err;
}
/* Upload image to verify downloaded contents. */
/* Let pressure continue to build ... */
qlen = pktq_plen(&qi->q, prec);
if (ini->tx_in_transit > 0 && qlen < scb_ampdu->max_pdu) {
- return -BCME_BUSY;
+ return -EBUSY;
}
wlc_ampdu_agg(ampdu, scb, p, tid);
if (wlc->block_datafifo) {
wiphy_err(wiphy, "%s: Fifo blocked\n", __func__);
- return -BCME_BUSY;
+ return -EBUSY;
}
rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
ampdu_len = 0;
}
if (err) {
- if (err == BCME_BUSY) {
+ if (err == -EBUSY) {
wiphy_err(wiphy, "wl%d: wlc_sendampdu: "
"prep_xdu retry; seq 0x%x\n",
wlc->pub->unit, seq);
if (!N_ENAB(wlc->pub)) {
WL_AMPDU_ERR("wl%d: driver not nmode enabled\n",
wlc->pub->unit);
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
if (!wlc_ampdu_cap(ampdu)) {
WL_AMPDU_ERR("wl%d: device not ampdu capable\n",
wlc->pub->unit);
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
wlc->pub->_ampdu = on;
}
}
if (country == NULL)
- return -BCME_BADARG;
+ return -EINVAL;
/* set the driver state for the country */
wlc_set_country_common(wlc_cm, country_abbrev, mapped_ccode,
if (len == sizeof(tx_power_legacy_t))
old_power = (tx_power_legacy_t *) pwr;
else if (len < sizeof(tx_power_t))
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
memset(&power, 0, sizeof(tx_power_t));
* Gmode is not 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 */
if (wlc->band->bandtype == WLC_BAND_2G)
(wlc->bandstate[OTHERBANDUNIT(wlc)]->bandtype == WLC_BAND_2G))
band = wlc->bandstate[OTHERBANDUNIT(wlc)];
else
- return -BCME_BADBAND;
+ return -EINVAL;
/* Legacy or bust when no OFDM is supported by regulatory */
if ((wlc_channel_locale_flags_in_band(wlc->cmi, band->bandunit) &
/* Error */
wiphy_err(wlc->wiphy, "wl%d: %s: invalid gmode %d\n",
wlc->pub->unit, __func__, gmode);
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
/*
case WL_11N_2x2:
case WL_11N_3x3:
if (!(WLC_PHY_11N_CAP(wlc->band)))
- err = -BCME_BADBAND;
+ err = -EINVAL;
break;
default:
/* check for bad count value */
if ((rs.count == 0) || (rs.count > WLC_NUMRATES))
- return -BCME_BADRATESET;
+ return -EINVAL;
/* try the current band */
bandunit = wlc->band->bandunit;
wiphy_err(wlc->wiphy, "wl%d: %s: Command %d needs "
"arguments\n",
wlc->pub->unit, __func__, cmd);
- bcmerror = -BCME_BADARG;
+ bcmerror = -EINVAL;
goto done;
}
}
channel_info_t *ci = (channel_info_t *) arg;
if (len <= (int)sizeof(ci)) {
- bcmerror = BCME_BUFTOOSHORT;
+ bcmerror = EOVERFLOW;
goto done;
}
chanspec_t chspec = CH20MHZ_CHSPEC(val);
if (val < 0 || val > MAXCHANNEL) {
- bcmerror = -BCME_OUTOFRANGECHAN;
+ bcmerror = -EINVAL;
break;
}
if (!wlc_valid_chanspec_db(wlc->cmi, chspec)) {
- bcmerror = -BCME_BADCHAN;
+ bcmerror = -EINVAL;
break;
}
#if defined(BCMDBG)
case WLC_GET_UCFLAGS:
if (!wlc->pub->up) {
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
break;
}
case WLC_SET_UCFLAGS:
if (!wlc->pub->up) {
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
break;
}
break;
if (val & 1) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
}
break;
if (val & 1) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
}
band = WLC_BAND_AUTO;
if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
break;
if ((r->byteoff + r->size) > sizeof(d11regs_t)) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
}
if (r->size == sizeof(u32))
R_REG((u16 *)((unsigned char *)(unsigned long)regs +
r->byteoff));
else
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
case WLC_W_REG:
band = WLC_BAND_AUTO;
if (len < (int)(sizeof(rw_reg_t) - sizeof(uint))) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
break;
if (r->byteoff + r->size > sizeof(d11regs_t)) {
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
}
if (r->size == sizeof(u32))
W_REG((u16 *)((unsigned char *)(unsigned long) regs +
r->byteoff), r->val);
else
- bcmerror = -BCME_BADADDR;
+ bcmerror = -EINVAL;
break;
#endif /* BCMDBG */
u16 rxstatus;
if (!wlc->pub->up) {
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
break;
}
case WLC_SET_UCANTDIV:{
if (!wlc->pub->up) {
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
break;
}
wsec_key_t *src_key = wlc->wsec_keys[val];
if (len < (int)sizeof(key)) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
memcpy(arg, &key, sizeof(key));
} else
- bcmerror = -BCME_BADKEYIDX;
+ bcmerror = -EINVAL;
break;
#endif /* defined(BCMDBG) */
wsec_key_t *key;
if (len < DOT11_WPA_KEY_RSC_LEN) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
memcpy(arg, seq, sizeof(seq));
} else {
- bcmerror = -BCME_BADKEYIDX;
+ bcmerror = -EINVAL;
}
break;
}
rs = &wlc->default_bss->rateset;
if (len < (int)(rs->count + sizeof(rs->count))) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
wlc_default_rateset(wlc, (wlc_rateset_t *) &rs);
if (len < (int)(rs.count + sizeof(rs.count))) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
wl_rateset_t *in_rs = (wl_rateset_t *) arg;
if (len < (int)(in_rs->count + sizeof(in_rs->count))) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
{
unsigned char *cp = arg;
if (len < 3) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
/* copyin */
if (len < (int)sizeof(wlc_rateset_t)) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
memcpy(&rs, arg, sizeof(wlc_rateset_t));
/* check for bad count value */
if (rs.count > WLC_NUMRATES) {
- bcmerror = -BCME_BADRATESET;
+ bcmerror = -EINVAL;
break;
}
((NBANDS(wlc) > 1)
&& wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) {
/* gmode only command when not in gmode */
- bcmerror = -BCME_BADBAND;
+ bcmerror = -EINVAL;
break;
}
false,
wlc->stf->txstreams);
if (rs.count != new.count) {
- bcmerror = -BCME_BADRATESET;
+ bcmerror = -EINVAL;
break;
}
((NBANDS(wlc) > 1)
&& wlc->bandstate[OTHERBANDUNIT(wlc)]->gmode))) {
/* gmode only command when not in gmode */
- bcmerror = -BCME_BADBAND;
+ bcmerror = -EINVAL;
break;
}
if (len < (int)sizeof(wlc_rateset_t)) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
memcpy(arg, &wlc->sup_rates_override, sizeof(wlc_rateset_t));
if (key != NULL) {
*pval = key->id == val ? true : false;
} else {
- bcmerror = -BCME_BADKEYIDX;
+ bcmerror = -EINVAL;
}
break;
}
case WLC_SET_KEY_PRIMARY:{
wsec_key_t *key, *old_key;
- bcmerror = -BCME_BADKEYIDX;
+ bcmerror = -EINVAL;
/* treat the 'val' parm as the key id */
for (i = 0; i < WSEC_MAX_DEFAULT_KEYS; i++) {
;
if (i == (uint) len) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
break;
}
i++; /* include the null in the string length */
}
case WLC_SET_WSEC_PMK:
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
break;
#if defined(BCMDBG)
case WLC_CURRENT_PWR:
if (!wlc->pub->up)
- bcmerror = -BCME_NOTUP;
+ bcmerror = -ENOLINK;
else
bcmerror = wlc_get_current_txpwr(wlc, arg, len);
break;
{
/* if band is specified, it must be the current band */
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 ((band == WLC_BAND_AUTO) && IS_MBAND_UNLOCKED(wlc))
int wlc_iocpichk(struct wlc_info *wlc, uint phytype)
{
if (wlc->band->phytype != phytype)
- return -BCME_BADBAND;
+ return -EINVAL;
return 0;
}
#endif
}
}
- return -BCME_NORESOURCE;
+ return -ENOSR;
}
/* unregister module callbacks */
!(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) {
wiphy_err(wlc->wiphy, "wl%d: %s unaligned get ptr for %s\n",
wlc->pub->unit, __func__, name);
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
/* find the given iovar name */
}
/* iovar name not found */
if (i >= WLC_MAXMODULES) {
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
/* set up 'params' pointer in case this is a set command so that
if (set) {
if (((vi->flags & IOVF_SET_DOWN) && 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)
&& IS_MBAND_UNLOCKED(wlc)) {
err = -BCME_NOTBANDLOCKED;
} else {
if (((vi->flags & IOVF_GET_DOWN) && 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)
&& IS_MBAND_UNLOCKED(wlc)) {
err = -BCME_NOTBANDLOCKED;
default:
wiphy_err(wlc->wiphy, "wl%d: %s: unsupported\n",
wlc->pub->unit, __func__);
- err = -BCME_UNSUPPORTED;
+ err = -ENOTSUPP;
break;
}
}
}
- if (err == -BCME_BUSY) {
+ if (err == -EBUSY) {
pktq_penq_head(q, prec, pkt[0]);
/* If send failed due to any other reason than a change in
* HW FIFO condition, quit. Otherwise, read the new prec_map!
if (TXAVAIL(wlc, fifo) < MAX_DMA_SEGS) {
/* Mark precedences related to this FIFO, unsendable */
WLC_TX_FIFO_CLEAR(wlc, fifo);
- return -BCME_BUSY;
+ return -EBUSY;
}
if (!ieee80211_is_data(txh->MacFrameControl))
wlc_rev_info_t *rinfo = (wlc_rev_info_t *) buf;
if (len < WL_REV_INFO_LEGACY_LENGTH)
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
rinfo->vendorid = wlc->vendorid;
rinfo->deviceid = wlc->deviceid;
*/
#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_BADKEYIDX 8 /* BAD Key Index */
#define BCME_RADIOOFF 9 /* Radio Off */
#define BCME_NOTBANDLOCKED 10 /* Not band locked */
#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_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_EPERM 26 /* Not Permitted */
-#define BCME_NOMEM 27 /* No Memory */
#define BCME_ASSOCIATED 28 /* Associated */
#define BCME_RANGE 29 /* Not In Range */
#define BCME_NOTFOUND 30 /* Not Found */
}
if (*wlen < sz) {
*wlen = sz;
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
}
base = oi->hwbase;
break;
}
if (*wlen < sz) {
*wlen = sz;
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
}
base = oi->swbase;
break;
}
if (*wlen < sz) {
*wlen = sz;
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
}
base = oi->otpgu_base + OTPGU_CI_OFF;
break;
}
if (*wlen < sz) {
*wlen = sz;
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
}
base = oi->fbase;
break;
}
if (*wlen < sz) {
*wlen = sz;
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
}
base = oi->hwbase;
break;
default:
- return -BCME_BADARG;
+ return -EINVAL;
}
idx = si_coreidx(oi->sih);
static int ipxotp_nvread(void *oh, char *data, uint *len)
{
- return -BCME_UNSUPPORTED;
+ return -ENOTSUPP;
}
static otp_fn_t ipxotp_fn = {
char *vp = kmalloc(c, GFP_ATOMIC);
ASSERT(vp != NULL);
if (!vp)
- return -BCME_NOMEM;
+ return -ENOMEM;
memcpy(vp, start, c);
*vars = vp;
*count = c;
/* allocate memory and read in flash */
flash = kmalloc(NVRAM_SPACE, GFP_ATOMIC);
if (!flash)
- return -BCME_NOMEM;
+ return -ENOMEM;
err = nvram_getall(flash, NVRAM_SPACE);
if (err)
goto exit;
/* is there enough room to copy? */
copy_len = l - dl + 1;
if (len < copy_len) {
- err = -BCME_BUFTOOSHORT;
+ err = -EOVERFLOW;
goto exit;
}
/* add null string as terminator */
if (len < 1) {
- err = -BCME_BUFTOOSHORT;
+ err = -EOVERFLOW;
goto exit;
}
*vp++ = '\0';
base = vp = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
ASSERT(vp != NULL);
if (!vp)
- return -BCME_NOMEM;
+ return -ENOMEM;
err = initvars_flash(sih, &vp, MAXSZ_NVRAM_VARS);
if (err == 0)
case IOVT_UINT32:
/* all integers are s32 sized args at the ioctl interface */
if (len < (int)sizeof(int)) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
}
break;
case IOVT_BUFFER:
/* buffer must meet minimum length requirement */
if (len < vi->minlen) {
- bcmerror = -BCME_BUFTOOSHORT;
+ bcmerror = -EOVERFLOW;
}
break;
case IOVT_VOID:
if (!set) {
/* Cannot return nil... */
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
} else if (len) {
/* Set is an action w/o parameters */
bcmerror = -BCME_BUFTOOLONG;
default:
/* unknown type for length check in iovar info */
ASSERT(0);
- bcmerror = -BCME_UNSUPPORTED;
+ bcmerror = -ENOTSUPP;
}
return bcmerror;
new = kmalloc(bufsz, GFP_ATOMIC);
if (new == NULL)
- return -BCME_NOMEM;
+ return -ENOMEM;
new->vars = varlst;
new->bufsz = bufsz;
while ((from < lim) && (*from)) {
len = strlen(from) + 1;
if (resid < (acc + len))
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
memcpy(to, from, len);
acc += len;
from += len;
this = this->next;
}
if (resid < 1)
- return -BCME_BUFTOOSHORT;
+ return -EOVERFLOW;
*buf = '\0';
return 0;
}