aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-09-27 19:21:31 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-15 15:53:13 (GMT)
commita4cba8f1e208c95218f89daec01cbcb59d97dc6c (patch)
tree5b778c7d30bd15b01f3771345628b0ba4bd5b373
parentd21c63b925ac0d7dd5e5697445dc598591d8c1b7 (diff)
downloadhostap-a4cba8f1e208c95218f89daec01cbcb59d97dc6c.zip
hostap-a4cba8f1e208c95218f89daec01cbcb59d97dc6c.tar.gz
hostap-a4cba8f1e208c95218f89daec01cbcb59d97dc6c.tar.bz2
Use sched_scan in driver init
This patch uses sched_scan, if available, when the driver is initialized. It also adds a couple of cancel operations where appropriate. Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--wpa_supplicant/events.c8
-rw-r--r--wpa_supplicant/sme.c1
-rw-r--r--wpa_supplicant/wpa_supplicant.c7
3 files changed, 13 insertions, 3 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 08ed7be..9d83e4d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -996,10 +996,14 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
*/
timeout_sec = 0;
timeout_usec = 250000;
+ wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
+ timeout_usec);
+ return 0;
}
#endif /* CONFIG_P2P */
- wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
- timeout_usec);
+ if (wpa_supplicant_req_sched_scan(wpa_s))
+ wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
+ timeout_usec);
}
}
return 0;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index dbf385e..4cb5062 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -237,6 +237,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_P2P */
+ wpa_supplicant_cancel_sched_scan(wpa_s);
wpa_supplicant_cancel_scan(wpa_s);
wpa_msg(wpa_s, MSG_INFO, "SME: Trying to authenticate with " MACSTR
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 3d1fa9b..9fa737c 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -446,6 +446,8 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
offchannel_deinit(wpa_s);
#endif /* CONFIG_OFFCHANNEL */
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+
os_free(wpa_s->next_scan_freqs);
wpa_s->next_scan_freqs = NULL;
@@ -1176,6 +1178,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
}
+ wpa_supplicant_cancel_sched_scan(wpa_s);
wpa_supplicant_cancel_scan(wpa_s);
/* Starting new association, so clear the possibly used WPA IE from the
@@ -2087,7 +2090,9 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
if (wpa_supplicant_enabled_networks(wpa_s->conf)) {
- wpa_supplicant_req_scan(wpa_s, interface_count, 100000);
+ if (wpa_supplicant_req_sched_scan(wpa_s))
+ wpa_supplicant_req_scan(wpa_s, interface_count,
+ 100000);
interface_count++;
} else
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);