Get rid of unnecessary code duplication.
Signed-off-by: Jouni Malinen <j@w1.fi>
3 + sizeof(struct ieee80211_he_6ghz_band_cap);
/* An additional Transmit Power Envelope element for
* subordinate client */
- if (hapd->iconf->he_6ghz_reg_pwr_type ==
- HE_REG_INFO_6GHZ_AP_TYPE_INDOOR ||
- hapd->iconf->he_6ghz_reg_pwr_type ==
- HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP)
+ if (he_reg_is_sp(hapd->iconf->he_6ghz_reg_pwr_type))
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))
+ he_reg_is_sp(hapd->iconf->he_6ghz_reg_pwr_type))
len += 4;
}
#endif /* CONFIG_IEEE80211AX */
/* Indoor Access Point must include an additional TPE for
* subordinate devices */
- if (iconf->he_6ghz_reg_pwr_type ==
- HE_REG_INFO_6GHZ_AP_TYPE_INDOOR ||
- iconf->he_6ghz_reg_pwr_type ==
- HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP) {
+ if (he_reg_is_sp(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;
}
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))
+ he_reg_is_sp(iconf->he_6ghz_reg_pwr_type))
eid = hostapd_add_tpe_info(
eid, tx_pwr_count, REGULATORY_CLIENT_EIRP,
REG_DEFAULT_CLIENT,
HE_REG_INFO_6GHZ_AP_TYPE_MAX = 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 ||
+ type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP;
+}
+
/* Spatial Reuse defines */
#define SPATIAL_REUSE_SRP_DISALLOWED BIT(0)
#define SPATIAL_REUSE_NON_SRG_OBSS_PD_SR_DISALLOWED BIT(1)