diff --git a/src/netdev.h b/src/netdev.h index 73d38c32..f27130f1 100644 --- a/src/netdev.h +++ b/src/netdev.h @@ -51,6 +51,7 @@ enum netdev_event { NETDEV_EVENT_RSSI_LEVEL_NOTIFY, NETDEV_EVENT_PACKET_LOSS_NOTIFY, NETDEV_EVENT_FT_ROAMED, + NETDEV_EVENT_BEACON_LOSS_NOTIFY, }; enum netdev_watch_event { diff --git a/src/station.c b/src/station.c index 3da02b06..ee229fc2 100644 --- a/src/station.c +++ b/src/station.c @@ -3370,6 +3370,21 @@ static void station_packets_lost(struct station *station, uint32_t num_pkts) station_start_roam(station); } +static void station_beacon_lost(struct station *station) +{ + l_debug("Beacon lost event"); + + if (station_cannot_roam(station)) + return; + + station_debug_event(station, "beacon-loss-roam"); + + if (station->roam_trigger_timeout) + return; + + station_roam_timeout_rearm(station, LOSS_ROAM_RATE_LIMIT); +} + static void station_netdev_event(struct netdev *netdev, enum netdev_event event, void *event_data, void *user_data) { @@ -3414,6 +3429,9 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event, station_roamed(station); break; + case NETDEV_EVENT_BEACON_LOSS_NOTIFY: + station_beacon_lost(station); + break; } }