aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/dbus.doxygen5
-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
4 files changed, 35 insertions, 0 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index 9430632..437f9fc 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -97,6 +97,11 @@ registered in the bus with fi.w1.wpa_supplicant1 name.
<dd>Getting an interface object path failed for an unknown reason.</dd>
</dl>
</li>
+
+ <li>
+ <h3>ExpectDisconnect ( ) --> nothing</h3>
+ <p>Notify wpa_supplicant of an externally triggered disconnection, e.g., due to system suspend.</p>
+ </li>
</ul>
\subsection dbus_main_properties Properties
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);