aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wang <matthewmwang@chromium.org>2020-06-02 00:10:18 (GMT)
committerJouni Malinen <j@w1.fi>2020-06-19 15:34:26 (GMT)
commitb97aa038b7e2be722b9d362c8645a763009969d6 (patch)
tree6e6cbc527059a95b452bf5e1df65d605def6863f
parentd6b450e890e0cd6a84b4023873a2015c2f49226e (diff)
downloadhostap-b97aa038b7e2be722b9d362c8645a763009969d6.zip
hostap-b97aa038b7e2be722b9d362c8645a763009969d6.tar.gz
hostap-b97aa038b7e2be722b9d362c8645a763009969d6.tar.bz2
Add WPA_EVENT_{DO,SKIP}_ROAM events
Add events for within-ESS reassociation. This allows us to monitor roam events, both skipped and allowed, in tests. Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
-rw-r--r--src/common/wpa_ctrl.h4
-rw-r--r--wpa_supplicant/events.c22
2 files changed, 20 insertions, 6 deletions
diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 58ce101..f5199de 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -97,6 +97,10 @@ extern "C" {
"CTRL-EVENT-SAE-UNKNOWN-PASSWORD-IDENTIFIER "
/** Unprotected Beacon frame dropped */
#define WPA_EVENT_UNPROT_BEACON "CTRL-EVENT-UNPROT-BEACON "
+/** Decision made to do a within-ESS roam */
+#define WPA_EVENT_DO_ROAM "CTRL-EVENT-DO-ROAM "
+/** Decision made to skip a within-ESS roam */
+#define WPA_EVENT_SKIP_ROAM "CTRL-EVENT-SKIP-ROAM "
/** IP subnet status change notification
*
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index e3cf853..0fcb176 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1866,6 +1866,7 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
unsigned int cur_est, sel_est;
struct wpa_signal_info si;
int cur_snr = 0;
+ int ret = 0;
wpa_dbg(wpa_s, MSG_DEBUG, "Considering within-ESS reassociation");
wpa_dbg(wpa_s, MSG_DEBUG, "Current BSS: " MACSTR
@@ -1985,13 +1986,22 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG,
"Skip roam - too small difference in signal level (%d < %d)",
diff, min_diff);
- return 0;
+ ret = 0;
+ } else {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "Allow reassociation due to difference in signal level (%d >= %d)",
+ diff, min_diff);
+ ret = 1;
}
-
- wpa_dbg(wpa_s, MSG_DEBUG,
- "Allow reassociation due to difference in signal level (%d >= %d)",
- diff, min_diff);
- return 1;
+ wpa_msg_ctrl(wpa_s, MSG_INFO, "%scur_bssid=" MACSTR
+ " cur_freq=%d cur_level=%d cur_est=%d sel_bssid=" MACSTR
+ " sel_freq=%d sel_level=%d sel_est=%d",
+ ret ? WPA_EVENT_DO_ROAM : WPA_EVENT_SKIP_ROAM,
+ MAC2STR(current_bss->bssid),
+ current_bss->freq, cur_level, cur_est,
+ MAC2STR(selected->bssid),
+ selected->freq, selected->level, sel_est);
+ return ret;
}
#endif /* CONFIG_NO_ROAMING */