aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2015-09-29 21:13:33 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-12 15:03:11 (GMT)
commitc143c3b72a63ad9b0a2d159153731204375bf89a (patch)
treee422e7d7d352b66a3c202356aa2b00e2ff208fac /wpa_supplicant
parent7966674d734c7c56c2d33852fd3f42369bf18645 (diff)
downloadhostap-c143c3b72a63ad9b0a2d159153731204375bf89a.zip
hostap-c143c3b72a63ad9b0a2d159153731204375bf89a.tar.gz
hostap-c143c3b72a63ad9b0a2d159153731204375bf89a.tar.bz2
D-Bus: Add a dbus handler for expected disconnection
Add a global D-Bus handler ExpectDisconnect for setting wpa_s->own_disconnect_req flag. This flag will prevent wpa_supplicant from adding blacklists and requesting incomplete scan upon the incoming disconnection. This is mainly meant for a case where suspend/resume is used and some external component knows about that and can provide the information to wpa_supplicant before the disconnection happens. Signed-off-by: Ningyuan Wang <nywang@google.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/dbus/dbus_new.c6
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c21
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.h3
3 files changed, 30 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 67d0e28..9b04ee1 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -2172,6 +2172,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_global_methods[] = {
END_ARGS
}
},
+ { "ExpectDisconnect", WPAS_DBUS_NEW_INTERFACE,
+ (WPADBusMethodHandler) wpas_dbus_handler_expect_disconnect,
+ {
+ END_ARGS
+ }
+ },
{ NULL, NULL, NULL, { END_ARGS } }
};
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 67562a5..57dc25b 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1580,6 +1580,27 @@ DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message,
/**
+ * wpas_dbus_handler_expect_disconnect - ExpectDisconnect
+ * @message: Pointer to incoming dbus message
+ * @global: %wpa_supplicant global data structure
+ * Returns: NULL
+ *
+ * Handler function for notifying system there will be a expected disconnect.
+ * This will prevent wpa_supplicant from adding blacklists upon next disconnect..
+ */
+DBusMessage * wpas_dbus_handler_expect_disconnect(DBusMessage *message,
+ struct wpa_global *global)
+{
+ struct wpa_supplicant *wpa_s = global->ifaces;
+
+ for (; wpa_s; wpa_s = wpa_s->next)
+ if (wpa_s->wpa_state >= WPA_ASSOCIATED)
+ wpa_s->own_disconnect_req = 1;
+ return NULL;
+}
+
+
+/**
* wpas_dbus_handler_reattach - Reattach to current AP
* @message: Pointer to incoming dbus message
* @wpa_s: wpa_supplicant structure for a network interface
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h
index 50f72ec..1be81df 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers.h
@@ -50,6 +50,9 @@ DBusMessage * wpas_dbus_handler_remove_interface(DBusMessage *message,
DBusMessage * wpas_dbus_handler_get_interface(DBusMessage *message,
struct wpa_global *global);
+DBusMessage * wpas_dbus_handler_expect_disconnect(DBusMessage *message,
+ struct wpa_global *global);
+
dbus_bool_t wpas_dbus_getter_debug_level(DBusMessageIter *iter,
DBusError *error,
void *user_data);