aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/dbus.doxygen4
-rw-r--r--wpa_supplicant/dbus/dbus_new.c6
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.h3
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_wps.c20
4 files changed, 33 insertions, 0 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index d623116..7ad9759 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -877,6 +877,10 @@ Interface for performing WPS (Wi-Fi Simple Config) operations.
<dd>Invalid entries were found in the passed argument.</dd>
</dl>
</li>
+ <li>
+ <h3>Cancel ( nothing ) --> nothing</h3>
+ <p>Cancel ongoing WPS operation.</p>
+ </li>
</ul>
\subsection dbus_wps_properties Properties
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 840d105..85039bc 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -2583,6 +2583,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS
}
},
+ { "Cancel", WPAS_DBUS_NEW_IFACE_WPS,
+ (WPADBusMethodHandler) wpas_dbus_handler_wps_cancel,
+ {
+ END_ARGS
+ }
+ },
#endif /* CONFIG_WPS */
#ifdef CONFIG_P2P
{ "Find", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h
index 6113db5..9afdc05 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers.h
@@ -291,6 +291,9 @@ dbus_bool_t wpas_dbus_setter_network_properties(DBusMessageIter *iter,
DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
struct wpa_supplicant *wpa_s);
+DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message,
+ struct wpa_supplicant *wpa_s);
+
dbus_bool_t wpas_dbus_getter_process_credentials(DBusMessageIter *iter,
DBusError *error, void *user_data);
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_wps.c b/wpa_supplicant/dbus/dbus_new_handlers_wps.c
index 734ac4a..dcae0a9 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_wps.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_wps.c
@@ -320,6 +320,26 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
/**
+ * wpas_dbus_handler_wps_cancel - Cancel ongoing WPS configuration
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: %wpa_supplicant data structure
+ * Returns: NULL on success or DBus error on failure
+ *
+ * Handler for "Cancel" method call. Returns NULL if WPS cancel successfull
+ * or DBus error on WPS cancel failure
+ */
+DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ if (wpas_wps_cancel(wpa_s))
+ return wpas_dbus_error_unknown_error(message,
+ "WPS cancel failed");
+
+ return NULL;
+}
+
+
+/**
* wpas_dbus_getter_process_credentials - Check if credentials are processed
* @message: Pointer to incoming dbus message
* @wpa_s: %wpa_supplicant data structure