From 0cd860284c21854d28604b0f1e7b1f99684de39f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 12 Apr 2014 11:48:05 +0300 Subject: [PATCH] Add CTRL-EVENT-SIGNAL-CHANGE for bgscan signal update events This allows external programs to monitor driver signal change events through wpa_supplicant when bgscan is used. Signed-off-by: Jouni Malinen --- src/common/wpa_ctrl.h | 2 ++ wpa_supplicant/events.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 7f39ccdc3..5ef75e835 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -64,6 +64,8 @@ extern "C" { #define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED " /** A BSS entry was removed (followed by BSS entry id and BSSID) */ #define WPA_EVENT_BSS_REMOVED "CTRL-EVENT-BSS-REMOVED " +/** Change in the signal level was reported by the driver */ +#define WPA_EVENT_SIGNAL_CHANGE "CTRL-EVENT-SIGNAL-CHANGE " /** RSN IBSS 4-way handshakes completed with specified peer */ #define IBSS_RSN_COMPLETED "IBSS-RSN-COMPLETED " diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 3a6d42769..adcdf01df 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3268,6 +3268,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->eapol_rx.data_len); break; case EVENT_SIGNAL_CHANGE: + wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SIGNAL_CHANGE + "above=%d signal=%d noise=%d txrate=%d", + data->signal_change.above_threshold, + data->signal_change.current_signal, + data->signal_change.current_noise, + data->signal_change.current_txrate); bgscan_notify_signal_change( wpa_s, data->signal_change.above_threshold, data->signal_change.current_signal,