aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new.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/dbus/dbus_new.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/dbus/dbus_new.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index a8e87d5..fcdf995 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -1735,10 +1735,12 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
enum wpas_dbus_prop property)
{
char *prop;
+ dbus_bool_t flush;
if (wpa_s->dbus_new_path == NULL)
return; /* Skip signal since D-Bus setup is not yet ready */
+ flush = FALSE;
switch (property) {
case WPAS_DBUS_PROP_AP_SCAN:
prop = "ApScan";
@@ -1761,6 +1763,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
case WPAS_DBUS_PROP_CURRENT_AUTH_MODE:
prop = "CurrentAuthMode";
break;
+ case WPAS_DBUS_PROP_DISCONNECT_REASON:
+ prop = "DisconnectReason";
+ flush = TRUE;
+ break;
default:
wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
__func__, property);
@@ -1770,6 +1776,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
wpa_dbus_mark_property_changed(wpa_s->global->dbus,
wpa_s->dbus_new_path,
WPAS_DBUS_NEW_IFACE_INTERFACE, prop);
+ if (flush) {
+ wpa_dbus_flush_object_changed_properties(
+ wpa_s->global->dbus->con, wpa_s->dbus_new_path);
+ }
}
@@ -2746,6 +2756,10 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
NULL
},
#endif /* CONFIG_P2P */
+ { "DisconnectReason", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
+ wpas_dbus_getter_disconnect_reason,
+ NULL
+ },
{ NULL, NULL, NULL, NULL, NULL }
};