public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 08/11] station: get neighbor report on BSS TM request
Date: Wed, 27 Aug 2025 05:54:58 -0700	[thread overview]
Message-ID: <20250827125501.477908-8-prestwoj@gmail.com> (raw)
In-Reply-To: <20250827125501.477908-1-prestwoj@gmail.com>

If a BSS is requesting IWD roam elsewhere but does not include a
preferred candidate list try getting a neighbor report before doing
a full scan.

If the limited scan based on the candidate list comes up empty this
would previously result in IWD giving up on the AP roam entirely.
This patch also improves that behavior slightly by doing a full
scan afterwards as a last ditch effort. If no BSS's are found after
that, IWD will give up on the AP roam.
---
 src/station.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/station.c b/src/station.c
index 66395a5b..3d8eb36b 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2440,8 +2440,16 @@ static void station_roam_failed(struct station *station)
 	 * We were told by the AP to roam, but failed.  Try ourselves or
 	 * wait for the AP to tell us to roam again
 	 */
-	if (station->ap_directed_roaming)
+	if (station->ap_directed_roaming) {
+		/*
+		 * The candidate list from the AP (or neighbor report) found
+		 * no BSS's. Force a full scan
+		 */
+		if (!station->roam_scan_full)
+			goto full_scan;
+
 		goto delayed_retry;
+	}
 
 	/*
 	 * If we tried a limited scan, failed and the signal is still low,
@@ -2453,6 +2461,7 @@ static void station_roam_failed(struct station *station)
 		 * the scan here, so that the destroy callback is not called
 		 * after the return of this function
 		 */
+full_scan:
 		scan_cancel(netdev_get_wdev_id(station->netdev),
 						station->roam_scan_id);
 
@@ -3045,6 +3054,7 @@ static int station_roam_scan(struct station *station,
 	if (!freq_set) {
 		station->roam_scan_full = true;
 		params.freqs = allowed;
+		station_debug_event(station, "full-roam-scan");
 	} else
 		scan_freq_set_constrain(freq_set, allowed);
 
@@ -3378,7 +3388,15 @@ static void station_ap_directed_roam(struct station *station,
 		station_neighbor_report_cb(station->netdev, 0, body + pos,
 				body_len - pos, station);
 	} else {
-		l_debug("roam: AP did not include a preferred candidate list");
+		if (station->connected_bss->cap_rm_neighbor_report) {
+			if (!netdev_neighbor_report_req(station->netdev,
+					station_neighbor_report_cb))
+				return;
+
+			l_warn("failed to request neighbor report!");
+		}
+
+		l_debug("full scan after BSS transition request");
 		if (station_roam_scan(station, NULL) < 0)
 			station_roam_failed(station);
 	}
-- 
2.34.1


  parent reply	other threads:[~2025-08-27 12:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 12:54 [PATCH v2 01/11] vendor_quirks: initial skeleton James Prestwood
2025-08-27 12:54 ` [PATCH v2 02/11] vendor_quirks: implement two vendor quirks James Prestwood
2025-08-27 12:54 ` [PATCH v2 03/11] handshake: pass object to handshake_util_ap_ie_matches James Prestwood
2025-08-27 12:54 ` [PATCH v2 04/11] handshake: add vendor quirks into handshake object James Prestwood
2025-08-27 12:54 ` [PATCH v2 05/11] scan: store vendor quirks in scan_bss James Prestwood
2025-08-27 12:54 ` [PATCH v2 06/11] station: set vendor quirks into handshake object James Prestwood
2025-08-27 12:54 ` [PATCH v2 07/11] handshake: use vendor quirk to disable check of replay counters James Prestwood
2025-08-27 12:54 ` James Prestwood [this message]
2025-08-27 12:54 ` [PATCH v2 09/11] station: check vendor quirk for BSS TM request candidate list James Prestwood
2025-08-27 12:55 ` [PATCH v2 10/11] auto-t: add AP roam test for bad neighbor reports/candidate lists James Prestwood
2025-08-27 12:55 ` [PATCH v2 11/11] station: print vendor quirks (if any) when connecting/roaming James Prestwood
2025-08-27 17:42 ` [PATCH v2 01/11] vendor_quirks: initial skeleton Denis Kenzior

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=20250827125501.477908-8-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