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@xxxxxxxxxxxx> --- src/common/wpa_ctrl.h | 4 ++++ wpa_supplicant/events.c | 22 ++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 488e4addc..d84718d56 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 f70d84b75..700958ef3 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1785,6 +1785,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 @@ -1903,13 +1904,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, "%s " + "cur_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, sel_level, sel_est); + return ret; } #endif /* CONFIG_NO_ROAMING */ -- 2.27.0.rc0.183.gde8f92d652-goog _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap