]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
bgscan: Deliver beacon loss event to bgscan modules
authorJouni Malinen <j@w1.fi>
Sun, 8 Jan 2017 10:17:58 +0000 (12:17 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 8 Jan 2017 10:17:58 +0000 (12:17 +0200)
This adds a call to the notify_beacon_loss() callback functions when
beacon loss is detected. In addition, a new CTRL-EVENT-BEACON-LOSS event
is made available through the wpa_supplicant control interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/wpa_ctrl.h
wpa_supplicant/events.c

index ec4e879225078d3920006437f1abca99afad13a4..766a3fa1e7e78b6e693e5193d98b7c5e6b19b8bb 100644 (file)
@@ -74,6 +74,8 @@ extern "C" {
 #define WPA_EVENT_NETWORK_NOT_FOUND "CTRL-EVENT-NETWORK-NOT-FOUND "
 /** Change in the signal level was reported by the driver */
 #define WPA_EVENT_SIGNAL_CHANGE "CTRL-EVENT-SIGNAL-CHANGE "
+/** Beacon loss reported by the driver */
+#define WPA_EVENT_BEACON_LOSS "CTRL-EVENT-BEACON-LOSS "
 /** Regulatory domain channel */
 #define WPA_EVENT_REGDOM_CHANGE "CTRL-EVENT-REGDOM-CHANGE "
 /** Channel switch (followed by freq=<MHz> and other channel parameters) */
index afdda00bd9baf2edf9a050e050849223f0b3921e..c2f8a662d11e3efeae0594d8e4493a12184da018 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * WPA Supplicant - Driver event processing
- * Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -4334,6 +4334,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                        data->p2p_lo_stop.reason_code);
 #endif /* CONFIG_P2P */
                break;
+       case EVENT_BEACON_LOSS:
+               if (!wpa_s->current_bss || !wpa_s->current_ssid)
+                       break;
+               wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_BEACON_LOSS);
+               bgscan_notify_beacon_loss(wpa_s);
+               break;
        default:
                wpa_msg(wpa_s, MSG_INFO, "Unknown event %d", event);
                break;