From: Felix Fietkau Date: Sun, 27 Apr 2014 14:37:39 +0000 (+0200) Subject: ath9k_hw: do not lower ANI setting below default on AR913x X-Git-Tag: v4.0~1799^2~20^2^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae9c25a1826ca9602e89fe9c11700c63ce16d077;p=platform%2Fkernel%2Flinux-amlogic.git ath9k_hw: do not lower ANI setting below default on AR913x When the amount of noise fluctuates strongly, low immunity settings can sometimes disrupt signal detection on AR913x chips. When that happens, no OFDM/CCK errors are reported anymore, and ANI tunes the radio to the lowest immunity settings. Usually rx/tx fails as well in that case. To fix this, keep noise immunity settings at or above ANI default level, which will keep radio parameters at or above INI values. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c index 6d47783..ba502a2 100644 --- a/drivers/net/wireless/ath/ath9k/ani.c +++ b/drivers/net/wireless/ath/ath9k/ani.c @@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel, ATH9K_ANI_RSSI_THR_LOW, ATH9K_ANI_RSSI_THR_HIGH); + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL) + immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; + if (!scan) aniState->ofdmNoiseImmunityLevel = immunityLevel; @@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel, BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW, ATH9K_ANI_RSSI_THR_HIGH); + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL) + immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; + if (ah->opmode == NL80211_IFTYPE_STATION && BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW && immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)