Commit 5dfa128f authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: delete ASSERTs in 4 files in brcmsmac dir

wlc_antsel.c, wlc_channel.c, wlc_rate.c and wlc_stf.c are now
ASSERT free.

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: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5672cfa3
...@@ -130,7 +130,6 @@ struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc) ...@@ -130,7 +130,6 @@ struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc)
asi->antsel_avail = false; asi->antsel_avail = false;
wiphy_err(wlc->wiphy, "wlc_antsel_attach: 2o3 " wiphy_err(wlc->wiphy, "wlc_antsel_attach: 2o3 "
"board cfg invalid\n"); "board cfg invalid\n");
ASSERT(0);
} }
break; break;
default: default:
...@@ -298,8 +297,6 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel) ...@@ -298,8 +297,6 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
u8 ant_cfg; u8 ant_cfg;
u16 mimo_antsel; u16 mimo_antsel;
ASSERT(asi->antsel_type != ANTSEL_NA);
/* 1) Update TX antconfig for all frames that are not unicast data /* 1) Update TX antconfig for all frames that are not unicast data
* (aka default TX) * (aka default TX)
*/ */
......
...@@ -594,8 +594,7 @@ struct chan20_info chan20_info[] = { ...@@ -594,8 +594,7 @@ struct chan20_info chan20_info[] = {
static const locale_info_t *wlc_get_locale_2g(u8 locale_idx) static const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
{ {
if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) { if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table)); return NULL; /* error condition */
return NULL;
} }
return g_locale_2g_table[locale_idx]; return g_locale_2g_table[locale_idx];
} }
...@@ -603,8 +602,7 @@ static const locale_info_t *wlc_get_locale_2g(u8 locale_idx) ...@@ -603,8 +602,7 @@ static const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
static const locale_info_t *wlc_get_locale_5g(u8 locale_idx) static const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
{ {
if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) { if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table)); return NULL; /* error condition */
return NULL;
} }
return g_locale_5g_table[locale_idx]; return g_locale_5g_table[locale_idx];
} }
...@@ -656,8 +654,6 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc) ...@@ -656,8 +654,6 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1); strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1);
country = wlc_country_lookup(wlc, country_abbrev); country = wlc_country_lookup(wlc, country_abbrev);
ASSERT(country != NULL);
/* save default country for exiting 11d regulatory mode */ /* save default country for exiting 11d regulatory mode */
strncpy(wlc->country_default, country_abbrev, WLC_CNTRY_BUF_SZ - 1); strncpy(wlc->country_default, country_abbrev, WLC_CNTRY_BUF_SZ - 1);
...@@ -708,7 +704,6 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm, ...@@ -708,7 +704,6 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
&mapped_regrev); &mapped_regrev);
} else { } else {
/* find the matching built-in country definition */ /* find the matching built-in country definition */
ASSERT(0);
country = wlc_country_lookup_direct(ccode, regrev); country = wlc_country_lookup_direct(ccode, regrev);
strncpy(mapped_ccode, ccode, WLC_CNTRY_BUF_SZ); strncpy(mapped_ccode, ccode, WLC_CNTRY_BUF_SZ);
mapped_regrev = regrev; mapped_regrev = regrev;
...@@ -738,8 +733,6 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm, ...@@ -738,8 +733,6 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
struct wlc_info *wlc = wlc_cm->wlc; struct wlc_info *wlc = wlc_cm->wlc;
char prev_country_abbrev[WLC_CNTRY_BUF_SZ]; char prev_country_abbrev[WLC_CNTRY_BUF_SZ];
ASSERT(country != NULL);
/* save current country state */ /* save current country state */
wlc_cm->country = country; wlc_cm->country = country;
...@@ -824,7 +817,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm, ...@@ -824,7 +817,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
*mapped_regrev = srom_regrev; *mapped_regrev = srom_regrev;
mapped = 0; mapped = 0;
wiphy_err(wlc->wiphy, "srom_code == ccode %s\n", __func__); wiphy_err(wlc->wiphy, "srom_code == ccode %s\n", __func__);
ASSERT(0);
} else { } else {
mapped = mapped =
wlc_country_aggregate_map(wlc_cm, ccode, mapped_ccode, wlc_country_aggregate_map(wlc_cm, ccode, mapped_ccode,
...@@ -837,7 +829,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm, ...@@ -837,7 +829,6 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
/* if there is not an exact rev match, default to rev zero */ /* if there is not an exact rev match, default to rev zero */
if (country == NULL && *mapped_regrev != 0) { if (country == NULL && *mapped_regrev != 0) {
*mapped_regrev = 0; *mapped_regrev = 0;
ASSERT(0);
country = country =
wlc_country_lookup_direct(mapped_ccode, *mapped_regrev); wlc_country_lookup_direct(mapped_ccode, *mapped_regrev);
} }
...@@ -874,8 +865,6 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode, ...@@ -874,8 +865,6 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
return &cntry_locales[i].country; return &cntry_locales[i].country;
} }
} }
ASSERT(0);
return NULL; return NULL;
} }
...@@ -896,12 +885,10 @@ wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country) ...@@ -896,12 +885,10 @@ wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
li = BAND_5G(band->bandtype) ? li = BAND_5G(band->bandtype) ?
wlc_get_locale_5g(country->locale_5G) : wlc_get_locale_5g(country->locale_5G) :
wlc_get_locale_2g(country->locale_2G); wlc_get_locale_2g(country->locale_2G);
ASSERT(li);
wlc_cm->bandstate[band->bandunit].locale_flags = li->flags; wlc_cm->bandstate[band->bandunit].locale_flags = li->flags;
li_mimo = BAND_5G(band->bandtype) ? li_mimo = BAND_5G(band->bandtype) ?
wlc_get_mimo_5g(country->locale_mimo_5G) : wlc_get_mimo_5g(country->locale_mimo_5G) :
wlc_get_mimo_2g(country->locale_mimo_2G); wlc_get_mimo_2g(country->locale_mimo_2G);
ASSERT(li_mimo);
/* merge the mimo non-mimo locale flags */ /* merge the mimo non-mimo locale flags */
wlc_cm->bandstate[band->bandunit].locale_flags |= wlc_cm->bandstate[band->bandunit].locale_flags |=
...@@ -1509,7 +1496,6 @@ wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband) ...@@ -1509,7 +1496,6 @@ wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband)
if (wf_chspec_malformed(chspec)) { if (wf_chspec_malformed(chspec)) {
wiphy_err(wlc->wiphy, "wl%d: malformed chanspec 0x%x\n", wiphy_err(wlc->wiphy, "wl%d: malformed chanspec 0x%x\n",
wlc->pub->unit, chspec); wlc->pub->unit, chspec);
ASSERT(0);
return false; return false;
} }
......
...@@ -315,7 +315,6 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs, ...@@ -315,7 +315,6 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
count = 0; count = 0;
for (i = 0; i < hw_rs->count; i++) { for (i = 0; i < hw_rs->count; i++) {
r = hw_rs->rates[i] & WLC_RATE_MASK; r = hw_rs->rates[i] & WLC_RATE_MASK;
ASSERT(r <= WLC_MAXRATE);
if (rateset[r]) if (rateset[r])
rs->rates[count++] = rateset[r]; rs->rates[count++] = rateset[r];
} }
...@@ -364,8 +363,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp) ...@@ -364,8 +363,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
case PRXS0_STDN: case PRXS0_STDN:
/* fallthru */ /* fallthru */
default: default:
/* not supported */ /* not supported, error condition */
ASSERT(0);
break; break;
} }
if (PLCP3_ISSGI(plcp[3])) if (PLCP3_ISSGI(plcp[3]))
...@@ -451,7 +449,7 @@ wlc_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw, ...@@ -451,7 +449,7 @@ wlc_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
} else if (PHYTYPE_IS(phy_type, PHY_TYPE_G)) { } else if (PHYTYPE_IS(phy_type, PHY_TYPE_G)) {
rs_dflt = &cck_ofdm_rates; rs_dflt = &cck_ofdm_rates;
} else { } else {
ASSERT(0); /* should not happen */ /* should not happen, error condition */
rs_dflt = &cck_rates; /* force cck */ rs_dflt = &cck_rates; /* force cck */
} }
......
...@@ -69,9 +69,6 @@ const u8 txcore_default[5] = { ...@@ -69,9 +69,6 @@ const u8 txcore_default[5] = {
static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val) static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
{ {
ASSERT((val == HT_CAP_RX_STBC_NO)
|| (val == HT_CAP_RX_STBC_ONE_STREAM));
/* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */ /* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */
if (WLC_STF_SS_STBC_RX(wlc)) { if (WLC_STF_SS_STBC_RX(wlc)) {
if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO)) if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO))
...@@ -196,8 +193,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask) ...@@ -196,8 +193,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
WL_TRACE("wl%d: %s: Nsts %d core_mask %x\n", WL_TRACE("wl%d: %s: Nsts %d core_mask %x\n",
wlc->pub->unit, __func__, Nsts, core_mask); wlc->pub->unit, __func__, Nsts, core_mask);
ASSERT((Nsts > 0) && (Nsts <= MAX_STREAMS_SUPPORTED));
if (WLC_BITSCNT(core_mask) > wlc->stf->txstreams) { if (WLC_BITSCNT(core_mask) > wlc->stf->txstreams) {
core_mask = 0; core_mask = 0;
} }
...@@ -208,8 +203,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask) ...@@ -208,8 +203,6 @@ static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
core_mask = wlc->stf->txchain; core_mask = wlc->stf->txchain;
} }
ASSERT(!core_mask || Nsts <= WLC_BITSCNT(core_mask));
wlc->stf->txcore[Nsts] = core_mask; wlc->stf->txcore[Nsts] = core_mask;
/* Nsts = 1..4, txcore index = 1..4 */ /* Nsts = 1..4, txcore index = 1..4 */
if (Nsts == 1) { if (Nsts == 1) {
...@@ -323,9 +316,6 @@ int wlc_stf_ss_update(struct wlc_info *wlc, struct wlcband *band) ...@@ -323,9 +316,6 @@ int wlc_stf_ss_update(struct wlc_info *wlc, struct wlcband *band)
if (WLC_STBC_CAP_PHY(wlc) && if (WLC_STBC_CAP_PHY(wlc) &&
wlc->stf->ss_algosel_auto wlc->stf->ss_algosel_auto
&& (wlc->stf->ss_algo_channel != (u16) -1)) { && (wlc->stf->ss_algo_channel != (u16) -1)) {
ASSERT(isset(&wlc->stf->ss_algo_channel, PHY_TXC1_MODE_CDD)
|| isset(&wlc->stf->ss_algo_channel,
PHY_TXC1_MODE_SISO));
upd_stf_ss = (wlc->stf->no_cddstbc || (wlc->stf->txstreams == 1) upd_stf_ss = (wlc->stf->no_cddstbc || (wlc->stf->txstreams == 1)
|| isset(&wlc->stf->ss_algo_channel, || isset(&wlc->stf->ss_algo_channel,
PHY_TXC1_MODE_SISO)) ? PHY_TXC1_MODE_SISO PHY_TXC1_MODE_SISO)) ? PHY_TXC1_MODE_SISO
...@@ -425,9 +415,6 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc) ...@@ -425,9 +415,6 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc)
s8 txant; s8 txant;
txant = (s8) wlc->stf->txant; txant = (s8) wlc->stf->txant;
ASSERT(txant == ANT_TX_FORCE_0 || txant == ANT_TX_FORCE_1
|| txant == ANT_TX_LAST_RX);
if (WLC_PHY_11N_CAP(wlc->band)) { if (WLC_PHY_11N_CAP(wlc->band)) {
if (txant == ANT_TX_FORCE_0) { if (txant == ANT_TX_FORCE_0) {
wlc->stf->phytxant = PHY_TXC_ANT_0; wlc->stf->phytxant = PHY_TXC_ANT_0;
...@@ -443,8 +430,8 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc) ...@@ -443,8 +430,8 @@ static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc)
if (WLCISLCNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band)) if (WLCISLCNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band))
wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST; wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST;
else { else {
/* keep this assert to catch out of sync wlc->stf->txcore */ /* catch out of sync wlc->stf->txcore */
ASSERT(wlc->stf->txchain > 0); WARN_ON(wlc->stf->txchain <= 0);
wlc->stf->phytxant = wlc->stf->phytxant =
wlc->stf->txchain << PHY_TXC_ANT_SHIFT; wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
} }
...@@ -508,7 +495,6 @@ static u16 _wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec) ...@@ -508,7 +495,6 @@ static u16 _wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec)
u16 phytxant = wlc->stf->phytxant; u16 phytxant = wlc->stf->phytxant;
if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO) { if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO) {
ASSERT(wlc->stf->txstreams > 1);
phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
} else if (wlc->stf->txant == ANT_TX_DEF) } else if (wlc->stf->txant == ANT_TX_DEF)
phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
...@@ -528,7 +514,6 @@ u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec) ...@@ -528,7 +514,6 @@ u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec)
/* for non-siso rates or default setting, use the available chains */ /* for non-siso rates or default setting, use the available chains */
if (WLCISNPHY(wlc->band)) { if (WLCISNPHY(wlc->band)) {
ASSERT(wlc->stf->txchain != 0);
phytxant = _wlc_stf_phytxchain_sel(wlc, rspec); phytxant = _wlc_stf_phytxchain_sel(wlc, rspec);
mask = PHY_TXC_HTANT_MASK; mask = PHY_TXC_HTANT_MASK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment