From e7ce54023926addb6be4442bd1a87698c57e7524 Mon Sep 17 00:00:00 2001 From: Sunil Dutt Date: Thu, 30 Oct 2014 17:37:46 +0530 Subject: [PATCH] P2P: Delay scan operation only when P2P is not in search state With the radio work interface in place, station interface SCAN command was not scheduled (i.e., it got continously delayed with "Delay station mode scan while P2P operation is in progress") when a p2p_find was operational. Fix this be delaying station mode scan only when a P2P operation is in progress, but not in search state. Signed-off-by: Jouni Malinen --- wpa_supplicant/scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index b95182ec4..4e266f0df 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -603,7 +603,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) { struct wpa_supplicant *wpa_s = eloop_ctx; struct wpa_ssid *ssid; - int ret; + int ret, p2p_in_progress; struct wpabuf *extra_ie = NULL; struct wpa_driver_scan_params params; struct wpa_driver_scan_params *scan_params; @@ -656,7 +656,8 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) return; } - if (wpas_p2p_in_progress(wpa_s)) { + p2p_in_progress = wpas_p2p_in_progress(wpa_s); + if (p2p_in_progress && p2p_in_progress != 2) { wpa_dbg(wpa_s, MSG_DEBUG, "Delay station mode scan while P2P operation is in progress"); wpa_supplicant_req_scan(wpa_s, 5, 0); return;