mac80211: handle channel frequency offset
cfg80211_chan_def and ieee80211_channel recently gained a frequency offset component. Handle this where it makes sense (potentially required by S1G channels). For IBSS, TDLS, CSA, and ROC we return -EOPNOTSUPP if a channel with frequency offset is passed, since they may or may not work. Once someone tests and verifies these commands work on thos types of channels, we can remove that error. join_ocb and join_mesh look harmless because they use a simple ieee80211_vif_use_channel(), which is using an already verified channel, so we let those through. Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com> Link: https://lore.kernel.org/r/20200402011810.22947-4-thomas@adapt-ip.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
committed by
Johannes Berg
parent
934f4c7dd3
commit
b6011960f3
@@ -107,13 +107,15 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
|
||||
chandef.chan = local->tmp_channel;
|
||||
chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
|
||||
chandef.center_freq1 = chandef.chan->center_freq;
|
||||
chandef.freq1_offset = chandef.chan->freq_offset;
|
||||
} else
|
||||
chandef = local->_oper_chandef;
|
||||
|
||||
WARN(!cfg80211_chandef_valid(&chandef),
|
||||
"control:%d MHz width:%d center: %d/%d MHz",
|
||||
chandef.chan->center_freq, chandef.width,
|
||||
chandef.center_freq1, chandef.center_freq2);
|
||||
"control:%d.%03d MHz width:%d center: %d.%03d/%d MHz",
|
||||
chandef.chan->center_freq, chandef.chan->freq_offset,
|
||||
chandef.width, chandef.center_freq1, chandef.freq1_offset,
|
||||
chandef.center_freq2);
|
||||
|
||||
if (!cfg80211_chandef_identical(&chandef, &local->_oper_chandef))
|
||||
local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
|
||||
|
||||
Reference in New Issue
Block a user