Do not trigger the scan during initialization on Android platforms
authorSunil Dutt <usdutt@qti.qualcomm.com>
Wed, 17 Dec 2014 07:17:10 +0000 (12:47 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 19 Dec 2014 13:24:33 +0000 (15:24 +0200)
Android framework maintains a state to process the scan results after
the scan is issued. If wpa_supplicant issues the scan during the
initialization, the one issued by the framework may fail (with EBUSY) if
the host driver is already processing the scan. Thus, the scan results
returned for the first scan triggered by wpa_supplicant are not
processed for getting displayed resulting in delay for the display of
the first scan results after the Wi-Fi subsystem initialization. Thus,
trigger the scan only based on the framework request on Android.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wpa_supplicant.c

index 8ea023a..995c8d8 100644 (file)
@@ -2931,12 +2931,14 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
                        wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
                        interface_count = 0;
                }
+#ifndef ANDROID
                if (!wpa_s->p2p_mgmt &&
                    wpa_supplicant_delayed_sched_scan(wpa_s,
                                                      interface_count % 3,
                                                      100000))
                        wpa_supplicant_req_scan(wpa_s, interface_count % 3,
                                                100000);
+#endif /* ANDROID */
                interface_count++;
        } else
                wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);