aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-08-13 00:58:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 13:59:46 -0400
commite338a85e21d89574a0160fef7a89f42960cc5d7f (patch)
treec643cc1db586645011146a7f2bfad107e9f8d7e8 /drivers
parent6b3d348681a153b8e4a16ba1a6f792711e389a9e (diff)
ath9k: Fix invalid noisefloor reading due to channel update
While switching b/w HT20/40, the current channel's nf values are updated into history buffer. Since the current channel's channel type, channel flag got updated before reading nf value from hw. This channel type mismatch is causing invalid readings when hw is on ht20 but getnf tries to read on extn chains. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2af4a1c2e2d6..113c1df26b36 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1672,6 +1672,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1672 1672
1673 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 1673 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
1674 struct ieee80211_channel *curchan = hw->conf.channel; 1674 struct ieee80211_channel *curchan = hw->conf.channel;
1675 struct ath9k_channel old_chan;
1675 int pos = curchan->hw_value; 1676 int pos = curchan->hw_value;
1676 int old_pos = -1; 1677 int old_pos = -1;
1677 unsigned long flags; 1678 unsigned long flags;
@@ -1688,15 +1689,25 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1688 "Set channel: %d MHz type: %d\n", 1689 "Set channel: %d MHz type: %d\n",
1689 curchan->center_freq, conf->channel_type); 1690 curchan->center_freq, conf->channel_type);
1690 1691
1691 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
1692 curchan, conf->channel_type);
1693
1694 /* update survey stats for the old channel before switching */ 1692 /* update survey stats for the old channel before switching */
1695 spin_lock_irqsave(&common->cc_lock, flags); 1693 spin_lock_irqsave(&common->cc_lock, flags);
1696 ath_update_survey_stats(sc); 1694 ath_update_survey_stats(sc);
1697 spin_unlock_irqrestore(&common->cc_lock, flags); 1695 spin_unlock_irqrestore(&common->cc_lock, flags);
1698 1696
1699 /* 1697 /*
1698 * Preserve the current channel values, before updating
1699 * the same channel
1700 */
1701 if (old_pos == pos) {
1702 memcpy(&old_chan, &sc->sc_ah->channels[pos],
1703 sizeof(struct ath9k_channel));
1704 ah->curchan = &old_chan;
1705 }
1706
1707 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
1708 curchan, conf->channel_type);
1709
1710 /*
1700 * If the operating channel changes, change the survey in-use flags 1711 * If the operating channel changes, change the survey in-use flags
1701 * along with it. 1712 * along with it.
1702 * Reset the survey data for the new channel, unless we're switching 1713 * Reset the survey data for the new channel, unless we're switching