From e488da341f1264a7d5e053d7b16f9cc1f3c6af1e Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Tue, 4 Sep 2012 16:52:41 -0700 Subject: Fix 'restore STA reconnection behavior' cherry-pick BUG: b/6400311 Change-Id: I7b90ab9b5430b92e9e4e5702c3b1805a6bbc0b9a Signed-off-by: Dmitry Shmidt --- wpa_supplicant/config_ssid.h | 7 +++++++ wpa_supplicant/wpa_supplicant.c | 5 +++-- wpa_supplicant/wpa_supplicant_i.h | 3 --- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h index 2605ae8..45a423c 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -423,6 +423,13 @@ struct wpa_ssid { */ int export_keys; +#ifdef ANDROID_P2P + /** + * assoc_retry - Number of times association should be retried. + */ + int assoc_retry; +#endif + #ifdef CONFIG_HT_OVERRIDES /** * disable_ht - Disable HT (IEEE 802.11n) for this network diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index cb5b42f..e1ad4d9 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -582,8 +582,9 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_supplicant_state_txt(state)); #ifdef ANDROID_P2P - if(state == WPA_ASSOCIATED || (state <= WPA_INACTIVE)) - wpa_s->assoc_retries = 0; + if(state == WPA_ASSOCIATED && wpa_s->current_ssid) { + wpa_s->current_ssid->assoc_retry = 0; + } #endif /* ANDROID_P2P */ if (state != WPA_SCANNING) diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 33b6258..21fe5cc 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -276,9 +276,6 @@ struct wpa_supplicant { struct wpa_bss *current_bss; int ap_ies_from_associnfo; unsigned int assoc_freq; -#ifdef ANDROID_P2P - unsigned int assoc_retries; -#endif /* Selected configuration (based on Beacon/ProbeResp WPA IE) */ int pairwise_cipher; -- cgit v1.1