aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/p2p_supplicant.c1
-rw-r--r--wpa_supplicant/scan.c6
-rw-r--r--wpa_supplicant/scan.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 76ddf0f..94a8219 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -151,6 +151,7 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
if (ifs->sta_scan_pending &&
+ (wpas_scan_scheduled(ifs) || ifs->scanning) &&
wpas_p2p_in_progress(wpa_s) == 2) {
wpa_printf(MSG_DEBUG, "Delaying P2P scan to allow "
"pending station mode scan to be "
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 29a430c..1a4f695 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1613,3 +1613,9 @@ void scan_only_handler(struct wpa_supplicant *wpa_s,
wpas_notify_scan_results(wpa_s);
wpas_notify_scan_done(wpa_s, 1);
}
+
+
+int wpas_scan_scheduled(struct wpa_supplicant *wpa_s)
+{
+ return eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL);
+}
diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h
index 5ecfa00..e892479 100644
--- a/wpa_supplicant/scan.h
+++ b/wpa_supplicant/scan.h
@@ -35,5 +35,6 @@ int wpa_supplicant_filter_bssid_match(struct wpa_supplicant *wpa_s,
void wpa_supplicant_update_scan_int(struct wpa_supplicant *wpa_s, int sec);
void scan_only_handler(struct wpa_supplicant *wpa_s,
struct wpa_scan_results *scan_res);
+int wpas_scan_scheduled(struct wpa_supplicant *wpa_s);
#endif /* SCAN_H */