wpa_supplicant: Do not disconnect on deinit if WoWLAN is enabled

Do not disconnect on interface deinit when WoWLAN is enabled, so we can
boot the system with WoWLAN after S5 (poweroff).

Signed-off-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
This commit is contained in:
Alfonso Sánchez-Beato 2018-06-14 11:00:43 +02:00 committed by Jouni Malinen
parent 82ba4f2d1b
commit 02c21c02d0
2 changed files with 17 additions and 4 deletions

View file

@ -681,6 +681,13 @@ static inline int wpa_drv_set_qos_map(struct wpa_supplicant *wpa_s,
qos_map_set_len);
}
static inline int wpa_drv_get_wowlan(struct wpa_supplicant *wpa_s)
{
if (!wpa_s->driver->get_wowlan)
return 0;
return wpa_s->driver->get_wowlan(wpa_s->drv_priv);
}
static inline int wpa_drv_wowlan(struct wpa_supplicant *wpa_s,
const struct wowlan_triggers *triggers)
{

View file

@ -6318,11 +6318,17 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
wpa_s->disconnected = 1;
if (wpa_s->drv_priv) {
wpa_supplicant_deauthenticate(wpa_s,
WLAN_REASON_DEAUTH_LEAVING);
/* Don't deauthenticate if WoWLAN is enabled */
if (!wpa_drv_get_wowlan(wpa_s)) {
wpa_supplicant_deauthenticate(
wpa_s, WLAN_REASON_DEAUTH_LEAVING);
wpa_drv_set_countermeasures(wpa_s, 0);
wpa_clear_keys(wpa_s, NULL);
} else {
wpa_msg(wpa_s, MSG_INFO,
"Do not deauthenticate as part of interface deinit since WoWLAN is enabled");
}
}
wpa_supplicant_cleanup(wpa_s);