staging: brcm80211: removed ASSERTs in LCN phy code
Code cleanup. Driver contains far too many ASSERTs. Bringing driver more in line with Greg KH's guidelines. Signed-off-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
3b6ee72351
commit
0c6d4ad9f7
|
@ -1081,8 +1081,6 @@ wlc_lcnphy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
|
||||||
{
|
{
|
||||||
u32 quotient, remainder, roundup, rbit;
|
u32 quotient, remainder, roundup, rbit;
|
||||||
|
|
||||||
ASSERT(divisor);
|
|
||||||
|
|
||||||
quotient = dividend / divisor;
|
quotient = dividend / divisor;
|
||||||
remainder = dividend % divisor;
|
remainder = dividend % divisor;
|
||||||
rbit = divisor & 1;
|
rbit = divisor & 1;
|
||||||
|
@ -1780,11 +1778,6 @@ void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode)
|
||||||
s8 index;
|
s8 index;
|
||||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||||
|
|
||||||
ASSERT((LCNPHY_TX_PWR_CTRL_OFF == mode) ||
|
|
||||||
(LCNPHY_TX_PWR_CTRL_SW == mode) ||
|
|
||||||
(LCNPHY_TX_PWR_CTRL_HW == mode) ||
|
|
||||||
(LCNPHY_TX_PWR_CTRL_TEMPBASED == mode));
|
|
||||||
|
|
||||||
mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, mode);
|
mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, mode);
|
||||||
old_mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, old_mode);
|
old_mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, old_mode);
|
||||||
|
|
||||||
|
@ -1904,16 +1897,14 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LCNPHY_CAL_RECAL:
|
case LCNPHY_CAL_RECAL:
|
||||||
ASSERT(pi_lcn->lcnphy_cal_results.txiqlocal_bestcoeffs_valid);
|
|
||||||
|
|
||||||
start_coeffs = syst_coeffs;
|
start_coeffs = syst_coeffs;
|
||||||
|
|
||||||
cal_cmds = commands_recal;
|
cal_cmds = commands_recal;
|
||||||
n_cal_cmds = ARRAY_SIZE(commands_recal);
|
n_cal_cmds = ARRAY_SIZE(commands_recal);
|
||||||
command_nums = command_nums_recal;
|
command_nums = command_nums_recal;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT(false);
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
|
wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL,
|
||||||
|
@ -2460,8 +2451,6 @@ void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index)
|
||||||
lcnphy_txgains_t gains;
|
lcnphy_txgains_t gains;
|
||||||
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
|
||||||
|
|
||||||
ASSERT(index <= LCNPHY_MAX_TX_POWER_INDEX);
|
|
||||||
|
|
||||||
pi_lcn->lcnphy_tx_power_idx_override = (s8) index;
|
pi_lcn->lcnphy_tx_power_idx_override = (s8) index;
|
||||||
pi_lcn->lcnphy_current_index = (u8) index;
|
pi_lcn->lcnphy_current_index = (u8) index;
|
||||||
|
|
||||||
|
@ -2760,7 +2749,6 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
|
||||||
do {
|
do {
|
||||||
bw = phy_bw * 1000 * k;
|
bw = phy_bw * 1000 * k;
|
||||||
num_samps = bw / ABS(f_kHz);
|
num_samps = bw / ABS(f_kHz);
|
||||||
ASSERT(num_samps <= ARRAY_SIZE(data_buf));
|
|
||||||
k++;
|
k++;
|
||||||
} while ((num_samps * (u32) (ABS(f_kHz))) != bw);
|
} while ((num_samps * (u32) (ABS(f_kHz))) != bw);
|
||||||
} else
|
} else
|
||||||
|
@ -3298,8 +3286,6 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (module == 2) {
|
if (module == 2) {
|
||||||
ASSERT(iqcomp_sz);
|
|
||||||
|
|
||||||
while (iqcomp_sz--) {
|
while (iqcomp_sz--) {
|
||||||
if (iqcomp[iqcomp_sz].chan ==
|
if (iqcomp[iqcomp_sz].chan ==
|
||||||
CHSPEC_CHANNEL(pi->radio_chanspec)) {
|
CHSPEC_CHANNEL(pi->radio_chanspec)) {
|
||||||
|
@ -3313,7 +3299,6 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASSERT(result);
|
|
||||||
goto cal_done;
|
goto cal_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3584,9 +3569,6 @@ void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode)
|
||||||
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
|
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
|
||||||
wlc_lcnphy_tx_power_adjustment((wlc_phy_t *) pi);
|
wlc_lcnphy_tx_power_adjustment((wlc_phy_t *) pi);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5072,8 +5054,6 @@ bool wlc_phy_attach_lcnphy(phy_info_t *pi)
|
||||||
}
|
}
|
||||||
|
|
||||||
pi->xtalfreq = si_alp_clock(pi->sh->sih);
|
pi->xtalfreq = si_alp_clock(pi->sh->sih);
|
||||||
ASSERT(0 == (pi->xtalfreq % 1000));
|
|
||||||
|
|
||||||
pi_lcn->lcnphy_papd_rxGnCtrl_init = 0;
|
pi_lcn->lcnphy_papd_rxGnCtrl_init = 0;
|
||||||
|
|
||||||
pi->pi_fptr.init = wlc_phy_init_lcnphy;
|
pi->pi_fptr.init = wlc_phy_init_lcnphy;
|
||||||
|
@ -5293,9 +5273,7 @@ wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, s16 filt_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filt_index == -1) {
|
if (filt_index != -1) {
|
||||||
ASSERT(false);
|
|
||||||
} else {
|
|
||||||
for (j = 0; j < LCNPHY_NUM_DIG_FILT_COEFFS; j++) {
|
for (j = 0; j < LCNPHY_NUM_DIG_FILT_COEFFS; j++) {
|
||||||
write_phy_reg(pi, addr[j],
|
write_phy_reg(pi, addr[j],
|
||||||
LCNPHY_txdigfiltcoeffs_cck
|
LCNPHY_txdigfiltcoeffs_cck
|
||||||
|
@ -5310,9 +5288,7 @@ wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, s16 filt_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filt_index == -1) {
|
if (filt_index != -1) {
|
||||||
ASSERT(false);
|
|
||||||
} else {
|
|
||||||
for (j = 0; j < LCNPHY_NUM_DIG_FILT_COEFFS; j++) {
|
for (j = 0; j < LCNPHY_NUM_DIG_FILT_COEFFS; j++) {
|
||||||
write_phy_reg(pi, addr_ofdm[j],
|
write_phy_reg(pi, addr_ofdm[j],
|
||||||
LCNPHY_txdigfiltcoeffs_ofdm
|
LCNPHY_txdigfiltcoeffs_ofdm
|
||||||
|
|
Loading…
Reference in New Issue