AP: Fix a regression in indoor 6 GHz AP determination

The change to use a helper function for checking he_6ghz_reg_pwr_type
missed the difference between two types of checks for different values:
indoor AP vs. SP AP. Fix this by introducing another helper function to
cover the indoor (i.e., SP and non-SP indoor cases).

Fixes: 121ccadeb4 ("AP: A helper function for determining whether the AP is an SP AP")
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2024-01-04 11:04:20 +02:00
parent 196d6c83b9
commit 064c233d1e
3 changed files with 8 additions and 2 deletions

View file

@ -580,7 +580,7 @@ static size_t he_elem_len(struct hostapd_data *hapd)
3 + sizeof(struct ieee80211_he_6ghz_band_cap);
/* An additional Transmit Power Envelope element for
* subordinate client */
if (he_reg_is_sp(hapd->iconf->he_6ghz_reg_pwr_type))
if (he_reg_is_indoor(hapd->iconf->he_6ghz_reg_pwr_type))
len += 4;
/* An additional Transmit Power Envelope element for

View file

@ -7077,7 +7077,7 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
/* Indoor Access Point must include an additional TPE for
* subordinate devices */
if (he_reg_is_sp(iconf->he_6ghz_reg_pwr_type)) {
if (he_reg_is_indoor(iconf->he_6ghz_reg_pwr_type)) {
/* TODO: Extract PSD limits from channel data */
if (hapd->iconf->reg_sub_cli_eirp_psd != -1)
tx_pwr = hapd->iconf->reg_sub_cli_eirp_psd;

View file

@ -2461,6 +2461,12 @@ enum he_reg_info_6ghz_ap_type {
HE_REG_INFO_6GHZ_AP_TYPE_MAX = HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP,
};
static inline bool he_reg_is_indoor(enum he_reg_info_6ghz_ap_type type)
{
return type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR ||
type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP;
}
static inline bool he_reg_is_sp(enum he_reg_info_6ghz_ap_type type)
{
return type == HE_REG_INFO_6GHZ_AP_TYPE_SP ||