Allow advertising of U-APSD functionality in Beacon
[libeap.git] / hostapd / config_file.c
index 0554f12..8916b03 100644 (file)
  * See README and COPYING for more details.
  */
 
-#include "includes.h"
+#include "utils/includes.h"
 #ifndef CONFIG_NATIVE_WINDOWS
 #include <grp.h>
 #endif /* CONFIG_NATIVE_WINDOWS */
 
-#include "common.h"
-#include "uuid.h"
+#include "utils/common.h"
+#include "utils/uuid.h"
 #include "common/ieee802_11_defs.h"
 #include "drivers/driver.h"
 #include "eap_server/eap.h"
 #include "radius/radius_client.h"
-#include "wpa.h"
-#include "config.h"
+#include "ap/wpa_auth.h"
+#include "ap/ap_config.h"
+#include "config_file.h"
 
 
 extern struct wpa_driver_ops *wpa_drivers[];
@@ -1148,6 +1149,16 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                fclose(f);
                return NULL;
        }
+
+       /* set default driver based on configuration */
+       conf->driver = wpa_drivers[0];
+       if (conf->driver == NULL) {
+               wpa_printf(MSG_ERROR, "No driver wrappers registered!");
+               hostapd_config_free(conf);
+               fclose(f);
+               return NULL;
+       }
+
        bss = conf->last_bss = conf->bss;
 
        while (fgets(buf, sizeof(buf), f)) {
@@ -1804,6 +1815,8 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                } else if (os_strcmp(buf, "wme_enabled") == 0 ||
                           os_strcmp(buf, "wmm_enabled") == 0) {
                        bss->wmm_enabled = atoi(pos);
+               } else if (os_strcmp(buf, "uapsd_advertisement_enabled") == 0) {
+                       bss->wmm_uapsd = atoi(pos);
                } else if (os_strncmp(buf, "wme_ac_", 7) == 0 ||
                           os_strncmp(buf, "wmm_ac_", 7) == 0) {
                        if (hostapd_config_wmm_ac(conf, buf, pos)) {