1 | WL_CHANSPEC_BW_20 | WL_CHANSPEC_CTL_SB_NONE |
WL_CHANSPEC_BAND_2G;
- /* make sure the channel is on the supported band if we are band-restricted */
- if (wlc->bandlocked || NBANDS(wlc) == 1) {
- ASSERT(CHSPEC_WLCBANDUNIT(chanspec) == wlc->band->bandunit);
- }
- ASSERT(wlc_valid_chanspec_db(wlc->cmi, chanspec));
return chanspec;
}
wlc_bcn_li_upd(wlc);
wlc->bcn_wait_prd =
(u8) (wlc_bmac_read_shm(wlc->hw, M_NOSLPZNATDTIM) >> 10);
- ASSERT(wlc->bcn_wait_prd > 0);
/* the world is new again, so is our reported rate */
wlc_reprate_init(wlc);
if (WLC_WME_RETRY_SHORT_GET(wlc, 0) == 0) { /* Uninitialized; read from HW */
int ac;
- ASSERT(wlc->clk);
for (ac = 0; ac < AC_COUNT; ac++) {
wlc->wme_retries[ac] =
wlc_read_shm(wlc, M_AC_TXLMT_ADDR(ac));
res = false;
}
}
- ASSERT(res);
return res;
}
int idx;
struct wlc_bsscfg *cfg;
- ASSERT(wlc->band->gmode);
-
/* use the override if it is set */
if (wlc->shortslot_override != WLC_SHORTSLOT_AUTO)
shortslot = (wlc->shortslot_override == WLC_SHORTSLOT_ON);
if (!wlc_valid_chanspec_db(wlc->cmi, chanspec)) {
wiphy_err(wlc->wiphy, "wl%d: %s: Bad channel %d\n",
wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec));
- ASSERT(wlc_valid_chanspec_db(wlc->cmi, chanspec));
return;
}
}
}
- ASSERT(N_ENAB(wlc->pub) || !CHSPEC_IS40(chanspec));
-
/* sync up phy/radio chanspec */
wlc_set_phy_chanspec(wlc, chanspec);
break;
default:
- ASSERT(0);
break;
}
* figure out the right band to park on
*/
if (wlc->bandlocked || NBANDS(wlc) == 1) {
- ASSERT(CHSPEC_WLCBANDUNIT(chanspec) == wlc->band->bandunit);
-
parkband = wlc->band->bandunit; /* updated in wlc_bandlock() */
band_order[0] = band_order[1] = parkband;
} else {
int idx;
struct wlc_bsscfg *cfg;
- ASSERT(NBANDS(wlc) > 1);
- ASSERT(!wlc->bandlocked);
- ASSERT(bandunit != wlc->band->bandunit || wlc->bandinit_pending);
-
wlc->band = wlc->bandstate[bandunit];
if (!wlc->pub->up)
shm_acparams_t acp_shm;
u16 *shm_entry;
- ASSERT(wlc);
-
/* Only apply params if the core is out of reset and has clocks */
if (!wlc->clk) {
wiphy_err(wlc->wiphy, "wl%d: %s : no-clock\n", wlc->pub->unit,
do {
memset((char *)&acp_shm, 0, sizeof(shm_acparams_t));
- /* find out which ac this set of params applies to */
- ASSERT(aci < AC_COUNT);
-
/* fill in shm ac params struct */
acp_shm.txop = le16_to_cpu(params->txop);
/* convert from units of 32us to us for ucode */
struct ieee80211_tx_queue_params txq_pars;
struct ieee80211_tx_queue_params *params = &txq_pars;
- ASSERT(wlc);
-
/*
* AP uses AC params from wme_param_ie_ap.
* AP advertises AC params from wme_param_ie.
for (i_ac = 0; i_ac < AC_COUNT; i_ac++, edcf_acp++) {
/* find out which ac this set of params applies to */
aci = (edcf_acp->ACI & EDCF_ACI_MASK) >> EDCF_ACI_SHIFT;
- ASSERT(aci < AC_COUNT);
/* set the admission control policy for this AC */
if (edcf_acp->ACI & EDCF_ACM_MASK) {
wlc->wme_admctl |= 1 << aci;
*/
uint wlc_detach(struct wlc_info *wlc)
{
- uint i;
uint callbacks = 0;
if (wlc == NULL)
WL_TRACE("wl%d: %s\n", wlc->pub->unit, __func__);
- ASSERT(!wlc->pub->up);
-
callbacks += wlc_bmac_detach(wlc);
/* delete software timers */
while (wlc->tx_queues != NULL)
wlc_txq_free(wlc, wlc->tx_queues);
- /*
- * consistency check: wlc_module_register/wlc_module_unregister calls
- * should match therefore nothing should be left here.
- */
- for (i = 0; i < WLC_MAXMODULES; i++)
- ASSERT(wlc->modulecb[i].name[0] == '\0');
-
wlc_detach_mfree(wlc);
return callbacks;
}
/* maintain LED behavior in down state */
static void wlc_down_led_upd(struct wlc_info *wlc)
{
- ASSERT(!wlc->pub->up);
-
/* maintain LEDs while in down state, turn on sbclk if not available yet */
/* turn on sbclk if necessary */
if (!AP_ENAB(wlc->pub)) {
if (wlc->mpc_offcnt < WLC_MPC_MAX_DELAYCNT)
wlc->mpc_offcnt++;
- /* validate all the reasons driver could be down and running this radio_timer */
- ASSERT(wlc->pub->radio_disabled || wlc->down_override);
wlc_radio_hwdisable_upd(wlc);
wlc_radio_upd(wlc);
}
if (!wlc->radio_monitor)
return true;
- ASSERT((wlc->pub->wlfeatureflag & WL_SWFL_NOHWRADIO) !=
- WL_SWFL_NOHWRADIO);
-
wlc->radio_monitor = false;
wlc_pllreq(wlc, false, WLC_PLLREQ_RADIO_MON);
return wl_del_timer(wlc->wl, wlc->radio_timer);
wlc->pub->hw_up = false;
}
-#if defined(BCMDBG)
-/* Verify the sanity of wlc->tx_prec_map. This can be done only by making sure that
- * if there is no packet pending for the FIFO, then the corresponding prec bits should be set
- * in prec_map. Of course, ignore this rule when block_datafifo is set
- */
-static bool wlc_tx_prec_map_verify(struct wlc_info *wlc)
-{
- /* For non-WME, both fifos have overlapping prec_map. So it's an error only if both
- * fail the check.
- */
- if (!EDCF_ENAB(wlc->pub)) {
- if (!(WLC_TX_FIFO_CHECK(wlc, TX_DATA_FIFO) ||
- WLC_TX_FIFO_CHECK(wlc, TX_CTL_FIFO)))
- return false;
- else
- return true;
- }
-
- return WLC_TX_FIFO_CHECK(wlc, TX_AC_BK_FIFO)
- && WLC_TX_FIFO_CHECK(wlc, TX_AC_BE_FIFO)
- && WLC_TX_FIFO_CHECK(wlc, TX_AC_VI_FIFO)
- && WLC_TX_FIFO_CHECK(wlc, TX_AC_VO_FIFO);
-}
-#endif /* BCMDBG */
-
static void wlc_watchdog_by_timer(void *arg)
{
struct wlc_info *wlc = (struct wlc_info *) arg;
/* radio sync: sw/hw/mpc --> radio_disable/radio_enable */
wlc_radio_hwdisable_upd(wlc);
wlc_radio_upd(wlc);
- /* if ismpc, driver should be in down state if up/down is allowed */
- if (wlc->mpc && wlc_ismpc(wlc))
- ASSERT(!wlc->pub->up);
/* if radio is disable, driver may be down, quit here */
if (wlc->pub->radio_disabled)
return;
wlc->tempsense_lasttime = wlc->pub->now;
wlc_tempsense_upd(wlc);
}
- /* BMAC_NOTE: for HIGH_ONLY driver, this seems being called after RPC bus failed */
- ASSERT(wlc_bmac_taclear(wlc->hw, true));
-
- /* Verify that tx_prec_map and fifos are in sync to avoid lock ups */
- ASSERT(wlc_tx_prec_map_verify(wlc));
-
- ASSERT(wlc_ps_check(wlc));
}
/* make interface operational */
wlc->pub->unit, idx);
}
}
- } else
- ASSERT(!status);
+ }
}
if (wlc->pub->radio_disabled) {
wlc_wme_retries_write(wlc);
/* start one second watchdog timer */
- ASSERT(!wlc->WDarmed);
wl_add_timer(wlc->wl, wlc->wdtimer, TIMER_INTERVAL_WATCHDOG, true);
wlc->WDarmed = true;
/* cancel all other timers */
callbacks += wlc_down_del_timer(wlc);
- /* interrupt must have been blocked */
- ASSERT((wlc->macintmask == 0) || !wlc->pub->up);
-
wlc->pub->up = false;
wlc_phy_mute_upd(wlc->band->pi, false, PHY_MUTE_ALL);
/* flush tx queues */
for (qi = wlc->tx_queues; qi != NULL; qi = qi->next) {
pktq_flush(&qi->q, true, NULL, 0);
- ASSERT(pktq_empty(&qi->q));
}
callbacks += wlc_bmac_down_finish(wlc->hw);
/* wlc_bmac_down_finish has done wlc_coredisable(). so clk is off */
wlc->clk = false;
-#ifdef BCMDBG
- /* Since all the packets should have been freed,
- * all callbacks should have been called
- */
- for (i = 1; i <= wlc->pub->tunables->maxpktcb; i++)
- ASSERT(wlc->pkt_callback[i].fn == NULL);
-#endif
wlc->going_down = false;
return callbacks;
}
int err;
err = wlc_nmode_validate(wlc, nmode);
- ASSERT(err == 0);
if (err)
return err;
nmode = WL_11N_2x2;
case WL_11N_2x2:
case WL_11N_3x3:
- ASSERT(WLC_PHY_11N_CAP(wlc->band));
/* force GMODE_AUTO if NMODE is ON */
wlc_set_gmode(wlc, GMODE_AUTO, true);
if (nmode == WL_11N_3x3)
break;
default:
- ASSERT(0);
break;
}
return -BCME_ERROR;
}
- ASSERT(!(wlc->pub->hw_off && wlc->pub->up));
-
/* default argument is generic integer */
pval = arg ? (int *)arg:NULL;
case WLC_GET_CHANNEL:{
channel_info_t *ci = (channel_info_t *) arg;
- ASSERT(len > (int)sizeof(ci));
+ if (len <= (int)sizeof(ci)) {
+ bcmerror = BCME_BUFTOOSHORT;
+ goto done;
+ }
ci->hw_channel =
CHSPEC_CHANNEL(WLC_BAND_PI_RADIO_CHANSPEC);
}
}
- /* BMAC_NOTE: for HIGH_ONLY driver, this seems being called after RPC bus failed */
- /* In hw_off condition, IOCTLs that reach here are deemed safe but taclear would
- * certainly result in getting -1 for register reads. So skip ta_clear altogether
- */
- if (!(wlc->pub->hw_off))
- ASSERT(wlc_bmac_taclear(wlc->hw, ta_ok) || !ta_ok);
return bcmerror;
}
else
lookup_name = name;
- ASSERT(table != NULL);
-
for (vi = table; vi->name; vi++) {
if (!strcmp(vi->name, lookup_name))
return vi;
struct wlc_info *wlc = (struct wlc_info *) pub->wlc;
int i;
- ASSERT(name != NULL);
- ASSERT(i_fn != NULL || w_fn != NULL || d_fn != NULL);
-
/* find an empty entry and just add, no duplication check! */
for (i = 0; i < WLC_MAXMODULES; i++) {
if (wlc->modulecb[i].name[0] == '\0') {
}
}
- /* it is time to increase the capacity */
- ASSERT(i < WLC_MAXMODULES);
return -BCME_NORESOURCE;
}
if (wlc == NULL)
return -BCME_NOTFOUND;
- ASSERT(name != NULL);
-
for (i = 0; i < WLC_MAXMODULES; i++) {
if (!strcmp(wlc->modulecb[i].name, name) &&
(wlc->modulecb[i].hdl == hdl)) {
u32 actionid;
int i;
- ASSERT(name != NULL);
-
- ASSERT(len >= 0);
-
- /* Get MUST have return space */
- ASSERT(set || (arg && len));
-
- ASSERT(!(wlc->pub->hw_off && wlc->pub->up));
-
- /* Set does NOT take qualifiers */
- ASSERT(!set || (!params && !p_len));
-
if (!set && (len == sizeof(int)) &&
!(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);
- ASSERT(0);
+ return -BCME_UNSUPPORTED;
}
/* find the given iovar name */
}
/* iovar name not found */
if (i >= WLC_MAXMODULES) {
- err = -BCME_UNSUPPORTED;
- goto exit;
+ return -BCME_UNSUPPORTED;
}
/* set up 'params' pointer in case this is a set command so that
err = wlc->modulecb[i].iovar_fn(wlc->modulecb[i].hdl, vi, actionid,
name, params, p_len, arg, len, val_size,
wlcif);
-
- exit:
return err;
}
}
}
*p = '\0';
- ASSERT(p < endp);
-
return (int)(p - buf);
}
#endif /* defined(BCMDBG) */
eprec = prec;
else if (pktq_full(q)) {
p = pktq_peek_tail(q, &eprec);
- ASSERT(p != NULL);
if (eprec > prec) {
wiphy_err(wlc->wiphy, "%s: Failing: eprec %d > prec %d"
"\n", __func__, eprec, prec);
if (eprec >= 0) {
bool discard_oldest;
- /* Detect queueing to unconfigured precedence */
- ASSERT(!pktq_pempty(q, eprec));
-
discard_oldest = AC_BITMAP_TST(wlc->wme_dp, eprec);
/* Refuse newer packet unless configured to discard oldest */
/* Evict packet according to discard policy */
p = discard_oldest ? pktq_pdeq(q, eprec) : pktq_pdeq_tail(q,
eprec);
- ASSERT(p != NULL);
-
/* Increment wme stats */
if (WME_ENAB(wlc->pub)) {
WLCNTINCR(wlc->pub->_wme_cnt->
p = pktq_penq_head(q, prec, pkt);
else
p = pktq_penq(q, prec, pkt);
- ASSERT(p != NULL);
return true;
}
prio = sdu->priority;
- ASSERT(pktq_max(q) >= wlc->pub->tunables->datahiwat);
-
if (!wlc_prec_enq(wlc, q, sdu, prec)) {
if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL))
struct scb *scb = &global_scb;
struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);
- ASSERT(sdu);
-
/* 802.11 standard requires management traffic to go at highest priority */
prio = ieee80211_is_data(d11_header->frame_control) ? sdu->priority :
MAXPRIO;
fifo = prio2fifo[prio];
-
- ASSERT((uint) skb_headroom(sdu) >= TXOFF);
- ASSERT(!(sdu->next));
- ASSERT(!(sdu->prev));
- ASSERT(fifo < NFIFO);
-
pkt = sdu;
if (unlikely
(wlc_d11hdrs_mac80211(wlc, hw, pkt, scb, 0, 1, fifo, 0, NULL, 0)))
u16 frameid = INVALIDFID;
d11txh_t *txh;
- ASSERT(fifo < NFIFO);
txh = (d11txh_t *) (p->data);
/* When a BC/MC frame is being committed to the BCMC fifo via DMA (NOT PIO), update
if (IS_MCS(rspec)) {
/* not supported yet */
- ASSERT(0);
} else if (IS_OFDM(rspec)) {
/* nsyms = Ceiling(Nbits / (Nbits/sym))
*
wiphy_err(wlc->wiphy, "wl%d: wlc_compute_airtime: "
"unsupported rspec 0x%x\n",
wlc->pub->unit, rspec);
- ASSERT((const char *)"Bad phy_rate" == NULL);
break;
}
}
static void wlc_compute_mimo_plcp(ratespec_t rspec, uint length, u8 *plcp)
{
u8 mcs = (u8) (rspec & RSPEC_RATE_MASK);
- ASSERT(IS_MCS(rspec));
plcp[0] = mcs;
if (RSPEC_IS40MHZ(rspec) || (mcs == 32))
plcp[0] |= MIMO_PLCP_40MHZ;
u32 tmp = 0;
int rate = RSPEC2RATE(rspec);
- ASSERT(IS_OFDM(rspec));
-
/* encode rate per 802.11a-1999 sec 17.3.4.1, with lsb transmitted first */
rate_signal = rate_info[rate] & WLC_RATE_MASK;
- ASSERT(rate_signal != 0);
-
memset(plcp, 0, D11_PHY_HDR_LEN);
D11A_PHY_HDR_SRATE((ofdm_phy_hdr_t *) plcp, rate_signal);
{
int rate = RSPEC2RATE(rspec);
- ASSERT(IS_CCK(rspec));
-
wlc_cck_plcp_set(wlc, rate, length, plcp);
}
return dur;
}
-static bool wlc_phy_rspec_check(struct wlc_info *wlc, u16 bw, ratespec_t rspec)
-{
- if (IS_MCS(rspec)) {
- uint mcs = rspec & RSPEC_RATE_MASK;
-
- if (mcs < 8) {
- ASSERT(RSPEC_STF(rspec) < PHY_TXC1_MODE_SDM);
- } else if ((mcs >= 8) && (mcs <= 23)) {
- ASSERT(RSPEC_STF(rspec) == PHY_TXC1_MODE_SDM);
- } else if (mcs == 32) {
- ASSERT(RSPEC_STF(rspec) < PHY_TXC1_MODE_SDM);
- ASSERT(bw == PHY_TXC1_BW_40MHZ_DUP);
- }
- } else if (IS_OFDM(rspec)) {
- ASSERT(RSPEC_STF(rspec) < PHY_TXC1_MODE_STBC);
- } else {
- ASSERT(IS_CCK(rspec));
-
- ASSERT((bw == PHY_TXC1_BW_20MHZ)
- || (bw == PHY_TXC1_BW_20MHZ_UP));
- ASSERT(RSPEC_STF(rspec) == PHY_TXC1_MODE_SISO);
- }
-
- return true;
-}
-
u16 BCMFASTPATH wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec)
{
u16 phyctl1 = 0;
"not supported yet, set to 20L\n", bw);
bw = PHY_TXC1_BW_20MHZ;
}
-
- wlc_phy_rspec_check(wlc, bw, rspec);
}
if (IS_MCS(rspec)) {
if (phycfg == -1) {
wiphy_err(wlc->wiphy, "wlc_phytxctl1_calc: wrong "
"legacy OFDM/CCK rate\n");
- ASSERT(0);
phycfg = 0;
}
/* set the upper byte of phyctl1 */
(bw | (phycfg << 8) |
(RSPEC_STF(rspec) << PHY_TXC1_MODE_SHIFT));
}
-
-#ifdef BCMDBG
- /* phy clock must support 40Mhz if tx descriptor uses it */
- if ((phyctl1 & PHY_TXC1_BW_MASK) >= PHY_TXC1_BW_40MHZ) {
- ASSERT(CHSPEC_WLC_BW(wlc->chanspec) == WLC_40_MHZ);
- ASSERT(wlc->chanspec == wlc_phy_chanspec_get(wlc->band->pi));
- }
-#endif /* BCMDBG */
return phyctl1;
}
u16 mimo_txbw;
u8 mimo_preamble_type;
- ASSERT(queue < NFIFO);
-
/* locate 802.11 MAC header */
h = (struct ieee80211_hdr *)(p->data);
qos = ieee80211_is_data_qos(h->frame_control);
/* Get tx_info */
tx_info = IEEE80211_SKB_CB(p);
- ASSERT(tx_info);
/* add PLCP */
plcp = skb_push(p, D11_PHY_HDR_LEN);
/* setup frameid */
if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
/* non-AP STA should never use BCMC queue */
- ASSERT(queue != TX_BCMC_FIFO);
if (queue == TX_BCMC_FIFO) {
wiphy_err(wlc->wiphy, "wl%d: %s: ASSERT queue == "
"TX_BCMC!\n", WLCWLUNIT(wlc), __func__);
if (SCB_PS(scb) || ieee80211_is_beacon(h->frame_control))
mcl |= TXC_IGNOREPMQ;
- ASSERT(hw->max_rates <= IEEE80211_TX_MAX_RATES);
- ASSERT(hw->max_rates == 2);
-
txrate[0] = tx_info->control.rates;
txrate[1] = txrate[0] + 1;
- ASSERT(txrate[0]->idx >= 0);
/* if rate control algorithm didn't give us a fallback rate, use the primary rate */
if (txrate[1]->idx < 0) {
txrate[1] = txrate[0];
is_mcs[k] =
txrate[k]->flags & IEEE80211_TX_RC_MCS ? true : false;
if (!is_mcs[k]) {
- ASSERT(!(tx_info->flags & IEEE80211_TX_CTL_AMPDU));
if ((txrate[k]->idx >= 0)
&& (txrate[k]->idx <
hw->wiphy->bands[tx_info->band]->n_bitrates)) {
flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ?
true : false;
} else {
- ASSERT((txrate[k]->idx >= 0) &&
- (txrate[k]->idx <
- hw->wiphy->bands[tx_info->band]->
- n_bitrates));
rate_val[k] = WLC_RATE_1M;
}
} else {
/* (1) RATE: determine and validate primary rate and fallback rates */
if (!RSPEC_ACTIVE(rspec[k])) {
- ASSERT(RSPEC_ACTIVE(rspec[k]));
rspec[k] = WLC_RATE_1M;
} else {
if (!is_multicast_ether_addr(h->addr1)) {
&& WLC_STF_SS_STBC_TX(wlc, scb)) {
u8 stc;
- ASSERT(WLC_STBC_CAP_PHY(wlc));
stc = 1; /* Nss for single stream is always 1 */
rspec[k] |=
(PHY_TXC1_MODE_STBC <<
if (wlc->ofdm_40txbw != AUTO)
mimo_txbw = wlc->ofdm_40txbw;
} else {
- ASSERT(IS_CCK(rspec[k]));
if (wlc->cck_40txbw != AUTO)
mimo_txbw = wlc->cck_40txbw;
}
wiphy_err(wlc->wiphy, "wl%d: %s: IEEE80211_TX_"
"RC_MCS != IS_MCS(rspec)\n",
WLCWLUNIT(wlc), __func__);
- ASSERT(0 && "Rate mismatch");
}
if (IS_MCS(rspec[k])) {
}
}
- /* mimo bw field MUST now be valid in the rspec (it affects duration calculations) */
- ASSERT(VALID_RATE_DBG(wlc, rspec[0]));
-
/* should be better conditionalized */
if (!IS_MCS(rspec[0])
&& (tx_info->control.rates[0].
flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE))
preamble_type[k] = WLC_SHORT_PREAMBLE;
-
- ASSERT(!IS_MCS(rspec[0])
- || WLC_IS_MIMO_PREAMBLE(preamble_type[k]));
}
} else {
for (k = 0; k < hw->max_rates; k++) {
/* Set ctrlchbw as 20Mhz */
- ASSERT(!IS_MCS(rspec[k]));
rspec[k] &= ~RSPEC_BW_MASK;
rspec[k] |= (PHY_TXC1_BW_20MHZ << RSPEC_BW_SHIFT);
/* Set fallback rate preamble type */
if ((preamble_type[1] == WLC_SHORT_PREAMBLE) ||
(preamble_type[1] == WLC_GF_PREAMBLE)) {
- ASSERT((preamble_type[1] == WLC_GF_PREAMBLE) ||
- (!IS_MCS(rspec[1])));
if (RSPEC2RATE(rspec[1]) != WLC_RATE_1M)
mch |= TXC_PREAMBLE_DATA_FB_SHORT;
}
}
/* RTS PLCP header */
- ASSERT(IS_ALIGNED((unsigned long)txh->RTSPhyHeader, sizeof(u16)));
rts_plcp = txh->RTSPhyHeader;
if (use_cts)
rts_phylen = DOT11_CTS_LEN + FCS_LEN;
phyctl = FRAMETYPE(rspec[0], wlc->mimoft);
if ((preamble_type[0] == WLC_SHORT_PREAMBLE) ||
(preamble_type[0] == WLC_GF_PREAMBLE)) {
- ASSERT((preamble_type[0] == WLC_GF_PREAMBLE)
- || !IS_MCS(rspec[0]));
if (RSPEC2RATE(rspec[0]) != WLC_RATE_1M)
phyctl |= PHY_TXC_SHORT_HDR;
wlc->pub->_cnt->txprshort++;
}
}
- if (IS_MCS(rspec[0]))
- ASSERT(IS_MCS(rspec[1]));
-
- ASSERT(!IS_MCS(rspec[0]) ||
- ((preamble_type[0] == WLC_MM_PREAMBLE) == (txh->MModeLen != 0)));
- ASSERT(!IS_MCS(rspec[1]) ||
- ((preamble_type[1] == WLC_MM_PREAMBLE) ==
- (txh->MModeFbrLen != 0)));
-
ac = skb_get_queue_mapping(p);
if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) {
uint frag_dur, dur, dur_fallback;
- ASSERT(!is_multicast_ether_addr(h->addr1));
-
/* WME: Update TXOP threshold */
if ((!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) && (frag == 0)) {
frag_dur =
}
#endif /* BCMDBG */
- if (macintstatus & MI_PRQ) {
- /* Process probe request FIFO */
- ASSERT(0 && "PRQ Interrupt in non-MBSS");
- }
-
/* TBTT indication */
/* ucode only gives either TBTT or DTIM_TBTT, not both */
if (macintstatus & (MI_TBTT | MI_DTIM_TBTT))
/* send any enq'd tx packets. Just makes sure to jump start tx */
if (!pktq_empty(&wlc->active_queue->q))
wlc_send_q(wlc, wlc->active_queue);
-
- ASSERT(wlc_ps_check(wlc));
}
static void wlc_war16165(struct wlc_info *wlc, bool tx)
}
queue = txs->frameid & TXFID_QUEUE_MASK;
- ASSERT(queue < NFIFO);
if (queue >= NFIFO) {
p = NULL;
goto fatal;
wlc_print_txstatus(txs);
}
- ASSERT(txs->frameid == cpu_to_le16(txh->TxFrameID));
if (txs->frameid != cpu_to_le16(txh->TxFrameID))
goto fatal;
-
tx_info = IEEE80211_SKB_CB(p);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
}
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
- ASSERT((mcl & TXC_AMPDU_MASK) != TXC_AMPDU_NONE);
wlc_ampdu_dotxstatus(wlc->ampdu, scb, p, txs);
return false;
}
return false;
fatal:
- ASSERT(0);
if (p)
pkt_buf_free_skb(p);
/* There is more room; mark precedences related to this FIFO sendable */
WLC_TX_FIFO_ENAB(wlc, fifo);
- ASSERT(TXPKTPENDGET(wlc, fifo) >= 0);
if (!TXPKTPENDTOT(wlc)) {
if (wlc->block_datafifo & DATA_BLOCK_TX_SUPR)
{
int len_mpdu;
struct ieee80211_rx_status rx_status;
-#if defined(BCMDBG)
- struct sk_buff *skb = p;
-#endif /* BCMDBG */
memset(&rx_status, 0, sizeof(rx_status));
prep_mac80211_status(wlc, rxh, p, &rx_status);
skb_pull(p, D11_PHY_HDR_LEN);
__skb_trim(p, len_mpdu);
- ASSERT(!(p->next));
- ASSERT(!(p->prev));
-
- ASSERT(IS_ALIGNED((unsigned long)skb->data, 2));
-
memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
/* MCS_TXS(mcs) returns num tx streams - 1 */
int tot_streams = (MCS_TXS(mcs) + 1) + RSPEC_STC(ratespec);
- ASSERT(WLC_PHY_11N_CAP(wlc->band));
/* the payload duration calculation matches that of regular ofdm */
/* 1000Ndbps = kbps * 4 */
kNdps =
uint rate = RSPEC2RATE(ratespec);
if (rate == 0) {
- ASSERT(0);
wiphy_err(wlc->wiphy, "wl%d: WAR: using rate of 1 mbps\n",
wlc->pub->unit);
rate = WLC_RATE_1M;
if (IS_MCS(ratespec)) {
uint mcs = ratespec & RSPEC_RATE_MASK;
int tot_streams = MCS_TXS(mcs) + RSPEC_STC(ratespec);
- ASSERT(WLC_PHY_11N_CAP(wlc->band));
- ASSERT(WLC_IS_MIMO_PREAMBLE(preamble_type));
dur = PREN_PREAMBLE + (tot_streams * PREN_PREAMBLE_EXT);
if (preamble_type == WLC_MM_PREAMBLE)
if (IS_MCS(ratespec)) {
uint mcs = ratespec & RSPEC_RATE_MASK;
int tot_streams = MCS_TXS(mcs) + RSPEC_STC(ratespec);
- ASSERT(WLC_PHY_11N_CAP(wlc->band));
dur -= PREN_PREAMBLE + (tot_streams * PREN_PREAMBLE_EXT);
/* payload calculation matches that of regular ofdm */
if (BAND_2G(wlc->band->bandtype))
* or equal to the rate of the immediately previous frame in the FES
*/
rspec = WLC_BASIC_RATE(wlc, rspec);
- ASSERT(VALID_RATE_DBG(wlc, rspec));
-
/* BA len == 32 == 16(ctl hdr) + 4(ba len) + 8(bitmap) + 4(fcs) */
return wlc_calc_frame_time(wlc, rspec, preamble_type,
(DOT11_BA_LEN + DOT11_BA_BITMAP_LEN +
* or equal to the rate of the immediately previous frame in the FES
*/
rspec = WLC_BASIC_RATE(wlc, rspec);
- ASSERT(VALID_RATE_DBG(wlc, rspec));
-
/* ACK frame len == 14 == 2(fc) + 2(dur) + 6(ra) + 4(fcs) */
dur =
wlc_calc_frame_time(wlc, rspec, preamble_type,
for (i = 0; i < wlc->band->hw_rateset.count; i++) {
rate = wlc->band->hw_rateset.rates[i];
- ASSERT(rate <= WLC_MAXRATE);
if (br[rate] != 0) {
/* This rate is a basic rate.
uint i;
rs_dflt = wlc_rateset_get_hwrs(wlc);
- ASSERT(rs_dflt != NULL);
wlc_rateset_copy(rs_dflt, &rs);
wlc_rateset_mcs_upd(&rs, wlc->stf->txstreams);
else
band->mimo_cap_40 = false;
} else {
- ASSERT(band->bandtype == WLC_BAND_2G);
if (bwcap == WLC_N_BW_40ALL)
band->mimo_cap_40 = true;
else
sifs = SIFS(wlc->band);
rs_dflt = wlc_rateset_get_hwrs(wlc);
- ASSERT(rs_dflt != NULL);
wlc_rateset_copy(rs_dflt, &rs);
wlc_rateset_mcs_upd(&rs, wlc->stf->txstreams);
struct ieee80211_mgmt *h;
int hdr_len, body_len;
- ASSERT(*len >= 142);
- ASSERT(type == IEEE80211_STYPE_BEACON ||
- type == IEEE80211_STYPE_PROBE_RESP);
-
if (MBSS_BCN_ENAB(cfg) && type == IEEE80211_STYPE_BEACON)
hdr_len = DOT11_MAC_HDR_LEN;
else
wlc->bcn_rspec =
wlc_lowest_basic_rspec(wlc, &cfg->current_bss->rateset);
- ASSERT(wlc_valid_rate
- (wlc, wlc->bcn_rspec,
- CHSPEC_IS2G(cfg->current_bss->
- chanspec) ? WLC_BAND_2G : WLC_BAND_5G,
- true));
-
/* update the template and ucode shm */
wlc_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON,
wlc->bcn_rspec, cfg, bcn, &len);
if (suspend)
wlc_enable_mac(wlc);
} else { /* Generating probe resp in sw; update local template */
- ASSERT(0 && "No software probe response support without MBSS");
+ /* error: No software probe response support without MBSS */
}
}
struct ieee80211_hdr *h;
struct scb *scb;
- ASSERT(pdu);
txh = (d11txh_t *) (pdu->data);
- ASSERT(txh);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- ASSERT(h);
/* get the pkt queue info. This was put at wlc_sendctl or wlc_send for PDU */
fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK;
* starting from the 2G channels
*/
chanspec = CH20MHZ_CHSPEC(1);
- ASSERT(chanspec != INVCHANSPEC);
-
wlc->home_chanspec = bi->chanspec = chanspec;
/* find the band of our default channel */
void wlc_set_shm(struct wlc_info *wlc, uint offset, u16 v, int len)
{
/* offset and len need to be even */
- ASSERT((offset & 1) == 0);
- ASSERT((len & 1) == 0);
-
- if (len <= 0)
+ if (len <= 0 || (offset & 1) || (len & 1))
return;
wlc_bmac_set_shm(wlc->hw, offset, v, len);
void wlc_copyto_shm(struct wlc_info *wlc, uint offset, const void *buf, int len)
{
/* offset and len need to be even */
- ASSERT((offset & 1) == 0);
- ASSERT((len & 1) == 0);
-
- if (len <= 0)
+ if (len <= 0 || (offset & 1) || (len & 1))
return;
+
wlc_bmac_copyto_objmem(wlc->hw, offset, buf, len, OBJADDR_SHM_SEL);
}
void wlc_copyfrom_shm(struct wlc_info *wlc, uint offset, void *buf, int len)
{
/* offset and len need to be even */
- ASSERT((offset & 1) == 0);
- ASSERT((len & 1) == 0);
-
- if (len <= 0)
+ if (len <= 0 || (offset & 1) || (len & 1))
return;
wlc_bmac_copyfrom_objmem(wlc->hw, offset, buf, len, OBJADDR_SHM_SEL);
if (prio == ALLPRIO) {
prio_mask = TXQ_STOP_FOR_PRIOFC_MASK;
} else {
- ASSERT(prio >= 0 && prio <= MAXPRIO);
prio_mask = NBITVAL(prio);
}
if (prio == ALLPRIO) {
prio_bits = TXQ_STOP_FOR_PRIOFC_MASK;
} else {
- ASSERT(prio >= 0 && prio <= MAXPRIO);
prio_bits = NBITVAL(prio);
}
{
uint prev_override;
- ASSERT(override != 0);
- ASSERT((override & TXQ_STOP_FOR_PRIOFC_MASK) == 0);
-
prev_override = (qi->stopped & ~TXQ_STOP_FOR_PRIOFC_MASK);
/* Update the flow control bits and do an early return if there is
else {
while (p != NULL && p->next != qi)
p = p->next;
- ASSERT(p->next == qi);
if (p != NULL)
p->next = p->next->next;
}