From: Johannes Berg <johannes@sipsolutions.net>
To: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
Arend van Spriel <arend.vanspriel@broadcom.com>
Subject: Re: [RFC PATCH] mac80211/cfg80211: update bss channel on channel switch
Date: Sat, 23 Mar 2019 13:32:47 +0100 [thread overview]
Message-ID: <3d76d0d033609fff4e72448a9fd7d63ad1365cb2.camel@sipsolutions.net> (raw)
In-Reply-To: <20190321151915.16826-1-sergey.matyukevich.os@quantenna.com> (sfid-20190321_162003_388890_DC9426EB)
On Thu, 2019-03-21 at 15:19 +0000, Sergey Matyukevich wrote:
> 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 to cfg80211 behavior
> and to update current bss channel in cfg80211_ch_switch_notify.
>
> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
>
> ---
>
> This issue has been observed for both qtnfmac and brcmfmac. Fix tested
> for qtnfmac and iwlwifi, to make sure there is no regression for mac80211.
> However this is not going to be enough to fix brcmfmac behavior as it
> does not use cfg80211_ch_switch_notify. This issue may also affect
> ath6kl and mwifiex, but I have no hardware to check.
Yeah, I think this makes sense.
> + if (wdev->iftype == NL80211_IFTYPE_STATION) {
> + if (wdev->current_bss)
> + wdev->current_bss->pub.channel = chandef->chan;
> + }
Maybe do
if (wdev->iftype == ... &&
!WARN_ON(!wdev->current_bss))
wdev->current_bss->... = ...
I worry slightly about locking too, since there's no protection on the
wdev->current_bss pointer here.
johannes
next prev parent reply other threads:[~2019-03-23 12:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 15:19 [RFC PATCH] mac80211/cfg80211: update bss channel on channel switch Sergey Matyukevich
2019-03-23 12:32 ` Johannes Berg [this message]
2019-03-25 15:44 ` Sergey Matyukevich
2019-03-25 16:18 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d76d0d033609fff4e72448a9fd7d63ad1365cb2.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arend.vanspriel@broadcom.com \
--cc=igor.mitsyanko.os@quantenna.com \
--cc=linux-wireless@vger.kernel.org \
--cc=sergey.matyukevich.os@quantenna.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox