[PATCH v4 08/15] mbssid: add MBSSID configuration element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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 68b6b28588ce..c5283adb135e 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;
 
@@ -1634,6 +1643,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);
@@ -1723,7 +1735,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 0bc31865caf8..5851ea942677 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.25.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux