aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-08-23 16:42:53 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-23 16:42:53 (GMT)
commit99fcd404091a90317f6619e466f544ee32128a23 (patch)
tree111986c2315038ecc5f646d2ca2bbb26d6f30e32 /wpa_supplicant/events.c
parent05a77b3b46eff4aaf2bc7526f56b2fa0dbbc5f1e (diff)
downloadhostap-99fcd404091a90317f6619e466f544ee32128a23.zip
hostap-99fcd404091a90317f6619e466f544ee32128a23.tar.gz
hostap-99fcd404091a90317f6619e466f544ee32128a23.tar.bz2
P2P: Allow scan operations during p2p_find
Previously, all station mode scan operations were either skipped or delayed while any P2P operation was in progress. To make concurrent operations easier to use, reduce this limitation by allowing a scan operation to be completed in the middle of a p2p_find. In addition, allow station mode association to be completed. When the station mode operation is run to its completion (scan results not acted on, connection to an AP completed, connection failed), resume the p2p_find operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0c5c07c..d70eae7 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1027,7 +1027,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_P2P
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
- wpa_s->global->p2p != NULL) {
+ wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
wpa_s->p2p_cb_on_scan_complete = 0;
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
@@ -1035,6 +1035,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
return -1;
}
}
+ wpa_s->sta_scan_pending = 0;
#endif /* CONFIG_P2P */
scan_res = wpa_supplicant_get_scan_results(wpa_s,
@@ -2321,6 +2322,18 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
#ifndef CONFIG_NO_SCAN_PROCESSING
case EVENT_SCAN_RESULTS:
wpa_supplicant_event_scan_results(wpa_s, data);
+#ifdef CONFIG_P2P
+ if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
+ wpa_s->global->p2p != NULL &&
+ wpa_s->wpa_state != WPA_AUTHENTICATING &&
+ wpa_s->wpa_state != WPA_ASSOCIATING) {
+ wpa_s->p2p_cb_on_scan_complete = 0;
+ if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
+ "continued after scan result processing");
+ }
+ }
+#endif /* CONFIG_P2P */
break;
#endif /* CONFIG_NO_SCAN_PROCESSING */
case EVENT_ASSOCINFO: