[PATCH 04/10] AP: SMD: Advertise SMD in Beacon and Probe Response frames
Pooventhiran G
pooventhiran.g at oss.qualcomm.com
Sat Nov 21 12:34:13 PST 2026
From: Rohan Dutta <drohan at qti.qualcomm.com>
Advertise SMD Information element in Beacon and Probe Response frames to
indicate SMD capability. When an AP is part of an SMD, the capability is
also advertised in the Extended RSN Capabilities subfield of the RSN
Extension element or Security Profile element.
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 | 3 ++-
src/ap/beacon.c | 8 +++++-
src/ap/ieee802_11.c | 3 ++-
src/ap/ieee802_11.h | 4 ++-
src/ap/ieee802_11_shared.c | 10 ++++---
src/ap/ieee802_11_uhr.c | 51 ++++++++++++++++++++++++++++++++++++
src/common/ieee802_11_defs.h | 1 +
7 files changed, 73 insertions(+), 7 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index dd2f5c542785..4a62a78fce89 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -133,7 +133,8 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
if (!hapd->conf->rsn_override_omit_rsnxe) {
pos = hostapd_eid_rsnxe(hapd, buf, sizeof(buf),
- hapd->conf->rsnxe_capab_mask);
+ hapd->conf->rsnxe_capab_mask,
+ false);
if (add_buf_data(&assocresp, buf, pos - buf) < 0)
goto fail;
}
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 3d278d244b84..96b8b1385917 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -847,6 +847,7 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
if (hostapd_is_uhr_enabled(hapd)) {
buflen += hostapd_eid_uhr_capab_len(hapd, IEEE80211_MODE_AP);
buflen += 3 + IEEE80211_UHR_OPER_MAX_SIZE;
+ buflen += hostapd_eid_smd_info_len(hapd);
}
#endif /* CONFIG_IEEE80211BN */
@@ -1022,6 +1023,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
if (hostapd_is_uhr_enabled(hapd)) {
pos = hostapd_eid_uhr_capab(hapd, pos, IEEE80211_MODE_AP);
pos = hostapd_eid_uhr_operation(hapd, pos, false);
+ pos = hostapd_eid_smd_info(hapd, pos);
}
#endif /* CONFIG_IEEE80211BN */
pos = hostapd_eid_security_profile(hapd, pos);
@@ -2356,8 +2358,10 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON, true);
#ifdef CONFIG_IEEE80211BN
- if (hostapd_is_uhr_enabled(hapd))
+ if (hostapd_is_uhr_enabled(hapd)) {
tail_len += 3 + sizeof(struct ieee80211_uhr_operation);
+ tail_len += hostapd_eid_smd_info_len(hapd);
+ }
#endif /* CONFIG_IEEE80211BN */
tail_len += hostapd_security_profile_len(hapd);
@@ -2560,6 +2564,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
os_free(params->uhr_oper);
params->uhr_oper = NULL;
}
+
+ tailpos = hostapd_eid_smd_info(hapd, tailpos);
}
#endif /* CONFIG_IEEE80211BN */
tailpos = hostapd_eid_security_profile(hapd, tailpos);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 411ac8733765..0b36bc5c25be 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -8349,7 +8349,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
#endif /* CONFIG_TESTING_OPTIONS */
if (!omit_rsnxe)
p = hostapd_eid_rsnxe(hapd, p, end - p,
- hapd->conf->rsnxe_capab_mask);
+ hapd->conf->rsnxe_capab_mask,
+ false);
#ifdef CONFIG_TESTING_OPTIONS
rsnxe_done:
#endif /* CONFIG_TESTING_OPTIONS */
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index e0c2576a0fff..5127c423a658 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -268,7 +268,7 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
void auth_sae_process_commit(void *eloop_ctx, void *user_ctx);
u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len,
- u64 capab_mask);
+ u64 capab_mask, bool sec_prof);
size_t hostapd_security_profile_len(struct hostapd_data *hapd);
u8 * hostapd_eid_security_profile(struct hostapd_data *hapd, u8 *eid);
u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
@@ -353,5 +353,7 @@ void hostapd_get_uhr_capab(struct hostapd_data *hapd,
const struct ieee80211_uhr_capabilities *src,
struct ieee80211_uhr_capabilities *dest,
size_t len);
+size_t hostapd_eid_smd_info_len(struct hostapd_data *hapd);
+u8 * hostapd_eid_smd_info(struct hostapd_data *hapd, u8 *eid);
#endif /* IEEE802_11_H */
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 45e733d0b12e..01ae2c4a6255 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -1144,7 +1144,7 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len,
- u64 capab_mask)
+ u64 capab_mask, bool sec_prof)
{
u8 *pos = eid;
bool sae_pk = false;
@@ -1207,6 +1207,10 @@ u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len,
if (hapd->conf->eppke_unauth)
capab |= BIT_ULL(WLAN_RSNX_CAPAB_UNAUTH_EPPKE);
#endif /* CONFIG_ENC_ASSOC */
+#ifdef CONFIG_IEEE80211BN
+ if (hapd->conf->smd.enabled && sec_prof)
+ capab |= BIT_ULL(WLAN_RSNX_CAPAB_SMD);
+#endif /* CONFIG_IEEE80211BN */
capab &= capab_mask;
@@ -1273,7 +1277,7 @@ size_t hostapd_security_profile_len(struct hostapd_data *hapd)
bitmap_len = max_profile / 8 + 1;
rsnxe_end = hostapd_eid_rsnxe(hapd, rsnxe_buf, sizeof(rsnxe_buf),
- ~0ULL);
+ ~0ULL, true);
if (rsnxe_end > rsnxe_buf + 2)
ext_rsn_capab_len = rsnxe_end - rsnxe_buf - 2;
@@ -1343,7 +1347,7 @@ u8 * hostapd_eid_security_profile(struct hostapd_data *hapd, u8 *eid)
}
rsnxe_end = hostapd_eid_rsnxe(hapd, rsnxe_buf, sizeof(rsnxe_buf),
- ~0ULL);
+ ~0ULL, true);
if (rsnxe_end > rsnxe_buf + 2) {
ext_rsn_capab_len = rsnxe_end - rsnxe_buf - 2;
if (ext_rsn_capab_len > sizeof(ext_rsn_capab)) {
diff --git a/src/ap/ieee802_11_uhr.c b/src/ap/ieee802_11_uhr.c
index f7af76e8e732..5fb4360e4134 100644
--- a/src/ap/ieee802_11_uhr.c
+++ b/src/ap/ieee802_11_uhr.c
@@ -203,3 +203,54 @@ void hostapd_get_uhr_capab(struct hostapd_data *hapd,
os_memset(dest, 0, sizeof(*dest));
os_memcpy(dest, src, len);
}
+
+size_t hostapd_eid_smd_info_len(struct hostapd_data *hapd)
+{
+ if (!hapd->conf->smd.enabled)
+ return 0;
+
+ return 3 /* ext elem hdr */ + sizeof(struct ieee80211_smd_info);
+}
+
+u8 * hostapd_eid_smd_info(struct hostapd_data *hapd, u8 *eid)
+{
+ struct ieee80211_smd_info *smd_info;
+ u8 *pos = eid;
+
+ if (!hapd->conf->smd.enabled)
+ return eid;
+
+ *pos++ = WLAN_EID_EXTENSION;
+ *pos++ = 1 + sizeof(*smd_info);
+ *pos++ = WLAN_EID_EXT_SMD_INFO;
+
+ smd_info = (void *) pos;
+ os_memset(smd_info, 0, sizeof(*smd_info));
+
+ os_memcpy(smd_info->smd_identifier, hapd->conf->smd.identifier,
+ ETH_ALEN);
+
+ /* SMD Capabilities (1 octet)
+ * b0: DL Data Forwarding
+ * b3:b1: Max Number Of Prepared Target AP MLDs
+ * b4: SMD Type
+ * b5: PTK Mode
+ * b6: Neighboring AP Probing Support
+ * b7: Reserved
+ */
+ if (hapd->conf->smd.capab.dl_data_forward)
+ smd_info->smd_capab |= SMD_CAPAB_DL_DATA_FORWARDING;
+ smd_info->smd_capab |= hapd->conf->smd.capab.max_prep_target_ap_mlds <<
+ SMD_CAPAB_MAX_PREP_TGT_AP_MLD_SHIFT;
+ if (hapd->conf->smd.capab.type)
+ smd_info->smd_capab |= SMD_CAPAB_ONE_MAC_SAP_PER_SMD;
+ if (hapd->conf->smd.capab.ptk_mode)
+ smd_info->smd_capab |= SMD_CAPAB_PER_AP_MLD_PTK_MODE;
+ if (hapd->conf->smd.capab.neighbor_probing)
+ smd_info->smd_capab |= SMD_CAPAB_NEIGHBOR_AP_PROBING;
+
+ smd_info->prep_timeout = hapd->conf->smd.prep_timeout;
+ pos += sizeof(*smd_info);
+
+ return pos;
+}
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 3c30e164c5c3..002a75fa7873 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -667,6 +667,7 @@
#define WLAN_RSNX_CAPAB_PMKSA_CACHING_PRIVACY 29
#define WLAN_RSNX_CAPAB_SAE_PW_ID_CHANGE 34
#define WLAN_RSNX_CAPAB_UNAUTH_EPPKE 36
+#define WLAN_RSNX_CAPAB_SMD 37
/* Security Profile element fields (IEEE P802.11bn/D2.0, 9.4.2.369) */
/* Reduced RSN Capabilities field bits (Figure 9-aa75) */
--
2.34.1
More information about the Hostap
mailing list