diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-4965-calib.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-calib.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-calib.c b/drivers/net/wireless/iwlegacy/iwl-4965-calib.c index 7f858344b920..c055a153f7df 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-calib.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-calib.c | |||
@@ -198,8 +198,8 @@ static int il4965_sens_energy_cck(struct il_priv *il, | |||
198 | data->num_in_cck_no_fa); | 198 | data->num_in_cck_no_fa); |
199 | 199 | ||
200 | /* If we got too many false alarms this time, reduce sensitivity */ | 200 | /* If we got too many false alarms this time, reduce sensitivity */ |
201 | if ((false_alarms > max_false_alarms) && | 201 | if (false_alarms > max_false_alarms && |
202 | (data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK)) { | 202 | data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK) { |
203 | D_CALIB("norm FA %u > max FA %u\n", | 203 | D_CALIB("norm FA %u > max FA %u\n", |
204 | false_alarms, max_false_alarms); | 204 | false_alarms, max_false_alarms); |
205 | D_CALIB("... reducing sensitivity\n"); | 205 | D_CALIB("... reducing sensitivity\n"); |
@@ -230,9 +230,9 @@ static int il4965_sens_energy_cck(struct il_priv *il, | |||
230 | * from a previous beacon with too many, or healthy # FAs | 230 | * from a previous beacon with too many, or healthy # FAs |
231 | * OR 2) We've seen a lot of beacons (100) with too few | 231 | * OR 2) We've seen a lot of beacons (100) with too few |
232 | * false alarms */ | 232 | * false alarms */ |
233 | if ((data->nrg_prev_state != IL_FA_TOO_MANY) && | 233 | if (data->nrg_prev_state != IL_FA_TOO_MANY && |
234 | ((data->nrg_auto_corr_silence_diff > NRG_DIFF) || | 234 | (data->nrg_auto_corr_silence_diff > NRG_DIFF || |
235 | (data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA))) { | 235 | data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA)) { |
236 | 236 | ||
237 | D_CALIB("... increasing sensitivity\n"); | 237 | D_CALIB("... increasing sensitivity\n"); |
238 | /* Increase nrg value to increase sensitivity */ | 238 | /* Increase nrg value to increase sensitivity */ |
@@ -289,9 +289,9 @@ static int il4965_sens_energy_cck(struct il_priv *il, | |||
289 | val = data->auto_corr_cck_mrc + AUTO_CORR_STEP_CCK; | 289 | val = data->auto_corr_cck_mrc + AUTO_CORR_STEP_CCK; |
290 | data->auto_corr_cck_mrc = | 290 | data->auto_corr_cck_mrc = |
291 | min((u32)ranges->auto_corr_max_cck_mrc, val); | 291 | min((u32)ranges->auto_corr_max_cck_mrc, val); |
292 | } else if ((false_alarms < min_false_alarms) && | 292 | } else if (false_alarms < min_false_alarms && |
293 | ((data->nrg_auto_corr_silence_diff > NRG_DIFF) || | 293 | (data->nrg_auto_corr_silence_diff > NRG_DIFF || |
294 | (data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA))) { | 294 | data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA)) { |
295 | 295 | ||
296 | /* Decrease auto_corr values to increase sensitivity */ | 296 | /* Decrease auto_corr values to increase sensitivity */ |
297 | val = data->auto_corr_cck - AUTO_CORR_STEP_CCK; | 297 | val = data->auto_corr_cck - AUTO_CORR_STEP_CCK; |
@@ -747,9 +747,8 @@ static void il4965_gain_computation(struct il_priv *il, | |||
747 | for (i = default_chain; i < NUM_RX_CHAINS; i++) { | 747 | for (i = default_chain; i < NUM_RX_CHAINS; i++) { |
748 | s32 delta_g = 0; | 748 | s32 delta_g = 0; |
749 | 749 | ||
750 | if (!(data->disconn_array[i]) && | 750 | if (!data->disconn_array[i] && |
751 | (data->delta_gain_code[i] == | 751 | data->delta_gain_code[i] == CHAIN_NOISE_DELTA_GAIN_INIT_VAL) { |
752 | CHAIN_NOISE_DELTA_GAIN_INIT_VAL)) { | ||
753 | delta_g = average_noise[i] - min_average_noise; | 752 | delta_g = average_noise[i] - min_average_noise; |
754 | data->delta_gain_code[i] = (u8)((delta_g * 10) / 15); | 753 | data->delta_gain_code[i] = (u8)((delta_g * 10) / 15); |
755 | data->delta_gain_code[i] = | 754 | data->delta_gain_code[i] = |
@@ -860,7 +859,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp) | |||
860 | 859 | ||
861 | /* Make sure we accumulate data for just the associated channel | 860 | /* Make sure we accumulate data for just the associated channel |
862 | * (even if scanning). */ | 861 | * (even if scanning). */ |
863 | if ((rxon_chnum != stat_chnum) || (rxon_band24 != stat_band24)) { | 862 | if (rxon_chnum != stat_chnum || rxon_band24 != stat_band24) { |
864 | D_CALIB("Stats not from chan=%d, band24=%d\n", | 863 | D_CALIB("Stats not from chan=%d, band24=%d\n", |
865 | rxon_chnum, rxon_band24); | 864 | rxon_chnum, rxon_band24); |
866 | spin_unlock_irqrestore(&il->lock, flags); | 865 | spin_unlock_irqrestore(&il->lock, flags); |
@@ -920,8 +919,8 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp) | |||
920 | il->cfg->base_params->chain_noise_num_beacons; | 919 | il->cfg->base_params->chain_noise_num_beacons; |
921 | 920 | ||
922 | for (i = 0; i < NUM_RX_CHAINS; i++) { | 921 | for (i = 0; i < NUM_RX_CHAINS; i++) { |
923 | if (!(data->disconn_array[i]) && | 922 | if (!data->disconn_array[i] && |
924 | (average_noise[i] <= min_average_noise)) { | 923 | average_noise[i] <= min_average_noise) { |
925 | /* This means that chain i is active and has | 924 | /* This means that chain i is active and has |
926 | * lower noise values so far: */ | 925 | * lower noise values so far: */ |
927 | min_average_noise = average_noise[i]; | 926 | min_average_noise = average_noise[i]; |