[PATCH wireless-next v5 02/19] wifi: nl80211/cfg80211: define interfaces for SMD STA indications

From: Pooventhiran G

Date: Wed Dec 02 2026 - 05:28:51 EST


From: Rohan Dutta <drohan@xxxxxxxxxxxxxxxx>

Define nl80211 and cfg80211 interfaces to support non-AP STA MLD
creation upon SMD negotiation. This helps the drivers to instantiate
workflows to support ST of the STA.

Signed-off-by: Rohan Dutta <drohan@xxxxxxxxxxxxxxxx>
Signed-off-by: Sidhanta Sahu <sidhanta.sahu@xxxxxxxxxxxxxxxx>
Signed-off-by: Pooventhiran G <pooventhiran.g@xxxxxxxxxxxxxxxx>
---
include/net/cfg80211.h | 2 ++
include/uapi/linux/nl80211.h | 8 ++++++++
net/wireless/nl80211.c | 7 +++++++
3 files changed, 17 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c166f97dcf81..c17b6e128394 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1920,6 +1920,7 @@ struct cfg80211_ttlm_params {
* @link_sta_params: link related params.
* @epp_peer: EPP peer indication
* @nmi_mac: MAC address of the NMI station of the NAN peer
+ * @smd_sta: station has negotiated SMD
*/
struct station_parameters {
struct net_device *vlan;
@@ -1948,6 +1949,7 @@ struct station_parameters {
struct link_station_parameters link_sta_params;
bool epp_peer;
const u8 *nmi_mac;
+ bool smd_sta;
};

/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 2e4b08c41587..ed64aeb13ed2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -415,6 +415,9 @@
*
* Drivers can indicate userspace about the support for SMD (and ST) by setting
* %NL80211_EXT_FEATURE_SMD_SUPPORT.
+ *
+ * Userspace indicate that the non-AP MLD has negotiated SMD with the AP MLD
+ * by setting %NL80211_ATTR_SMD in %NL80211_CMD_NEW_STATION.
*/

/**
@@ -3355,6 +3358,9 @@ enum nl80211_commands {
* @NL80211_ATTR_ASSOC_PROTECTED_TWT: Enable protected TWT for the association,
* requires protected TWT support (flag attribute)
*
+ * @NL80211_ATTR_SMD: Flag attribute to indicate that the station has negotiated
+ * SMD.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3962,6 +3968,8 @@ enum nl80211_attrs {

NL80211_ATTR_ASSOC_PROTECTED_TWT,

+ NL80211_ATTR_SMD,
+
/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8a5c9dd9d0db..003e7dae87f9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1220,6 +1220,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_ASSOC_CIP] = { .type = NLA_FLAG },
[NL80211_ATTR_CIP_CAPABILITIES] = { .type = NLA_U8 },
[NL80211_ATTR_ASSOC_PROTECTED_TWT] = { .type = NLA_FLAG },
+ [NL80211_ATTR_SMD] = { .type = NLA_FLAG },
};

/* policy for the key attributes */
@@ -10216,6 +10217,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
params.epp_peer =
nla_get_flag(info->attrs[NL80211_ATTR_EPP_PEER]);

+ params.smd_sta = nla_get_flag(info->attrs[NL80211_ATTR_SMD]);
+ if (!wiphy_ext_feature_isset(&rdev->wiphy,
+ NL80211_EXT_FEATURE_SMD_SUPPORT) &&
+ params.smd_sta)
+ return -EINVAL;
+
err = rdev_add_station(rdev, wdev, mac_addr, &params);
dev_put(params.vlan);
return err;

--
2.34.1