dbus: Export BSS Transition Management status

Add new Interface properties "BSSTMStatus", which carries the status of
the most recent BSS Transition Management request. This property will be
logged in UMA to measure 802.11v success.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
This commit is contained in:
Matthew Wang 2018-05-04 11:16:18 -07:00 committed by Jouni Malinen
parent 2bbad1c7c9
commit 80d06d0ca9
9 changed files with 53 additions and 0 deletions

View file

@ -789,6 +789,11 @@ fi.w1.wpa_supplicant1.CreateInterface.
<p>The most recent BSS session length in milliseconds.</p> <p>The most recent BSS session length in milliseconds.</p>
</li> </li>
<li>
<h3>BSSTMStatus - u - (read)</h3>
<p>The most recent BSS Transition Management status code.</p>
</li>
<li> <li>
<h3>EapolVersion - s - (read/write)</h3> <h3>EapolVersion - s - (read/write)</h3>
<p>IEEE 802.1X/EAPOL version number</p> <p>IEEE 802.1X/EAPOL version number</p>

View file

@ -2244,6 +2244,9 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
case WPAS_DBUS_PROP_SESSION_LENGTH: case WPAS_DBUS_PROP_SESSION_LENGTH:
prop = "SessionLength"; prop = "SessionLength";
break; break;
case WPAS_DBUS_PROP_BSS_TM_STATUS:
prop = "BSSTMStatus";
break;
default: default:
wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d", wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
__func__, property); __func__, property);
@ -2866,6 +2869,12 @@ static const struct wpa_dbus_property_desc wpas_dbus_bss_properties[] = {
NULL, NULL,
NULL NULL
}, },
{
"BSSTMStatus", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
wpas_dbus_getter_bss_tm_status,
NULL,
NULL
},
{ NULL, NULL, NULL, NULL, NULL, NULL } { NULL, NULL, NULL, NULL, NULL, NULL }
}; };

View file

@ -34,6 +34,7 @@ enum wpas_dbus_prop {
WPAS_DBUS_PROP_ROAM_TIME, WPAS_DBUS_PROP_ROAM_TIME,
WPAS_DBUS_PROP_ROAM_COMPLETE, WPAS_DBUS_PROP_ROAM_COMPLETE,
WPAS_DBUS_PROP_SESSION_LENGTH, WPAS_DBUS_PROP_SESSION_LENGTH,
WPAS_DBUS_PROP_BSS_TM_STATUS,
}; };
enum wpas_dbus_bss_prop { enum wpas_dbus_bss_prop {

View file

@ -3178,6 +3178,28 @@ dbus_bool_t wpas_dbus_getter_session_length(
} }
/**
* wpas_dbus_getter_bss_tm_status - Get most BSS Transition Management request
* status code
* @iter: Pointer to incoming dbus message iter
* @error: Location to store error on failure
* @user_data: Function specific data
* Returns: TRUE on success, FALSE on failure
*
* Getter for "BSSTMStatus" property.
*/
dbus_bool_t wpas_dbus_getter_bss_tm_status(
const struct wpa_dbus_property_desc *property_desc,
DBusMessageIter *iter, DBusError *error, void *user_data)
{
struct wpa_supplicant *wpa_s = user_data;
dbus_uint32_t bss_tm_status = wpa_s->bss_tm_status;
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT32,
&bss_tm_status, error);
}
/** /**
* wpas_dbus_getter_bss_expire_age - Get BSS entry expiration age * wpas_dbus_getter_bss_expire_age - Get BSS entry expiration age
* @iter: Pointer to incoming dbus message iter * @iter: Pointer to incoming dbus message iter

View file

@ -154,6 +154,7 @@ DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code);
DECLARE_ACCESSOR(wpas_dbus_getter_roam_time); DECLARE_ACCESSOR(wpas_dbus_getter_roam_time);
DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete); DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete);
DECLARE_ACCESSOR(wpas_dbus_getter_session_length); DECLARE_ACCESSOR(wpas_dbus_getter_session_length);
DECLARE_ACCESSOR(wpas_dbus_getter_bss_tm_status);
DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age);
DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age);
DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count);

View file

@ -176,6 +176,15 @@ void wpas_notify_session_length(struct wpa_supplicant *wpa_s)
} }
void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
{
if (wpa_s->p2p_mgmt)
return;
wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSS_TM_STATUS);
}
void wpas_notify_network_changed(struct wpa_supplicant *wpa_s) void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
{ {
if (wpa_s->p2p_mgmt) if (wpa_s->p2p_mgmt)

View file

@ -27,6 +27,7 @@ void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s);
void wpas_notify_roam_time(struct wpa_supplicant *wpa_s); void wpas_notify_roam_time(struct wpa_supplicant *wpa_s);
void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s); void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s);
void wpas_notify_session_length(struct wpa_supplicant *wpa_s); void wpas_notify_session_length(struct wpa_supplicant *wpa_s);
void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
void wpas_notify_network_changed(struct wpa_supplicant *wpa_s); void wpas_notify_network_changed(struct wpa_supplicant *wpa_s);
void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s); void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s);
void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s); void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s);

View file

@ -21,6 +21,7 @@
#include "ctrl_iface.h" #include "ctrl_iface.h"
#include "bss.h" #include "bss.h"
#include "wnm_sta.h" #include "wnm_sta.h"
#include "notify.h"
#include "hs20_supplicant.h" #include "hs20_supplicant.h"
#define MAX_TFS_IE_LEN 1024 #define MAX_TFS_IE_LEN 1024
@ -1015,6 +1016,9 @@ static void wnm_send_bss_transition_mgmt_resp(
return; return;
} }
wpa_s->bss_tm_status = status;
wpas_notify_bss_tm_status(wpa_s);
wpabuf_put_u8(buf, WLAN_ACTION_WNM); wpabuf_put_u8(buf, WLAN_ACTION_WNM);
wpabuf_put_u8(buf, WNM_BSS_TRANS_MGMT_RESP); wpabuf_put_u8(buf, WNM_BSS_TRANS_MGMT_RESP);
wpabuf_put_u8(buf, dialog_token); wpabuf_put_u8(buf, dialog_token);

View file

@ -1065,6 +1065,7 @@ struct wpa_supplicant {
struct neighbor_report *wnm_neighbor_report_elements; struct neighbor_report *wnm_neighbor_report_elements;
struct os_reltime wnm_cand_valid_until; struct os_reltime wnm_cand_valid_until;
u8 wnm_cand_from_bss[ETH_ALEN]; u8 wnm_cand_from_bss[ETH_ALEN];
enum bss_trans_mgmt_status_code bss_tm_status;
struct wpabuf *coloc_intf_elems; struct wpabuf *coloc_intf_elems;
u8 coloc_intf_dialog_token; u8 coloc_intf_dialog_token;
u8 coloc_intf_auto_report; u8 coloc_intf_auto_report;