aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-15 09:25:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-20 14:44:41 -0400
commit0b81cc3922bce79d0f21189648bf4f9992e9a533 (patch)
tree7091880bd04c630b3dfec150e30d65e75510686f /drivers/net
parent35e808b7e4e9ddac1086716867fe686f52fb78ff (diff)
ath9k_hw: fix OFDM weak signal detection handling
Commit "ath9k_hw: improve ANI processing and rx desensitizing parameters" was unifying some code related to overriding OFDM weak signal detection, but seems to have gotten some of the original intent wrong, probably because of a misnamed variable. The beacon RSSI is only valid in station mode, and the main reason to check it in ath9k_hw_set_ofdm_nil is to make sure that OFDM weak signal detection stays enabled if the RSSI is low, even when the OFDM noise immunity entry is supposed to disable it. The above commit removed the mode checks and changed the code so that OFDM weak signal detection would only be changed if the rssi is high, which is wrong for everything but client mode. This patch restores the old behavior in a simplified form. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 18ce69d7fea..cf310508cac 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -265,6 +265,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
265 struct ath_common *common = ath9k_hw_common(ah); 265 struct ath_common *common = ath9k_hw_common(ah);
266 const struct ani_ofdm_level_entry *entry_ofdm; 266 const struct ani_ofdm_level_entry *entry_ofdm;
267 const struct ani_cck_level_entry *entry_cck; 267 const struct ani_cck_level_entry *entry_cck;
268 bool weak_sig;
268 269
269 ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", 270 ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
270 aniState->ofdmNoiseImmunityLevel, 271 aniState->ofdmNoiseImmunityLevel,
@@ -290,13 +291,15 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
290 ATH9K_ANI_FIRSTEP_LEVEL, 291 ATH9K_ANI_FIRSTEP_LEVEL,
291 entry_ofdm->fir_step_level); 292 entry_ofdm->fir_step_level);
292 293
293 if (BEACON_RSSI(ah) >= aniState->rssiThrHigh && 294 weak_sig = entry_ofdm->ofdm_weak_signal_on;
294 (!aniState->ofdmWeakSigDetectOff != 295 if (ah->opmode == NL80211_IFTYPE_STATION &&
295 entry_ofdm->ofdm_weak_signal_on)) { 296 BEACON_RSSI(ah) <= aniState->rssiThrHigh)
297 weak_sig = true;
298
299 if (!aniState->ofdmWeakSigDetectOff != weak_sig)
296 ath9k_hw_ani_control(ah, 300 ath9k_hw_ani_control(ah,
297 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 301 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
298 entry_ofdm->ofdm_weak_signal_on); 302 entry_ofdm->ofdm_weak_signal_on);
299 }
300} 303}
301 304
302static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) 305static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)