From 6ae0d78b8e42670388a939322f2ebcbe6e2f709e Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Chitrapu Date: Thu, 22 Apr 2021 13:01:03 -0700 Subject: [PATCH] Determine 6 GHz bandwidth in AP mode ACS using op_class parameter Determine bandwidth from op_class parameter when set in config. When not configured, use he_oper_chwidth for determining 80 MHz or 160 MHz. When both are not set, fall back to 20 MHz by default. This helps in removing the dependency on op_class parameter in 6 GHz ACS. Signed-off-by: Pradeep Kumar Chitrapu --- src/ap/acs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ap/acs.c b/src/ap/acs.c index bb3446d4b..a11204536 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -841,6 +841,12 @@ acs_find_ideal_chan(struct hostapd_iface *iface) u32 bw; struct hostapd_hw_modes *mode; + if (is_6ghz_op_class(iface->conf->op_class)) { + bw = op_class_to_bandwidth(iface->conf->op_class); + n_chans = bw / 20; + goto bw_selected; + } + /* TODO: HT40- support */ if (iface->conf->ieee80211n && @@ -866,6 +872,7 @@ acs_find_ideal_chan(struct hostapd_iface *iface) bw = num_chan_to_bw(n_chans); +bw_selected: /* TODO: VHT/HE80+80. Update acs_adjust_center_freq() too. */ wpa_printf(MSG_DEBUG,