]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Fix a regression in indoor 6 GHz AP determination
authorJouni Malinen <j@w1.fi>
Thu, 4 Jan 2024 09:04:20 +0000 (11:04 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 4 Jan 2024 09:04:20 +0000 (11:04 +0200)
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: 121ccadeb44c ("AP: A helper function for determining whether the AP is an SP AP")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/beacon.c
src/ap/ieee802_11.c
src/common/ieee802_11_defs.h

index ee1f027921fc305c30b37ac768ccd4d68fd73829..89e3608744f0340376867418e7d5dffd31912f73 100644 (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
index a939ad35e29a236a4e290ba3ef316e17f11154c0..50190a280b67e750bbaa88a41334f2ac5f0af593 100644 (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;
index 4e040c35c93c36d6a3f31b96e72941b14293562b..12137dcf4d7869953035212a617672c60e022f9e 100644 (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 ||