diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen index 943063254..437f9fc0e 100644 --- a/doc/dbus.doxygen +++ b/doc/dbus.doxygen @@ -97,6 +97,11 @@ registered in the bus with fi.w1.wpa_supplicant1 name.
Getting an interface object path failed for an unknown reason.
+ +
  • +

    ExpectDisconnect ( ) --> nothing

    +

    Notify wpa_supplicant of an externally triggered disconnection, e.g., due to system suspend.

    +
  • \subsection dbus_main_properties Properties diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 67d0e2877..9b04ee1c7 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 67562a547..57dc25bfe 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -1579,6 +1579,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 diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h index 50f72ec50..1be81df58 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);