[PATCH v2] Fix ACS when using 20MHz channels in 6GHz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When configured to use ACS with 20MHz channels, hostapd incorrectly rejects
half of the available channels with an error messages "Channel XX: not
allowed as primary channel for 40 MHz bandwidth." This includes all PSC
channels.

Signed-off-by: Matěj Vrba <matej.vrba@xxxxxxxxxxxx>
---
 src/ap/acs.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/ap/acs.c b/src/ap/acs.c
index 44d083684..7c6bdc003 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -889,11 +889,10 @@ 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) ||
-            is_6ghz_freq(chan->freq)) &&
-           !acs_usable_bw_chan(chan, ACS_BW40)) {
+       if (bw == 40 &&
+           mode->mode == HOSTAPD_MODE_IEEE80211A &&
+           iface->conf->ieee80211n &&
+           !acs_usable_bw_chan(chan, ACS_BW40)) {
            wpa_printf(MSG_DEBUG,
                   "ACS: Channel %d: not allowed as primary channel for 40 MHz bandwidth",
                   chan->chan);
@@ -903,18 +902,14 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
        if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
            (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
             iface->conf->ieee80211be)) {
-           if (hostapd_get_oper_chwidth(iface->conf) ==
-               CONF_OPER_CHWIDTH_80MHZ &&
-               !acs_usable_bw_chan(chan, ACS_BW80)) {
+           if (bw == 80 && !acs_usable_bw_chan(chan, ACS_BW80)) {
                wpa_printf(MSG_DEBUG,
                       "ACS: Channel %d: not allowed as primary channel for 80 MHz bandwidth",
                       chan->chan);
                continue;
            }
 
-           if (hostapd_get_oper_chwidth(iface->conf) ==
-               CONF_OPER_CHWIDTH_160MHZ &&
-               !acs_usable_bw_chan(chan, ACS_BW160)) {
+           if (bw == 160 && !acs_usable_bw_chan(chan, ACS_BW160)) {
                wpa_printf(MSG_DEBUG,
                       "ACS: Channel %d: not allowed as primary channel for 160 MHz bandwidth",
                       chan->chan);
@@ -924,10 +919,12 @@ 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_bw320_chan(iface, chan, &bw320_offset))
+           if (bw == 320 && !acs_usable_bw320_chan(iface, chan, &bw320_offset)){
+               wpa_printf(MSG_DEBUG,
+                      "ACS: Channel %d: not allowed as primary channel for 320 MHz bandwidth",
+                      chan->chan);
                continue;
+           }
        }
 
        factor = 0;
-- 
2.49.0

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux