[PATCH 06/10] AP: SMD: Handle SMD authentication and association
Pooventhiran G
pooventhiran.g at oss.qualcomm.com
Sat Nov 21 12:34:15 PST 2026
Non-AP MLDs advertise SMD support by setting the bit-37 in the Extended
RSN Capabilities field. Handle authentication and association to
negotiate SMD and add station to the driver upon successful association.
Based on whether assoc frame encryption is enabled or not, add the SMD
Information element in the encrypted (Re)Association Response for the
non-AP MLD to validate and accept association.
Co-developed-by: Rohan Dutta <drohan at qti.qualcomm.com>
Signed-off-by: Rohan Dutta <drohan at qti.qualcomm.com>
Co-developed-by: Sidhanta Sahu <sidhanta.sahu at oss.qualcomm.com>
Signed-off-by: Sidhanta Sahu <sidhanta.sahu at oss.qualcomm.com>
Signed-off-by: Pooventhiran G <pooventhiran.g at oss.qualcomm.com>
---
src/ap/ap_drv_ops.c | 13 ++++--
src/ap/ap_drv_ops.h | 4 +-
src/ap/ieee802_11.c | 77 +++++++++++++++++++++++++++++++++++-
src/ap/ieee802_11.h | 3 ++
src/ap/ieee802_11_eht.c | 6 +--
src/ap/sta_info.c | 10 ++++-
src/ap/sta_info.h | 21 ++++++++++
src/ap/wpa_auth.c | 44 +++++++++++++++++++++
src/ap/wpa_auth.h | 12 ++++++
src/ap/wpa_auth_glue.c | 14 +++++++
src/ap/wpa_auth_i.h | 3 ++
src/drivers/driver.h | 2 +
src/drivers/driver_nl80211.c | 15 ++++++-
13 files changed, 209 insertions(+), 15 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 4a62a78fce89..b59a356e0830 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -27,7 +27,7 @@
#include "ap_drv_ops.h"
-u32 hostapd_sta_flags_to_drv(u32 flags)
+u32 hostapd_sta_flags_to_drv(u64 flags)
{
int res = 0;
if (flags & WLAN_STA_AUTHORIZED)
@@ -44,6 +44,8 @@ u32 hostapd_sta_flags_to_drv(u32 flags)
res |= WPA_STA_ASSOCIATED;
if (flags & WLAN_STA_SPP_AMSDU)
res |= WPA_STA_SPP_AMSDU;
+ if (flags & WLAN_STA_SMD)
+ res |= WPA_STA_SMD;
return res;
}
@@ -342,7 +344,7 @@ int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta)
int set_flags, total_flags, flags_and, flags_or;
total_flags = hostapd_sta_flags_to_drv(sta->flags);
set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP |
- WPA_STA_AUTHORIZED;
+ WPA_STA_AUTHORIZED | WPA_STA_SMD;
/*
* All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant
@@ -493,7 +495,6 @@ int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
reassoc, status, ie, len);
}
-
int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *addr, u16 aid, u16 capability,
const u8 *supp_rates, size_t supp_rates_len,
@@ -509,7 +510,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
int set, const u8 *link_addr, bool mld_link_sta,
- u16 eml_cap, bool epp_sta)
+ u16 eml_cap, bool epp_sta, bool smd_sta)
{
struct hostapd_sta_add_params params;
@@ -560,6 +561,10 @@ int hostapd_sta_add(struct hostapd_data *hapd,
}
#endif /* CONFIG_IEEE80211BE */
+#ifdef CONFIG_IEEE80211BN
+ params.smd_sta = smd_sta;
+#endif /* CONFIG_IEEE80211BN */
+
return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index cd86fb762315..b5b447e9afbd 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -16,7 +16,7 @@ struct ieee80211_ht_capabilities;
struct ieee80211_vht_capabilities;
struct hostapd_freq_params;
-u32 hostapd_sta_flags_to_drv(u32 flags);
+u32 hostapd_sta_flags_to_drv(u64 flags);
int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
struct wpabuf **beacon,
struct wpabuf **proberesp,
@@ -52,7 +52,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
int set, const u8 *link_addr, bool mld_link_sta,
- u16 eml_cap, bool epp_sta);
+ u16 eml_cap, bool epp_sta, bool smd_sta);
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 6b1bb0cf0494..9d35c2e393b3 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -478,6 +478,12 @@ static u16 validate_security_profile(
return WLAN_STATUS_SUCCESS;
if (!elems->security_profile) {
+ /* SMD association requires Security Profile */
+ if (ap_sta_is_smd(hapd, sta)) {
+ wpa_printf(MSG_INFO,
+ "STA requested SMD but no Security Profile - rejecting");
+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ }
/* No Security Profile element present - validation not needed
*/
return WLAN_STATUS_SUCCESS;
@@ -5887,6 +5893,38 @@ static void handle_auth(struct hostapd_data *hapd,
sta->auth_rssi = rssi;
#endif /* CONFIG_MBO */
+#ifdef CONFIG_IEEE80211BN
+ if (auth_transaction == 1) {
+ const u8 *pos;
+ size_t ies_len;
+ size_t auth_offset =
+ offsetof(struct ieee80211_mgmt, u.auth.variable);
+
+ /* SMD association expects EPPKE Security Profiles [and
+ * PQC Security Profiles]
+ */
+ pos = auth_skip_fixed_fields(hapd, mgmt, len - auth_offset);
+ if (pos && hapd->conf->smd.enabled) {
+ const u8 *rsnxe;
+
+ ies_len = len - (pos - mgmt->u.auth.variable);
+ rsnxe = get_ie(pos, ies_len, WLAN_EID_RSNX);
+ if (ieee802_11_rsnx_capab(rsnxe, WLAN_RSNX_CAPAB_SMD)) {
+ if (!ap_sta_is_mld(hapd, sta)) {
+ wpa_printf(MSG_ERROR, "SMD: STA " MACSTR "not an MLD",
+ MAC2STR(sta->addr));
+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
+ goto fail;
+ }
+
+ wpa_printf(MSG_DEBUG, "SMD: Mark STA as SMD in auth");
+ sta->smd_info.smd_sta = true;
+ sta->flags |= WLAN_STA_SMD;
+ }
+ }
+ }
+#endif /* CONFIG_IEEE80211BN */
+
res = ieee802_11_set_radius_info(hapd, sta, res, &rad_info);
if (res) {
wpa_printf(MSG_DEBUG, "ieee802_11_set_radius_info() failed");
@@ -7742,6 +7780,11 @@ omit_rsnxe:
if (hostapd_is_uhr_enabled(hapd)) {
p = hostapd_eid_uhr_capab(hapd, p, IEEE80211_MODE_AP);
p = hostapd_eid_uhr_operation(hapd, p, false);
+ if (ap_sta_is_smd(hapd, sta) &&
+ wpa_auth_assoc_smd_info(sta->wpa_sm)) {
+ wpa_printf(MSG_DEBUG, "SMD: SMD Information in assoc");
+ p = hostapd_eid_smd_info(hapd, p);
+ }
}
#endif /* CONFIG_IEEE80211BN */
@@ -7826,6 +7869,9 @@ int ieee80211_ml_process_link(struct hostapd_data *hapd,
#ifdef CONFIG_ENC_ASSOC
sta->epp_sta = origin_sta->epp_sta;
#endif /* CONFIG_ENC_ASSOC */
+#ifdef CONFIG_IEEE80211BN
+ os_memcpy(&sta->smd_info, &origin_sta->smd_info, sizeof(sta->smd_info));
+#endif /* CONFIG_IEEE80211BN */
status = __check_assoc_ies(hapd, sta, NULL, 0, &elems, type,
origin_sta->wpa_sm);
@@ -8021,13 +8067,17 @@ static int add_associated_sta(struct hostapd_data *hapd,
struct ieee80211_uhr_capabilities uhr_cap;
int set = 1;
const u8 *mld_link_addr = NULL;
- bool mld_link_sta = false, epp_sta = false;
+ bool mld_link_sta = false, epp_sta = false, smd_sta = false;
u16 eml_cap = 0;
#ifdef CONFIG_ENC_ASSOC
epp_sta = sta->epp_sta;
#endif /* CONFIG_ENC_ASSOC */
+#ifdef CONFIG_IEEE80211BN
+ smd_sta = sta->smd_info.smd_sta;
+#endif /* CONFIG_IEEE80211BN */
+
#ifdef CONFIG_IEEE80211BE
if (ap_sta_is_mld(hapd, sta)) {
u8 mld_link_id = hapd->mld_link_id;
@@ -8126,7 +8176,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
sta->vht_opmode, sta->p2p_ie ? 1 : 0,
set, mld_link_addr, mld_link_sta, eml_cap,
- epp_sta)) {
+ epp_sta, smd_sta)) {
hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
"Could not %s STA to kernel driver",
@@ -8191,6 +8241,9 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
if (hostapd_is_uhr_enabled(hapd)) {
buflen += hostapd_eid_uhr_capab_len(hapd, IEEE80211_MODE_AP);
buflen += 3 + IEEE80211_UHR_OPER_MAX_SIZE;
+ if (ap_sta_is_smd(hapd, sta) &&
+ wpa_auth_assoc_smd_info(sta->wpa_sm))
+ buflen += hostapd_eid_smd_info_len(hapd);
}
#endif /* CONFIG_IEEE80211BN */
@@ -8370,6 +8423,11 @@ rsnxe_done:
if (hostapd_is_uhr_enabled(hapd)) {
p = hostapd_eid_uhr_capab(hapd, p, IEEE80211_MODE_AP);
p = hostapd_eid_uhr_operation(hapd, p, false);
+ if (ap_sta_is_smd(hapd, sta) &&
+ wpa_auth_assoc_smd_info(sta->wpa_sm)) {
+ wpa_printf(MSG_DEBUG, "SMD: SMD Information in assoc");
+ p = hostapd_eid_smd_info(hapd, p);
+ }
}
#endif /* CONFIG_IEEE80211BN */
@@ -9054,6 +9112,21 @@ static void handle_assoc(struct hostapd_data *hapd,
if (hapd->conf->rsn_override_omit_rsnxe)
omit_rsnxe = 1;
+#ifdef CONFIG_IEEE80211BN
+ if (ap_sta_is_smd(hapd, sta)) {
+ const u8 *rsnxe = get_ie(pos, left, WLAN_EID_RSNX);
+
+ if (!ieee802_11_rsnx_capab(rsnxe, WLAN_RSNX_CAPAB_SMD)) {
+ wpa_printf(MSG_ERROR,
+ "STA " MACSTR " disabled SMD in assoc req",
+ MAC2STR(sta->addr));
+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
+ goto fail;
+ }
+ wpa_auth_set_smd(sta->wpa_sm);
+ }
+#endif /* CONFIG_IEEE80211BN */
+
if (hostapd_get_aid(hapd, sta) < 0) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "No room for more AIDs");
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index 5127c423a658..645e6b5230de 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -356,4 +356,7 @@ void hostapd_get_uhr_capab(struct hostapd_data *hapd,
size_t hostapd_eid_smd_info_len(struct hostapd_data *hapd);
u8 * hostapd_eid_smd_info(struct hostapd_data *hapd, u8 *eid);
+const u8 * auth_skip_fixed_fields(struct hostapd_data *hapd,
+ const struct ieee80211_mgmt *mgmt,
+ size_t len);
#endif /* IEEE802_11_H */
diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index 052ce030a05a..40ff320b735b 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -1099,9 +1099,9 @@ sae_confirm_skip_fixed_fields(struct hostapd_data *hapd,
#endif /* CONFIG_SAE */
-static const u8 * auth_skip_fixed_fields(struct hostapd_data *hapd,
- const struct ieee80211_mgmt *mgmt,
- size_t len)
+const u8 * auth_skip_fixed_fields(struct hostapd_data *hapd,
+ const struct ieee80211_mgmt *mgmt,
+ size_t len)
{
u16 auth_alg = le_to_host16(mgmt->u.auth.auth_alg);
#if defined(CONFIG_SAE) || defined(CONFIG_IEEE8021X_AUTH)
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 1e8ef1b4f870..0d9d57a6a429 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -2122,12 +2122,17 @@ static void ap_sta_remove_link_sta(struct hostapd_data *hapd,
int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
{
const u8 *mld_link_addr = NULL;
- bool mld_link_sta = false, epp_sta = false;
+ bool mld_link_sta = false, epp_sta = false, smd_sta = false;
u16 eml_cap = 0;
#ifdef CONFIG_ENC_ASSOC
epp_sta = sta->epp_sta;
#endif /* CONFIG_ENC_ASSOC */
+
+#ifdef CONFIG_IEEE80211BN
+ smd_sta = sta->smd_info.smd_sta;
+#endif /* CONFIG_IEEE80211BN */
+
/*
* If a station that is already associated to the AP, is trying to
* authenticate again, remove the STA entry, in order to make sure the
@@ -2161,7 +2166,8 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
sta->supported_rates_len,
0, NULL, NULL, NULL, 0, NULL, 0, NULL, 0, NULL,
sta->flags, 0, 0, 0, 0,
- mld_link_addr, mld_link_sta, eml_cap, epp_sta)) {
+ mld_link_addr, mld_link_sta, eml_cap, epp_sta,
+ smd_sta)) {
hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE,
diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
index 8e2a7d11aec8..c2292c3fb4d5 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -50,6 +50,7 @@
#define WLAN_STA_PENDING_DEAUTH_CB BIT_ULL(30)
#define WLAN_STA_NONERP BIT_ULL(31)
#define WLAN_STA_UHR BIT_ULL(32)
+#define WLAN_STA_SMD BIT_ULL(33)
/* Maximum number of supported rates (from both Supported Rates and Extended
* Supported Rates IEs). */
@@ -108,6 +109,13 @@ struct dscp_policy_state {
bool pending_more;
};
+#ifdef CONFIG_IEEE80211BN
+struct smd_info {
+ bool smd_sta;
+ // TODO: to be extended for ST
+};
+#endif /* CONFIG_IEEE80211BN */
+
struct sta_info {
struct sta_info *next; /* next entry in sta list */
struct sta_info *hnext; /* next entry in hash table list */
@@ -375,6 +383,9 @@ struct sta_info {
u8 unsolicited_dialog_token;
struct dscp_policy_state dscp_state;
#endif /* CONFIG_ROBUST_AV */
+#ifdef CONFIG_IEEE80211BN
+ struct smd_info smd_info;
+#endif /* CONFIG_IEEE80211BN */
};
@@ -517,4 +528,14 @@ static inline bool ap_sta_support_enc_assoc(struct hostapd_data *hapd,
return false;
#endif /* CONFIG_ENC_ASSOC */
}
+
+static inline bool ap_sta_is_smd(struct hostapd_data *hapd,
+ struct sta_info *sta)
+{
+#ifdef CONFIG_IEEE80211BN
+ return hapd->conf->smd.enabled && sta && sta->smd_info.smd_sta;
+#else /* CONFIG_IEEE80211BN */
+ return false;
+#endif /* CONFIG_IEEE80211BN */
+}
#endif /* STA_INFO_H */
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 2c8c7432baa6..a6795904440d 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -1258,6 +1258,11 @@ void wpa_auth_sta_deinit(struct wpa_state_machine *sm)
#ifdef CONFIG_IEEE80211R_AP
wpa_ft_sta_deinit(sm);
#endif /* CONFIG_IEEE80211R_AP */
+
+#ifdef CONFIG_IEEE80211BN
+ sm->smd = false;
+#endif /* CONFIG_IEEE80211BN */
+
if (sm->in_step_loop) {
/* Must not free state machine while wpa_sm_step() is running.
* Freeing will be completed in the end of wpa_sm_step(). */
@@ -5029,6 +5034,17 @@ fail:
}
#endif /* CONFIG_SAE */
+#ifdef CONFIG_IEEE80211BN
+bool wpa_auth_assoc_smd_info(struct wpa_state_machine *sm)
+{
+ return sm->smd && sm->epp && wpa_auth_ap_sta_support_assoc_enc(sm);
+}
+
+static bool wpa_auth_m3_smd_info(struct wpa_state_machine *sm)
+{
+ return sm->smd && (!sm->epp || !wpa_auth_ap_sta_support_assoc_enc(sm));
+}
+#endif /* CONFIG_IEEE80211BN */
SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
{
@@ -5267,6 +5283,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
if (sm->security_profile)
kde_len += conf->security_profile_len;
+#ifdef CONFIG_IEEE80211BN
+ if (wpa_auth_m3_smd_info(sm))
+ kde_len += conf->smd_info_len;
+#endif /* CONFIG_IEEE80211BN */
+
kde = os_malloc(kde_len);
if (!kde)
goto done;
@@ -5430,6 +5451,16 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
pos += conf->security_profile_len;
}
+#ifdef CONFIG_IEEE80211BN
+ if (wpa_auth_m3_smd_info(sm)) {
+ wpa_hexdump(MSG_DEBUG,
+ "SMD: SMD Information in M3",
+ conf->smd_info, conf->smd_info_len);
+ os_memcpy(pos, conf->smd_info, conf->smd_info_len);
+ pos += conf->smd_info_len;
+ }
+#endif /* CONFIG_IEEE80211BN */
+
wpa_send_eapol(sm->wpa_auth, sm,
(secure ? WPA_KEY_INFO_SECURE : 0) |
(wpa_mic_len(sm->wpa_key_mgmt, sm->pmk_len,
@@ -8409,4 +8440,17 @@ bool wpa_auth_ap_support_secure_ltf(struct wpa_authenticator *wpa_auth)
{
return wpa_auth->conf.secure_ltf;
}
+
+void wpa_auth_set_smd(struct wpa_state_machine *sm)
+{
+#ifdef CONFIG_IEEE80211BN
+ wpa_auth_logger(sm->wpa_auth, wpa_auth_get_spa(sm), LOGGER_DEBUG,
+ "SMD: Initialization");
+
+ sm->smd = true;
+ wpa_printf(MSG_DEBUG, "WPA_AUTH: SMD: peer=" MACSTR,
+ MAC2STR(sm->addr));
+#endif /* CONFIG_IEEE80211BN */
+}
+
#endif /* CONFIG_IEEE8021X_AUTH */
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index 25ffae8f52d6..cc40f1336e07 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -342,6 +342,13 @@ struct wpa_auth_config {
u8 security_profile[257];
size_t security_profile_len;
bool pqc_enabled;
+
+#ifdef CONFIG_IEEE80211BN
+ const u8 *smd_identifier;
+ int smd_ptk_mode;
+ u8 smd_info[257];
+ size_t smd_info_len;
+#endif /* CONFIG_IEEE80211BN */
};
typedef enum {
@@ -779,4 +786,9 @@ int wpa_write_eppke_rsne(const u8 *wpa_ie, size_t wpa_ie_len,
const u8 *pmkid, int akmp,
int pairwise_cipher, enum mfp_options mfp);
+#ifdef CONFIG_IEEE80211BN
+void wpa_auth_set_smd(struct wpa_state_machine *sm);
+bool wpa_auth_assoc_smd_info(struct wpa_state_machine *sm);
+#endif /* CONFIG_IEEE80211BN */
+
#endif /* WPA_AUTH_H */
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index 9da2e6d2069a..7c401611c679 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -112,6 +112,13 @@ static void hostapd_wpa_auth_config_update(struct hostapd_data *hapd,
pos = hostapd_eid_security_profile(hapd, _conf->security_profile);
_conf->security_profile_len = pos - _conf->security_profile;
_conf->pqc_enabled = hostapd_pqc_enabled(hapd->conf);
+
+#ifdef CONFIG_IEEE80211BN
+ if (_conf->smd_identifier) {
+ pos = hostapd_eid_smd_info(hapd, _conf->smd_info);
+ _conf->smd_info_len = pos - _conf->smd_info;
+ }
+#endif /* CONFIG_IEEE80211BN */
}
static void hostapd_wpa_auth_conf(struct hostapd_iface *iface,
@@ -371,6 +378,13 @@ static void hostapd_wpa_auth_conf(struct hostapd_iface *iface,
wpabuf_head(conf->sae_pw_id_key),
wpabuf_len(conf->sae_pw_id_key));
}
+
+#ifdef CONFIG_IEEE80211BN
+ if (conf->smd.enabled) {
+ wconf->smd_identifier = conf->smd.identifier;
+ wconf->smd_ptk_mode = conf->smd.capab.ptk_mode;
+ }
+#endif /* CONFIG_IEEE80211BN */
}
diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
index b80e9bd459ee..9892265b457a 100644
--- a/src/ap/wpa_auth_i.h
+++ b/src/ap/wpa_auth_i.h
@@ -100,6 +100,9 @@ struct wpa_state_machine {
unsigned int pmkid_set:1;
unsigned int spp_amsdu:1;
unsigned int epp:1;
+#ifdef CONFIG_IEEE80211BN
+ unsigned int smd:1;
+#endif /* CONFIG_IEEE80211BN */
unsigned int ptkstart_without_success;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index c8b4f3f327c0..a96bf9dbd8db 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2933,6 +2933,7 @@ struct hostapd_sta_add_params {
*/
const u8 *nmi_addr;
#endif /* CONFIG_NAN */
+ bool smd_sta;
};
struct mac_address {
@@ -2981,6 +2982,7 @@ struct wpa_bss_params {
#define WPA_STA_AUTHENTICATED BIT(5)
#define WPA_STA_ASSOCIATED BIT(6)
#define WPA_STA_SPP_AMSDU BIT(7)
+#define WPA_STA_SMD BIT(8)
enum tdls_oper {
TDLS_DISCOVERY_REQ,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 9dc1dd48d609..55dc56105077 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4622,7 +4622,6 @@ nl80211_put_bss_membership_selectors(struct wpa_driver_nl80211_data *drv,
selectors_len, selectors);
}
-
static int wpa_driver_nl80211_authenticate(
struct i802_bss *bss, struct wpa_driver_auth_params *params)
{
@@ -6257,6 +6256,8 @@ static u32 sta_flags_nl80211(int flags)
f |= BIT(NL80211_STA_FLAG_ASSOCIATED);
if (flags & WPA_STA_SPP_AMSDU)
f |= BIT(NL80211_STA_FLAG_SPP_AMSDU);
+ if (flags & WPA_STA_SMD)
+ f |= BIT(NL80211_STA_FLAG_SMD);
return f;
}
@@ -6643,6 +6644,14 @@ static int wpa_driver_nl80211_sta_add(void *priv,
}
#endif /* CONFIG_NAN */
+#ifdef CONFIG_IEEE80211BN
+ if (params->smd_sta) {
+ wpa_printf(MSG_DEBUG, " * SMD STA");
+ if (nla_put_flag(msg, NL80211_ATTR_SMD_SUPPORT))
+ goto fail;
+ }
+#endif /* CONFIG_IEEE80211BN */
+
ret = send_and_recv_cmd(drv, msg);
msg = NULL;
if (ret)
@@ -7195,7 +7204,9 @@ static int wpa_driver_nl80211_sta_set_flags(void *priv, const u8 *addr,
((total_flags & WPA_STA_MFP) &&
nla_put_flag(msg, NL80211_STA_FLAG_MFP)) ||
((total_flags & WPA_STA_TDLS_PEER) &&
- nla_put_flag(msg, NL80211_STA_FLAG_TDLS_PEER)))
+ nla_put_flag(msg, NL80211_STA_FLAG_TDLS_PEER)) ||
+ ((total_flags & WPA_STA_SMD) &&
+ nla_put_flag(msg, NL80211_STA_FLAG_SMD)))
goto fail;
nla_nest_end(msg, flags);
--
2.34.1
More information about the Hostap
mailing list