Lines Matching +full:noise +full:- +full:sensitive

2  * Copyright (c) 2008-2011 Atheros Communications Inc.
20 #include "hw-ops.h"
36 * MRC-CCK: Maximal Ratio Combining for CCK
55 (ATH9K_ANI_OFDM_NUM_LEVEL-1)
57 3 /* default level - matches the INI settings */
60 * MRC (Maximal Ratio Combining) has always been used with multi-antenna ofdm.
70 * You also need to remove noise before the addition and this is where ANI
77 * https://en.wikipedia.org/wiki/Maximal-ratio_combining
86 /* FS MRC-CCK */
101 (ATH9K_ANI_CCK_NUM_LEVEL-1)
103 (ATH9K_ANI_CCK_NUM_LEVEL-3)
105 2 /* default level - matches the INI settings */
116 stats->rts_good += data[0]; in ath9k_hw_update_mibstats()
118 stats->rts_bad += data[1]; in ath9k_hw_update_mibstats()
120 stats->ackrcv_bad += data[2]; in ath9k_hw_update_mibstats()
122 stats->fcs_bad += data[3]; in ath9k_hw_update_mibstats()
124 stats->beacons += data[4]; in ath9k_hw_update_mibstats()
129 struct ar5416AniState *aniState = &ah->ani; in ath9k_ani_restart()
131 aniState->listenTime = 0; in ath9k_ani_restart()
142 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); in ath9k_ani_restart()
144 aniState->ofdmPhyErrCount = 0; in ath9k_ani_restart()
145 aniState->cckPhyErrCount = 0; in ath9k_ani_restart()
148 /* Adjust the OFDM Noise Immunity Level */
152 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_set_ofdm_nil()
159 aniState->ofdmNoiseImmunityLevel, in ath9k_hw_set_ofdm_nil()
168 aniState->ofdmNoiseImmunityLevel = immunityLevel; in ath9k_hw_set_ofdm_nil()
170 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; in ath9k_hw_set_ofdm_nil()
171 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; in ath9k_hw_set_ofdm_nil()
173 if (aniState->spurImmunityLevel != entry_ofdm->spur_immunity_level) in ath9k_hw_set_ofdm_nil()
176 entry_ofdm->spur_immunity_level); in ath9k_hw_set_ofdm_nil()
178 if (aniState->firstepLevel != entry_ofdm->fir_step_level && in ath9k_hw_set_ofdm_nil()
179 entry_ofdm->fir_step_level >= entry_cck->fir_step_level) in ath9k_hw_set_ofdm_nil()
182 entry_ofdm->fir_step_level); in ath9k_hw_set_ofdm_nil()
184 weak_sig = entry_ofdm->ofdm_weak_signal_on; in ath9k_hw_set_ofdm_nil()
185 if (ah->opmode == NL80211_IFTYPE_STATION && in ath9k_hw_set_ofdm_nil()
189 * Newer chipsets are better at dealing with high PHY error counts - in ath9k_hw_set_ofdm_nil()
194 ah->opmode != NL80211_IFTYPE_STATION) in ath9k_hw_set_ofdm_nil()
197 /* Older chipsets are more sensitive to high PHY error counts */ in ath9k_hw_set_ofdm_nil()
199 aniState->ofdmNoiseImmunityLevel >= 8) in ath9k_hw_set_ofdm_nil()
202 if (aniState->ofdmWeakSigDetect != weak_sig) in ath9k_hw_set_ofdm_nil()
209 if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) { in ath9k_hw_set_ofdm_nil()
210 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; in ath9k_hw_set_ofdm_nil()
211 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI; in ath9k_hw_set_ofdm_nil()
213 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI; in ath9k_hw_set_ofdm_nil()
214 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; in ath9k_hw_set_ofdm_nil()
220 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_ani_ofdm_err_trigger()
222 if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) in ath9k_hw_ani_ofdm_err_trigger()
223 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false); in ath9k_hw_ani_ofdm_err_trigger()
232 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_set_cck_nil()
238 aniState->cckNoiseImmunityLevel, immunityLevel, in ath9k_hw_set_cck_nil()
245 if (ah->opmode == NL80211_IFTYPE_STATION && in ath9k_hw_set_cck_nil()
251 aniState->cckNoiseImmunityLevel = immunityLevel; in ath9k_hw_set_cck_nil()
253 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; in ath9k_hw_set_cck_nil()
254 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; in ath9k_hw_set_cck_nil()
256 if (aniState->firstepLevel != entry_cck->fir_step_level && in ath9k_hw_set_cck_nil()
257 entry_cck->fir_step_level >= entry_ofdm->fir_step_level) in ath9k_hw_set_cck_nil()
260 entry_cck->fir_step_level); in ath9k_hw_set_cck_nil()
267 if (aniState->mrcCCK != entry_cck->mrc_cck_on) in ath9k_hw_set_cck_nil()
270 entry_cck->mrc_cck_on); in ath9k_hw_set_cck_nil()
275 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_ani_cck_err_trigger()
277 if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) in ath9k_hw_ani_cck_err_trigger()
278 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1, in ath9k_hw_ani_cck_err_trigger()
288 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_ani_lower_immunity()
290 /* lower OFDM noise immunity */ in ath9k_hw_ani_lower_immunity()
291 if (aniState->ofdmNoiseImmunityLevel > 0 && in ath9k_hw_ani_lower_immunity()
292 (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) { in ath9k_hw_ani_lower_immunity()
293 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel - 1, in ath9k_hw_ani_lower_immunity()
298 /* lower CCK noise immunity */ in ath9k_hw_ani_lower_immunity()
299 if (aniState->cckNoiseImmunityLevel > 0) in ath9k_hw_ani_lower_immunity()
300 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1, in ath9k_hw_ani_lower_immunity()
311 struct ar5416AniState *aniState = &ah->ani; in ath9k_ani_reset()
312 struct ath9k_channel *chan = ah->curchan; in ath9k_ani_reset()
320 ah->stats.ast_ani_reset++; in ath9k_ani_reset()
323 aniState->ofdmNoiseImmunityLevel); in ath9k_ani_reset()
325 aniState->cckNoiseImmunityLevel); in ath9k_ani_reset()
328 (ah->opmode != NL80211_IFTYPE_STATION && in ath9k_ani_reset()
329 ah->opmode != NL80211_IFTYPE_ADHOC)) { in ath9k_ani_reset()
336 if (aniState->ofdmNoiseImmunityLevel != in ath9k_ani_reset()
338 aniState->cckNoiseImmunityLevel != in ath9k_ani_reset()
342 ah->opmode, in ath9k_ani_reset()
343 chan->channel, in ath9k_ani_reset()
345 aniState->ofdmNoiseImmunityLevel, in ath9k_ani_reset()
346 aniState->cckNoiseImmunityLevel); in ath9k_ani_reset()
357 ah->opmode, in ath9k_ani_reset()
358 chan->channel, in ath9k_ani_reset()
360 aniState->ofdmNoiseImmunityLevel, in ath9k_ani_reset()
361 aniState->cckNoiseImmunityLevel); in ath9k_ani_reset()
372 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_ani_read_counters()
380 ah->stats.ast_ani_lneg_or_lzero++; in ath9k_hw_ani_read_counters()
385 aniState->listenTime += listenTime; in ath9k_hw_ani_read_counters()
387 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); in ath9k_hw_ani_read_counters()
392 ah->stats.ast_ani_ofdmerrs += phyCnt1 - aniState->ofdmPhyErrCount; in ath9k_hw_ani_read_counters()
393 aniState->ofdmPhyErrCount = phyCnt1; in ath9k_hw_ani_read_counters()
395 ah->stats.ast_ani_cckerrs += phyCnt2 - aniState->cckPhyErrCount; in ath9k_hw_ani_read_counters()
396 aniState->cckPhyErrCount = phyCnt2; in ath9k_hw_ani_read_counters()
403 struct ar5416AniState *aniState = &ah->ani; in ath9k_hw_ani_monitor()
410 ofdmPhyErrRate = aniState->ofdmPhyErrCount * 1000 / in ath9k_hw_ani_monitor()
411 aniState->listenTime; in ath9k_hw_ani_monitor()
412 cckPhyErrRate = aniState->cckPhyErrCount * 1000 / in ath9k_hw_ani_monitor()
413 aniState->listenTime; in ath9k_hw_ani_monitor()
417 aniState->listenTime, in ath9k_hw_ani_monitor()
418 aniState->ofdmNoiseImmunityLevel, in ath9k_hw_ani_monitor()
419 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel, in ath9k_hw_ani_monitor()
420 cckPhyErrRate, aniState->ofdmsTurn); in ath9k_hw_ani_monitor()
422 if (aniState->listenTime > ah->aniperiod) { in ath9k_hw_ani_monitor()
423 if (cckPhyErrRate < ah->config.cck_trig_low && in ath9k_hw_ani_monitor()
424 ofdmPhyErrRate < ah->config.ofdm_trig_low) { in ath9k_hw_ani_monitor()
426 aniState->ofdmsTurn = !aniState->ofdmsTurn; in ath9k_hw_ani_monitor()
427 } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) { in ath9k_hw_ani_monitor()
429 aniState->ofdmsTurn = false; in ath9k_hw_ani_monitor()
430 } else if (cckPhyErrRate > ah->config.cck_trig_high) { in ath9k_hw_ani_monitor()
432 aniState->ofdmsTurn = true; in ath9k_hw_ani_monitor()
447 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); in ath9k_enable_mib_counters()
470 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); in ath9k_hw_disable_mib_counters()
480 struct ar5416AniState *ani = &ah->ani; in ath9k_hw_ani_init()
485 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; in ath9k_hw_ani_init()
486 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; in ath9k_hw_ani_init()
487 ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH; in ath9k_hw_ani_init()
488 ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW; in ath9k_hw_ani_init()
490 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD; in ath9k_hw_ani_init()
491 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD; in ath9k_hw_ani_init()
492 ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD; in ath9k_hw_ani_init()
493 ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD; in ath9k_hw_ani_init()
496 ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; in ath9k_hw_ani_init()
497 ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; in ath9k_hw_ani_init()
498 ani->mrcCCK = AR_SREV_9300_20_OR_LATER(ah) ? true : false; in ath9k_hw_ani_init()
499 ani->ofdmsTurn = true; in ath9k_hw_ani_init()
500 ani->ofdmWeakSigDetect = true; in ath9k_hw_ani_init()
501 ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; in ath9k_hw_ani_init()
502 ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; in ath9k_hw_ani_init()
508 ah->aniperiod = ATH9K_ANI_PERIOD; in ath9k_hw_ani_init()
509 ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL; in ath9k_hw_ani_init()