diff options
author | Jouni Malinen <j@w1.fi> | 2009-12-25 18:32:44 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-12-25 18:32:44 +0200 |
commit | 8c5fe31fe87cdd8bd5af51df3bb3f99929770e0f (patch) | |
tree | f9cf704d8c844c92c4965315c016942f563bb333 /hostapd/main.c | |
parent | a4f2110934465c60236a6e3a44a1303022998f3e (diff) | |
download | external_wpa_supplicant_8_ti-8c5fe31fe87cdd8bd5af51df3bb3f99929770e0f.zip external_wpa_supplicant_8_ti-8c5fe31fe87cdd8bd5af51df3bb3f99929770e0f.tar.gz external_wpa_supplicant_8_ti-8c5fe31fe87cdd8bd5af51df3bb3f99929770e0f.tar.bz2 |
Move driver deinitialization away from hostapd.c
This matches with the earlier change of moving driver initialization
and allows more control on how the driver context is managed.
Diffstat (limited to 'hostapd/main.c')
-rw-r--r-- | hostapd/main.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/hostapd/main.c b/hostapd/main.c index 0b9a2d5..79e2969 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -291,7 +291,13 @@ hostapd_interface_init(struct hapd_interfaces *interfaces, 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; } @@ -532,8 +538,16 @@ int main(int argc, char *argv[]) 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); |