]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: include S1G_NO_PRIMARY flag when sending channel
authorLachlan Hodges <lachlan.hodges@morsemicro.com>
Fri, 9 Jan 2026 08:14:39 +0000 (19:14 +1100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 12 Jan 2026 18:47:35 +0000 (19:47 +0100)
When sending a channel ensure we include the IEEE80211_CHAN_S1G_NO_PRIMARY
flag.

Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Link: https://patch.msgid.link/20260109081439.3168-1-lachlan.hodges@morsemicro.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 8134f10e4e6c02d48a9089d6c8c8be52f73881a5..964e1c779cdd3a5bba3c9367bc5382d47ea5f8cd 100644 (file)
@@ -4444,6 +4444,9 @@ enum nl80211_wmm_rule {
  *     channel in current regulatory domain.
  * @NL80211_FREQUENCY_ATTR_NO_16MHZ: 16 MHz operation is not allowed on this
  *     channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY: Channel is not permitted for use
+ *     as a primary channel. Does not prevent the channel from existing
+ *     as a non-primary subchannel. Only applicable to S1G channels.
  * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
  *     currently defined
  * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -4492,6 +4495,7 @@ enum nl80211_frequency_attr {
        NL80211_FREQUENCY_ATTR_NO_4MHZ,
        NL80211_FREQUENCY_ATTR_NO_8MHZ,
        NL80211_FREQUENCY_ATTR_NO_16MHZ,
+       NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY,
 
        /* keep last */
        __NL80211_FREQUENCY_ATTR_AFTER_LAST,
index c961cd42a8325b84e09879aad13a88d4cb07255d..225580507a4b9068b8bfe00544b151578bc5dc77 100644 (file)
@@ -1314,6 +1314,9 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy,
                if ((chan->flags & IEEE80211_CHAN_NO_16MHZ) &&
                    nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_16MHZ))
                        goto nla_put_failure;
+               if ((chan->flags & IEEE80211_CHAN_S1G_NO_PRIMARY) &&
+                   nla_put_flag(msg, NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY))
+                       goto nla_put_failure;
        }
 
        if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,