]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0049-ath9k-Fix-regression-in-channelwidth-switch-at-the-s.patch
linux-ti33x-psp 3.2: update to 3.2.21, add libertas fixes
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0049-ath9k-Fix-regression-in-channelwidth-switch-at-the-s.patch
1 From f7938357cefb08ed00118138736f4d475fbc6578 Mon Sep 17 00:00:00 2001
2 From: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
3 Date: Mon, 9 Jan 2012 15:37:53 +0530
4 Subject: [PATCH 049/129] ath9k: Fix regression in channelwidth switch at the
5  same channel
7 commit 1a19f77f3642b8194ad9cf55548cc5d92e841766 upstream.
9 The commit "ath9k: Fix invalid noisefloor reading due to channel update"
10 preserves the current channel noisefloor readings before updating
11 channel type at the same channel index. It is also updating the curchan
12 pointer. As survey updation is also referring curchan pointer to fetch
13 the appropriate index, which might leads to invalid memory access. This
14 patch partially reverts the change and stores the noise floor history
15 buffer before updating channel type w/o updating curchan.
17 Cc: Gary Morain <gmorain@google.com>
18 Cc: Paul Stewart <pstew@google.com>
19 Reported-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
20 Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
21 Signed-off-by: John W. Linville <linville@tuxdriver.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23 ---
24  drivers/net/wireless/ath/ath9k/calib.c |    1 +
25  drivers/net/wireless/ath/ath9k/main.c  |    8 ++------
26  2 files changed, 3 insertions(+), 6 deletions(-)
28 diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
29 index 9953881..8ddef3e 100644
30 --- a/drivers/net/wireless/ath/ath9k/calib.c
31 +++ b/drivers/net/wireless/ath/ath9k/calib.c
32 @@ -402,6 +402,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
33         ah->noise = ath9k_hw_getchan_noise(ah, chan);
34         return true;
35  }
36 +EXPORT_SYMBOL(ath9k_hw_getnf);
37  
38  void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah,
39                                   struct ath9k_channel *chan)
40 diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
41 index a9c5ae7..f76a814 100644
42 --- a/drivers/net/wireless/ath/ath9k/main.c
43 +++ b/drivers/net/wireless/ath/ath9k/main.c
44 @@ -1667,7 +1667,6 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
45  
46         if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
47                 struct ieee80211_channel *curchan = hw->conf.channel;
48 -               struct ath9k_channel old_chan;
49                 int pos = curchan->hw_value;
50                 int old_pos = -1;
51                 unsigned long flags;
52 @@ -1693,11 +1692,8 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
53                  * Preserve the current channel values, before updating
54                  * the same channel
55                  */
56 -               if (old_pos == pos) {
57 -                       memcpy(&old_chan, &sc->sc_ah->channels[pos],
58 -                               sizeof(struct ath9k_channel));
59 -                       ah->curchan = &old_chan;
60 -               }
61 +               if (ah->curchan && (old_pos == pos))
62 +                       ath9k_hw_getnf(ah, ah->curchan);
63  
64                 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
65                                           curchan, conf->channel_type);
66 -- 
67 1.7.9.5