]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Determine 6 GHz bandwidth in AP mode ACS using op_class parameter
authorPradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Thu, 22 Apr 2021 20:01:03 +0000 (13:01 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 3 May 2021 20:24:13 +0000 (23:24 +0300)
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 <pradeepc@codeaurora.org>
src/ap/acs.c

index bb3446d4b9f36629aacc0aac122e0973b4df121c..a112045364e3213516d3b8ec156a1467151380cb 100644 (file)
@@ -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,