AP: Add an additional TPE element when needed

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>
This commit is contained in:
Ilan Peer 2023-12-22 11:04:22 +02:00 committed by Jouni Malinen
parent 3cbb3ac3fa
commit 150ee0c068
5 changed files with 52 additions and 0 deletions

View file

@ -3685,6 +3685,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->reg_def_cli_eirp_psd = atoi(pos); conf->reg_def_cli_eirp_psd = atoi(pos);
} else if (os_strcmp(buf, "reg_sub_cli_eirp_psd") == 0) { } else if (os_strcmp(buf, "reg_sub_cli_eirp_psd") == 0) {
conf->reg_sub_cli_eirp_psd = atoi(pos); 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) { } else if (os_strcmp(buf, "he_oper_chwidth") == 0) {
conf->he_oper_chwidth = atoi(pos); conf->he_oper_chwidth = atoi(pos);
} else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) {

View 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->he_6ghz_reg_pwr_type = HE_REG_INFO_6GHZ_AP_TYPE_VLP;
conf->reg_def_cli_eirp_psd = -1; conf->reg_def_cli_eirp_psd = -1;
conf->reg_sub_cli_eirp_psd = -1; conf->reg_sub_cli_eirp_psd = -1;
conf->reg_def_cli_eirp = -1;
#endif /* CONFIG_IEEE80211AX */ #endif /* CONFIG_IEEE80211AX */
/* The third octet of the country string uses an ASCII space character /* The third octet of the country string uses an ASCII space character

View file

@ -1153,6 +1153,15 @@ struct hostapd_config {
int reg_def_cli_eirp_psd; int reg_def_cli_eirp_psd;
int reg_sub_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 APs BSS.
*/
int reg_def_cli_eirp;
bool require_he; bool require_he;
#endif /* CONFIG_IEEE80211AX */ #endif /* CONFIG_IEEE80211AX */

View file

@ -624,6 +624,16 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
hapd->iconf->he_6ghz_reg_pwr_type == hapd->iconf->he_6ghz_reg_pwr_type ==
HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP) HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
buflen += 4; 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 */ #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 == hapd->iconf->he_6ghz_reg_pwr_type ==
HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP) HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
total_len += 4; 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 */ #endif /* CONFIG_IEEE80211AX */
@ -2104,6 +2124,16 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
hapd->iconf->he_6ghz_reg_pwr_type == hapd->iconf->he_6ghz_reg_pwr_type ==
HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP) HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
tail_len += 4; 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 */ #endif /* CONFIG_IEEE80211AX */

View file

@ -7092,6 +7092,16 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
tx_pwr); 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; return eid;
} }
#endif /* CONFIG_IEEE80211AX */ #endif /* CONFIG_IEEE80211AX */