diff mbox series

Include EHT Operation Information field only if 320MHz and/or if at least one punctured 20MHz subchannel

Message ID DM4PR19MB6173DCD7BF45D56625041B81A8B2A@DM4PR19MB6173.namprd19.prod.outlook.com
State Accepted
Headers show
Series Include EHT Operation Information field only if 320MHz and/or if at least one punctured 20MHz subchannel | expand

Commit Message

Jurijs Soloveckis Nov. 14, 2023, 12:47 p.m. UTC
802.11be D3 chapter 35.15.1 Basic EHT BSS operation defines:
EHT AP shall include EHT Operation Information field only if at least one punctured 20MHz subchannel
and/or is 320MHz. Otherwise, the EHT AP shall set the EHT Operation Information Present subfield to 0.

Signed-off-by: Jurijs Soloveckis <jsoloveckis@maxlinear.com>
---
 src/ap/ieee802_11_eht.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

Comments

Jouni Malinen Nov. 24, 2023, 4:57 p.m. UTC | #1
On Tue, Nov 14, 2023 at 12:47:05PM +0000, Jurijs Soloveckis wrote:
> 802.11be D3 chapter 35.15.1 Basic EHT BSS operation defines:
> EHT AP shall include EHT Operation Information field only if at least one punctured 20MHz subchannel
> and/or is 320MHz. Otherwise, the EHT AP shall set the EHT Operation Information Present subfield to 0.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index 1d1751837..27df569a1 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -199,11 +199,23 @@  u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
 	struct ieee80211_eht_operation *oper;
 	u8 *pos = eid, seg0 = 0, seg1 = 0;
 	enum oper_chan_width chwidth;
-	size_t elen = 1 + 4 + 3;
+	size_t elen = 1 + 4;
+	bool eht_oper_info_present = false;
 
 	if (!hapd->iface->current_mode)
 		return eid;
 
+	if (is_6ghz_op_class(conf->op_class))
+		chwidth = op_class_to_ch_width(conf->op_class);
+	else
+		chwidth = conf->eht_oper_chwidth;
+
+	eht_oper_info_present = (chwidth == CONF_OPER_CHWIDTH_320MHZ) ||
+		    hapd->iconf->punct_bitmap;
+
+	if (eht_oper_info_present)
+		elen += 3;
+
 	if (hapd->iconf->punct_bitmap)
 		elen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
 
@@ -212,7 +224,6 @@  u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
 	*pos++ = WLAN_EID_EXT_EHT_OPERATION;
 
 	oper = (struct ieee80211_eht_operation *) pos;
-	oper->oper_params = EHT_OPER_INFO_PRESENT;
 
 	/* TODO: Fill in appropriate EHT-MCS max Nss information */
 	oper->basic_eht_mcs_nss_set[0] = 0x11;
@@ -220,11 +231,10 @@  u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
 	oper->basic_eht_mcs_nss_set[2] = 0x00;
 	oper->basic_eht_mcs_nss_set[3] = 0x00;
 
-	if (is_6ghz_op_class(conf->op_class))
-		chwidth = op_class_to_ch_width(conf->op_class);
-	else
-		chwidth = conf->eht_oper_chwidth;
+	if (!eht_oper_info_present)
+		return pos + elen;
 
+	oper->oper_params = EHT_OPER_INFO_PRESENT;
 	seg0 = hostapd_get_oper_centr_freq_seg0_idx(conf);
 
 	switch (chwidth) {