[PATCH v2] ACS: Add 320MHz support for 80211be

Nicolas Escande nico.escande at gmail.com
Mon Nov 13 00:55:55 PST 2023


This enables support for ACS in the 80211be/320MHZ. To do so we just:
  - add channel definitions for the 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 at gmail.com>
---
Changes in v2:
  - fix typo in channel 191 (66755/6755)
  - add missing definitions for channels 31/95/159
---
 src/ap/acs.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/src/ap/acs.c b/src/ap/acs.c
index fdc9c0d35..f84accdd9 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,16 @@ 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[] = {
+	{ 5955, 6255, 31 },  { 6115, 6415, 63 }, { 6275, 6575, 95 },
+	{ 6435, 6735, 127 }, { 6595, 6895, 159}, { 6755, 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 +867,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 +1054,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 +1063,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 +1149,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 +1219,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




More information about the Hostap mailing list