[PATCH 03/10] hostapd: SMD: Set up AP as part of an SMD

Pooventhiran G pooventhiran.g at oss.qualcomm.com
Sat Nov 21 12:34:12 PST 2026


From: Rohan Dutta <drohan at qti.qualcomm.com>

Add configuration support to set up an AP as part of an SMD. SMD is
defined by the below parameters:
 - SMD Identifier: unique identifier of the SMD
 - SMD Preparation Timeout: Valid duration for a prepared target AP MLD
 - Downlink Data Forwarding: Forwarding support for buffered DL packets
 - Max Number of Peer AP MLDs: Number of target AP MLDs that a non-AP
                               MLD can prepare with
 - SMD Type: Type of SMD
 - SMD PTK Mode: PTK mode used in the SMD
 - Neighbor Probing: UHR Neighboring AP Probing

Start such an AP as SMD enabled in the driver.

Signed-off-by: Rohan Dutta <drohan at qti.qualcomm.com>
Co-developed-by: Pooventhiran G <pooventhiran.g at oss.qualcomm.com>
Signed-off-by: Pooventhiran G <pooventhiran.g at oss.qualcomm.com>
---
 hostapd/config_file.c        | 60 +++++++++++++++++++++++++++++++++++
 hostapd/hostapd.conf         | 49 +++++++++++++++++++++++++++++
 src/ap/ap_config.h           | 15 +++++++++
 src/ap/beacon.c              |  4 +++
 src/ap/hostapd.c             | 61 ++++++++++++++++++++++++++++++++++++
 src/drivers/driver.h         |  5 +++
 src/drivers/driver_nl80211.c |  4 +++
 7 files changed, 198 insertions(+)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 396d145b5e8c..e1b67213d746 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -5305,6 +5305,66 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 	} else if (os_strcmp(buf, "enable_dscp_policy_capa") == 0) {
 		bss->enable_dscp_policy_capa = atoi(pos);
 #endif /* CONFIG_ROBUST_AV */
+#ifdef CONFIG_IEEE80211BN
+	} else if (os_strcmp(buf, "smd_ap") == 0) {
+		bss->smd.enabled = !!atoi(pos);
+	} else if (os_strcmp(buf, "smd_identifier") == 0) {
+		if (hwaddr_aton(pos, bss->smd.identifier) ||
+		    is_zero_ether_addr(bss->smd.identifier)) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: Invalid SMD identifier '%s'",
+				   line, pos);
+			return 1;
+		}
+	} else if (os_strcmp(buf, "smd_prep_timeout") == 0) {
+		int val = strtol(pos, NULL, 10);
+
+		if (val < 2 || val > 255) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: Invalid SMD Preparation Timeout %d (must be 2-255)",
+				   line, val);
+			return 1;
+		}
+
+		bss->smd.prep_timeout = val;
+	} else if (os_strcmp(buf, "smd_dl_data_forward") == 0) {
+		bss->smd.capab.dl_data_forward = !!atoi(pos);
+	} else if (os_strcmp(buf, "smd_max_prep_target_ap_mlds") == 0) {
+		int val = atoi(pos);
+
+		if (val < 0 || val > 7) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: Invalid smd_max_peer_apmlds value %d (must be 0-7)",
+				   line, val);
+			return 1;
+		}
+
+		bss->smd.capab.max_prep_target_ap_mlds = val;
+	} else if (os_strcmp(buf, "smd_type") == 0) {
+		int val = atoi(pos);
+
+		if (val < 0 || val > 1) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: Invalid SMD Type %d (must be 0 or 1)",
+				   line, val);
+			return 1;
+		}
+
+		bss->smd.capab.type = val;
+	} else if (os_strcmp(buf, "smd_ptk_mode") == 0) {
+		int val = atoi(pos);
+
+		if (val < 0 || val > 1) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: Invalid SMD PTK mode %d (must be 0 or 1)",
+				   line, val);
+			return 1;
+		}
+
+		bss->smd.capab.ptk_mode = val;
+	} else if (os_strcmp(buf, "smd_neighbor_probing") == 0) {
+		bss->smd.capab.neighbor_probing = !!atoi(pos);
+#endif /* CONFIG_IEEE80211BN */
 	} else {
 		wpa_printf(MSG_ERROR,
 			   "Line %d: unknown configuration item '%s'",
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 639556ef4414..35c42ac5a477 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -3790,3 +3790,52 @@ own_ip_addr=127.0.0.1
 #bridge=br-lan
 #wpa_key_mgmt=SAE
 #bssid=00:03:7f:12:84:85
+
+##### Seamless Mobility Domain (SMD) support ###################################
+# Enable SMD for AP mode. When enabled, this AP affiliated to an AP MLD is part
+# of an SMD which allows stations to perform seamless transition between the
+# AP MLDs within the same SMD.
+# 0 - disabled (default)
+# 1 - enabled
+#smd_enabled=0
+#
+# SMD Identifier
+# A unique identifier for the SMD in the format of 48-bit MAC address.
+#smd_identifier=02:03:04:05:06:07
+#
+# Preparation Timeout
+# Indicates the duration for which the SMD preparation is valid with a target
+# AP MLD. Represented in the units of 64 TU and values 0 and 1 are reserved.
+#smd_prep_timeout=2
+#
+# DL Data Forwarding
+# When enabled, the current AP MLD to which the station is associated to shall
+# forward DL data packets to the target AP MLD for retransmission.
+# 0 - disabled (default)
+# 1 - enabled
+#smd_dl_data_forward=0
+#
+# Max Number of Prepared Target AP MLDs
+# Indicates the maximum number of AP MLDs a non-AP MLD can prepare with for
+# an eventual roam. This value ranges [0, 7] representing the maximum number
+# minus 1, and should be the same across all AP MLDs within an SMD.
+#smd_max_prep_target_ap_mlds=7
+#
+# SMD Type
+# Type of SMD
+# 0 - Separate MAC SAP per AP MLD (default)
+# 1 - one MAC SAP per SMD
+#smd_type=0
+#
+# PTK Mode
+# PTK derivation mode when SMD is used
+# 0 - Same PTK per SMD (default)
+# 1 - PTK per AP MLD
+#smd_ptk_mode=0
+#
+# Neighboring AP Probing
+# Indicates support for probing UHR non-colocated neighboring AP MLDs within
+# the SMD.
+# 0 - disabled (default)
+# 1 - enabled
+#smd_neighbor_probing=0
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index bde816591422..8e92a47b56dd 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1041,6 +1041,21 @@ struct hostapd_bss_config {
 	int *security_profiles; /* -1 terminated array of enabled security
 				 * profiles */
 	u64 rsnxe_capab_mask;
+
+#ifdef CONFIG_IEEE80211BN
+	struct {
+		bool enabled;
+		u8 identifier[ETH_ALEN];
+		u8 prep_timeout;
+		struct {
+			bool dl_data_forward;
+			u8 max_prep_target_ap_mlds;
+			u8 type;
+			u8 ptk_mode;
+			bool neighbor_probing;
+		} capab;
+	} smd;
+#endif /* CONFIG_IEEE80211BN */
 };
 
 /**
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index d7b9874d58e0..3d278d244b84 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -2766,6 +2766,10 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 	}
 #endif /* CONFIG_IEEE80211BE */
 
+#ifdef CONFIG_IEEE80211BN
+	params->smd_ap = hapd->conf->smd.enabled;
+#endif /* CONFIG_IEEE80211BN */
+
 	return 0;
 
 #if defined(CONFIG_SAE) || defined(NEED_AP_MLME)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a4394f73d94f..3491262830c5 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1440,6 +1440,56 @@ static int hostapd_bss_radius_init(struct hostapd_data *hapd)
 #endif /* CONFIG_NO_RADIUS */
 
 
+#ifdef CONFIG_IEEE80211BN
+static bool hostapd_validate_smd_setup(struct hostapd_data *hapd)
+{
+#ifdef CONFIG_IEEE80211BE
+	bool valid_prof = false;
+	int i;
+
+	if (!hapd->conf->mld_ap) {
+		wpa_printf(MSG_DEBUG, "SMD AP without MLD");
+		return false;
+	}
+
+	if (!hostapd_is_uhr_enabled(hapd)) {
+		wpa_printf(MSG_DEBUG, "SMD AP without UHR");
+		return false;
+	}
+
+	if (!(hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SMD)) {
+		wpa_printf(MSG_ERROR, "Driver does not support SMD");
+		return false;
+	}
+
+	/* UHR AP-STA association uses Security Profiles */
+	if (!hapd->conf->security_profiles) {
+		wpa_printf(MSG_DEBUG, "SMD AP without security profiles");
+		return false;
+	}
+
+	for (i = 0; hapd->conf->security_profiles[i] >= 0; i++) {
+		int p = hapd->conf->security_profiles[i];
+
+		/* Look for EPPKE and PQC profiles */
+		if (p <= SEC_PROF_OWE ||
+		    (p >= SEC_PROF_8021X_PQC_0 &&
+		     p <= SEC_PROF_8021X_FT_PQC_3)) {
+			valid_prof = true;
+			break;
+		}
+	}
+
+	if (!valid_prof)
+		wpa_printf(MSG_DEBUG, "SMD AP without supported security profile");
+
+	return valid_prof;
+#else /* CONFIG_IEEE80211BE */
+	return false;
+#endif /* CONFIG_IEEE80211BE */
+}
+#endif /* CONFIG_IEEE80211BN */
+
 /**
  * hostapd_setup_bss - Per-BSS setup (initialization)
  * @hapd: Pointer to BSS data
@@ -1584,6 +1634,17 @@ setup_mld:
 	}
 #endif /* CONFIG_IEEE80211BE */
 
+#ifdef CONFIG_IEEE80211BN
+	if (hapd->conf->smd.enabled) {
+		if (!hostapd_validate_smd_setup(hapd)) {
+			wpa_printf(MSG_ERROR, "SMD: Failed to set up SMD");
+			return -1;
+		}
+		wpa_printf(MSG_DEBUG, "SMD: Identifier=" MACSTR,
+			   MAC2STR(hapd->conf->smd.identifier));
+	}
+#endif /* CONFIG_IEEE80211BN */
+
 	if (conf->wmm_enabled < 0)
 		conf->wmm_enabled = hapd->iconf->ieee80211n |
 			hapd->iconf->ieee80211ax;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 5a6d48bdf235..c8b4f3f327c0 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1982,6 +1982,11 @@ struct wpa_driver_ap_params {
 	 * includes the extended element header
 	 */
 	u8 *uhr_oper;
+
+	/*
+	 * smd_ap - Whether the AP is part of an SMD
+	 */
+	bool smd_ap;
 };
 
 struct wpa_driver_mesh_bss_params {
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index bc2e480dfcc1..9dc1dd48d609 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6111,6 +6111,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 		    params->uhr_oper[1] - 1,
 		    params->uhr_oper + 3))
 		goto fail;
+
+	if (params->smd_ap &&
+	    nla_put_flag(msg, NL80211_ATTR_SMD_SUPPORT))
+		goto fail;
 #endif /* CONFIG_IEEE80211BN */
 
 #ifdef CONFIG_SAE
-- 
2.34.1




More information about the Hostap mailing list