From c8189e0929509c743e104de9cec236d2af5fa5e3 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 30 Sep 2026 12:05:18 +0300 Subject: [PATCH] wifi: mac80211: set SP in reg connectivity with any channel The regulatory connectivity element is informational and for debug, per spec, but that didn't stop some situations/tests from requiring certain bits to be set, notably the SP bit to be set if any channel is available for AFC client behaviour, even if that seems to reduce the utility of the bit. Set the bit accordingly by initialising the flags to NO_AFC and then masking for all enabled channels. Signed-off-by: Johannes Berg Reviewed-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20260930120507.2ba7e2905019.I6d589cf60434ba9d3e007fe4537c8c8e2aeb7415@changeid Signed-off-by: Johannes Berg --- net/mac80211/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 9e1749d2e427..44feb80274c6 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2731,13 +2731,13 @@ int ieee80211_put_he_cap(struct sk_buff *skb, void ieee80211_put_reg_conn(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) { + u32 flags = IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT; struct ieee80211_local *local = sdata->local; u8 reg_conn = IEEE80211_REG_CONN_LPI_VALID | IEEE80211_REG_CONN_LPI_VALUE | IEEE80211_REG_CONN_SP_VALID; struct ieee80211_supported_band *sband; bool available_channels = false; - u32 flags = 0; int i; sband = local->hw.wiphy->bands[NL80211_BAND_6GHZ]; @@ -2747,7 +2747,7 @@ void ieee80211_put_reg_conn(struct ieee80211_sub_if_data *sdata, for (i = 0; i < sband->n_channels; i++) { if (sband->channels[i].flags & IEEE80211_CHAN_DISABLED) continue; - flags |= sband->channels[i].flags; + flags &= sband->channels[i].flags; available_channels = true; }