Accumulative patch from commit 52728dcd25b5074fb7c0493a8155f096089ad6d0

P2P: Stop P2P_PD_DURING_FIND wait on PD Response RX
P2P: Postpone P2P scan only if station mode scan is pending
Use special scan result processing steps only on requesting interface
P2P: Re-start P2P operation if station mode scanning is stopped
P2P: Use common function for re-starting P2P scan after station scan

Change-Id: I62bb738a912483647606de1a5bd5357346ebd8f9
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 7a93716..6fb1cae 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -199,16 +199,7 @@
 	 */
 	wpa_supplicant_req_scan(wpa_s, 1, 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->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 "
-				"continued after timed out authentication");
-		}
-	}
-#endif /* CONFIG_P2P */
+	wpas_p2p_continue_after_scan(wpa_s);
 }
 
 
@@ -3575,16 +3566,7 @@
 	wpa_supplicant_req_scan(wpa_s, timeout / 1000,
 				1000 * (timeout % 1000));
 
-#ifdef CONFIG_P2P
-	if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
-	    wpa_s->global->p2p != NULL) {
-		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 "
-				"continued after failed association");
-		}
-	}
-#endif /* CONFIG_P2P */
+	wpas_p2p_continue_after_scan(wpa_s);
 }