{
hostapd_ctrl_iface_deinit(hapd);
- os_free(hapd->default_wep_key);
- hapd->default_wep_key = NULL;
iapp_deinit(hapd->iapp);
hapd->iapp = NULL;
accounting_deinit(hapd);
size_t i;
char country[4];
u8 *b = conf->bssid;
- int freq;
- size_t j;
- u8 *prev_addr;
/*
* Initialize the driver interface and make sure that all BSSes get
iface->bss[i]->drv_priv = hapd->drv_priv;
}
+ if (hostapd_driver_set_mode(hapd, IEEE80211_MODE_AP)) {
+ wpa_printf(MSG_ERROR, "Failed to set driver in AP mode");
+ return -1;
+ }
+
if (hostapd_validate_bssid_configuration(iface))
return -1;
}
}
- if (hapd->iconf->ieee80211d &&
- hostapd_set_ieee80211d(hapd, 1) < 0) {
- wpa_printf(MSG_ERROR, "Failed to set ieee80211d (%d)",
- hapd->iconf->ieee80211d);
- return -1;
- }
-
if (hapd->iconf->bridge_packets != INTERNAL_BRIDGE_DO_NOT_CONTROL &&
hostapd_set_internal_bridge(hapd, hapd->iconf->bridge_packets)) {
wpa_printf(MSG_ERROR, "Failed to set bridge_packets for "
"channel. (%d)", ret);
return -1;
}
+ ret = hostapd_check_ht_capab(iface);
+ if (ret < 0)
+ return -1;
+ if (ret == 1) {
+ wpa_printf(MSG_DEBUG, "Interface initialization will "
+ "be completed in a callback");
+ return 0;
+ }
}
+ return hostapd_setup_interface_complete(iface, 0);
+}
+
+int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err)
+{
+ struct hostapd_data *hapd = iface->bss[0];
+ int freq;
+ size_t j;
+ u8 *prev_addr;
+
+ if (err) {
+ wpa_printf(MSG_ERROR, "Interface initialization failed");
+ eloop_terminate();
+ return -1;
+ }
+
+ wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (hapd->iconf->channel) {
freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
wpa_printf(MSG_DEBUG, "Mode: %s Channel: %d "
return -1;
}
+ wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
+ iface->bss[0]->conf->iface);
+
return 0;
}
iface->bss[0]->conf->iface);
eloop_terminate();
return -1;
- } else if (!hostapd_drv_none(iface->bss[0])) {
- wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
- iface->bss[0]->conf->iface);
}
return 0;
hapd->conf = bss;
hapd->iface = hapd_iface;
- if (hapd->conf->individual_wep_key_len > 0) {
- /* use key0 in individual key and key1 in broadcast key */
- hapd->default_wep_key_idx = 1;
- }
-
#ifdef EAP_TLS_FUNCS
if (hapd->conf->eap_server &&
(hapd->conf->ca_cert || hapd->conf->server_cert ||