From 387b308a6af81ada3643cc1c1658a7756f359b5a Mon Sep 17 00:00:00 2001 From: Karthikeyan Periyasamy Date: Tue, 21 Sep 2021 17:20:23 +0530 Subject: [PATCH] hostapd: Add 320 MHz support Added 320 MHz channel support in 6GHz band (EHT) as define by IEEE P802.11be/D1.1, July 2021 section 36.3.23.2. It covers channel bringup, frequency validation, channel switch and also across all channel width and frequency manipulation. Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Ramya Gnanasekar --- hostapd/ctrl_iface.c | 31 +++++++++++++++++++++++++++++++ src/ap/drv_callbacks.c | 6 ++++++ src/ap/hostapd.c | 9 +++++++++ src/ap/ieee802_11.c | 4 ++++ src/ap/ieee802_11_eht.c | 4 +++- src/ap/neighbor_db.c | 9 ++++++--- src/common/defs.h | 1 + src/common/hw_features_common.c | 3 +++ src/common/ieee802_11_common.c | 6 ++++++ src/common/ieee802_11_defs.h | 6 ++++++ src/drivers/driver.h | 1 + src/drivers/driver_common.c | 4 ++++ src/drivers/driver_nl80211.c | 5 +++++ src/drivers/driver_nl80211_capa.c | 3 +++ src/drivers/driver_nl80211_event.c | 6 ++++++ src/drivers/nl80211_copy.h | 2 ++ wpa_supplicant/ctrl_iface.c | 2 ++ 17 files changed, 98 insertions(+), 4 deletions(-) diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 45245f1..c8d219b 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1238,7 +1238,8 @@ hostapd_set_oper_chwidth(struct hostapd_config *conf, oper_chwidth = CONF_OPER_CHWIDTH_160MHZ; #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_IEEE80211AX - if (conf->ieee80211ax) + if (conf->ieee80211ax && + oper_chwidth < CONF_OPER_CHWIDTH_320MHZ) conf->he_oper_chwidth = oper_chwidth; #endif /* CONFIG_IEEE80211AX */ conf->vht_oper_chwidth = oper_chwidth; diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index c3af932..8543101 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -230,7 +230,7 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) enum oper_chan_width oper_chwidth = hostapd_get_oper_chwidth(hapd->iconf); u8 seg0 = hapd->iconf->he_oper_centr_freq_seg0_idx; - u8 seg1 = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf); + u8 seg1 = hapd->iconf->he_oper_centr_freq_seg1_idx; u8 control; #ifdef CONFIG_IEEE80211BE diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index b4f1f5e..841e327 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -1708,6 +1708,8 @@ static void phy_info_freq(struct hostapd_hw_modes *mode, chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_80; if (tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ]) chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_160; + if (tb_freq[NL80211_FREQUENCY_ATTR_NO_320MHZ]) + chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_320; if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) { enum nl80211_dfs_state state = diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h index ce325cf..c7353a6 100644 --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h @@ -4282,6 +4282,7 @@ enum nl80211_frequency_attr { NL80211_FREQUENCY_ATTR_16MHZ, NL80211_FREQUENCY_ATTR_NO_320MHZ, NL80211_FREQUENCY_ATTR_NO_EHT, + NL80211_FREQUENCY_ATTR_PSD, /* keep last */ __NL80211_FREQUENCY_ATTR_AFTER_LAST,