[PATCH] P2P:Remove scheduling of p2p scan without handling the STA scan results

Neeraj Kumar Garg neerajkg
Wed Oct 24 03:10:23 PDT 2012


If STA scan is issued by UI/application (even after STA connection is made) and then immediately, if we issue p2p_find, p2p_search will get delayed. Upon completion of STA scan, we will check for p2p_search if pending. Since p2p_search is pending, p2p_search will be issued. Upon return of p2p_search successful, supplicant will then unnecessarily schedules a STA scan again. At this time, supplicant will also ignore the received scan results. Now once p2p_search will be over, it will check if STA scan is pending. And then it will issue a STA scan. Upon getting STA scan results, we will again check if p2p_search is pending. And after scheduling the p2p_search successfully, again we will issue a STA scan.

I am not sure, what is the intent of checking for p2p_search possibility after receiving the scan_results. We can let the supplicant, process the STA scan_results. And then after that, we already have a check for scheduling the p2p_search after wpa_supplicant_event_scan_results() is completed.

If the code (removed in the below patch) is to take care of STA connection scenario, then once the STA connection is successful, we will schedule the p2p_search from that context.

From: Neeraj Garg <neerajkg at broadcom.com>
Date: Wed, 24 Oct 2012 15:27:47 +0530
Subject: [PATCH] PATCH:P2P Remove scheduling of p2p scan without handling the STA scan results

Signed-off-by: Neeraj Garg <neerajkg at broadcom.com>
---
 wpa_supplicant/events.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)
 mode change 100644 => 100755 wpa_supplicant/events.c

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
old mode 100644
new mode 100755
index 53b8338..68bf3eb
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1070,19 +1070,6 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 	wpa_supplicant_notify_scanning(wpa_s, 0);
 
 #ifdef CONFIG_P2P
-	if (wpa_s->global->p2p_cb_on_scan_complete &&
-	    !wpa_s->global->p2p_disabled &&
-	    wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending &&
-	    !wpa_s->scan_res_handler) {
-		wpa_s->global->p2p_cb_on_scan_complete = 0;
-		if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
-			wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
-				"stopped scan processing");
-			wpa_s->sta_scan_pending = 1;
-			wpa_supplicant_req_scan(wpa_s, 5, 0);
-			return -1;
-		}
-	}
 	wpa_s->sta_scan_pending = 0;
 #endif /* CONFIG_P2P */
 
-- 
1.7.4.1





More information about the Hostap mailing list