]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Avoid 20/40 MHz co-ex scan if PRI/SEC switch is not allowed
authorAlexander Bondar <alexander.bondar@intel.com>
Tue, 3 Nov 2015 14:25:00 +0000 (16:25 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 21 Nov 2015 16:42:53 +0000 (18:42 +0200)
When an AP is started on the 5.2 GHz band with 40 MHz bandwidth, a
scan is issued in order to handle 20/40 MHz coexistence. However,
the scan is issued even if iface->conf->no_pri_sec_switch is set,
which is redundant.

Fix this by checking iface->conf->no_pri_sec_switch before starting
the scan.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
src/ap/hw_features.c

index fc8786dc311cafd106d08a00ddec53dcbf6e9dc1..360706684f8414740864f520c199c06fda28398d 100644 (file)
@@ -472,8 +472,9 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
        struct wpa_driver_scan_params params;
        int ret;
 
-       if (!iface->conf->secondary_channel)
-               return 0; /* HT40 not used */
+       /* Check that HT40 is used and PRI / SEC switch is allowed */
+       if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
+               return 0;
 
        hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
        wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling "