]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - net/wireless/nl80211.c
mac80211/cfg80211: update bss channel on channel switch
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Tue, 26 Mar 2019 09:27:37 +0000 (09:27 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit10b56e14fd58064d34aac568ae590bfc67e04b40
tree613f1a26fcb9c143c060f9b684950d7222df0f7d
parent9a0e59e6cb3c9c2ed18617b14b0294d5819ed3c8
mac80211/cfg80211: update bss channel on channel switch

BugLink: https://bugs.launchpad.net/bugs/1838700
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/mac80211/mlme.c
net/wireless/nl80211.c