From 6fc48481e41fde6e445b9bcc71a770d663dfb618 Mon Sep 17 00:00:00 2001 From: Rashmi Ramanna Date: Tue, 12 Nov 2013 19:47:35 +0530 Subject: [PATCH] P2P: Short scan wait to speed up the group re-invocation The shorter 250 ms wait for the next scan request can be used also for the case of persistent group re-invocation instead of just formation of a new group. This speeds up the process and makes this more robust especially in cases where the GO is using MCC. Signed-hostap: Jouni Malinen --- wpa_supplicant/events.c | 6 ++++-- wpa_supplicant/p2p_supplicant.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index b70e1fb71..35712e58e 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1353,10 +1353,12 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, if (wpas_p2p_scan_no_go_seen(wpa_s) == 1) return 0; - if (wpa_s->p2p_in_provisioning) { + if (wpa_s->p2p_in_provisioning || + wpa_s->show_group_started) { /* * Use shorter wait during P2P Provisioning - * state to speed up group formation. + * state and during P2P join-a-group operation + * to speed up group formation. */ timeout_sec = 0; timeout_usec = 250000; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 963a0b806..fecc25936 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4774,10 +4774,10 @@ static int wpas_start_p2p_client(struct wpa_supplicant *wpa_s, if (params->passphrase) ssid->passphrase = os_strdup(params->passphrase); - wpa_supplicant_select_network(wpa_s, ssid); - wpa_s->show_group_started = 1; + wpa_supplicant_select_network(wpa_s, ssid); + return 0; }