]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Add an additional TPE element when needed
authorIlan Peer <ilan.peer@intel.com>
Fri, 22 Dec 2023 09:04:22 +0000 (11:04 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 18:43:27 +0000 (20:43 +0200)
If the regulatory client EIRP PSD values advertised by an AP that is a
standard power AP or indoor standard power AP are insufficient to ensure
that regulatory client limits on total EIRP are always met for all
transmission bandwidths within the bandwidth of the AP’s BSS, the AP
shall also send a TPE element in Beacon and Probe Response frames as
that depicts the regulatory client EIRP limit.

Add support for this.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
hostapd/config_file.c
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/beacon.c
src/ap/ieee802_11.c

index 7c15ff5707f979cfdbe1323966faf42c9b77644b..b84107472c4f8865ee0963c8c2dc129349f52102 100644 (file)
@@ -3685,6 +3685,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                conf->reg_def_cli_eirp_psd = atoi(pos);
        } else if (os_strcmp(buf, "reg_sub_cli_eirp_psd") == 0) {
                conf->reg_sub_cli_eirp_psd = atoi(pos);
+       } else if (os_strcmp(buf, "reg_def_cli_eirp") == 0) {
+               conf->reg_def_cli_eirp = atoi(pos);
        } 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 a86887930f9f87548adf64fdd5e6673eaf87bf4d..f53aeae94d987b1edee079345bd522184a9ab78c 100644 (file)
@@ -284,6 +284,7 @@ struct hostapd_config * hostapd_config_defaults(void)
        conf->he_6ghz_reg_pwr_type = HE_REG_INFO_6GHZ_AP_TYPE_VLP;
        conf->reg_def_cli_eirp_psd = -1;
        conf->reg_sub_cli_eirp_psd = -1;
+       conf->reg_def_cli_eirp = -1;
 #endif /* CONFIG_IEEE80211AX */
 
        /* The third octet of the country string uses an ASCII space character
index f145425b7306fab86aeff7eb939d9c41a9251fbe..b5bb2201e7a3ee4edc27a2daff606eb053fea82a 100644 (file)
@@ -1153,6 +1153,15 @@ struct hostapd_config {
        int reg_def_cli_eirp_psd;
        int reg_sub_cli_eirp_psd;
 
+       /*
+        * This value should be used when regulatory client EIRP PSD values
+        * advertised by an AP that is an SP AP or an indoor SP AP are
+        * insufficient to ensure that regulatory client limits on total EIRP
+        * are always met for all transmission bandwidths within the bandwidth
+        * of the AP’s BSS.
+        */
+       int reg_def_cli_eirp;
+
        bool require_he;
 #endif /* CONFIG_IEEE80211AX */
 
index eb7ef6f19fd4945be4cc0f5ddac9c2a969fadc67..f0ab013d47289bd18c3b48a4db9e3b1490f7dd45 100644 (file)
@@ -624,6 +624,16 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
                            hapd->iconf->he_6ghz_reg_pwr_type ==
                            HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
                                buflen += 4;
+
+                       /* An additional Transmit Power Envelope element for
+                        * default client with unit interpretation of regulatory
+                        * client EIRP */
+                       if (hapd->iconf->reg_def_cli_eirp != -1 &&
+                           (hapd->iconf->he_6ghz_reg_pwr_type ==
+                            HE_REG_INFO_6GHZ_AP_TYPE_SP ||
+                            hapd->iconf->he_6ghz_reg_pwr_type ==
+                            HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP))
+                               buflen += 4;
                }
        }
 #endif /* CONFIG_IEEE80211AX */
@@ -1937,6 +1947,16 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
                    hapd->iconf->he_6ghz_reg_pwr_type ==
                    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
                        total_len += 4;
+
+               /* An additional Transmit Power Envelope element for
+                * default client with unit interpretation of regulatory
+                * client EIRP */
+               if (hapd->iconf->reg_def_cli_eirp != -1 &&
+                   (hapd->iconf->he_6ghz_reg_pwr_type ==
+                    HE_REG_INFO_6GHZ_AP_TYPE_SP ||
+                    hapd->iconf->he_6ghz_reg_pwr_type ==
+                    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP))
+                       total_len += 4;
        }
 #endif /* CONFIG_IEEE80211AX */
 
@@ -2104,6 +2124,16 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
                            hapd->iconf->he_6ghz_reg_pwr_type ==
                            HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
                                tail_len += 4;
+
+                       /* An additional Transmit Power Envelope element for
+                        * default client with unit interpretation of regulatory
+                        * client EIRP */
+                       if (hapd->iconf->reg_def_cli_eirp != -1 &&
+                           (hapd->iconf->he_6ghz_reg_pwr_type ==
+                            HE_REG_INFO_6GHZ_AP_TYPE_SP ||
+                            hapd->iconf->he_6ghz_reg_pwr_type ==
+                            HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP))
+                               tail_len += 4;
                }
        }
 #endif /* CONFIG_IEEE80211AX */
index 8eae9efc7e8a0e7bc828b516be9c2fd8980e7342..8f61766a7e526754c4992a52725d10dac22e6c24 100644 (file)
@@ -7092,6 +7092,16 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
                                                   tx_pwr);
                }
 
+               if (iconf->reg_def_cli_eirp != -1 &&
+                   (iconf->he_6ghz_reg_pwr_type ==
+                    HE_REG_INFO_6GHZ_AP_TYPE_SP ||
+                    iconf->he_6ghz_reg_pwr_type ==
+                    HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP))
+                       eid = hostapd_add_tpe_info(
+                               eid, tx_pwr_count, REGULATORY_CLIENT_EIRP,
+                               REG_DEFAULT_CLIENT,
+                               hapd->iconf->reg_def_cli_eirp);
+
                return eid;
        }
 #endif /* CONFIG_IEEE80211AX */