summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>2019-03-26 09:27:37 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:46:14 -0700
commitca5b9d63e9b110bf6f62666d9b8f2470fff09239 (patch)
tree6d2ce880efe5045ae65422b36215e938168a1c3d /net/wireless
parent1d057fefa0459a18c414308a2612f73f9eb8d72a (diff)
downloadlinux-rpi3-ca5b9d63e9b110bf6f62666d9b8f2470fff09239.tar.gz
linux-rpi3-ca5b9d63e9b110bf6f62666d9b8f2470fff09239.tar.bz2
linux-rpi3-ca5b9d63e9b110bf6f62666d9b8f2470fff09239.zip
mac80211/cfg80211: update bss channel on channel switch
[ Upstream commit 5dc8cdce1d722c733f8c7af14c5fb595cfedbfa8 ] FullMAC STAs have no way to update bss channel after CSA channel switch completion. As a result, user-space tools may provide inconsistent channel info. For instance, consider the following two commands: $ sudo iw dev wlan0 link $ sudo iw dev wlan0 info The latter command gets channel info from the hardware, so most probably its output will be correct. However the former command gets channel info from scan cache, so its output will contain outdated channel info. In fact, current bss channel info will not be updated until the next [re-]connect. Note that mac80211 STAs have a workaround for this, but it requires access to internal cfg80211 data, see ieee80211_chswitch_work: /* XXX: shouldn't really modify cfg80211-owned data! */ ifmgd->associated->channel = sdata->csa_chandef.chan; This patch suggests to convert mac80211 workaround into cfg80211 behavior and to update current bss channel in cfg80211_ch_switch_notify. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 048e004ed0ee..c6711ead5e59 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -15441,6 +15441,11 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
wdev->chandef = *chandef;
wdev->preset_chandef = *chandef;
+
+ if (wdev->iftype == NL80211_IFTYPE_STATION &&
+ !WARN_ON(!wdev->current_bss))
+ wdev->current_bss->pub.channel = chandef->chan;
+
nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
NL80211_CMD_CH_SWITCH_NOTIFY, 0);
}