aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorGary Morain <gmorain@chromium.org>2012-06-30 13:43:50 (GMT)
committerJouni Malinen <j@w1.fi>2012-06-30 13:43:50 (GMT)
commit0bb1e425b553f05adbc9df9e7ff92c0284e7e8f6 (patch)
treefcc749980727e54a181286439d32a98d98e071c2 /wpa_supplicant/events.c
parent8350d0afd8f5a93c39c2569bd78b8f5c92f85348 (diff)
downloadhostap-0bb1e425b553f05adbc9df9e7ff92c0284e7e8f6.zip
hostap-0bb1e425b553f05adbc9df9e7ff92c0284e7e8f6.tar.gz
hostap-0bb1e425b553f05adbc9df9e7ff92c0284e7e8f6.tar.bz2
Export disconnect reason code to dbus
In the properties changed signal, added a new property "DisconnectReason", which carries the IEEE 802.11 reason code of the most recent disassociation or deauthentication event. The reason code is negative if it is locally generated. The property is sent to the DBUS immediately so as to prevent it from being coalesced with other disconnect events. Signed-off-by: Gary Morain <gmorain@chromium.org>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 513a8e8..6685b6b 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1761,6 +1761,11 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
wpas_connection_failed(wpa_s, bssid);
wpa_sm_notify_disassoc(wpa_s->wpa);
+ if (locally_generated)
+ wpa_s->disconnect_reason = -reason_code;
+ else
+ wpa_s->disconnect_reason = reason_code;
+ wpas_notify_disconnect_reason(wpa_s);
if (!is_zero_ether_addr(bssid) ||
wpa_s->wpa_state >= WPA_AUTHENTICATING) {
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "bssid=" MACSTR