Skip to content

Commit f9e788c

Browse files
donnaskiezjmberg-intel
authored andcommitted
wifi: mac80211: allow sharing identical chanctx for S1G interfaces
Introduce support for sharing identical channel contexts for S1G interfaces. Additionally, do not downgrade channel requests for S1G interfaces. Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com> Link: https://patch.msgid.link/20251126015758.149034-1-lachlan.hodges@morsemicro.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 1c6a92a commit f9e788c

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

net/mac80211/chan.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,19 @@ static void _ieee80211_change_chanctx(struct ieee80211_local *local,
654654
};
655655
u32 changed = 0;
656656

657-
/* expected to handle only 20/40/80/160/320 channel widths */
657+
/* 5/10 MHz not handled here */
658658
switch (chandef->width) {
659+
case NL80211_CHAN_WIDTH_1:
660+
case NL80211_CHAN_WIDTH_2:
661+
case NL80211_CHAN_WIDTH_4:
662+
case NL80211_CHAN_WIDTH_8:
663+
case NL80211_CHAN_WIDTH_16:
664+
/*
665+
* mac80211 currently only supports sharing identical
666+
* chanctx's for S1G interfaces.
667+
*/
668+
WARN_ON(!ieee80211_chanreq_identical(&ctx_req, chanreq));
669+
return;
659670
case NL80211_CHAN_WIDTH_20_NOHT:
660671
case NL80211_CHAN_WIDTH_20:
661672
case NL80211_CHAN_WIDTH_40:

net/mac80211/mlme.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6108,9 +6108,10 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
61086108
ret = ieee80211_link_use_channel(link, &chanreq,
61096109
IEEE80211_CHANCTX_SHARED);
61106110

6111-
/* don't downgrade for 5 and 10 MHz channels, though. */
6111+
/* don't downgrade for 5/10/S1G MHz channels, though. */
61126112
if (chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
6113-
chanreq.oper.width == NL80211_CHAN_WIDTH_10)
6113+
chanreq.oper.width == NL80211_CHAN_WIDTH_10 ||
6114+
cfg80211_chandef_is_s1g(&chanreq.oper))
61146115
return ret;
61156116

61166117
while (ret && chanreq.oper.width != NL80211_CHAN_WIDTH_20_NOHT) {

0 commit comments

Comments
 (0)