From 37fd0be2d3ca50c9035e67041328099356a46860 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 27 Jun 2016 20:24:06 +0300 Subject: [PATCH] Add CTRL-EVENT-CHANNEL-SWITCH event to indicate channel changes This provides information of the channel switch to wpa_supplicant control interface monitors. Signed-off-by: Jouni Malinen --- src/common/wpa_ctrl.h | 2 ++ wpa_supplicant/events.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index d78ea64..df26c7b 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -76,6 +76,8 @@ extern "C" { #define WPA_EVENT_SIGNAL_CHANGE "CTRL-EVENT-SIGNAL-CHANGE " /** Regulatory domain channel */ #define WPA_EVENT_REGDOM_CHANGE "CTRL-EVENT-REGDOM-CHANGE " +/** Channel switch (followed by freq= and other channel parameters) */ +#define WPA_EVENT_CHANNEL_SWITCH "CTRL-EVENT-CHANNEL-SWITCH " /** IP subnet status change notification * diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 057f630..b7a3bc0 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3669,6 +3669,15 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, if (!data || !wpa_s->current_ssid) break; + wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_CHANNEL_SWITCH + "freq=%d ht_enabled=%d ch_offset=%d ch_width=%s cf1=%d cf2=%d", + data->ch_switch.freq, + data->ch_switch.ht_enabled, + data->ch_switch.ch_offset, + channel_width_to_string(data->ch_switch.ch_width), + data->ch_switch.cf1, + data->ch_switch.cf2); + wpa_s->assoc_freq = data->ch_switch.freq; wpa_s->current_ssid->frequency = data->ch_switch.freq; -- 2.1.4