From ec01d5f6b0bec5f02960b910b78f860a6d0189ad Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 11 Feb 2013 12:21:03 +0200 Subject: [PATCH] P2P: Avoid concurrent scans during all steps of group formation Previously, only some P2P states were considered to postpone concurrent station mode scans during group formation. Especially the WPS provisioning step was skipped due to issues to scans run on the P2P client interface (see commit fc6997b345d97c80965725b12c52b0d225f32a1a). This is not ideal since a concurrent scan can slow down group formation considerably and potentially make it time out. Enforce p2p-in-progress through all steps of group formation on another interface to address this. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 21f5cf646..7d4f2bfe5 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -5359,10 +5359,29 @@ int wpas_p2p_disconnect(struct wpa_supplicant *wpa_s) int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s) { + int ret; + if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL) return 0; - return p2p_in_progress(wpa_s->global->p2p); + ret = p2p_in_progress(wpa_s->global->p2p); + if (ret == 0) { + /* + * Check whether there is an ongoing WPS provisioning step (or + * other parts of group formation) on another interface since + * p2p_in_progress() does not report this to avoid issues for + * scans during such provisioning step. + */ + if (wpa_s->global->p2p_group_formation && + wpa_s->global->p2p_group_formation != wpa_s) { + wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Another interface (%s) " + "in group formation", + wpa_s->global->p2p_group_formation->ifname); + ret = 1; + } + } + + return ret; }