ath9k: fix ANI weak signal detection handling
[openwrt/staging/yousong.git] / package / mac80211 / patches / 570-ath9k_remove_noiseFloor.patch
1 --- a/drivers/net/wireless/ath/ath9k/ani.h
2 +++ b/drivers/net/wireless/ath/ath9k/ani.h
3 @@ -128,7 +128,6 @@ struct ar5416AniState {
4 u32 listenTime;
5 int32_t rssiThrLow;
6 int32_t rssiThrHigh;
7 - u32 noiseFloor;
8 u32 ofdmPhyErrCount;
9 u32 cckPhyErrCount;
10 int16_t pktRssi[2];
11 --- a/drivers/net/wireless/ath/ath9k/ani.c
12 +++ b/drivers/net/wireless/ath/ath9k/ani.c
13 @@ -266,11 +266,9 @@ static void ath9k_hw_set_ofdm_nil(struct
14 const struct ani_ofdm_level_entry *entry_ofdm;
15 const struct ani_cck_level_entry *entry_cck;
16
17 - aniState->noiseFloor = BEACON_RSSI(ah);
18 -
19 ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
20 aniState->ofdmNoiseImmunityLevel,
21 - immunityLevel, aniState->noiseFloor,
22 + immunityLevel, BEACON_RSSI(ah),
23 aniState->rssiThrLow, aniState->rssiThrHigh);
24
25 if (aniState->update_ani)
26 @@ -292,7 +290,7 @@ static void ath9k_hw_set_ofdm_nil(struct
27 ATH9K_ANI_FIRSTEP_LEVEL,
28 entry_ofdm->fir_step_level);
29
30 - if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
31 + if (BEACON_RSSI(ah) >= aniState->rssiThrHigh &&
32 (!aniState->ofdmWeakSigDetectOff !=
33 entry_ofdm->ofdm_weak_signal_on)) {
34 ath9k_hw_ani_control(ah,
35 @@ -329,15 +327,14 @@ static void ath9k_hw_set_cck_nil(struct
36 const struct ani_ofdm_level_entry *entry_ofdm;
37 const struct ani_cck_level_entry *entry_cck;
38
39 - aniState->noiseFloor = BEACON_RSSI(ah);
40 ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
41 aniState->cckNoiseImmunityLevel, immunityLevel,
42 - aniState->noiseFloor, aniState->rssiThrLow,
43 + BEACON_RSSI(ah), aniState->rssiThrLow,
44 aniState->rssiThrHigh);
45
46 if ((ah->opmode == NL80211_IFTYPE_STATION ||
47 ah->opmode == NL80211_IFTYPE_ADHOC) &&
48 - aniState->noiseFloor <= aniState->rssiThrLow &&
49 + BEACON_RSSI(ah) <= aniState->rssiThrLow &&
50 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
51 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
52