aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>2018-06-14 09:00:43 (GMT)
committerJouni Malinen <j@w1.fi>2019-12-30 16:51:06 (GMT)
commit02c21c02d09fdce55c0048cc58ff870cab77c9e9 (patch)
tree9c41ac0eba453c8edcf59bab91b925d8f1ef725c
parent82ba4f2d1b360f88efc81c8cd6502bd4c5d1549d (diff)
downloadhostap-02c21c02d09fdce55c0048cc58ff870cab77c9e9.zip
hostap-02c21c02d09fdce55c0048cc58ff870cab77c9e9.tar.gz
hostap-02c21c02d09fdce55c0048cc58ff870cab77c9e9.tar.bz2
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>
-rw-r--r--wpa_supplicant/driver_i.h7
-rw-r--r--wpa_supplicant/wpa_supplicant.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index cf9972a..31643a8 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -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)
{
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 2ef1dcd..ce4ce0b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -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);
+ 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);