aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-06-10 04:19:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:30 -0400
commit13311514a74f520989e304b746dc7478335877f9 (patch)
treec8464d6ed7ecd8b2db916480d1d6da911fc93d6a
parente9c25a407d5c75646eb258de1363dccc1fd3ab47 (diff)
ath9k: Fix noisefloor calibration
commit 696df78509d1f81b651dd98ecdc1aecab616db6b upstream. The commits, "ath9k: Fix regression in channelwidth switch at the same channel" "ath9k: Fix invalid noisefloor reading due to channel update" attempted to fix noisefloor calibration when a channel switch happens due to HT20/HT40 bandwidth change. This is causing invalid readings resulting in messages like: "ath: phy16: NF[0] (-45) > MAX (-95), correcting to MAX". This results in an incorrect noise being used initially for reporting the signal level of received packets, until NF calibration is done and the history buffer is updated via the ANI timer, which happens much later. When a bandwidth change happens, it is appropriate to reset the internal history data for the channel. Do this correctly in the reset() routine by checking the "chanmode" variable. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c7
2 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 15dfefcf2d0f..b1d5037bff7f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1872,7 +1872,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1872 1872
1873 ah->caldata = caldata; 1873 ah->caldata = caldata;
1874 if (caldata && (chan->channel != caldata->channel || 1874 if (caldata && (chan->channel != caldata->channel ||
1875 chan->channelFlags != caldata->channelFlags)) { 1875 chan->channelFlags != caldata->channelFlags ||
1876 chan->chanmode != caldata->chanmode)) {
1876 /* Operating channel changed, reset channel calibration data */ 1877 /* Operating channel changed, reset channel calibration data */
1877 memset(caldata, 0, sizeof(*caldata)); 1878 memset(caldata, 0, sizeof(*caldata));
1878 ath9k_init_nfcal_hist_buffer(ah, chan); 1879 ath9k_init_nfcal_hist_buffer(ah, chan);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 5092ecae7706..35ced100c183 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1211,13 +1211,6 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1211 ath_update_survey_stats(sc); 1211 ath_update_survey_stats(sc);
1212 spin_unlock_irqrestore(&common->cc_lock, flags); 1212 spin_unlock_irqrestore(&common->cc_lock, flags);
1213 1213
1214 /*
1215 * Preserve the current channel values, before updating
1216 * the same channel
1217 */
1218 if (ah->curchan && (old_pos == pos))
1219 ath9k_hw_getnf(ah, ah->curchan);
1220
1221 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos], 1214 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
1222 curchan, channel_type); 1215 curchan, channel_type);
1223 1216