[PATCH v3 08/11] mbssid: add MBSSID configuration element

Aloka Dixit quic_alokad at quicinc.com
Wed May 11 14:15:18 PDT 2022


Add multiple BSSID configuration element data as per
IEEE Std 802.11ax-2021, section 9.4.2.260 when enhanced multiple BSSID
advertisements (EMA) are enabled.
This element informs the clients about the EMA profile periodicity of
the multiple BSSID set.

Signed-off-by: Aloka Dixit <quic_alokad at quicinc.com>
---
 src/ap/beacon.c              | 18 +++++++++++++++---
 src/common/ieee802_11_defs.h |  1 +
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index dce09d0c9c10..85871693db3c 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -463,12 +463,14 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid)
 
 
 static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd,
-					     struct wpa_driver_ap_params *params)
+					     struct wpa_driver_ap_params *params,
+					     u8 **eid)
 {
 	struct hostapd_iface *iface = hapd->iface;
 	struct hostapd_data *tx_bss;
 	size_t len;
 	u8 elem_count = 0, *elem = NULL, **elem_offset = NULL, *end;
+	u8 *tailpos = *eid;
 
 	if (!iface->mbssid_max_interfaces ||
 	    iface->num_bss > iface->mbssid_max_interfaces ||
@@ -499,8 +501,15 @@ static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd,
 	params->mbssid_elem_len = end - elem;
 	params->mbssid_elem_count = elem_count;
 	params->mbssid_elem_offset = elem_offset;
-	if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED)
+	if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED) {
 		params->ema = true;
+		*tailpos++ = WLAN_EID_EXTENSION;
+		*tailpos++ = 3;
+		*tailpos++ = WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION;
+		*tailpos++ = iface->num_bss;
+		*tailpos++ = params->mbssid_elem_count;
+		*eid = tailpos;
+	}
 
 	return 0;
 
@@ -1632,6 +1641,9 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 	}
 #endif /* CONFIG_IEEE80211BE */
 
+	if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED &&
+	    hapd == hostapd_mbssid_get_tx_bss(hapd))
+		tail_len += 5; /* Multiple BSSID Configuration element */
 	tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON);
 	tail_len += hostapd_mbo_ie_len(hapd);
 	tail_len += hostapd_eid_owe_trans_len(hapd);
@@ -1721,7 +1733,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 	tailpos = hostapd_eid_ext_capab(hapd, tailpos);
 
 	if (hapd->iconf->mbssid && hapd->iconf->num_bss > 1) {
-		if (ieee802_11_build_ap_params_mbssid(hapd, params)) {
+		if (ieee802_11_build_ap_params_mbssid(hapd, params, &tailpos)) {
 			os_free(head);
 			os_free(tail);
 			wpa_printf(MSG_ERROR, "Failed to set beacon data");
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 28c1ac526443..26b4970fff20 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -481,6 +481,7 @@
 #define WLAN_EID_EXT_SPATIAL_REUSE 39
 #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42
 #define WLAN_EID_EXT_OCV_OCI 54
+#define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55
 #define WLAN_EID_EXT_NON_INHERITANCE 56
 #define WLAN_EID_EXT_SHORT_SSID_LIST 58
 #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59
-- 
2.31.1




More information about the Hostap mailing list