]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Update the HE regulatory information AP types for the 6 GHz band
authorIlan Peer <ilan.peer@intel.com>
Fri, 22 Dec 2023 09:04:17 +0000 (11:04 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 15:57:26 +0000 (17:57 +0200)
Update the HE regulatory information AP types based on IEEE
P802.11-REVme/D4.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@intel.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/beacon.c
src/ap/ieee802_11.c
src/ap/ieee802_11_he.c
src/common/ieee802_11_defs.h

index b1b7350df7d32b8d761e1174cdde394a0c9c88ba..18aab8e509beceb95cc3d6139dcbb7e0dfccca3d 100644 (file)
@@ -3675,6 +3675,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) {
index 8f6165a0bd0e21e9a1c807bfe648b0d2a7af47f4..542489a397792f4f5e6f5505f2145090ce843d0e 100644 (file)
@@ -980,9 +980,14 @@ 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)
-# 1 = Standard Power AP
+# 0 = Indoor AP
+# 1 = Standard power AP
+# 2 = Very low power AP (default)
+# 3 = Indoor enabled AP
+# 4 = Indoor standard power AP
 # This has no impact for operation on other bands.
+# See IEEE P802.11-REVme/D4.0, Table E-12 (Regulatory Info subfield encoding)
+# for more details.
 #he_6ghz_reg_pwr_type=0
 
 # Unsolicited broadcast Probe Response transmission settings
index 2c66217e8decc98cb4e9dd34db0f45e42c858348..cc1f37694eb72f30c39f687907b369d44d93c3ab 100644 (file)
@@ -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
index 3588030fbe56fb46fcf2e27fdaa3682d18d3af81..3c0353901c121de65f85f330b705eab6ed3ac77f 100644 (file)
@@ -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;
                }
        }
index c905c0fcd0fdd214c7dcae351374e8311a4dd743..1703d8317a8b3f4c9e4113429fc6097a5a2acbd0 100644 (file)
@@ -7073,7 +7073,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,
index f308a6daf0b851bd6414b1f286442b264983a165..4b693a7c52526ab407162937f1d3fafba11b3448 100644 (file)
@@ -254,12 +254,10 @@ 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 */
index 349aceb3c1dd6bce74f2d07258246f3b624ccf8f..09f7d0054c29434bda90b0fb862dcb378a68c169 100644 (file)
@@ -2448,14 +2448,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)
+ * IEEE P802.11-REVme/D4.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 */