aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishant Chaprana <n.chaprana@samsung.com>2015-05-13 12:03:48 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-25 15:31:09 (GMT)
commit7b642dc80b965de3cb5c559febc340116aac54cb (patch)
treeb75bd3e047e72a614b6ffd0ffd3efd45272772cd
parentd63f1419b5a5ea84195c180758a93f57311e9b29 (diff)
downloadhostap-7b642dc80b965de3cb5c559febc340116aac54cb.zip
hostap-7b642dc80b965de3cb5c559febc340116aac54cb.tar.gz
hostap-7b642dc80b965de3cb5c559febc340116aac54cb.tar.bz2
P2P: Add D-Bus FindStopped to notify P2P-FIND-STOPPED event
Add D-Bus notification mechanism of P2P-FIND-STOPPED event on fi.w1.wpa_supplicant1.Interface.P2PDevice interface. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
-rw-r--r--doc/dbus.doxygen4
-rw-r--r--wpa_supplicant/dbus/dbus_new.c34
-rw-r--r--wpa_supplicant/dbus/dbus_new.h6
-rw-r--r--wpa_supplicant/notify.c7
-rw-r--r--wpa_supplicant/notify.h1
-rw-r--r--wpa_supplicant/p2p_supplicant.c1
6 files changed, 53 insertions, 0 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index 329e5d0..d623116 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -1287,6 +1287,10 @@ Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations.
</li>
<li>
+ <h3>FindStopped ( )</h3>
+ </li>
+
+ <li>
<h3>ProvisionDiscoveryRequestDisplayPin ( o : peer_object, s : pin )</h3>
</li>
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 89a562c..840d105 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -3039,6 +3039,11 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
END_ARGS
}
},
+ { "FindStopped", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+ {
+ END_ARGS
+ }
+ },
{ "ProvisionDiscoveryRequestDisplayPin", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
{
{ "peer_object", "o", ARG_OUT },
@@ -3530,6 +3535,35 @@ int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
}
+/**
+ * wpas_dbus_signal_p2p_find_stopped - Send P2P Find stopped signal
+ * @wpa_s: %wpa_supplicant network interface data
+ *
+ * Notify listeners about P2P Find stopped
+ */
+void wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s)
+{
+ struct wpas_dbus_priv *iface;
+ DBusMessage *msg;
+
+ iface = wpa_s->global->dbus;
+
+ /* Do nothing if the control interface is not turned on */
+ if (iface == NULL || !wpa_s->dbus_new_path)
+ return;
+
+ msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+ WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+ "FindStopped");
+ if (msg == NULL)
+ return;
+
+ dbus_connection_send(iface->con, msg, NULL);
+
+ dbus_message_unref(msg);
+}
+
+
void wpas_dbus_signal_peer_groups_changed(struct wpa_supplicant *wpa_s,
const u8 *dev_addr)
{
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index d162d2b..31db8d4 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -168,6 +168,7 @@ void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global);
void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global);
int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr);
+void wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s);
void wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
const u8 *dev_addr);
int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
@@ -460,6 +461,11 @@ wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
}
static inline void
+wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s)
+{
+}
+
+static inline void
wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
const u8 *dev_addr)
{
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 184a95c..4df9d90 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -520,6 +520,13 @@ void wpas_notify_resume(struct wpa_global *global)
#ifdef CONFIG_P2P
+void wpas_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s)
+{
+ /* Notify P2P find has stopped */
+ wpas_dbus_signal_p2p_find_stopped(wpa_s);
+}
+
+
void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
const u8 *dev_addr, int new_device)
{
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index b268332..1025ca8 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -84,6 +84,7 @@ void wpas_notify_resume(struct wpa_global *global);
void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
const u8 *mac_addr, int authorized,
const u8 *p2p_dev_addr);
+void wpas_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
const u8 *dev_addr, int new_device);
void wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 7a8a46a..2ccc5ea 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -2248,6 +2248,7 @@ static void wpas_find_stopped(void *ctx)
{
struct wpa_supplicant *wpa_s = ctx;
wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_FIND_STOPPED);
+ wpas_notify_p2p_find_stopped(wpa_s);
}