[PATCH] p2p_supplicant: probe reporting should be from listen interface

Arend van Spriel arend at broadcom.com
Thu Mar 28 10:39:03 EDT 2013


P2P listen phase is used to listen for P2P probe request messages
from peers. The probe reporting call should be done on the same
interface as the remain_on_channel.

Cc: Greg Goldman <ggoldman at broadcom.com>
Cc: Jithu Jance <jithu at broadcom.com>
Cc: Johannes Berg <johannes at sipsolutions.net>
Signed-hostap: Arend van Spriel <arend at broadcom.com>
---
Hi David,

Found during testing that my device was not found, because we were not
responding to P2P probe requests during the listen phase.

This patch fixes it for my driver and it kind of makes sense to me that
the probe request reporting should be done on the same interface as the
on doing the LISTEN.

Not sure whether the P2P device patches are already applied so sending
this patch to you first.

Regards,
Arend
---
 wpa_supplicant/driver_i.h       |    9 +++++++++
 wpa_supplicant/p2p_supplicant.c |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index d70da3d..c7de723 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -734,6 +734,15 @@ wpa_drv_p2p_send_action_cancel_wait(struct wpa_supplicant *wpa_s)
 		wpa_s->driver->send_action_cancel_wait(wpa_p2p_get_priv(wpa_s));
 }

+static inline int wpa_drv_p2p_probe_req_report(struct wpa_supplicant *wpa_s,
+					       int report)
+{
+	if (wpa_s->driver->probe_req_report)
+		return wpa_s->driver->probe_req_report(wpa_p2p_get_priv(wpa_s),
+						       report);
+	return -1;
+}
+
 static inline int wpa_drv_p2p_remain_on_channel(struct wpa_supplicant *wpa_s,
 						unsigned int freq,
 						unsigned int duration)
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a6f7614..fefa86f 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1229,7 +1229,7 @@ static int wpas_start_listen(void *ctx, unsigned int freq,

 	wpa_drv_set_ap_wps_ie(wpa_s, NULL, probe_resp_ie, NULL);

-	if (wpa_drv_probe_req_report(wpa_s, 1) < 0) {
+	if (wpa_drv_p2p_probe_req_report(wpa_s, 1) < 0) {
 		wpa_printf(MSG_DEBUG, "P2P: Failed to request the driver to "
 			   "report received Probe Request frames");
 		return -1;
@@ -1261,7 +1261,7 @@ static void wpas_stop_listen(void *ctx)
 		wpa_s->roc_waiting_drv_freq = 0;
 	}
 	wpa_drv_set_ap_wps_ie(wpa_s, NULL, NULL, NULL);
-	wpa_drv_probe_req_report(wpa_s, 0);
+	wpa_drv_p2p_probe_req_report(wpa_s, 0);
 }


--
1.7.10.4




More information about the HostAP mailing list