diff mbox

[1/2] wpa_s: reset wpa_s::normal_scans upon entering DISABLED state

Message ID 1389777093-4814-1-git-send-email-arend@broadcom.com
State Accepted
Headers show

Commit Message

Arend van Spriel Jan. 15, 2014, 9:11 a.m. UTC
Depending on the implementation the scheduled scan may not give results
quickly when in DISCONNECTED state. This patch resets wpa_s::normal_scans
upon entering to the DISABLED state so a normal scan is assured upon
going to DISCONNECTED state. This mainly solves a long reconnect time
observed upon repeated kernel driver reloads, ie. third reload resulted
in a scheduled scan.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
 wpa_supplicant/wpa_supplicant.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Jouni Malinen Jan. 17, 2014, 10:33 a.m. UTC | #1
On Wed, Jan 15, 2014 at 10:11:32AM +0100, Arend van Spriel wrote:
> Depending on the implementation the scheduled scan may not give results
> quickly when in DISCONNECTED state. This patch resets wpa_s::normal_scans
> upon entering to the DISABLED state so a normal scan is assured upon
> going to DISCONNECTED state. This mainly solves a long reconnect time
> observed upon repeated kernel driver reloads, ie. third reload resulted
> in a scheduled scan.

Thanks, applied both patches.
diff mbox

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 78e2749..a2281f1 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -652,6 +652,10 @@  void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
 		wpa_supplicant_state_txt(wpa_s->wpa_state),
 		wpa_supplicant_state_txt(state));
 
+	if (state == WPA_INTERFACE_DISABLED)
+		/* assure normal scan when interface is restored */
+		wpa_s->normal_scans = 0;
+
 	if (state == WPA_COMPLETED)
 		wpas_connect_work_done(wpa_s);