Introduce support for sharing identical channel contexts for S1G interfaces. Additionally, do not downgrade channel requests for S1G interfaces. Signed-off-by: Lachlan Hodges --- I've kept the WARN_ON(1) here, though it only *should* be hit if an S1G driver advertises num_different_channels > 1 and starts a non-identical interface, otherwise the connection will be rejected earlier when verifying the iface combinations assuming num_different_channels = 1 (should be every S1G driver at this point). --- net/mac80211/chan.c | 14 +++++++++++++- net/mac80211/mlme.c | 9 +++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 57065714cf8c..f73973096097 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -530,8 +530,20 @@ static void _ieee80211_change_chanctx(struct ieee80211_local *local, }; u32 changed = 0; - /* expected to handle only 20/40/80/160/320 channel widths */ + /* 5/10 MHz not handled here */ switch (chandef->width) { + case NL80211_CHAN_WIDTH_1: + case NL80211_CHAN_WIDTH_2: + case NL80211_CHAN_WIDTH_4: + case NL80211_CHAN_WIDTH_8: + case NL80211_CHAN_WIDTH_16: + /* + * mac80211 currently only supports sharing identical + * chanctx's for S1G interfaces. + */ + if (ieee80211_chanreq_identical(&ctx_req, chanreq)) + return; + WARN_ON(1); case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20: case NL80211_CHAN_WIDTH_40: diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 025210d50405..e4814cb1c181 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -6122,9 +6122,14 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, ret = ieee80211_link_use_channel(link, &chanreq, IEEE80211_CHANCTX_SHARED); - /* don't downgrade for 5 and 10 MHz channels, though. */ + /* don't downgrade for 5/10/S1G MHz channels, though. */ if (chanreq.oper.width == NL80211_CHAN_WIDTH_5 || - chanreq.oper.width == NL80211_CHAN_WIDTH_10) + chanreq.oper.width == NL80211_CHAN_WIDTH_10 || + chanreq.oper.width == NL80211_CHAN_WIDTH_1 || + chanreq.oper.width == NL80211_CHAN_WIDTH_2 || + chanreq.oper.width == NL80211_CHAN_WIDTH_4 || + chanreq.oper.width == NL80211_CHAN_WIDTH_8 || + chanreq.oper.width == NL80211_CHAN_WIDTH_16) return ret; while (ret && chanreq.oper.width != NL80211_CHAN_WIDTH_20_NOHT) { -- 2.43.0