[PATCH] P2P: Notify device expiry via P2P-DEVICE-LOST event.

Jithu Jance jithu at broadcom.com
Tue Oct 25 20:46:14 EDT 2011


This patch will notify applications listening over control socket about the device expiry [from p2p peer list]. Kindly see whether the patch is okay.


---
 src/common/wpa_ctrl.h           |    4 ++++
 wpa_supplicant/p2p_supplicant.c |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index fd096e7..6cd9de5 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -99,6 +99,10 @@ extern "C" {

 /** P2P device found */
 #define P2P_EVENT_DEVICE_FOUND "P2P-DEVICE-FOUND "
+
+/** P2P device lost */
+#define P2P_EVENT_DEVICE_LOST "P2P-DEVICE-LOST "
+
 /** A P2P device requested GO negotiation, but we were not ready to start the
  * negotiation */
 #define P2P_EVENT_GO_NEG_REQUEST "P2P-GO-NEG-REQUEST "
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 55e84a1..722311c 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -983,6 +983,8 @@ static void wpas_dev_lost(void *ctx, const u8 *dev_addr)
 {
        struct wpa_supplicant *wpa_s = ctx;

+       wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_LOST
+               "p2p_dev_addr=" MACSTR, MAC2STR(dev_addr));
        wpas_notify_p2p_device_lost(wpa_s, dev_addr);
 }

-- 
1.7.4.1


- Jithu Jance.



More information about the HostAP mailing list