diff options
author | Thomas Pedersen <thomas@adapt-ip.com> | 2020-09-22 04:28:03 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2020-09-28 13:53:05 +0200 |
commit | 75b1593533f13a2b77306a1edb971be2d8705dd7 (patch) | |
tree | a3be333c6a4c67e65705500c1d70ff0a11ba1abc /net/mac80211 | |
parent | mac80211: get correct default channel width for S1G (diff) | |
download | linux-75b1593533f13a2b77306a1edb971be2d8705dd7.tar.xz linux-75b1593533f13a2b77306a1edb971be2d8705dd7.zip |
mac80211: s1g: choose scanning width based on frequency
An S1G BSS can beacon at either 1 or 2 MHz and the channel
width is unique to a given frequency. Ignore scan channel
width for now and use the allowed channel width.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200922022818.15855-3-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/scan.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 7361e1239bf2..d211160e42da 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -909,6 +909,17 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, local->scan_chandef.center_freq1 = chan->center_freq; local->scan_chandef.freq1_offset = chan->freq_offset; local->scan_chandef.center_freq2 = 0; + + /* For scanning on the S1G band, ignore scan_width (which is constant + * across all channels) for now since channel width is specific to each + * channel. Detect the required channel width here and likely revisit + * later. Maybe scan_width could be used to build the channel scan list? + */ + if (chan->band == NL80211_BAND_S1GHZ) { + local->scan_chandef.width = ieee80211_s1g_channel_width(chan); + goto set_channel; + } + switch (scan_req->scan_width) { case NL80211_BSS_CHAN_WIDTH_5: local->scan_chandef.width = NL80211_CHAN_WIDTH_5; @@ -929,8 +940,14 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, else local->scan_chandef.width = NL80211_CHAN_WIDTH_20_NOHT; break; + case NL80211_BSS_CHAN_WIDTH_1: + case NL80211_BSS_CHAN_WIDTH_2: + /* shouldn't get here, S1G handled above */ + WARN_ON(1); + break; } +set_channel: if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) skip = 1; |