Commit 5e480774 authored by Thomas Pedersen's avatar Thomas Pedersen Committed by Johannes Berg

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: default avatarThomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200922022818.15855-2-thomas@adapt-ip.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 211f2041
...@@ -536,7 +536,14 @@ static void ieee80211_del_chanctx(struct ieee80211_local *local, ...@@ -536,7 +536,14 @@ static void ieee80211_del_chanctx(struct ieee80211_local *local,
if (!local->use_chanctx) { if (!local->use_chanctx) {
struct cfg80211_chan_def *chandef = &local->_oper_chandef; 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->center_freq1 = chandef->chan->center_freq;
chandef->freq1_offset = chandef->chan->freq_offset; chandef->freq1_offset = chandef->chan->freq_offset;
chandef->center_freq2 = 0; chandef->center_freq2 = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment