P2P: Delay scan operation only when P2P is not in search state
authorSunil Dutt <usdutt@qti.qualcomm.com>
Thu, 30 Oct 2014 12:07:46 +0000 (17:37 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 30 Oct 2014 22:49:14 +0000 (00:49 +0200)
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 <jouni@qca.qualcomm.com>
wpa_supplicant/scan.c

index b95182e..4e266f0 100644 (file)
@@ -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;