[PATCH 1/7] AP: Update the HE regulatory information AP types

Andrei Otcheretianski andrei.otcheretianski at intel.com
Fri Dec 22 01:04:17 PST 2023


From: Ilan Peer <ilan.peer at intel.com>

- Update the HE regulatory information AP types based on Draft
  P802.11Revme_D2.0.
- Set the default AP type to VLP.
- Check for valid values when setting 'he_6ghz_reg_pwr_type' in
  the interface configuration.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 hostapd/config_file.c        |  6 ++++++
 hostapd/hostapd.conf         |  5 ++++-
 src/ap/ap_config.c           |  1 +
 src/ap/beacon.c              |  7 ++++---
 src/ap/ieee802_11.c          |  3 ++-
 src/ap/ieee802_11_he.c       |  9 +++------
 src/common/ieee802_11_defs.h | 15 +++++++++------
 7 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 1a49292b11..09c31b4eaf 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3624,6 +3624,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 		}
 	} else if (os_strcmp(buf, "he_6ghz_reg_pwr_type") == 0) {
 		conf->he_6ghz_reg_pwr_type = atoi(pos);
+		if (conf->he_6ghz_reg_pwr_type > HE_REG_INFO_6GHZ_AP_TYPE_MAX) {
+			wpa_printf(MSG_ERROR,
+				   "Line %d: invalid he_6ghz_reg_pwr_type value",
+				   line);
+			return 1;
+		}
 	} else if (os_strcmp(buf, "he_oper_chwidth") == 0) {
 		conf->he_oper_chwidth = atoi(pos);
 	} else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 99da3db3f7..cf18b2b7e7 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -980,8 +980,11 @@ wmm_ac_vo_acm=0
 
 # 6 GHz Access Point type
 # This config is to set the 6 GHz Access Point type. Possible options are:
-# 0 = Indoor AP (default)
+# 0 = Indoor AP
 # 1 = Standard Power AP
+# 2 = Very Low Power (default)
+# 3 = Indoor Enabled AP
+# 4 = Indoor Standard Power AP
 # This has no impact for operation on other bands.
 #he_6ghz_reg_pwr_type=0
 
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 2c66217e8d..cc1f37694e 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -281,6 +281,7 @@ struct hostapd_config * hostapd_config_defaults(void)
 	conf->he_6ghz_max_ampdu_len_exp = 7;
 	conf->he_6ghz_rx_ant_pat = 1;
 	conf->he_6ghz_tx_ant_pat = 1;
+	conf->he_6ghz_reg_pwr_type = HE_REG_INFO_6GHZ_AP_TYPE_VLP;
 #endif /* CONFIG_IEEE80211AX */
 
 	/* The third octet of the country string uses an ASCII space character
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 3588030fbe..3c0353901c 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -620,7 +620,7 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
 			 /* An additional Transmit Power Envelope element for
 			  * subordinate client */
 			if (hapd->iconf->he_6ghz_reg_pwr_type ==
-			    HE_6GHZ_INDOOR_AP)
+			    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR)
 				buflen += 4;
 		}
 	}
@@ -1930,7 +1930,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
 	/* Transmit Power Envelope element(s) */
 	if (is_6ghz_op_class(hapd->iconf->op_class)) {
 		total_len += 4;
-		if (hapd->iconf->he_6ghz_reg_pwr_type == HE_6GHZ_INDOOR_AP)
+		if (hapd->iconf->he_6ghz_reg_pwr_type ==
+		    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR)
 			total_len += 4;
 	}
 #endif /* CONFIG_IEEE80211AX */
@@ -2095,7 +2096,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 			 /* An additional Transmit Power Envelope element for
 			  * subordinate client */
 			if (hapd->iconf->he_6ghz_reg_pwr_type ==
-			    HE_6GHZ_INDOOR_AP)
+			    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR)
 				tail_len += 4;
 		}
 	}
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index a65287d77e..3964efa43e 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -7066,7 +7066,8 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
 
 		/* Indoor Access Point must include an additional TPE for
 		 * subordinate devices */
-		if (iconf->he_6ghz_reg_pwr_type == HE_6GHZ_INDOOR_AP) {
+		if (iconf->he_6ghz_reg_pwr_type ==
+		    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR) {
 			/* TODO: Extract PSD limits from channel data */
 			tx_pwr = REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT * 2;
 			eid = hostapd_add_tpe_info(eid, tx_pwr_count,
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
index f308a6daf0..04bf9cf760 100644
--- a/src/ap/ieee802_11_he.c
+++ b/src/ap/ieee802_11_he.c
@@ -254,12 +254,9 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
 			control = 3;
 		else
 			control = center_idx_to_bw_6ghz(seg0);
-		if (hapd->iconf->he_6ghz_reg_pwr_type == 1)
-			control |= HE_6GHZ_STANDARD_POWER_AP <<
-				HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT;
-		else
-			control |= HE_6GHZ_INDOOR_AP <<
-				HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT;
+
+		control |= hapd->iconf->he_6ghz_reg_pwr_type <<
+			HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT;
 		*pos++ = control;
 
 		/* Channel Center Freq Seg0/Seg1 */
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 9bf98518e3..223fd7501d 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -2447,14 +2447,17 @@ struct ieee80211_spatial_reuse {
 #define HE_OPERATION_BSS_COLOR_MAX		64
 
 /**
- * enum he_6ghz_ap_type - Allowed Access Point types for 6 GHz Band
+ * enum he_reg_info_6ghz_ap_type - Allowed Access Point types for 6 GHz Band
  *
- * IEEE Std 802.11ax-2021, Table E-12 (Regulatory Info subfield encoding in the
- * United States)
+ * See Draft P802.11Revme_D2.0, Table E-12 (Regulatory Info subfield encoding)
  */
-enum he_6ghz_ap_type {
-	HE_6GHZ_INDOOR_AP		= 0,
-	HE_6GHZ_STANDARD_POWER_AP	= 1,
+enum he_reg_info_6ghz_ap_type {
+	HE_REG_INFO_6GHZ_AP_TYPE_INDOOR         = 0,
+	HE_REG_INFO_6GHZ_AP_TYPE_SP		= 1,
+	HE_REG_INFO_6GHZ_AP_TYPE_VLP		= 2,
+	HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_ENABLED	= 3,
+	HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP	= 4,
+	HE_REG_INFO_6GHZ_AP_TYPE_MAX = HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP,
 };
 
 /* Spatial Reuse defines */
-- 
2.43.0




More information about the Hostap mailing list