Updated to hostap_2_6
[mech_eap.git] / libeap / src / ap / hw_features.c
index fc8786d..16887ac 100644 (file)
@@ -329,6 +329,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
        res = ieee80211n_allowed_ht40_channel_pair(iface);
        if (!res) {
                iface->conf->secondary_channel = 0;
+               res = 1;
                wpa_printf(MSG_INFO, "Fallback to 20 MHz");
        }
 
@@ -472,8 +473,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 "