History

wifi: cfg80211: allow devices to advertise extended MLD capa/ops

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.

Johannes Berg committed 6 months ago

Commit fb19b4d1 parent 793ccb73 files · +23 −12Browse files

Unified · Split

3 files
  1. include/net/cfg80211.h +2 −0
  2. include/uapi/linux/nl80211.h +9 −6
  3. net/wireless/nl80211.c +12 −6
include/net/cfg80211.h+2−0
@@ -5969,6 +5969,7 @@ struct wiphy_vendor_command { · 5968 unmodified lines
59695969 * @extended_capabilities_len: length of the extended capabilities
59705970 * @eml_capabilities: EML capabilities (for MLO)
59715971 * @mld_capa_and_ops: MLD capabilities and operations (for MLO)
5972+ * @ext_mld_capa_and_ops: Extended MLD capabilities and operations (for MLO)
59725973 */
59735974 struct wiphy_iftype_ext_capab {
59745975 enum nl80211_iftype iftype;
@@ -5977,6 +5978,7 @@ struct wiphy_iftype_ext_capab { · 2 unmodified lines
59775978 u8 extended_capabilities_len;
59785979 u16 eml_capabilities;
59795980 u16 mld_capa_and_ops;
5981+ u16 ext_mld_capa_and_ops;
59805982 };
59815983
59825984 /**
include/uapi/linux/nl80211.h+9−6
@@ -3004,11 +3004,13 @@ enum nl80211_commands { · 3003 unmodified lines
30043004 * @NL80211_ATTR_EPCS: Flag attribute indicating that EPCS is enabled for a
30053005 * station interface.
30063006 *
3007− * @NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS: Extended MLD capabilities and
3008− * operations that userspace implements to use during association/ML
3009− * link reconfig, currently only "BTM MLD Recommendation For Multiple
3010− * APs Support". Drivers may set additional flags that they support
3011− * in the kernel or device.
3007+ * @NL80211_ATTR_EXT_MLD_CAPA_AND_OPS: Extended MLD capabilities and operations.
3008+ * For association and link reconfiguration, indicates extra capabilities
3009+ * that userspace implements, currently only "BTM MLD Recommendation For
3010+ * Multiple APs Support".
3011+ * For wiphy information, additional flags that drivers will set, but
3012+ * this is informational only for userspace (it's not expected to set
3013+ * these.)
30123014 *
30133015 * @NL80211_ATTR_WIPHY_RADIO_INDEX: (int) Integer attribute denoting the index
30143016 * of the radio in interest. Internally a value of -1 is used to
@@ -3715,7 +3717,7 @@ enum nl80211_attrs { · 700 unmodified lines
37153717 NL80211_ATTR_MLO_RECONF_REM_LINKS,
37163718 NL80211_ATTR_EPCS,
37173719
3718− NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
3720+ NL80211_ATTR_EXT_MLD_CAPA_AND_OPS,
37193721
37203722 NL80211_ATTR_WIPHY_RADIO_INDEX,
37213723
@@ -3769,6 +3771,7 @@ enum nl80211_attrs { · 47 unmodified lines
37693771 #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
37703772 #define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
37713773 #define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
3774+#define NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS NL80211_ATTR_EXT_MLD_CAPA_AND_OPS
37723775
37733776 /*
37743777 * Allow user space programs to use #ifdef on new attributes by defining them
net/wireless/nl80211.c+12−6
@@ -1061,7 +1061,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 1060 unmodified lines
10611061 NL80211_MAX_SUPP_SELECTORS),
10621062 [NL80211_ATTR_MLO_RECONF_REM_LINKS] = { .type = NLA_U16 },
10631063 [NL80211_ATTR_EPCS] = { .type = NLA_FLAG },
1064− [NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS] = { .type = NLA_U16 },
1064+ [NL80211_ATTR_EXT_MLD_CAPA_AND_OPS] = { .type = NLA_U16 },
10651065 [NL80211_ATTR_WIPHY_RADIO_INDEX] = { .type = NLA_U8 },
10661066 [NL80211_ATTR_S1G_LONG_BEACON_PERIOD] = NLA_POLICY_MIN(NLA_U8, 2),
10671067 [NL80211_ATTR_S1G_SHORT_BEACON] =
@@ -3596,6 +3596,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, · 2528 unmodified lines
35963596 NL80211_ATTR_MLD_CAPA_AND_OPS,
35973597 capab->mld_capa_and_ops)))
35983598 goto nla_put_failure;
3599+ if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO &&
3600+ capab->ext_mld_capa_and_ops &&
3601+ nla_put_u16(msg,
3602+ NL80211_ATTR_EXT_MLD_CAPA_AND_OPS,
3603+ capab->ext_mld_capa_and_ops))
3604+ goto nla_put_failure;
35993605
36003606 nla_nest_end(msg, nested_ext_capab);
36013607 if (state->split)
@@ -13059,9 +13065,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) · 9457 unmodified lines
1305913065 goto free;
1306013066 }
1306113067
13062− if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
13068+ if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
1306313069 req.ext_mld_capa_ops =
13064− nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
13070+ nla_get_u16(info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS]);
1306513071 } else {
1306613072 if (req.link_id >= 0)
1306713073 return -EINVAL;
@@ -13072,7 +13078,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) · 4 unmodified lines
1307213078 return PTR_ERR(req.bss);
1307313079 ap_addr = req.bss->bssid;
1307413080
13075− if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
13081+ if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
1307613082 return -EINVAL;
1307713083 }
1307813084
@@ -19000,9 +19006,9 @@ static int nl80211_assoc_ml_reconf(struct sk_buff *skb, struct genl_info *info) · 5921 unmodified lines
1900019006 goto out;
1900119007 }
1900219008
19003− if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
19009+ if (info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS])
1900419010 req.ext_mld_capa_ops =
19005− nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
19011+ nla_get_u16(info->attrs[NL80211_ATTR_EXT_MLD_CAPA_AND_OPS]);
1900619012
1900719013 err = cfg80211_assoc_ml_reconf(rdev, dev, &req);
1900819014

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t