]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: allow devices to advertise extended MLD capa/ops
authorJohannes Berg <johannes.berg@intel.com>
Tue, 28 Apr 2026 09:06:59 +0000 (11:06 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 5 May 2026 12:49:01 +0000 (14:49 +0200)
For UHR, multi-link power-management capability lives there, and
so it's needed that hostapd knows what to advertise, and clients
should have it shown to userspace for information.

Repurpose the existing NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS by
renaming it to NL80211_ATTR_EXT_MLD_CAPA_AND_OPS (with a define
for compatibility) and advertise the capabilities.

We can also later use the value, if needed, to set per-station
capabilities on STAs added to AP interfaces.

Link: https://patch.msgid.link/20260428110915.e808e70feed6.I378a7c017bfc1ebb072fa8d5d1db2ac9b45596c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 13e035fecf7f16d8eed008fc88e838bd8578c75f..5755aa28891202f292255676cb5d851f1444f9b2 100644 (file)
@@ -5969,6 +5969,7 @@ struct wiphy_vendor_command {
  * @extended_capabilities_len: length of the extended capabilities
  * @eml_capabilities: EML capabilities (for MLO)
  * @mld_capa_and_ops: MLD capabilities and operations (for MLO)
+ * @ext_mld_capa_and_ops: Extended MLD capabilities and operations (for MLO)
  */
 struct wiphy_iftype_ext_capab {
        enum nl80211_iftype iftype;
@@ -5977,6 +5978,7 @@ struct wiphy_iftype_ext_capab {
        u8 extended_capabilities_len;
        u16 eml_capabilities;
        u16 mld_capa_and_ops;
+       u16 ext_mld_capa_and_ops;
 };
 
 /**
index 6c7e6c05b9a873e741821a09a5d10c5d2143a721..235d7ae72e6060c114c0caf90e4c4e1d5de43437 100644 (file)
@@ -3004,11 +3004,13 @@ enum nl80211_commands {
  * @NL80211_ATTR_EPCS: Flag attribute indicating that EPCS is enabled for a
  *     station interface.
  *
- * @NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS: Extended MLD capabilities and
- *     operations that userspace implements to use during association/ML
- *     link reconfig, currently only "BTM MLD Recommendation For Multiple
- *     APs Support". Drivers may set additional flags that they support
- *     in the kernel or device.
+ * @NL80211_ATTR_EXT_MLD_CAPA_AND_OPS: Extended MLD capabilities and operations.
+ *     For association and link reconfiguration, indicates extra capabilities
+ *     that userspace implements, currently only "BTM MLD Recommendation For
+ *     Multiple APs Support".
+ *     For wiphy information, additional flags that drivers will set, but
+ *     this is informational only for userspace (it's not expected to set
+ *     these.)
  *
  * @NL80211_ATTR_WIPHY_RADIO_INDEX: (int) Integer attribute denoting the index
  *     of the radio in interest. Internally a value of -1 is used to
@@ -3715,7 +3717,7 @@ enum nl80211_attrs {
        NL80211_ATTR_MLO_RECONF_REM_LINKS,
        NL80211_ATTR_EPCS,
 
-       NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
+       NL80211_ATTR_EXT_MLD_CAPA_AND_OPS,
 
        NL80211_ATTR_WIPHY_RADIO_INDEX,
 
@@ -3769,6 +3771,7 @@ enum nl80211_attrs {
 #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
 #define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
 #define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
+#define NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS NL80211_ATTR_EXT_MLD_CAPA_AND_OPS
 
 /*
  * Allow user space programs to use #ifdef on new attributes by defining them
index 61b1716daf1ef471f124af1c5f21994730048460..f935b18112e8845cab2c51ffee20682d19b33b9d 100644 (file)
@@ -1061,7 +1061,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
                                       NL80211_MAX_SUPP_SELECTORS),
        [NL80211_ATTR_MLO_RECONF_REM_LINKS] = { .type = NLA_U16 },
        [NL80211_ATTR_EPCS] = { .type = NLA_FLAG },
-       [NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS] = { .type = NLA_U16 },
+       [NL80211_ATTR_EXT_MLD_CAPA_AND_OPS] = { .type = NLA_U16 },
        [NL80211_ATTR_WIPHY_RADIO_INDEX] = { .type = NLA_U8 },
        [NL80211_ATTR_S1G_LONG_BEACON_PERIOD] = NLA_POLICY_MIN(NLA_U8, 2),
        [NL80211_ATTR_S1G_SHORT_BEACON] =
@@ -3596,6 +3596,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
                                                 NL80211_ATTR_MLD_CAPA_AND_OPS,
                                                 capab->mld_capa_and_ops)))
                                        goto nla_put_failure;
+                               if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO &&
+                                   capab->ext_mld_capa_and_ops &&
+                                   nla_put_u16(msg,
+                                               NL80211_ATTR_EXT_MLD_CAPA_AND_OPS,
+                                               capab->ext_mld_capa_and_ops))
+                                       goto nla_put_failure;
 
                                nla_nest_end(msg, nested_ext_capab);
                                if (state->split)
@@ -13059,9 +13065,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
                        goto free;
                }
 
-               if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
+               if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
                        req.ext_mld_capa_ops =
-                               nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
+                               nla_get_u16(info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS]);
        } else {
                if (req.link_id >= 0)
                        return -EINVAL;
@@ -13072,7 +13078,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
                        return PTR_ERR(req.bss);
                ap_addr = req.bss->bssid;
 
-               if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
+               if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
                        return -EINVAL;
        }
 
@@ -19000,9 +19006,9 @@ static int nl80211_assoc_ml_reconf(struct sk_buff *skb, struct genl_info *info)
                goto out;
        }
 
-       if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
+       if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
                req.ext_mld_capa_ops =
-                       nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
+                       nla_get_u16(info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS]);
 
        err = cfg80211_assoc_ml_reconf(rdev, dev, &req);