wifi: cfg80211: allow setting extended MLD capa/ops

Some extended MLD capabilities and operations bits (currently
the "BTM MLD Recommendataion For Multiple APs Support" bit)
may depend on userspace capabilities. Allow userspace to pass
the values for this field that it supports to the association
and link reconfiguration operations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20250308225541.bd52078b5f65.I4dd8f53b0030db7ea87a2e0920989e7e2c7b5345@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2025-03-08 23:03:28 +02:00
parent a096a8602f
commit 969241371f
4 changed files with 31 additions and 1 deletions

View File

@ -3086,10 +3086,13 @@ struct cfg80211_assoc_link {
* struct cfg80211_ml_reconf_req - MLO link reconfiguration request
* @add_links: data for links to add, see &struct cfg80211_assoc_link
* @rem_links: bitmap of links to remove
* @ext_mld_capa_ops: extended MLD capabilities and operations set by
* userspace for the ML reconfiguration action frame
*/
struct cfg80211_ml_reconf_req {
struct cfg80211_assoc_link add_links[IEEE80211_MLD_MAX_NUM_LINKS];
u16 rem_links;
u16 ext_mld_capa_ops;
};
/**
@ -3164,6 +3167,8 @@ enum cfg80211_assoc_req_flags {
* the link on which the association request should be sent
* @ap_mld_addr: AP MLD address in case of MLO association request,
* valid iff @link_id >= 0
* @ext_mld_capa_ops: extended MLD capabilities and operations set by
* userspace for the association
*/
struct cfg80211_assoc_request {
struct cfg80211_bss *bss;
@ -3184,6 +3189,7 @@ struct cfg80211_assoc_request {
struct cfg80211_assoc_link links[IEEE80211_MLD_MAX_NUM_LINKS];
const u8 *ap_mld_addr;
s8 link_id;
u16 ext_mld_capa_ops;
};
/**

View File

@ -11,7 +11,7 @@
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
* Copyright 2008 Colin McCabe <colin@cozybit.com>
* Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -2893,6 +2893,12 @@ 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.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@ -3448,6 +3454,8 @@ enum nl80211_attrs {
NL80211_ATTR_MLO_RECONF_REM_LINKS,
NL80211_ATTR_EPCS,
NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,

View File

@ -850,6 +850,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 },
};
/* policy for the key attributes */
@ -11373,6 +11374,10 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
err = -EINVAL;
goto free;
}
if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
req.ext_mld_capa_ops =
nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
} else {
if (req.link_id >= 0)
return -EINVAL;
@ -11382,6 +11387,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (IS_ERR(req.bss))
return PTR_ERR(req.bss);
ap_addr = req.bss->bssid;
if (info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS])
return -EINVAL;
}
err = nl80211_crypto_settings(rdev, info, &req.crypto, 1);
@ -16532,6 +16540,10 @@ 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])
req.ext_mld_capa_ops =
nla_get_u16(info->attrs[NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS]);
err = cfg80211_assoc_ml_reconf(rdev, dev, &req);
out:

View File

@ -1378,6 +1378,7 @@ TRACE_EVENT(rdev_assoc,
__dynamic_array(u8, fils_kek, req->fils_kek_len)
__dynamic_array(u8, fils_nonces,
req->fils_nonces ? 2 * FILS_NONCE_LEN : 0)
__field(u16, ext_mld_capa_ops)
),
TP_fast_assign(
WIPHY_ASSIGN;
@ -1404,6 +1405,7 @@ TRACE_EVENT(rdev_assoc,
if (req->fils_nonces)
memcpy(__get_dynamic_array(fils_nonces),
req->fils_nonces, 2 * FILS_NONCE_LEN);
__entry->ext_mld_capa_ops = req->ext_mld_capa_ops;
),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM"
", previous bssid: %pM, use mfp: %s, flags: 0x%x",
@ -4149,6 +4151,7 @@ TRACE_EVENT(rdev_assoc_ml_reconf,
NETDEV_ENTRY
__field(u16, add_links)
__field(u16, rem_links)
__field(u16, ext_mld_capa_ops)
),
TP_fast_assign(
WIPHY_ASSIGN;
@ -4160,6 +4163,7 @@ TRACE_EVENT(rdev_assoc_ml_reconf,
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++)
if (req->add_links[i].bss)
__entry->add_links |= BIT(i);
__entry->ext_mld_capa_ops = req->ext_mld_capa_ops;
),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", add_links=0x%x, rem_links=0x%x",
WIPHY_PR_ARG, NETDEV_PR_ARG,