summary refs log tree commit diff
path: root/net/mac80211
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@adapt-ip.com>2020-09-21 19:28:02 -0700
committerJohannes Berg <johannes.berg@intel.com>2020-09-28 13:53:05 +0200
commit5e48077498918e9e42f689df5f14dbdc3f1b8cc2 (patch)
tree5402af282b2f4da8f379602dc532fbf6dbf31e67 /net/mac80211
parent211f20415995f0c40aa91a0856b5f442154d56b2 (diff)
downloadlinux-5e48077498918e9e42f689df5f14dbdc3f1b8cc2.tar.gz
mac80211: get correct default channel width for S1G
When deleting a channel context, mac80211 would assing
NL80211_CHAN_WIDTH_20_NOHT as the default channel width.
This is wrong in S1G however, so instead get the allowed
channel width for a given channel.

Fixes eg. configuring strange (20Mhz) width during a scan
on the S1G band.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200922022818.15855-2-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/chan.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index bdc0f29dc6cd..8f48aff74c7b 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -536,7 +536,14 @@ static void ieee80211_del_chanctx(struct ieee80211_local *local,
 
 	if (!local->use_chanctx) {
 		struct cfg80211_chan_def *chandef = &local->_oper_chandef;
-		chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
+		/* S1G doesn't have 20MHz, so get the correct width for the
+		 * current channel.
+		 */
+		if (chandef->chan->band == NL80211_BAND_S1GHZ)
+			chandef->width =
+				ieee80211_s1g_channel_width(chandef->chan);
+		else
+			chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
 		chandef->center_freq1 = chandef->chan->center_freq;
 		chandef->freq1_offset = chandef->chan->freq_offset;
 		chandef->center_freq2 = 0;