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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-04-12 11:48:05 +03:00
parent b1d5134e5b
commit 0cd860284c
2 changed files with 8 additions and 0 deletions

View file

@ -64,6 +64,8 @@ extern "C" {
#define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED " #define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED "
/** A BSS entry was removed (followed by BSS entry id and BSSID) */ /** A BSS entry was removed (followed by BSS entry id and BSSID) */
#define WPA_EVENT_BSS_REMOVED "CTRL-EVENT-BSS-REMOVED " #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 */ /** RSN IBSS 4-way handshakes completed with specified peer */
#define IBSS_RSN_COMPLETED "IBSS-RSN-COMPLETED " #define IBSS_RSN_COMPLETED "IBSS-RSN-COMPLETED "

View file

@ -3268,6 +3268,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
data->eapol_rx.data_len); data->eapol_rx.data_len);
break; break;
case EVENT_SIGNAL_CHANGE: 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( bgscan_notify_signal_change(
wpa_s, data->signal_change.above_threshold, wpa_s, data->signal_change.above_threshold,
data->signal_change.current_signal, data->signal_change.current_signal,