summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-04 13:42:39 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-04 13:42:39 +0000
commit049b4337f5585c4a007a219a72532d455d3f3e7c (patch)
treeb2ff76fecedd24bfd90065f4109180a5939751ae /package
parent5bfb119980ceb2dd15b7492af9aaddf52a3e3e82 (diff)
ath9k: fix ANI weak signal detection handling
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32045 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/patches/570-ath9k_remove_noiseFloor.patch52
-rw-r--r--package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch30
2 files changed, 82 insertions, 0 deletions
diff --git a/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch b/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch
new file mode 100644
index 0000000000..fb17dc566a
--- /dev/null
+++ b/package/mac80211/patches/570-ath9k_remove_noiseFloor.patch
@@ -0,0 +1,52 @@
+--- a/drivers/net/wireless/ath/ath9k/ani.h
++++ b/drivers/net/wireless/ath/ath9k/ani.h
+@@ -128,7 +128,6 @@ struct ar5416AniState {
+ u32 listenTime;
+ int32_t rssiThrLow;
+ int32_t rssiThrHigh;
+- u32 noiseFloor;
+ u32 ofdmPhyErrCount;
+ u32 cckPhyErrCount;
+ int16_t pktRssi[2];
+--- a/drivers/net/wireless/ath/ath9k/ani.c
++++ b/drivers/net/wireless/ath/ath9k/ani.c
+@@ -266,11 +266,9 @@ static void ath9k_hw_set_ofdm_nil(struct
+ const struct ani_ofdm_level_entry *entry_ofdm;
+ const struct ani_cck_level_entry *entry_cck;
+
+- aniState->noiseFloor = BEACON_RSSI(ah);
+-
+ ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
+ aniState->ofdmNoiseImmunityLevel,
+- immunityLevel, aniState->noiseFloor,
++ immunityLevel, BEACON_RSSI(ah),
+ aniState->rssiThrLow, aniState->rssiThrHigh);
+
+ if (aniState->update_ani)
+@@ -292,7 +290,7 @@ static void ath9k_hw_set_ofdm_nil(struct
+ ATH9K_ANI_FIRSTEP_LEVEL,
+ entry_ofdm->fir_step_level);
+
+- if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
++ if (BEACON_RSSI(ah) >= aniState->rssiThrHigh &&
+ (!aniState->ofdmWeakSigDetectOff !=
+ entry_ofdm->ofdm_weak_signal_on)) {
+ ath9k_hw_ani_control(ah,
+@@ -329,15 +327,14 @@ static void ath9k_hw_set_cck_nil(struct
+ const struct ani_ofdm_level_entry *entry_ofdm;
+ const struct ani_cck_level_entry *entry_cck;
+
+- aniState->noiseFloor = BEACON_RSSI(ah);
+ ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
+ aniState->cckNoiseImmunityLevel, immunityLevel,
+- aniState->noiseFloor, aniState->rssiThrLow,
++ BEACON_RSSI(ah), aniState->rssiThrLow,
+ aniState->rssiThrHigh);
+
+ if ((ah->opmode == NL80211_IFTYPE_STATION ||
+ ah->opmode == NL80211_IFTYPE_ADHOC) &&
+- aniState->noiseFloor <= aniState->rssiThrLow &&
++ BEACON_RSSI(ah) <= aniState->rssiThrLow &&
+ immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
+ immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
+
diff --git a/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch b/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch
new file mode 100644
index 0000000000..bfe0f0b46f
--- /dev/null
+++ b/package/mac80211/patches/571-ath9k_ani_fix_weak_sig.patch
@@ -0,0 +1,30 @@
+--- 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
+ struct ath_common *common = ath9k_hw_common(ah);
+ const struct ani_ofdm_level_entry *entry_ofdm;
+ const struct ani_cck_level_entry *entry_cck;
++ bool weak_sig;
+
+ ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
+ aniState->ofdmNoiseImmunityLevel,
+@@ -290,13 +291,15 @@ static void ath9k_hw_set_ofdm_nil(struct
+ ATH9K_ANI_FIRSTEP_LEVEL,
+ entry_ofdm->fir_step_level);
+
+- if (BEACON_RSSI(ah) >= aniState->rssiThrHigh &&
+- (!aniState->ofdmWeakSigDetectOff !=
+- entry_ofdm->ofdm_weak_signal_on)) {
++ weak_sig = entry_ofdm->ofdm_weak_signal_on;
++ if (ah->opmode == NL80211_IFTYPE_STATION &&
++ BEACON_RSSI(ah) >= aniState->rssiThrHigh)
++ weak_sig = true;
++
++ if (!aniState->ofdmWeakSigDetectOff != weak_sig)
+ ath9k_hw_ani_control(ah,
+ ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
+ entry_ofdm->ofdm_weak_signal_on);
+- }
+ }
+
+ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)