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_p2p.c20
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.h3
4 files changed, 34 insertions, 0 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index 7ad9759..0566f0e 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -1074,6 +1074,11 @@ Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations.
</li>
<li>
+ <h3>Cancel ( nothing ) --> nothing</h3>
+ <p>Stop ongoing P2P group formation operation.</p>
+ </li>
+
+ <li>
<h3>Invite ( a{sv} : args ) --> nothing</h3>
<p>Invite a peer to join an already operating group or to re-invoke a persistent group.</p>
<h4>Arguments</h4>
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 85039bc..30c45c2 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -2648,6 +2648,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS
}
},
+ { "Cancel", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+ (WPADBusMethodHandler) wpas_dbus_handler_p2p_cancel,
+ {
+ END_ARGS
+ }
+ },
{ "Invite", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
(WPADBusMethodHandler) wpas_dbus_handler_p2p_invite,
{
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index 9419ba8..e3e2378 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -575,6 +575,26 @@ inv_args:
}
+/**
+ * wpas_dbus_handler_p2p_cancel - Cancel P2P group formation
+ * @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 P2P cancel succeeds or DBus
+ * error on P2P cancel failure
+ */
+DBusMessage * wpas_dbus_handler_p2p_cancel(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ if (wpas_p2p_cancel(wpa_s))
+ return wpas_dbus_error_unknown_error(message,
+ "P2P cancel failed");
+
+ return NULL;
+}
+
+
DBusMessage * wpas_dbus_handler_p2p_invite(DBusMessage *message,
struct wpa_supplicant *wpa_s)
{
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
index fdaccba..fe4b9dc 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
@@ -46,6 +46,9 @@ DBusMessage *wpas_dbus_handler_p2p_connect(
DBusMessage *message,
struct wpa_supplicant *wpa_s);
+DBusMessage * wpas_dbus_handler_p2p_cancel(DBusMessage *message,
+ struct wpa_supplicant *wpa_s);
+
DBusMessage *wpas_dbus_handler_p2p_invite(
DBusMessage *message,
struct wpa_supplicant *wpa_s);