This enables support for ACS in the 80211be/320MHZ. To do so we just: - add channel definitions for the 3 320MHZ blocks of the 6GHz band - handle CONF_OPER_CHWIDTH_320MHZ in the different cases - restrict 320MHZ to 80211be only Signed-off-by: Nicolas Escande <nico.escande@xxxxxxxxx> --- src/ap/acs.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ap/acs.c b/src/ap/acs.c index fdc9c0d35..770a571a6 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -246,6 +246,7 @@ enum bw_type { ACS_BW40, ACS_BW80, ACS_BW160, + ACS_BW320, }; struct bw_item { @@ -287,10 +288,15 @@ static const struct bw_item bw_160[] = { { 6435, 6575, 111 }, { 6595, 6735, 143 }, { 6755, 6895, 175 }, { 6915, 7055, 207 }, { -1, -1, -1 } }; +static const struct bw_item bw_320[] = { + { 6115, 6415, 63 }, { 6435, 6735, 127 }, { 66755, 7055, 191 }, + { -1, -1, -1 } +}; static const struct bw_item *bw_desc[] = { [ACS_BW40] = bw_40, [ACS_BW80] = bw_80, [ACS_BW160] = bw_160, + [ACS_BW320] = bw_320, }; @@ -860,6 +866,18 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface, } } + if (mode->mode == HOSTAPD_MODE_IEEE80211A && + iface->conf->ieee80211be) { + if (hostapd_get_oper_chwidth(iface->conf) == + CONF_OPER_CHWIDTH_320MHZ && + !acs_usable_bw_chan(chan, ACS_BW320)) { + wpa_printf(MSG_DEBUG, + "ACS: Channel %d: not allowed as primary channel for 320 MHz bandwidth", + chan->chan); + continue; + } + } + factor = 0; if (acs_usable_chan(chan)) factor = chan->interference_factor; @@ -1035,7 +1053,8 @@ acs_find_ideal_chan(struct hostapd_iface *iface) iface->conf->secondary_channel) n_chans = 2; - if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { + if (iface->conf->ieee80211ac || iface->conf->ieee80211ax || + iface->conf->ieee80211be) { switch (hostapd_get_oper_chwidth(iface->conf)) { case CONF_OPER_CHWIDTH_80MHZ: n_chans = 4; @@ -1043,6 +1062,9 @@ acs_find_ideal_chan(struct hostapd_iface *iface) case CONF_OPER_CHWIDTH_160MHZ: n_chans = 8; break; + case CONF_OPER_CHWIDTH_320MHZ: + n_chans = 16; + break; default: break; } @@ -1126,11 +1148,14 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface) case CONF_OPER_CHWIDTH_160MHZ: center = acs_get_bw_center_chan(iface->freq, ACS_BW160); break; + case CONF_OPER_CHWIDTH_320MHZ: + center = acs_get_bw_center_chan(iface->freq, ACS_BW320); + break; default: /* TODO: How can this be calculated? Adjust * acs_find_ideal_chan() */ wpa_printf(MSG_INFO, - "ACS: Only VHT20/40/80/160 is supported now"); + "ACS: Only VHT20/40/80/160/320 is supported now"); return; } @@ -1193,7 +1218,8 @@ static void acs_study(struct hostapd_iface *iface) iface->conf->punct_bitmap = ideal_chan->punct_bitmap; #endif /* CONFIG_IEEE80211BE */ - if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { + if (iface->conf->ieee80211ac || iface->conf->ieee80211ax || + iface->conf->ieee80211be) { acs_adjust_secondary(iface); acs_adjust_center_freq(iface); } -- 2.42.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap