wifi: nl80211: add EML/MLD capabilities to per-iftype capabilities
authorJohannes Berg <johannes.berg@intel.com>
Mon, 4 Jul 2022 13:02:33 +0000 (15:02 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:19 +0000 (11:43 +0200)
We have the per-interface type capabilities, currently for
extended capabilities, add the EML/MLD capabilities there
to have this advertised by the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index f9ea49e671641b4c7d38ff415a1ba7d4b5d43ef9..bc960646973b1d8dca4d3b031a8068675b09256b 100644 (file)
@@ -4993,12 +4993,16 @@ struct wiphy_vendor_command {
  *     802.11-2012 8.4.2.29 for the defined fields.
  * @extended_capabilities_mask: mask of the valid values
  * @extended_capabilities_len: length of the extended capabilities
+ * @eml_capabilities: EML capabilities (for MLO)
+ * @mld_capa_and_ops: MLD capabilities and operations (for MLO)
  */
 struct wiphy_iftype_ext_capab {
        enum nl80211_iftype iftype;
        const u8 *extended_capabilities;
        const u8 *extended_capabilities_mask;
        u8 extended_capabilities_len;
+       u16 eml_capabilities;
+       u16 mld_capa_and_ops;
 };
 
 /**
index 37bfc934325ab1af78e8b18252fab856cf942dcf..3fa586e38f88965da320a74bd599bc98bb1c1075 100644 (file)
@@ -2368,8 +2368,10 @@ enum nl80211_commands {
  *
  * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
  *     %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
- *     %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
- *     interface type.
+ *     %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
+ *     other interface-type specific capabilities per interface type. For MLO,
+ *     %NL80211_ATTR_EML_CAPABILITY and %NL80211_ATTR_MLD_CAPA_AND_OPS are
+ *     present.
  *
  * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
  *     groupID for monitor mode.
@@ -2709,6 +2711,9 @@ enum nl80211_commands {
  *     suites allowed as %NL80211_MAX_NR_AKM_SUITES which is the legacy maximum
  *     number prior to the introduction of this attribute.
  *
+ * @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
+ * @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3231,6 +3236,9 @@ enum nl80211_attrs {
 
        NL80211_ATTR_MAX_NUM_AKM_SUITES,
 
+       NL80211_ATTR_EML_CAPABILITY,
+       NL80211_ATTR_MLD_CAPA_AND_OPS,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
index 37ec8b3897b47d7a7c9222c116449f899bf1e3e6..35fb2b0517d9514e2b88a0c5d9fddc7316dfcb7e 100644 (file)
@@ -2867,6 +2867,15 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
                                            capab->extended_capabilities_mask))
                                        goto nla_put_failure;
 
+                               if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO &&
+                                   (nla_put_u16(msg,
+                                                NL80211_ATTR_EML_CAPABILITY,
+                                                capab->eml_capabilities) ||
+                                    nla_put_u16(msg,
+                                                NL80211_ATTR_MLD_CAPA_AND_OPS,
+                                                capab->mld_capa_and_ops)))
+                                       goto nla_put_failure;
+
                                nla_nest_end(msg, nested_ext_capab);
                                if (state->split)
                                        break;