aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-06-17 04:54:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-17 14:38:52 -0400
commit55fee98a6e732bea9f2da986b458e68ea462c584 (patch)
tree139b59e4162740de83b292907dfdef161c42530d
parentbac76a3d07133f6d9389689f3693b78f68b77adb (diff)
ath9k: Fix ANI for AP mode
The commit "ath9k: Fix ANI monitoring" reverted an earlier commit that adjusted ANI to improve performance. But, this causes adverse effects in AP mode (as reported by Felix based on an OpenWrt report). Use the older INI/period configuration for now until more testing is done. Cc: Felix Fietkau <nbd@openwrt.org> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c29
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.h6
2 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index a68beb19ce4d..4994bea809eb 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -186,6 +186,14 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel,
186 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 186 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
187 entry_ofdm->ofdm_weak_signal_on); 187 entry_ofdm->ofdm_weak_signal_on);
188 } 188 }
189
190 if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) {
191 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
192 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI;
193 } else {
194 ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI;
195 ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW;
196 }
189} 197}
190 198
191static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) 199static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
@@ -420,25 +428,12 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
420 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel, 428 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
421 cckPhyErrRate, aniState->ofdmsTurn); 429 cckPhyErrRate, aniState->ofdmsTurn);
422 430
423 if (aniState->listenTime > 5 * ah->aniperiod) { 431 if (aniState->listenTime > ah->aniperiod) {
424 /* 432 if (cckPhyErrRate < ah->config.cck_trig_low &&
425 * Check if we need to lower immunity if 433 ofdmPhyErrRate < ah->config.ofdm_trig_low) {
426 * 5 ani_periods have passed.
427 */
428 if (ofdmPhyErrRate <= ah->config.ofdm_trig_low &&
429 cckPhyErrRate <= ah->config.cck_trig_low) {
430 ath9k_hw_ani_lower_immunity(ah); 434 ath9k_hw_ani_lower_immunity(ah);
431 aniState->ofdmsTurn = !aniState->ofdmsTurn; 435 aniState->ofdmsTurn = !aniState->ofdmsTurn;
432 } 436 } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) {
433 ath9k_ani_restart(ah);
434 } else if (aniState->listenTime > ah->aniperiod) {
435 /*
436 * Check if immunity has to be raised,
437 * (either OFDM or CCK).
438 */
439 if (ofdmPhyErrRate > ah->config.ofdm_trig_high &&
440 (cckPhyErrRate <= ah->config.cck_trig_high ||
441 aniState->ofdmsTurn)) {
442 ath9k_hw_ani_ofdm_err_trigger(ah); 437 ath9k_hw_ani_ofdm_err_trigger(ah);
443 aniState->ofdmsTurn = false; 438 aniState->ofdmsTurn = false;
444 } else if (cckPhyErrRate > ah->config.cck_trig_high) { 439 } else if (cckPhyErrRate > ah->config.cck_trig_high) {
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 77a06fd40287..b54a3fb01883 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -20,8 +20,12 @@
20#define BEACON_RSSI(ahp) (ahp->stats.avgbrssi) 20#define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
21 21
22/* units are errors per second */ 22/* units are errors per second */
23#define ATH9K_ANI_OFDM_TRIG_HIGH 1000 23#define ATH9K_ANI_OFDM_TRIG_HIGH 3500
24#define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000
25
24#define ATH9K_ANI_OFDM_TRIG_LOW 400 26#define ATH9K_ANI_OFDM_TRIG_LOW 400
27#define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900
28
25#define ATH9K_ANI_CCK_TRIG_HIGH 600 29#define ATH9K_ANI_CCK_TRIG_HIGH 600
26#define ATH9K_ANI_CCK_TRIG_LOW 300 30#define ATH9K_ANI_CCK_TRIG_LOW 300
27 31