aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c56
-rw-r--r--drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c70
2 files changed, 3 insertions, 123 deletions
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c
index 26313828a21..873d64c9d60 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c
@@ -155,8 +155,6 @@ char *phy_getvar(phy_info_t *pi, const char *name)
155 char *s; 155 char *s;
156 int len; 156 int len;
157 157
158 ASSERT(pi->vars != (char *)&pi->vars);
159
160 if (!name) 158 if (!name)
161 return NULL; 159 return NULL;
162 160
@@ -241,7 +239,7 @@ u16 read_radio_reg(phy_info_t *pi, u16 addr)
241 break; 239 break;
242 240
243 default: 241 default:
244 ASSERT(VALID_PHYTYPE(pi->pubpi.phy_type)); 242 break;
245 } 243 }
246 244
247 if ((D11REV_GE(pi->sh->corerev, 24)) || 245 if ((D11REV_GE(pi->sh->corerev, 24)) ||
@@ -579,9 +577,6 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
579void wlc_phy_shared_detach(shared_phy_t *phy_sh) 577void wlc_phy_shared_detach(shared_phy_t *phy_sh)
580{ 578{
581 if (phy_sh) { 579 if (phy_sh) {
582 if (phy_sh->phy_head) {
583 ASSERT(!phy_sh->phy_head);
584 }
585 kfree(phy_sh); 580 kfree(phy_sh);
586 } 581 }
587} 582}
@@ -781,8 +776,6 @@ void wlc_phy_detach(wlc_phy_t *pih)
781 pi->sh->phy_head = pi->next; 776 pi->sh->phy_head = pi->next;
782 else if (pi->sh->phy_head->next == pi) 777 else if (pi->sh->phy_head->next == pi)
783 pi->sh->phy_head->next = NULL; 778 pi->sh->phy_head->next = NULL;
784 else
785 ASSERT(0);
786 779
787 if (pi->pi_fptr.detach) 780 if (pi->pi_fptr.detach)
788 (pi->pi_fptr.detach) (pi); 781 (pi->pi_fptr.detach) (pi);
@@ -894,7 +887,6 @@ u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
894 phy_bw_clkbits = SICF_BW40; 887 phy_bw_clkbits = SICF_BW40;
895 break; 888 break;
896 default: 889 default:
897 ASSERT(0);
898 break; 890 break;
899 } 891 }
900 } 892 }
@@ -967,8 +959,6 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
967 "wlc_phy_init: Called with the MAC running!" == NULL); 959 "wlc_phy_init: Called with the MAC running!" == NULL);
968 } 960 }
969 961
970 ASSERT(pi != NULL);
971
972 if (!(pi->measure_hold & PHY_HOLD_FOR_SCAN)) { 962 if (!(pi->measure_hold & PHY_HOLD_FOR_SCAN)) {
973 pi->measure_hold |= PHY_HOLD_FOR_NOT_ASSOC; 963 pi->measure_hold |= PHY_HOLD_FOR_NOT_ASSOC;
974 } 964 }
@@ -979,7 +969,6 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
979 phy_init = pi->pi_fptr.init; 969 phy_init = pi->pi_fptr.init;
980 970
981 if (phy_init == NULL) { 971 if (phy_init == NULL) {
982 ASSERT(phy_init != NULL);
983 return; 972 return;
984 } 973 }
985 974
@@ -1029,8 +1018,6 @@ int wlc_phy_down(wlc_phy_t *pih)
1029 phy_info_t *pi = (phy_info_t *) pih; 1018 phy_info_t *pi = (phy_info_t *) pih;
1030 int callbacks = 0; 1019 int callbacks = 0;
1031 1020
1032 ASSERT(pi->phytest_on == false);
1033
1034 if (pi->phycal_timer 1021 if (pi->phycal_timer
1035 && !wlapi_del_timer(pi->sh->physhim, pi->phycal_timer)) 1022 && !wlapi_del_timer(pi->sh->physhim, pi->phycal_timer))
1036 callbacks++; 1023 callbacks++;
@@ -1070,8 +1057,6 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
1070 1057
1071void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val) 1058void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
1072{ 1059{
1073 ASSERT((width == 8) || (width == 16) || (width == 32));
1074
1075 if ((pi->sh->chip == BCM43224_CHIP_ID || 1060 if ((pi->sh->chip == BCM43224_CHIP_ID ||
1076 pi->sh->chip == BCM43421_CHIP_ID) && 1061 pi->sh->chip == BCM43421_CHIP_ID) &&
1077 (pi->sh->chiprev == 1) && 1062 (pi->sh->chiprev == 1) &&
@@ -1105,8 +1090,6 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
1105 const u16 *ptbl_16b = (const u16 *)ptbl_info->tbl_ptr; 1090 const u16 *ptbl_16b = (const u16 *)ptbl_info->tbl_ptr;
1106 const u32 *ptbl_32b = (const u32 *)ptbl_info->tbl_ptr; 1091 const u32 *ptbl_32b = (const u32 *)ptbl_info->tbl_ptr;
1107 1092
1108 ASSERT((tbl_width == 8) || (tbl_width == 16) || (tbl_width == 32));
1109
1110 write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset); 1093 write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset);
1111 1094
1112 for (idx = 0; idx < ptbl_info->tbl_len; idx++) { 1095 for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
@@ -1148,8 +1131,6 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
1148 u16 *ptbl_16b = (u16 *)ptbl_info->tbl_ptr; 1131 u16 *ptbl_16b = (u16 *)ptbl_info->tbl_ptr;
1149 u32 *ptbl_32b = (u32 *)ptbl_info->tbl_ptr; 1132 u32 *ptbl_32b = (u32 *)ptbl_info->tbl_ptr;
1150 1133
1151 ASSERT((tbl_width == 8) || (tbl_width == 16) || (tbl_width == 32));
1152
1153 write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset); 1134 write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset);
1154 1135
1155 for (idx = 0; idx < ptbl_info->tbl_len; idx++) { 1136 for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
@@ -1258,7 +1239,6 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
1258 1239
1259 W_REG(&regs->txe_phyctl, (ofdm ? 1 : 0) | PHY_TXC_ANT_0); 1240 W_REG(&regs->txe_phyctl, (ofdm ? 1 : 0) | PHY_TXC_ANT_0);
1260 if (ISNPHY(pi) || ISLCNPHY(pi)) { 1241 if (ISNPHY(pi) || ISLCNPHY(pi)) {
1261 ASSERT(ofdm);
1262 W_REG(&regs->txe_phyctl1, 0x1A02); 1242 W_REG(&regs->txe_phyctl1, 0x1A02);
1263 } 1243 }
1264 1244
@@ -1317,7 +1297,6 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
1317void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set) 1297void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set)
1318{ 1298{
1319 phy_info_t *pi = (phy_info_t *) pih; 1299 phy_info_t *pi = (phy_info_t *) pih;
1320 ASSERT(id);
1321 1300
1322 if (set) { 1301 if (set) {
1323 mboolset(pi->measure_hold, id); 1302 mboolset(pi->measure_hold, id);
@@ -1439,8 +1418,6 @@ void wlc_phy_chanspec_set(wlc_phy_t *ppi, chanspec_t chanspec)
1439 u16 m_cur_channel; 1418 u16 m_cur_channel;
1440 chansetfn_t chanspec_set = NULL; 1419 chansetfn_t chanspec_set = NULL;
1441 1420
1442 ASSERT(!wf_chspec_malformed(chanspec));
1443
1444 m_cur_channel = CHSPEC_CHANNEL(chanspec); 1421 m_cur_channel = CHSPEC_CHANNEL(chanspec);
1445 if (CHSPEC_IS5G(chanspec)) 1422 if (CHSPEC_IS5G(chanspec))
1446 m_cur_channel |= D11_CURCHANNEL_5G; 1423 m_cur_channel |= D11_CURCHANNEL_5G;
@@ -1480,8 +1457,7 @@ int wlc_phy_chanspec_bandrange_get(phy_info_t *pi, chanspec_t chanspec)
1480 range = wlc_phy_get_chan_freq_range_nphy(pi, channel); 1457 range = wlc_phy_get_chan_freq_range_nphy(pi, channel);
1481 } else if (ISLCNPHY(pi)) { 1458 } else if (ISLCNPHY(pi)) {
1482 range = wlc_phy_chanspec_freq2bandrange_lpssn(freq); 1459 range = wlc_phy_chanspec_freq2bandrange_lpssn(freq);
1483 } else 1460 }
1484 ASSERT(0);
1485 1461
1486 return range; 1462 return range;
1487} 1463}
@@ -1511,8 +1487,6 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)
1511 uint i; 1487 uint i;
1512 uint channel; 1488 uint channel;
1513 1489
1514 ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G));
1515
1516 memset(channels, 0, sizeof(chanvec_t)); 1490 memset(channels, 0, sizeof(chanvec_t));
1517 1491
1518 for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { 1492 for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) {
@@ -1535,8 +1509,6 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
1535 uint channel; 1509 uint channel;
1536 chanspec_t chspec; 1510 chanspec_t chspec;
1537 1511
1538 ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G));
1539
1540 for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { 1512 for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) {
1541 channel = chan_info_all[i].chan; 1513 channel = chan_info_all[i].chan;
1542 1514
@@ -1572,8 +1544,6 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
1572 return chspec; 1544 return chspec;
1573 } 1545 }
1574 1546
1575 ASSERT(0);
1576
1577 return (chanspec_t) INVCHANSPEC; 1547 return (chanspec_t) INVCHANSPEC;
1578} 1548}
1579 1549
@@ -1581,7 +1551,6 @@ int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
1581{ 1551{
1582 phy_info_t *pi = (phy_info_t *) ppi; 1552 phy_info_t *pi = (phy_info_t *) ppi;
1583 1553
1584 ASSERT(qdbm != NULL);
1585 *qdbm = pi->tx_user_target[0]; 1554 *qdbm = pi->tx_user_target[0];
1586 if (override != NULL) 1555 if (override != NULL)
1587 *override = pi->txpwroverride; 1556 *override = pi->txpwroverride;
@@ -1703,7 +1672,6 @@ wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr,
1703 break; 1672 break;
1704 } 1673 }
1705 } 1674 }
1706 ASSERT(i < ARRAY_SIZE(chan_info_all));
1707 1675
1708 if (pi->hwtxpwr) { 1676 if (pi->hwtxpwr) {
1709 *max_pwr = pi->hwtxpwr[i]; 1677 *max_pwr = pi->hwtxpwr[i];
@@ -2134,7 +2102,6 @@ void wlc_phy_txpower_update_shm(phy_info_t *pi)
2134{ 2102{
2135 int j; 2103 int j;
2136 if (ISNPHY(pi)) { 2104 if (ISNPHY(pi)) {
2137 ASSERT(0);
2138 return; 2105 return;
2139 } 2106 }
2140 2107
@@ -2466,8 +2433,6 @@ void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
2466 mod_phy_reg(pi, 0x410, (0x1 << 1), 0x00 << 1); 2433 mod_phy_reg(pi, 0x410, (0x1 << 1), 0x00 << 1);
2467 mod_phy_reg(pi, 0x410, (0x1 << 0), (u16) val << 0); 2434 mod_phy_reg(pi, 0x410, (0x1 << 0), (u16) val << 0);
2468 } 2435 }
2469 } else {
2470 ASSERT(0);
2471 } 2436 }
2472 2437
2473 if (!suspend) 2438 if (!suspend)
@@ -2483,7 +2448,6 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
2483 u8 i; 2448 u8 i;
2484 2449
2485 memset((u8 *) cmplx_pwr_dbm, 0, sizeof(cmplx_pwr_dbm)); 2450 memset((u8 *) cmplx_pwr_dbm, 0, sizeof(cmplx_pwr_dbm));
2486 ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX);
2487 wlc_phy_compute_dB(cmplx_pwr, cmplx_pwr_dbm, pi->pubpi.phy_corenum); 2451 wlc_phy_compute_dB(cmplx_pwr, cmplx_pwr_dbm, pi->pubpi.phy_corenum);
2488 2452
2489 for (i = 0; i < pi->pubpi.phy_corenum; i++) { 2453 for (i = 0; i < pi->pubpi.phy_corenum; i++) {
@@ -2529,7 +2493,6 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
2529 break; 2493 break;
2530 2494
2531 default: 2495 default:
2532 ASSERT(0);
2533 break; 2496 break;
2534 } 2497 }
2535 2498
@@ -2678,7 +2641,6 @@ static s8 wlc_phy_noise_read_shmem(phy_info_t *pi)
2678 s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY; 2641 s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
2679 u8 idx, core; 2642 u8 idx, core;
2680 2643
2681 ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX);
2682 memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr)); 2644 memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr));
2683 memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant)); 2645 memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant));
2684 2646
@@ -2760,8 +2722,6 @@ void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
2760 channel = jssi_aux & D11_CURCHANNEL_MAX; 2722 channel = jssi_aux & D11_CURCHANNEL_MAX;
2761 2723
2762 noise_dbm = wlc_phy_noise_read_shmem(pi); 2724 noise_dbm = wlc_phy_noise_read_shmem(pi);
2763 } else {
2764 ASSERT(0);
2765 } 2725 }
2766 2726
2767 wlc_phy_noise_cb(pi, channel, noise_dbm); 2727 wlc_phy_noise_cb(pi, channel, noise_dbm);
@@ -2871,10 +2831,7 @@ void BCMFASTPATH wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
2871 rssi -= 256; 2831 rssi -= 256;
2872 } else if (radioid == BCM2055_ID || radioid == BCM2056_ID 2832 } else if (radioid == BCM2055_ID || radioid == BCM2056_ID
2873 || radioid == BCM2057_ID) { 2833 || radioid == BCM2057_ID) {
2874 ASSERT(ISNPHY(pi));
2875 rssi = wlc_phy_rssi_compute_nphy(pi, wlc_rxhdr); 2834 rssi = wlc_phy_rssi_compute_nphy(pi, wlc_rxhdr);
2876 } else {
2877 ASSERT((const char *)"Unknown radio" == NULL);
2878 } 2835 }
2879 2836
2880 end: 2837 end:
@@ -2900,9 +2857,6 @@ void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
2900 wlc_lcnphy_deaf_mode(pi, true); 2857 wlc_lcnphy_deaf_mode(pi, true);
2901 else if (ISNPHY(pi)) 2858 else if (ISNPHY(pi))
2902 wlc_nphy_deaf_mode(pi, true); 2859 wlc_nphy_deaf_mode(pi, true);
2903 else {
2904 ASSERT(0);
2905 }
2906} 2860}
2907 2861
2908void wlc_phy_watchdog(wlc_phy_t *pih) 2862void wlc_phy_watchdog(wlc_phy_t *pih)
@@ -3163,13 +3117,9 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
3163 } else if (pi->nphy_perical == PHY_PERICAL_SPHASE) 3117 } else if (pi->nphy_perical == PHY_PERICAL_SPHASE)
3164 wlc_phy_cal_perical_nphy_run(pi, 3118 wlc_phy_cal_perical_nphy_run(pi,
3165 PHY_PERICAL_AUTO); 3119 PHY_PERICAL_AUTO);
3166 else {
3167 ASSERT(0);
3168 }
3169 } 3120 }
3170 break; 3121 break;
3171 default: 3122 default:
3172 ASSERT(0);
3173 break; 3123 break;
3174 } 3124 }
3175} 3125}
@@ -3391,8 +3341,6 @@ u32 wlc_phy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
3391{ 3341{
3392 u32 quotient, remainder, roundup, rbit; 3342 u32 quotient, remainder, roundup, rbit;
3393 3343
3394 ASSERT(divisor);
3395
3396 quotient = dividend / divisor; 3344 quotient = dividend / divisor;
3397 remainder = dividend % divisor; 3345 remainder = dividend % divisor;
3398 rbit = divisor & 1; 3346 rbit = divisor & 1;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c
index 7a759bfe1a1..9b380b88e21 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c
@@ -14218,8 +14218,6 @@ static void WLBANDINITFN(wlc_phy_bphy_init_nphy) (phy_info_t *pi)
14218{ 14218{
14219 u16 addr, val; 14219 u16 addr, val;
14220 14220
14221 ASSERT(ISNPHY(pi));
14222
14223 val = 0x1e1f; 14221 val = 0x1e1f;
14224 for (addr = (NPHY_TO_BPHY_OFF + BPHY_RSSI_LUT); 14222 for (addr = (NPHY_TO_BPHY_OFF + BPHY_RSSI_LUT);
14225 addr <= (NPHY_TO_BPHY_OFF + BPHY_RSSI_LUT_END); addr++) { 14223 addr <= (NPHY_TO_BPHY_OFF + BPHY_RSSI_LUT_END); addr++) {
@@ -14367,8 +14365,6 @@ static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (phy_info_t *pi)
14367 break; 14365 break;
14368 14366
14369 default: 14367 default:
14370
14371 ASSERT(0);
14372 break; 14368 break;
14373 } 14369 }
14374 14370
@@ -14401,8 +14397,6 @@ static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (phy_info_t *pi)
14401 [idx]); 14397 [idx]);
14402 break; 14398 break;
14403 default: 14399 default:
14404
14405 ASSERT(0);
14406 break; 14400 break;
14407 } 14401 }
14408 } else { 14402 } else {
@@ -14566,8 +14560,6 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
14566 14560
14567 regs = (d11regs_t *) si_switch_core(pi->sh->sih, D11_CORE_ID, 14561 regs = (d11regs_t *) si_switch_core(pi->sh->sih, D11_CORE_ID,
14568 &origidx, &intr_val); 14562 &origidx, &intr_val);
14569 ASSERT(regs != NULL);
14570
14571 d11_clk_ctl_st = R_REG(&regs->clk_ctl_st); 14563 d11_clk_ctl_st = R_REG(&regs->clk_ctl_st);
14572 AND_REG(&regs->clk_ctl_st, 14564 AND_REG(&regs->clk_ctl_st,
14573 ~(CCS_FORCEHT | CCS_HTAREQ)); 14565 ~(CCS_FORCEHT | CCS_HTAREQ));
@@ -14783,10 +14775,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
14783 rfpwr_offset = (s16) 14775 rfpwr_offset = (s16)
14784 nphy_papd_padgain_dlt_2g_2057rev7 14776 nphy_papd_padgain_dlt_2g_2057rev7
14785 [pad_gn]; 14777 [pad_gn];
14786 } else {
14787 ASSERT(0);
14788 } 14778 }
14789
14790 } else { 14779 } else {
14791 if ((pi->pubpi.radiorev == 3) || 14780 if ((pi->pubpi.radiorev == 3) ||
14792 (pi->pubpi.radiorev == 4) || 14781 (pi->pubpi.radiorev == 4) ||
@@ -14800,8 +14789,6 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
14800 rfpwr_offset = (s16) 14789 rfpwr_offset = (s16)
14801 nphy_papd_pgagain_dlt_5g_2057rev7 14790 nphy_papd_pgagain_dlt_5g_2057rev7
14802 [pga_gn]; 14791 [pga_gn];
14803 } else {
14804 ASSERT(0);
14805 } 14792 }
14806 } 14793 }
14807 wlc_phy_table_write_nphy(pi, 14794 wlc_phy_table_write_nphy(pi,
@@ -16130,8 +16117,6 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi)
16130 0x18, 16, bcm_adc_vmid); 16117 0x18, 16, bcm_adc_vmid);
16131 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 16118 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,
16132 0x1c, 16, bcm_adc_gain); 16119 0x1c, 16, bcm_adc_gain);
16133 } else {
16134 ASSERT(0);
16135 } 16120 }
16136 16121
16137 write_radio_reg(pi, 16122 write_radio_reg(pi,
@@ -17510,7 +17495,6 @@ static void wlc_phy_radio_init_2056(phy_info_t *pi)
17510 break; 17495 break;
17511 17496
17512 default: 17497 default:
17513 ASSERT(0);
17514 break; 17498 break;
17515 } 17499 }
17516 } 17500 }
@@ -17571,7 +17555,6 @@ static void wlc_phy_radio_init_2057(phy_info_t *pi)
17571 17555
17572 regs_2057_ptr = regs_2057_rev5v1; 17556 regs_2057_ptr = regs_2057_rev5v1;
17573 } else { 17557 } else {
17574 ASSERT(0);
17575 break; 17558 break;
17576 } 17559 }
17577 17560
@@ -17586,11 +17569,8 @@ static void wlc_phy_radio_init_2057(phy_info_t *pi)
17586 break; 17569 break;
17587 17570
17588 default: 17571 default:
17589 ASSERT(0);
17590 break; 17572 break;
17591 } 17573 }
17592 } else {
17593 ASSERT(0);
17594 } 17574 }
17595 17575
17596 wlc_phy_init_radio_regs_allbands(pi, regs_2057_ptr); 17576 wlc_phy_init_radio_regs_allbands(pi, regs_2057_ptr);
@@ -17708,7 +17688,6 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
17708 } 17688 }
17709 17689
17710 if (i >= tbl_len) { 17690 if (i >= tbl_len) {
17711 ASSERT(i < tbl_len);
17712 goto fail; 17691 goto fail;
17713 } 17692 }
17714 if (pi->pubpi.radiorev == 5) { 17693 if (pi->pubpi.radiorev == 5) {
@@ -17765,7 +17744,6 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
17765 } 17744 }
17766 17745
17767 if (i >= tbl_len) { 17746 if (i >= tbl_len) {
17768 ASSERT(i < tbl_len);
17769 goto fail; 17747 goto fail;
17770 } 17748 }
17771 *t1 = &chan_info_tbl_p_1[i]; 17749 *t1 = &chan_info_tbl_p_1[i];
@@ -17777,7 +17755,6 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
17777 break; 17755 break;
17778 17756
17779 if (i >= ARRAY_SIZE(chan_info_nphy_2055)) { 17757 if (i >= ARRAY_SIZE(chan_info_nphy_2055)) {
17780 ASSERT(i < ARRAY_SIZE(chan_info_nphy_2055));
17781 goto fail; 17758 goto fail;
17782 } 17759 }
17783 *t3 = &chan_info_nphy_2055[i]; 17760 *t3 = &chan_info_nphy_2055[i];
@@ -19585,8 +19562,6 @@ void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init)
19585 1, 0x08, 16, &v2); 19562 1, 0x08, 16, &v2);
19586 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, 19563 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT,
19587 1, 0x0C, 16, &v3); 19564 1, 0x0C, 16, &v3);
19588 } else {
19589 ASSERT(0);
19590 } 19565 }
19591 19566
19592 if (pi->srom_fem5g.antswctrllut == 0) { 19567 if (pi->srom_fem5g.antswctrllut == 0) {
@@ -19598,8 +19573,6 @@ void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init)
19598 1, 0x18, 16, &v2); 19573 1, 0x18, 16, &v2);
19599 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT, 19574 wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_ANTSWCTRLLUT,
19600 1, 0x1C, 16, &v3); 19575 1, 0x1C, 16, &v3);
19601 } else {
19602 ASSERT(0);
19603 } 19576 }
19604 } else { 19577 } else {
19605 19578
@@ -19718,8 +19691,6 @@ wlc_phy_set_rfseq_nphy(phy_info_t *pi, u8 cmd, u8 *events, u8 *dlys,
19718 3) ? NPHY_REV3_RFSEQ_CMD_END : NPHY_RFSEQ_CMD_END; 19691 3) ? NPHY_REV3_RFSEQ_CMD_END : NPHY_RFSEQ_CMD_END;
19719 u8 end_dly = 1; 19692 u8 end_dly = 1;
19720 19693
19721 ASSERT(len <= 16);
19722
19723 if (pi->phyhang_avoid) 19694 if (pi->phyhang_avoid)
19724 wlc_phy_stay_in_carriersearch_nphy(pi, true); 19695 wlc_phy_stay_in_carriersearch_nphy(pi, true);
19725 19696
@@ -21503,8 +21474,6 @@ wlc_phy_rssi_compute_nphy(phy_info_t *pi, wlc_d11rxhdr_t *wlc_rxh)
21503 rxpwr = (rxpwr0 < rxpwr1) ? rxpwr0 : rxpwr1; 21474 rxpwr = (rxpwr0 < rxpwr1) ? rxpwr0 : rxpwr1;
21504 else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_AVG) 21475 else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_AVG)
21505 rxpwr = (rxpwr0 + rxpwr1) >> 1; 21476 rxpwr = (rxpwr0 + rxpwr1) >> 1;
21506 else
21507 ASSERT(0);
21508 21477
21509 return rxpwr; 21478 return rxpwr;
21510} 21479}
@@ -22233,8 +22202,6 @@ static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi)
22233 22202
22234static void wlc_phy_restore_rssical_nphy(phy_info_t *pi) 22203static void wlc_phy_restore_rssical_nphy(phy_info_t *pi)
22235{ 22204{
22236 ASSERT(NREV_GE(pi->pubpi.phy_rev, 3));
22237
22238 if (CHSPEC_IS2G(pi->radio_chanspec)) { 22205 if (CHSPEC_IS2G(pi->radio_chanspec)) {
22239 if (pi->nphy_rssical_chanspec_2G == 0) 22206 if (pi->nphy_rssical_chanspec_2G == 0)
22240 return; 22207 return;
@@ -22775,8 +22742,6 @@ wlc_phy_iqcal_gainparams_nphy(phy_info_t *pi, u16 core_no,
22775 } 22742 }
22776 } 22743 }
22777 22744
22778 ASSERT(idx != -1);
22779
22780 params->txgm = tbl_iqcal_gainparams_nphy[band_idx][k][1]; 22745 params->txgm = tbl_iqcal_gainparams_nphy[band_idx][k][1];
22781 params->pga = tbl_iqcal_gainparams_nphy[band_idx][k][2]; 22746 params->pga = tbl_iqcal_gainparams_nphy[band_idx][k][2];
22782 params->pad = tbl_iqcal_gainparams_nphy[band_idx][k][3]; 22747 params->pad = tbl_iqcal_gainparams_nphy[band_idx][k][3];
@@ -23855,8 +23820,6 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
23855 if (PHY_MUTED(pi)) 23820 if (PHY_MUTED(pi))
23856 return; 23821 return;
23857 23822
23858 ASSERT(pi->nphy_perical != PHY_PERICAL_DISABLE);
23859
23860 if (caltype == PHY_PERICAL_AUTO) 23823 if (caltype == PHY_PERICAL_AUTO)
23861 fullcal = (pi->radio_chanspec != pi->nphy_txiqlocal_chanspec); 23824 fullcal = (pi->radio_chanspec != pi->nphy_txiqlocal_chanspec);
23862 else if (caltype == PHY_PERICAL_PARTIAL) 23825 else if (caltype == PHY_PERICAL_PARTIAL)
@@ -23955,8 +23918,6 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
23955 wlc_phy_radio205x_vcocal_nphy(pi); 23918 wlc_phy_radio205x_vcocal_nphy(pi);
23956 } 23919 }
23957 } else { 23920 } else {
23958 ASSERT(pi->nphy_perical >= PHY_PERICAL_MPHASE);
23959
23960 switch (pi->mphase_cal_phase_id) { 23921 switch (pi->mphase_cal_phase_id) {
23961 case MPHASE_CAL_STATE_INIT: 23922 case MPHASE_CAL_STATE_INIT:
23962 pi->nphy_perical_last = pi->sh->now; 23923 pi->nphy_perical_last = pi->sh->now;
@@ -24052,7 +24013,6 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
24052 break; 24013 break;
24053 24014
24054 default: 24015 default:
24055 ASSERT(0);
24056 wlc_phy_cal_perical_mphase_reset(pi); 24016 wlc_phy_cal_perical_mphase_reset(pi);
24057 break; 24017 break;
24058 } 24018 }
@@ -24468,8 +24428,6 @@ static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi)
24468{ 24428{
24469 u16 tbl_buf[7]; 24429 u16 tbl_buf[7];
24470 24430
24471 ASSERT(NREV_LT(pi->pubpi.phy_rev, 2));
24472
24473 if ((pi->nphy_txiqlocal_chanspec == pi->radio_chanspec) && 24431 if ((pi->nphy_txiqlocal_chanspec == pi->radio_chanspec) &&
24474 (pi->nphy_txiqlocal_coeffsvalid)) { 24432 (pi->nphy_txiqlocal_coeffsvalid)) {
24475 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, 24433 wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL,
@@ -24547,7 +24505,6 @@ wlc_phy_rx_iq_est_nphy(phy_info_t *pi, phy_iq_est_t *est, u16 num_samps,
24547 ASSERT((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) == 0); 24505 ASSERT((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) == 0);
24548 24506
24549 if ((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) == 0) { 24507 if ((read_phy_reg(pi, 0x129) & NPHY_IqestCmd_iqstart) == 0) {
24550 ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX);
24551 for (core = 0; core < pi->pubpi.phy_corenum; core++) { 24508 for (core = 0; core < pi->pubpi.phy_corenum; core++) {
24552 est[core].i_pwr = 24509 est[core].i_pwr =
24553 (read_phy_reg(pi, NPHY_IqestipwrAccHi(core)) << 16) 24510 (read_phy_reg(pi, NPHY_IqestipwrAccHi(core)) << 16)
@@ -25451,7 +25408,7 @@ wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rx_core,
25451 break; 25408 break;
25452 25409
25453 default: 25410 default:
25454 ASSERT(0); 25411 break;
25455 } 25412 }
25456 25413
25457 if ((curr_gaintbl_index < 0) || 25414 if ((curr_gaintbl_index < 0) ||
@@ -26270,8 +26227,6 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
26270 26227
26271 tx_pwrctrl_tbl = 26228 tx_pwrctrl_tbl =
26272 nphy_tpc_txgain_ipa_2g_2057rev7; 26229 nphy_tpc_txgain_ipa_2g_2057rev7;
26273 } else {
26274 ASSERT(0);
26275 } 26230 }
26276 26231
26277 } else if (NREV_IS(pi->pubpi.phy_rev, 6)) { 26232 } else if (NREV_IS(pi->pubpi.phy_rev, 6)) {
@@ -26303,8 +26258,6 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
26303 26258
26304 tx_pwrctrl_tbl = 26259 tx_pwrctrl_tbl =
26305 nphy_tpc_txgain_ipa_5g_2057rev7; 26260 nphy_tpc_txgain_ipa_5g_2057rev7;
26306 } else {
26307 ASSERT(0);
26308 } 26261 }
26309 26262
26310 } else { 26263 } else {
@@ -26347,8 +26300,6 @@ wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
26347 || (pi->pubpi.radiorev == 6)) { 26300 || (pi->pubpi.radiorev == 6)) {
26348 26301
26349 mixgain = 0x00; 26302 mixgain = 0x00;
26350 } else {
26351 ASSERT(0);
26352 } 26303 }
26353 26304
26354 } else { 26305 } else {
@@ -26361,8 +26312,6 @@ wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
26361 || (pi->pubpi.radiorev == 8)) { 26312 || (pi->pubpi.radiorev == 8)) {
26362 26313
26363 mixgain = 0x0; 26314 mixgain = 0x0;
26364 } else {
26365 ASSERT(0);
26366 } 26315 }
26367 } 26316 }
26368 26317
@@ -26464,8 +26413,6 @@ wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
26464 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core, 26413 WRITE_RADIO_REG3(pi, RADIO_2057, TX, core,
26465 TXRXCOUPLE_2G_ATTEN, 0xf0); 26414 TXRXCOUPLE_2G_ATTEN, 0xf0);
26466 26415
26467 } else {
26468 ASSERT(0);
26469 } 26416 }
26470 26417
26471 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core, 26418 WRITE_RADIO_REG3(pi, RADIO_2057, TX, off_core,
@@ -26724,8 +26671,6 @@ wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
26724 u32 *buf, *src, *dst, sz; 26671 u32 *buf, *src, *dst, sz;
26725 26672
26726 sz = end - start + 1; 26673 sz = end - start + 1;
26727 ASSERT(end > start);
26728 ASSERT(end < NPHY_PAPD_EPS_TBL_SIZE);
26729 26674
26730 buf = kmalloc(2 * sizeof(u32) * NPHY_PAPD_EPS_TBL_SIZE, GFP_ATOMIC); 26675 buf = kmalloc(2 * sizeof(u32) * NPHY_PAPD_EPS_TBL_SIZE, GFP_ATOMIC);
26731 if (NULL == buf) { 26676 if (NULL == buf) {
@@ -26787,8 +26732,6 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
26787 26732
26788 phy_a7 = (core == PHY_CORE_0) ? 1 : 0; 26733 phy_a7 = (core == PHY_CORE_0) ? 1 : 0;
26789 26734
26790 ASSERT((cal_mode == CAL_FULL) || (cal_mode == CAL_GCTRL)
26791 || (cal_mode == CAL_SOFT));
26792 phy_a6 = ((cal_mode == CAL_GCTRL) 26735 phy_a6 = ((cal_mode == CAL_GCTRL)
26793 || (cal_mode == CAL_SOFT)) ? true : false; 26736 || (cal_mode == CAL_SOFT)) ? true : false;
26794 26737
@@ -27333,8 +27276,6 @@ static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
27333 nphy_papd_cal_gain_index 27276 nphy_papd_cal_gain_index
27334 [phy_b5], phy_b5); 27277 [phy_b5], phy_b5);
27335 27278
27336 } else {
27337 ASSERT(0);
27338 } 27279 }
27339 27280
27340 phy_b1[phy_b5].gains.pad[phy_b5] = 27281 phy_b1[phy_b5].gains.pad[phy_b5] =
@@ -27417,8 +27358,6 @@ static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
27417 -(nphy_papd_padgain_dlt_2g_2057rev7 27358 -(nphy_papd_padgain_dlt_2g_2057rev7
27418 [phy_b8] 27359 [phy_b8]
27419 + 1) / 2; 27360 + 1) / 2;
27420 } else {
27421 ASSERT(0);
27422 } 27361 }
27423 } else { 27362 } else {
27424 phy_b7 = phy_b1[phy_b5].gains.pga[phy_b5]; 27363 phy_b7 = phy_b1[phy_b5].gains.pga[phy_b5];
@@ -27435,8 +27374,6 @@ static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
27435 -(nphy_papd_pgagain_dlt_5g_2057rev7 27374 -(nphy_papd_pgagain_dlt_5g_2057rev7
27436 [phy_b7] 27375 [phy_b7]
27437 + 1) / 2; 27376 + 1) / 2;
27438 } else {
27439 ASSERT(0);
27440 } 27377 }
27441 27378
27442 phy_b10 = -9; 27379 phy_b10 = -9;
@@ -27536,8 +27473,6 @@ void wlc_phy_txpwr_fixpower_nphy(phy_info_t *pi)
27536 u8 txpi[2], chan_freq_range; 27473 u8 txpi[2], chan_freq_range;
27537 s32 rfpwr_offset; 27474 s32 rfpwr_offset;
27538 27475
27539 ASSERT(pi->nphy_txpwrctrl == PHY_TPC_HW_OFF);
27540
27541 if (pi->phyhang_avoid) 27476 if (pi->phyhang_avoid)
27542 wlc_phy_stay_in_carriersearch_nphy(pi, true); 27477 wlc_phy_stay_in_carriersearch_nphy(pi, true);
27543 27478
@@ -29179,7 +29114,6 @@ wlc_phy_txpower_sromlimit_get_nphy(phy_info_t *pi, uint chan, u8 *max_pwr,
29179 *max_pwr = pi->tx_srom_max_rate_5g_hi[txp_rate_idx]; 29114 *max_pwr = pi->tx_srom_max_rate_5g_hi[txp_rate_idx];
29180 break; 29115 break;
29181 default: 29116 default:
29182 ASSERT(0);
29183 *max_pwr = pi->tx_srom_max_rate_2g[txp_rate_idx]; 29117 *max_pwr = pi->tx_srom_max_rate_2g[txp_rate_idx];
29184 break; 29118 break;
29185 } 29119 }
@@ -29207,8 +29141,6 @@ void wlc_phy_stay_in_carriersearch_nphy(phy_info_t *pi, bool enable)
29207 wlc_phy_resetcca_nphy(pi); 29141 wlc_phy_resetcca_nphy(pi);
29208 29142
29209 } else { 29143 } else {
29210 ASSERT(pi->nphy_deaf_count > 0);
29211
29212 pi->nphy_deaf_count--; 29144 pi->nphy_deaf_count--;
29213 29145
29214 if (pi->nphy_deaf_count == 0) { 29146 if (pi->nphy_deaf_count == 0) {