[PATCH 6/9] 6G: Do not add VHT IEs in 6 GHz band

Rajkumar Manoharan <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
Do not account VHT IEs for total beacon length and also add 6 GHz checks
in Wide band VHT channel switch, VHT Tx power and Vendor VHT IE
construction.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 src/ap/beacon.c         | 9 +++++----
 src/ap/ieee802_11_vht.c | 9 +++++++++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index fab6035c6130..55c27b8c2336 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -452,7 +452,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 #endif /* CONFIG_FST */
 	if (hapd->conf->vendor_elements)
 		buflen += wpabuf_len(hapd->conf->vendor_elements);
-	if (hapd->conf->vendor_vht) {
+	if (hapd->conf->vendor_vht &&
+	    !is_6ghz_op_class(hapd->iconf->op_class)) {
 		buflen += 5 + 2 + sizeof(struct ieee80211_vht_capabilities) +
 			2 + sizeof(struct ieee80211_vht_operation);
 	}
@@ -558,8 +559,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 #endif /* CONFIG_FST */
 
 #ifdef CONFIG_IEEE80211AC
-	if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac &&
-	    !is_6ghz_op_class(hapd->iconf->op_class)) {
+	if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) {
 		pos = hostapd_eid_vht_capabilities(hapd, pos, 0);
 		pos = hostapd_eid_vht_operation(hapd, pos);
 		pos = hostapd_eid_txpower_envelope(hapd, pos);
@@ -1156,7 +1156,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 		tail_len += wpabuf_len(hapd->conf->vendor_elements);
 
 #ifdef CONFIG_IEEE80211AC
-	if (hapd->conf->vendor_vht) {
+	if (hapd->conf->vendor_vht &&
+	    !is_6ghz_op_class(hapd->iconf->op_class)) {
 		tail_len += 5 + 2 + sizeof(struct ieee80211_vht_capabilities) +
 			2 + sizeof(struct ieee80211_vht_operation);
 	}
diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index f50f142dc0bb..f67ed392bcc6 100644
--- a/src/ap/ieee802_11_vht.c
+++ b/src/ap/ieee802_11_vht.c
@@ -176,6 +176,9 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
 	    !hapd->cs_freq_params.vht_enabled)
 		return eid;
 
+	if (is_6ghz_op_class(hapd->iconf->op_class))
+		return eid;
+
 	/* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
 	switch (hapd->cs_freq_params.bandwidth) {
 	case 40:
@@ -234,6 +237,9 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
 	if (!mode)
 		return eid;
 
+	if (is_6ghz_op_class(hapd->iconf->op_class))
+		return eid;
+
 	if (ieee80211_freq_to_chan(iface->freq, &channel) == NUM_HOSTAPD_MODES)
 		return eid;
 
@@ -428,6 +434,9 @@ u8 * hostapd_eid_vendor_vht(struct hostapd_data *hapd, u8 *eid)
 	if (!hapd->iface->current_mode)
 		return eid;
 
+	if (is_6ghz_op_class(hapd->iconf->op_class))
+		return eid;
+
 	*pos++ = WLAN_EID_VENDOR_SPECIFIC;
 	*pos++ = (5 +		/* The Vendor OUI, type and subtype */
 		  2 + sizeof(struct ieee80211_vht_capabilities) +
-- 
2.7.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.