]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Allow hw_mode=any to be used with internal ACS algorithm
authorNeo Jou <neojou@gmail.com>
Mon, 13 Jan 2020 08:31:28 +0000 (16:31 +0800)
committerJouni Malinen <j@w1.fi>
Sat, 29 Feb 2020 09:23:03 +0000 (11:23 +0200)
This was already supported in the offload ACS case and this commit
completes support for this with the internal ACS algorithm.

Signed-off-by: Neo Jou <neojou@gmail.com>
src/ap/acs.c
src/ap/hw_features.c

index ecd42d8775612762faf5615e33ff62c4db8be8de..5c016107061f0f791859119d3d7efa1e6e3741d1 100644 (file)
@@ -1085,7 +1085,8 @@ enum hostapd_chan_status acs_init(struct hostapd_iface *iface)
                return HOSTAPD_CHAN_ACS;
        }
 
-       if (!iface->current_mode)
+       if (!iface->current_mode &&
+           iface->conf->hw_mode != HOSTAPD_MODE_IEEE80211ANY)
                return HOSTAPD_CHAN_INVALID;
 
        acs_cleanup(iface);
index 72de45cac4b3a799c44d0fa9946d0155acf7b673..b73cc88e0cb19b9bc5f7003afa75f4ce4051e7d7 100644 (file)
@@ -1041,9 +1041,15 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
        }
 
        if (iface->current_mode == NULL) {
-               if (!(iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) ||
-                   !(iface->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY))
-               {
+               if ((iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) &&
+                   (iface->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY)) {
+                       wpa_printf(MSG_DEBUG,
+                                  "Using offloaded hw_mode=any ACS");
+               } else if (!(iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) &&
+                          iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211ANY) {
+                       wpa_printf(MSG_DEBUG,
+                                  "Using internal ACS for hw_mode=any");
+               } else {
                        wpa_printf(MSG_ERROR,
                                   "Hardware does not support configured mode");
                        hostapd_logger(iface->bss[0], NULL,