#include "drivers/driver.h"
#include "ap/config.h"
-static inline void
-hostapd_driver_deinit(struct hostapd_data *hapd)
-{
- if (hapd->driver == NULL || hapd->driver->hapd_deinit == NULL)
- return;
- hapd->driver->hapd_deinit(hapd->drv_priv);
-}
-
static inline int
hostapd_set_ieee8021x(struct hostapd_data *hapd, struct wpa_bss_params *params)
{
hostapd_free_stas(hapd);
hostapd_flush_old_stations(hapd);
hostapd_cleanup(hapd);
- if (j == iface->num_bss - 1 && hapd->driver)
- hostapd_driver_deinit(hapd);
}
for (j = 0; j < iface->num_bss; j++)
os_free(iface->bss[j]);
if (hostapd_driver_init(iface) ||
hostapd_setup_interface(iface)) {
+ const struct wpa_driver_ops *driver;
+ void *drv_priv;
+ driver = iface->bss[0]->driver;
+ drv_priv = iface->bss[0]->drv_priv;
hostapd_interface_deinit(iface);
+ if (driver && driver->hapd_deinit)
+ driver->hapd_deinit(drv_priv);
return NULL;
}
out:
/* Deinitialize all interfaces */
- for (i = 0; i < interfaces.count; i++)
- hostapd_interface_deinit(interfaces.iface[i]);
+ for (i = 0; i < interfaces.count; i++) {
+ struct hostapd_iface *iface = interfaces.iface[i];
+ const struct wpa_driver_ops *driver;
+ void *drv_priv;
+ driver = iface->bss[0]->driver;
+ drv_priv = iface->bss[0]->drv_priv;
+ hostapd_interface_deinit(iface);
+ if (driver && driver->hapd_deinit)
+ driver->hapd_deinit(drv_priv);
+ }
os_free(interfaces.iface);
hostapd_global_deinit(pid_file);
void wpa_supplicant_ap_deinit(struct wpa_supplicant *wpa_s)
{
+ const struct wpa_driver_ops *driver;
+ void *drv_priv;
+
if (wpa_s->ap_iface == NULL)
return;
+ driver = wpa_s->ap_iface->bss[0]->driver;
+ drv_priv = wpa_s->ap_iface->bss[0]->drv_priv;
hostapd_interface_deinit(wpa_s->ap_iface);
wpa_s->ap_iface = NULL;
+ if (driver && driver->hapd_deinit)
+ driver->hapd_deinit(drv_priv);
}