aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-05-04 14:35:35 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-05-04 14:35:35 +0000
commitdaba13cc2b87d315a2274f65f2b2f75679e41d9f (patch)
tree7572b149c3cc163b3bf30696acd4f076e4344172
parent1a12aca40b1c14fb0489b89141bceae6afb0f86f (diff)
downloadupstream-daba13cc2b87d315a2274f65f2b2f75679e41d9f.tar.gz
upstream-daba13cc2b87d315a2274f65f2b2f75679e41d9f.tar.bz2
upstream-daba13cc2b87d315a2274f65f2b2f75679e41d9f.zip
ath9k: add noise floor calibration fix that should improve stability
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26819 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/mac80211/patches/300-pending_work.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch
index d4a2f4ed5c..f06e9df99b 100644
--- a/package/mac80211/patches/300-pending_work.patch
+++ b/package/mac80211/patches/300-pending_work.patch
@@ -565,3 +565,55 @@
HT_RX_REORDER_BUF_TIMEOUT);
} else {
del_timer(&tid_agg_rx->reorder_timer);
+--- a/drivers/net/wireless/ath/ath9k/calib.c
++++ b/drivers/net/wireless/ath/ath9k/calib.c
+@@ -69,15 +69,21 @@ static void ath9k_hw_update_nfcal_hist_b
+ int16_t *nfarray)
+ {
+ struct ath_common *common = ath9k_hw_common(ah);
++ struct ieee80211_conf *conf = &common->hw->conf;
+ struct ath_nf_limits *limit;
+ struct ath9k_nfcal_hist *h;
+ bool high_nf_mid = false;
++ u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
+ int i;
+
+ h = cal->nfCalHist;
+ limit = ath9k_hw_get_nf_limits(ah, ah->curchan);
+
+ for (i = 0; i < NUM_NF_READINGS; i++) {
++ if (!(chainmask & (1 << i)) ||
++ ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf)))
++ continue;
++
+ h[i].nfCalBuffer[h[i].currIndex] = nfarray[i];
+
+ if (++h[i].currIndex >= ATH9K_NF_CAL_HIST_MAX)
+@@ -225,6 +231,7 @@ void ath9k_hw_loadnf(struct ath_hw *ah,
+ int32_t val;
+ u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
+ struct ath_common *common = ath9k_hw_common(ah);
++ struct ieee80211_conf *conf = &common->hw->conf;
+ s16 default_nf = ath9k_hw_get_default_nf(ah, chan);
+
+ if (ah->caldata)
+@@ -234,6 +241,9 @@ void ath9k_hw_loadnf(struct ath_hw *ah,
+ if (chainmask & (1 << i)) {
+ s16 nfval;
+
++ if ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))
++ continue;
++
+ if (h)
+ nfval = h[i].privNF;
+ else
+@@ -293,6 +303,9 @@ void ath9k_hw_loadnf(struct ath_hw *ah,
+ ENABLE_REGWRITE_BUFFER(ah);
+ for (i = 0; i < NUM_NF_READINGS; i++) {
+ if (chainmask & (1 << i)) {
++ if ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))
++ continue;
++
+ val = REG_READ(ah, ah->nf_regs[i]);
+ val &= 0xFFFFFE00;
+ val |= (((u32) (-50) << 1) & 0x1ff);