From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/4] station: start roam on beacon loss event
Date: Mon, 30 Oct 2023 06:48:35 -0700 [thread overview]
Message-ID: <20231030134837.452957-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20231030134837.452957-1-prestwoj@gmail.com>
In past testing the beacon loss event seemed to always be followed
immediately by a disconnect. It was determined at the time that there
wasn't much point in even attempting a roam because a disconnect
would happen before the roam could finish. This was a bit short
sighted because its hardware dependent when the beacon loss event
is sent.
Recently it was seen that some hardware (ath10k in this case)
actually gives some time before the kernel finally disconnects.
In this example a beacon loss event came and IWD remained connected
for 4 seconds (until a packet loss which issued a roam scan).
11:30:25 iwd[1407046]: src/netdev.c:netdev_cqm_event() Beacon lost event
11:30:29 iwd[1407046]: src/netdev.c:netdev_mlme_notify() MLME notification Notify CQM(64)
11:30:29 iwd[1407046]: src/station.c:station_packets_lost() Packets lost event: 10
11:30:29 iwd[1407046]: src/station.c:station_roam_scan() ifindex: 6
11:30:29 iwd[1407046]: src/wiphy.c:wiphy_radio_work_insert() Inserting work item 144
11:30:29 iwd[1407046]: src/wiphy.c:wiphy_radio_work_next() Starting work item 144
11:30:29 iwd[1407046]: src/station.c:station_start_roam() Using cached neighbor report for roam
11:30:29 iwd[1407046]: src/scan.c:scan_notify() Scan notification Trigger Scan(33)
11:30:29 iwd[1407046]: src/scan.c:scan_request_triggered() Active scan triggered for wdev 4
11:30:29 iwd[1407046]: src/netdev.c:netdev_link_notify() event 16 on ifindex 6
11:30:29 iwd[1407046]: src/netdev.c:netdev_mlme_notify() MLME notification Del Station(20)
11:30:29 iwd[1407046]: src/netdev.c:netdev_mlme_notify() MLME notification Deauthenticate(39)
11:30:29 iwd[1407046]: src/netdev.c:netdev_deauthenticate_event()
11:30:29 iwd[1407046]: src/netdev.c:netdev_mlme_notify() MLME notification Disconnect(48)
11:30:29 iwd[1407046]: src/netdev.c:netdev_disconnect_event()
11:30:29 iwd[1407046]: Received Deauthentication event, reason: 4, from_ap: false
It makes sense to also handle beacon loss events and attempt a
roam, potentially saving the connection. One difference here is
the beacon loss event will force a roam (similar to ap directed
roaming when the imminent bit is set).
---
src/netdev.h | 1 +
src/station.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
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 a2358d95..8c87b3e0 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3347,6 +3347,20 @@ 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->force_roam = true;
+
+ station_debug_event(station, "beacon-loss-roam");
+
+ station_start_roam(station);
+}
+
static void station_netdev_event(struct netdev *netdev, enum netdev_event event,
void *event_data, void *user_data)
{
@@ -3391,6 +3405,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;
}
}
--
2.25.1
next prev parent reply other threads:[~2023-10-30 13:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 13:48 [PATCH 0/4] Packet/beacon loss roaming improvements James Prestwood
2023-10-30 13:48 ` [PATCH 1/4] station: rename ap_directed_roam to force_roam James Prestwood
2023-10-30 13:48 ` James Prestwood [this message]
2023-10-30 13:48 ` [PATCH 3/4] netdev: handle/send beacon loss event James Prestwood
2023-10-30 13:48 ` [PATCH 4/4] station: rate limit packet loss roam scans James Prestwood
2023-10-30 14:48 ` Denis Kenzior
2023-10-30 15:00 ` [PATCH 0/4] Packet/beacon loss roaming improvements Denis Kenzior
2023-10-30 15:37 ` James Prestwood
2023-10-30 17:05 ` Denis Kenzior
2023-10-30 17:37 ` James Prestwood
2023-11-01 12:07 ` James Prestwood
2023-11-02 1:39 ` Denis Kenzior
2023-11-02 11:58 ` James Prestwood
2023-11-02 14:10 ` Denis Kenzior
2023-11-02 14:33 ` James Prestwood
2023-11-02 15:17 ` Denis Kenzior
2023-11-02 15:41 ` James Prestwood
2023-11-02 16:10 ` Denis Kenzior
2023-11-02 16:13 ` James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231030134837.452957-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox