aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ani.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ani.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 7e0ea4e9833..47a9fb4a116 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -46,8 +46,8 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = {
46 { 5, 4, 1 }, /* lvl 5 */ 46 { 5, 4, 1 }, /* lvl 5 */
47 { 6, 5, 1 }, /* lvl 6 */ 47 { 6, 5, 1 }, /* lvl 6 */
48 { 7, 6, 1 }, /* lvl 7 */ 48 { 7, 6, 1 }, /* lvl 7 */
49 { 7, 7, 1 }, /* lvl 8 */ 49 { 7, 6, 0 }, /* lvl 8 */
50 { 7, 8, 0 } /* lvl 9 */ 50 { 7, 7, 0 } /* lvl 9 */
51}; 51};
52#define ATH9K_ANI_OFDM_NUM_LEVEL \ 52#define ATH9K_ANI_OFDM_NUM_LEVEL \
53 ARRAY_SIZE(ofdm_level_table) 53 ARRAY_SIZE(ofdm_level_table)
@@ -91,8 +91,8 @@ static const struct ani_cck_level_entry cck_level_table[] = {
91 { 4, 0 }, /* lvl 4 */ 91 { 4, 0 }, /* lvl 4 */
92 { 5, 0 }, /* lvl 5 */ 92 { 5, 0 }, /* lvl 5 */
93 { 6, 0 }, /* lvl 6 */ 93 { 6, 0 }, /* lvl 6 */
94 { 7, 0 }, /* lvl 7 (only for high rssi) */ 94 { 6, 0 }, /* lvl 7 (only for high rssi) */
95 { 8, 0 } /* lvl 8 (only for high rssi) */ 95 { 7, 0 } /* lvl 8 (only for high rssi) */
96}; 96};
97 97
98#define ATH9K_ANI_CCK_NUM_LEVEL \ 98#define ATH9K_ANI_CCK_NUM_LEVEL \
@@ -290,16 +290,9 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
290 ATH9K_ANI_FIRSTEP_LEVEL, 290 ATH9K_ANI_FIRSTEP_LEVEL,
291 entry_ofdm->fir_step_level); 291 entry_ofdm->fir_step_level);
292 292
293 if ((ah->opmode != NL80211_IFTYPE_STATION && 293 if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
294 ah->opmode != NL80211_IFTYPE_ADHOC) || 294 (!aniState->ofdmWeakSigDetectOff !=
295 aniState->noiseFloor <= aniState->rssiThrHigh) { 295 entry_ofdm->ofdm_weak_signal_on)) {
296 if (aniState->ofdmWeakSigDetectOff)
297 /* force on ofdm weak sig detect */
298 ath9k_hw_ani_control(ah,
299 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
300 true);
301 else if (aniState->ofdmWeakSigDetectOff ==
302 entry_ofdm->ofdm_weak_signal_on)
303 ath9k_hw_ani_control(ah, 296 ath9k_hw_ani_control(ah,
304 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 297 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
305 entry_ofdm->ofdm_weak_signal_on); 298 entry_ofdm->ofdm_weak_signal_on);
@@ -717,26 +710,30 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
717 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel, 710 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
718 cckPhyErrRate, aniState->ofdmsTurn); 711 cckPhyErrRate, aniState->ofdmsTurn);
719 712
720 if (aniState->listenTime > 5 * ah->aniperiod) { 713 if (aniState->listenTime > ah->aniperiod) {
721 if (ofdmPhyErrRate <= ah->config.ofdm_trig_low && 714 if (cckPhyErrRate < ah->config.cck_trig_low &&
722 cckPhyErrRate <= ah->config.cck_trig_low) { 715 ((ofdmPhyErrRate < ah->config.ofdm_trig_low &&
716 aniState->ofdmNoiseImmunityLevel <
717 ATH9K_ANI_OFDM_DEF_LEVEL) ||
718 (ofdmPhyErrRate < ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI &&
719 aniState->ofdmNoiseImmunityLevel >=
720 ATH9K_ANI_OFDM_DEF_LEVEL))) {
723 ath9k_hw_ani_lower_immunity(ah); 721 ath9k_hw_ani_lower_immunity(ah);
724 aniState->ofdmsTurn = !aniState->ofdmsTurn; 722 aniState->ofdmsTurn = !aniState->ofdmsTurn;
725 } 723 } else if ((ofdmPhyErrRate > ah->config.ofdm_trig_high &&
726 ath9k_ani_restart(ah); 724 aniState->ofdmNoiseImmunityLevel >=
727 } else if (aniState->listenTime > ah->aniperiod) { 725 ATH9K_ANI_OFDM_DEF_LEVEL) ||
728 /* check to see if need to raise immunity */ 726 (ofdmPhyErrRate >
729 if (ofdmPhyErrRate > ah->config.ofdm_trig_high && 727 ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI &&
730 (cckPhyErrRate <= ah->config.cck_trig_high || 728 aniState->ofdmNoiseImmunityLevel <
731 aniState->ofdmsTurn)) { 729 ATH9K_ANI_OFDM_DEF_LEVEL)) {
732 ath9k_hw_ani_ofdm_err_trigger(ah); 730 ath9k_hw_ani_ofdm_err_trigger(ah);
733 ath9k_ani_restart(ah);
734 aniState->ofdmsTurn = false; 731 aniState->ofdmsTurn = false;
735 } else if (cckPhyErrRate > ah->config.cck_trig_high) { 732 } else if (cckPhyErrRate > ah->config.cck_trig_high) {
736 ath9k_hw_ani_cck_err_trigger(ah); 733 ath9k_hw_ani_cck_err_trigger(ah);
737 ath9k_ani_restart(ah);
738 aniState->ofdmsTurn = true; 734 aniState->ofdmsTurn = true;
739 } 735 }
736 ath9k_ani_restart(ah);
740 } 737 }
741} 738}
742EXPORT_SYMBOL(ath9k_hw_ani_monitor); 739EXPORT_SYMBOL(ath9k_hw_ani_monitor);