aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-04-23 21:08:24 (GMT)
committerJouni Malinen <j@w1.fi>2009-04-23 21:08:24 (GMT)
commitda1fb17ca7578641584346c8e87f3483cdfdc71c (patch)
treeeef88eca8017701f36565a591fad9f4b4ffd2f16 /wpa_supplicant
parent1fb1a6f0bfabdb8f99681423718dcafe42230f5a (diff)
downloadhostap-da1fb17ca7578641584346c8e87f3483cdfdc71c.zip
hostap-da1fb17ca7578641584346c8e87f3483cdfdc71c.tar.gz
hostap-da1fb17ca7578641584346c8e87f3483cdfdc71c.tar.bz2
Add handling of SME auth/assoc timeout events
This allows wpa_supplicant to start searching for other APs (or re-try) if the MLME times out.
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/events.c6
-rw-r--r--wpa_supplicant/sme.c17
-rw-r--r--wpa_supplicant/sme.h14
3 files changed, 37 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 1fb1d2d..56c57fb 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1229,6 +1229,12 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
case EVENT_ASSOC_REJECT:
sme_event_assoc_reject(wpa_s, data);
break;
+ case EVENT_AUTH_TIMED_OUT:
+ sme_event_auth_timed_out(wpa_s, data);
+ break;
+ case EVENT_ASSOC_TIMED_OUT:
+ sme_event_assoc_timed_out(wpa_s, data);
+ break;
default:
wpa_printf(MSG_INFO, "Unknown event %d", event);
break;
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 87b6b95..0d729ef 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -361,3 +361,20 @@ void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
*/
wpa_supplicant_req_scan(wpa_s, 5, 0);
}
+
+
+void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data)
+{
+ wpa_printf(MSG_DEBUG, "SME: Authentication timed out");
+ wpa_supplicant_req_scan(wpa_s, 5, 0);
+}
+
+
+void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data)
+{
+ wpa_printf(MSG_DEBUG, "SME: Association timed out");
+ wpa_supplicant_mark_disassoc(wpa_s);
+ wpa_supplicant_req_scan(wpa_s, 5, 0);
+}
diff --git a/wpa_supplicant/sme.h b/wpa_supplicant/sme.h
index 566e417..2780041 100644
--- a/wpa_supplicant/sme.h
+++ b/wpa_supplicant/sme.h
@@ -24,6 +24,10 @@ int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
const u8 *ies, size_t ies_len);
void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
union wpa_event_data *data);
+void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data);
+void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data);
#else /* CONFIG_SME */
@@ -50,6 +54,16 @@ static inline void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
{
}
+static inline void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data)
+{
+}
+
+static inline void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data)
+{
+}
+
#endif /* CONFIG_SME */
#endif /* SME_H */