aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2013-10-15 20:24:53 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2013-10-15 20:24:53 -0700
commit1b9c752d45e69e38e5babbb7e3d130291bf3c9f8 (patch)
treec4545cf8ed7c73bb564ac4e475f69568b083374a
parent679c0c78c2a2d91e4d311e4d3ec2254a38b1926e (diff)
parent67cceb9a375efc9067d3561501490bb0b50b9a15 (diff)
downloadandroid_external_wpa_supplicant_8-1b9c752d45e69e38e5babbb7e3d130291bf3c9f8.tar.gz
android_external_wpa_supplicant_8-1b9c752d45e69e38e5babbb7e3d130291bf3c9f8.tar.bz2
android_external_wpa_supplicant_8-1b9c752d45e69e38e5babbb7e3d130291bf3c9f8.zip
Merge "P2P: Extend group formation timeout on GO to first data connection"
-rw-r--r--wpa_supplicant/p2p_supplicant.c39
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h1
2 files changed, 36 insertions, 4 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index ab164f64..f6edc54a 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -663,8 +663,10 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
*/
if (wpa_s->global->p2p_group_formation)
wpa_s = wpa_s->global->p2p_group_formation;
- wpa_s->global->p2p_group_formation = NULL;
- wpa_s->p2p_in_provisioning = 0;
+ if (wpa_s->p2p_go_group_formation_completed) {
+ wpa_s->global->p2p_group_formation = NULL;
+ wpa_s->p2p_in_provisioning = 0;
+ }
if (!success) {
wpa_msg(wpa_s->parent, MSG_INFO,
@@ -4601,6 +4603,7 @@ void wpas_p2p_wps_success(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
eloop_cancel_timeout(wpas_p2p_group_formation_timeout, wpa_s->parent,
NULL);
+ wpa_s->p2p_go_group_formation_completed = 1;
if (ssid && ssid->mode == WPAS_MODE_INFRA) {
/*
* Use a separate timeout for initial data connection to
@@ -4608,9 +4611,28 @@ void wpas_p2p_wps_success(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
* something goes wrong in this step before the P2P group idle
* timeout mechanism is taken into use.
*/
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "P2P: Re-start group formation timeout (%d seconds) as client for initial connection",
+ P2P_MAX_INITIAL_CONN_WAIT);
eloop_register_timeout(P2P_MAX_INITIAL_CONN_WAIT, 0,
wpas_p2p_group_formation_timeout,
wpa_s->parent, NULL);
+ } else if (ssid) {
+ /*
+ * Use a separate timeout for initial data connection to
+ * complete to allow the group to be removed automatically if
+ * the client does not complete data connection successfully.
+ */
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "P2P: Re-start group formation timeout (%d seconds) as GO for initial connection",
+ P2P_MAX_INITIAL_CONN_WAIT_GO);
+ eloop_register_timeout(P2P_MAX_INITIAL_CONN_WAIT_GO, 0,
+ wpas_p2p_group_formation_timeout,
+ wpa_s->parent, NULL);
+ /*
+ * Complete group formation on first successful data connection
+ */
+ wpa_s->p2p_go_group_formation_completed = 0;
}
if (wpa_s->global->p2p)
p2p_wps_success_cb(wpa_s->global->p2p, peer_addr);
@@ -5838,9 +5860,18 @@ void wpas_p2p_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
* This can happen if WPS provisioning step is not terminated
* cleanly (e.g., P2P Client does not send WSC_Done). Since the
* peer was able to connect, there is no need to time out group
- * formation after this, though.
+ * formation after this, though. In addition, this is used with
+ * the initial connection wait on the GO as a separate formation
+ * timeout and as such, expected to be hit after the initial WPS
+ * provisioning step.
*/
- wpa_printf(MSG_DEBUG, "P2P: Workaround - cancelled P2P group formation timeout on data connection");
+ wpa_printf(MSG_DEBUG, "P2P: Canceled P2P group formation timeout on data connection");
+ }
+ if (!wpa_s->p2p_go_group_formation_completed) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Marking group formation completed on GO on first data connection");
+ wpa_s->p2p_go_group_formation_completed = 1;
+ wpa_s->global->p2p_group_formation = NULL;
+ wpa_s->p2p_in_provisioning = 0;
}
wpa_s->global->p2p_go_wait_client.sec = 0;
if (addr == NULL)
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index f583626d..f0e1ebe5 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -630,6 +630,7 @@ struct wpa_supplicant {
unsigned int p2p_pd_before_go_neg:1;
unsigned int p2p_go_ht40:1;
unsigned int user_initiated_pd:1;
+ unsigned int p2p_go_group_formation_completed:1;
int p2p_persistent_go_freq;
int p2p_persistent_id;
int p2p_go_intent;