From 0822de037cfcb6505c6979d6fe8029c453219d32 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Chitrapu Date: Thu, 22 Apr 2021 13:01:02 -0700 Subject: [PATCH] Add AP mode ACS support for the 6 GHz band Add support for the 6 GHz frequencies using 40, 80, and 160 MHz bandwidths in the AP mode ACS. Signed-off-by: Pradeep Kumar Chitrapu --- src/ap/acs.c | 18 +++++++++++++----- src/drivers/driver_nl80211.c | 3 ++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ap/acs.c b/src/ap/acs.c index 616d01401..bb3446d4b 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -375,7 +375,11 @@ acs_survey_chan_interference_factor(struct hostapd_iface *iface, static int acs_usable_bw40_chan(const struct hostapd_channel_data *chan) { const int allowed[] = { 5180, 5220, 5260, 5300, 5500, 5540, 5580, 5620, - 5660, 5745, 5785, 4920, 4960 }; + 5660, 5745, 5785, 4920, 4960, 5955, 5995, 6035, + 6075, 6115, 6155, 6195, 6235, 6275, 6315, 6355, + 6395, 6435, 6475, 6515, 6555, 6595, 6635, 6675, + 6715, 6755, 6795, 6835, 6875, 6915, 6955, 6995, + 7035, 7075 }; unsigned int i; for (i = 0; i < ARRAY_SIZE(allowed); i++) @@ -388,7 +392,9 @@ static int acs_usable_bw40_chan(const struct hostapd_channel_data *chan) static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) { - const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745 }; + const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035, + 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, + 6755, 6835, 6915, 6995 }; unsigned int i; for (i = 0; i < ARRAY_SIZE(allowed); i++) @@ -401,7 +407,8 @@ static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) static int acs_usable_bw160_chan(const struct hostapd_channel_data *chan) { - const int allowed[] = { 5180, 5500 }; + const int allowed[] = { 5180, 5500, 5955, 6115, 6275, 6435, 6595, 6755, + 6915 }; unsigned int i; for (i = 0; i < ARRAY_SIZE(allowed); i++) @@ -678,8 +685,9 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface, /* HT40 on 5 GHz has a limited set of primary channels as per * 11n Annex J */ if (mode->mode == HOSTAPD_MODE_IEEE80211A && - iface->conf->ieee80211n && - iface->conf->secondary_channel && + ((iface->conf->ieee80211n && + iface->conf->secondary_channel) || + is_6ghz_freq(chan->freq)) && !acs_usable_bw40_chan(chan)) { wpa_printf(MSG_DEBUG, "ACS: Channel %d: not allowed as primary channel for 40 MHz bandwidth", diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index c05058680..8eb033c78 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10963,7 +10963,8 @@ static int add_acs_ch_list(struct nl_msg *msg, const int *freq_list) * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && - !(freq >= 5180 && freq <= 5900)) + !(freq >= 5180 && freq <= 5900) && + !(freq >= 5945 && freq <= 7115)) continue; hw_mode = ieee80211_freq_to_chan(freq, &ch_list[num_channels]); if (hw_mode != NUM_HOSTAPD_MODES)