From: Jouni Malinen Date: Fri, 1 Nov 2013 11:03:04 +0000 (+0200) Subject: AOSP: Add SSID to EVENT-STATE-CHANGE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffc7c379774babf72b30fb4b0aafd7653a96a5fb;p=thirdparty%2Fhostap.git AOSP: Add SSID to EVENT-STATE-CHANGE This is a part of this AOSP commit: commit f20a4432808cee548326c4b35c83071ca576a239 Author: Irfan Sheriff Date: Mon Apr 16 16:48:34 2012 -0700 Add SSID in supplicant change event Change-Id: I67224e6765afad51b4b258b0df7d11d7ed3b9927 --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 57364f474..cf13af5b4 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -1607,6 +1607,25 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s, if (res >= 0) pos += res; +#ifdef ANDROID + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE + "id=%d state=%d BSSID=" MACSTR " SSID=%s", + wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, + wpa_s->wpa_state, + MAC2STR(wpa_s->bssid), + wpa_s->current_ssid && wpa_s->current_ssid->ssid ? + wpa_ssid_txt(wpa_s->current_ssid->ssid, + wpa_s->current_ssid->ssid_len) : ""); + if (wpa_s->wpa_state == WPA_COMPLETED) { + struct wpa_ssid *ssid = wpa_s->current_ssid; + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_CONNECTED "- connection to " + MACSTR " completed %s [id=%d id_str=%s]", + MAC2STR(wpa_s->bssid), "(auth)", + ssid ? ssid->id : -1, + ssid && ssid->id_str ? ssid->id_str : ""); + } +#endif /* ANDROID */ + return pos - buf; } diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index 40cffdfff..ab62beaf8 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -90,9 +90,13 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s, #ifdef ANDROID wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE - "id=%d state=%d BSSID=" MACSTR, + "id=%d state=%d BSSID=" MACSTR " SSID=%s", wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, - new_state, MAC2STR(wpa_s->pending_bssid)); + new_state, + MAC2STR(wpa_s->bssid), + wpa_s->current_ssid && wpa_s->current_ssid->ssid ? + wpa_ssid_txt(wpa_s->current_ssid->ssid, + wpa_s->current_ssid->ssid_len): ""); #endif /* ANDROID */ }