]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: don't recalc min def for S1G chan ctx
authorLachlan Hodges <lachlan.hodges@morsemicro.com>
Wed, 6 May 2026 13:19:25 +0000 (23:19 +1000)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 20 May 2026 09:58:07 +0000 (11:58 +0200)
__ieee80211_recalc_chanctx_min_def() currently does not attempt
to find the min def for S1G widths, meaning the BW will never change.
However, the following call into ieee80211_chan_bw_change() will
lead to a WARN within ieee80211_chan_width_to_rx_bw(). Not only that,
this entire path is geared towards 20MHz based channels, so it doesn't
make sense anyway. For now, return early when calculating the mindef
for S1G channels.

Fixes: d879d4da4579 ("wifi: mac80211: clean up initial STA NSS/bandwidth handling")
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Link: https://patch.msgid.link/20260506131925.2088353-3-lachlan.hodges@morsemicro.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/chan.c

index b9d563f927daa3da28e38b1f5c83bce991367d86..c64a991319549b1d0e1dcb50da326467d75546ef 100644 (file)
@@ -751,8 +751,14 @@ _ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
                                  struct ieee80211_link_data *rsvd_for,
                                  bool check_reserved)
 {
-       u32 changed = __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for,
-                                                        check_reserved);
+       u32 changed;
+
+       /* No recalc for S1G chan ctx's */
+       if (cfg80211_chandef_is_s1g(&ctx->conf.def))
+               return;
+
+       changed = __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for,
+                                                    check_reserved);
 
        /* check is BW narrowed */
        ieee80211_chan_bw_change(local, ctx, false, true);