Move CHANWIDTH_* definitions from ieee80211_defs.h to defs.h

Move most of CHANWIDTH_* definitions from ieee80211_defs.h to defs.h as
the definitions are getting used mostly for internal purpose only. Also
change prefix of the definitions to CONF_OPER_CHWIDTH_* and update in
all the files accordingly.

Leave the couple of VHT-specific exceptions to use the old defines (the
reason why they were originally added as VHT values), to avoid use of
clearly marked configuration values in information elements. In
addition, use the defines instead of magic values where appropriate.

Signed-off-by: Aleti Nageshwar Reddy <quic_anageshw@quicinc.com>
This commit is contained in:
Aleti Nageshwar Reddy 2022-05-13 21:47:40 +05:30 committed by Jouni Malinen
parent 92f5499010
commit bafe35df03
31 changed files with 275 additions and 227 deletions

View file

@ -1048,7 +1048,7 @@ struct hostapd_config {
u32 vht_capab;
int ieee80211ac;
int require_vht;
u8 vht_oper_chwidth;
enum oper_chan_width vht_oper_chwidth;
u8 vht_oper_centr_freq_seg0_idx;
u8 vht_oper_centr_freq_seg1_idx;
u8 ht40_plus_minus_allowed;
@ -1092,7 +1092,7 @@ struct hostapd_config {
struct he_operation he_op;
struct ieee80211_he_mu_edca_parameter_set he_mu_edca;
struct spatial_reuse spr;
u8 he_oper_chwidth;
enum oper_chan_width he_oper_chwidth;
u8 he_oper_centr_freq_seg0_idx;
u8 he_oper_centr_freq_seg1_idx;
u8 he_6ghz_max_mpdu;
@ -1130,7 +1130,7 @@ struct hostapd_config {
int ieee80211be;
#ifdef CONFIG_IEEE80211BE
u8 eht_oper_chwidth;
enum oper_chan_width eht_oper_chwidth;
u8 eht_oper_centr_freq_seg0_idx;
struct eht_phy_capabilities_info eht_phy_capab;
#endif /* CONFIG_IEEE80211BE */
@ -1142,7 +1142,8 @@ struct hostapd_config {
};
static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf)
static inline enum oper_chan_width
hostapd_get_oper_chwidth(struct hostapd_config *conf)
{
#ifdef CONFIG_IEEE80211BE
if (conf->ieee80211be)
@ -1156,7 +1157,8 @@ static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf)
}
static inline void
hostapd_set_oper_chwidth(struct hostapd_config *conf, u8 oper_chwidth)
hostapd_set_oper_chwidth(struct hostapd_config *conf,
enum oper_chan_width oper_chwidth)
{
#ifdef CONFIG_IEEE80211BE
if (conf->ieee80211be)