Remove src/common from default header file path
[mech_eap.git] / hostapd / hw_features.c
index c29cd19..e6caf50 100644 (file)
@@ -17,8 +17,8 @@
 #include "includes.h"
 
 #include "hostapd.h"
-#include "ieee802_11_defs.h"
-#include "ieee802_11_common.h"
+#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
 #include "eloop.h"
 #include "hw_features.h"
 #include "driver_i.h"
@@ -329,7 +329,8 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface,
        if (!match) {
                for (i = 0; i < scan_res->num; i++) {
                        struct wpa_scan_res *bss = scan_res->res[i];
-                       ieee80211n_get_pri_sec_chan(bss, &pri_chan, &sec_chan);
+                       ieee80211n_get_pri_sec_chan(bss, &bss_pri_chan,
+                                                   &bss_sec_chan);
                        if (pri_chan == bss_sec_chan &&
                            sec_chan == bss_pri_chan) {
                                wpa_printf(MSG_INFO, "Switch own primary and "
@@ -593,7 +594,7 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface)
  */
 int hostapd_select_hw_mode(struct hostapd_iface *iface)
 {
-       int i, j, ok, ret;
+       int i, j, ok;
 
        if (iface->num_hw_features < 1)
                return -1;
@@ -627,6 +628,13 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
                        break;
                }
        }
+       if (iface->conf->channel == 0) {
+               /* TODO: could request a scan of neighboring BSSes and select
+                * the channel automatically */
+               wpa_printf(MSG_ERROR, "Channel not configured "
+                          "(hw_mode/channel in hostapd.conf)");
+               return -1;
+       }
        if (ok == 0 && iface->conf->channel != 0) {
                hostapd_logger(iface->bss[0], NULL,
                               HOSTAPD_MODULE_IEEE80211,
@@ -654,23 +662,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
                return -1;
        }
 
-       ret = hostapd_passive_scan(iface->bss[0], 0,
-                                  iface->conf->passive_scan_mode,
-                                  iface->conf->passive_scan_interval,
-                                  iface->conf->passive_scan_listen,
-                                  NULL, NULL);
-       if (ret) {
-               if (ret == -1) {
-                       wpa_printf(MSG_DEBUG, "Passive scanning not "
-                                  "supported");
-               } else {
-                       wpa_printf(MSG_ERROR, "Could not set passive "
-                                  "scanning: %s", strerror(ret));
-               }
-               ret = 0;
-       }
-
-       return ret;
+       return 0;
 }