[PATCH] Add proper messages for Android network manager

Dmitry Shmidt dimitrysh
Thu Feb 24 18:00:07 PST 2011


Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 wpa_supplicant/wpa_supplicant.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 27f6c05..d9a3c7a 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -530,7 +530,14 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
 			      enum wpa_states state)
 {
 	enum wpa_states old_state = wpa_s->wpa_state;
-
+#ifdef ANDROID
+	int network_id = -1;
+
+	if (wpa_s && wpa_s->current_ssid)
+		network_id = wpa_s->current_ssid->id;
+	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE "id=%d state=%d
BSSID=" MACSTR,
+		network_id, state, MAC2STR(wpa_s->pending_bssid));
+#endif
 	wpa_dbg(wpa_s, MSG_DEBUG, "State: %s -> %s",
 		wpa_supplicant_state_txt(wpa_s->wpa_state),
 		wpa_supplicant_state_txt(state));
@@ -2501,6 +2508,9 @@ void wpa_supplicant_deinit(struct wpa_global *global)
 	if (global == NULL)
 		return;

+#ifdef ANDROID
+	wpa_supplicant_terminate(0, global);
+#endif
 #ifdef CONFIG_P2P
 	wpas_p2p_deinit_global(global);
 #endif /* CONFIG_P2P */
-- 
1.7.3.1



More information about the Hostap mailing list