[PATCH] WNM: Per-band minimum acceptable signal for BTM pre-scan
Shukla, Ashish
ashshukl at lab126.com
Thu Jul 30 12:04:43 PDT 2026
wnm_scan_process() uses a pre-scan-check step to decide whether the
candidate BSS selected from the driver's cached results is good enough
to accept without a fresh scan, or whether a scan should be triggered
to gather more up-to-date information. The current heuristic in that
step only checks that the sample is under 10 seconds old and that
need_to_roam_within_ess() does not immediately want to roam back to
the current BSS. It does not take the absolute signal level of the
selected candidate into account.
On 6 GHz in particular, the acceptable RSSI floor is meaningfully
lower than on 5.
Add a per-band minimum acceptable signal (-80 dBm on 2.4 GHz, -75 dBm
on 5 GHz, -70 dBm on 6 GHz) and consult it in the pre-scan-check step.
If the selected candidate's cached level is below the floor for its
band, return 0 from wnm_scan_process() so a scan is triggered before
committing to the roam. This avoids accepting a cached below-floor
sample as the transition target on the first pass, when a scan on the
candidate's channel would likely reveal it as unusable.
The main accept decision still flows through
wpa_supplicant_need_to_roam_within_ess() on the post-scan pass; this
change only tightens the pre-scan discard. No behavior change for
candidates cached at or above the floor.
Signed-off-by: Ashish Shukla <ashshukl at amazon.com>
---
wpa_supplicant/wnm_sta.c | 44 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
index 7e3b355c9..fc5b06720 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -27,6 +27,31 @@
#define MAX_TFS_IE_LEN 1024
#define WNM_MAX_NEIGHBOR_REPORT 10
+/*
+ * Per-band minimum acceptable signal levels used as an additional
+ * pre-scan-check discard in wnm_scan_process(). 6 GHz APs typically
+ * transmit at lower EIRP than 5 GHz (Low Power Indoor limits in
+ * particular), and path loss is higher on 6 GHz for the same distance,
+ * so the acceptable RSSI floor is band-dependent. The values below
+ * correspond to a rate/margin combination well above the noise floor
+ * on each band; a candidate cached below this level is treated as
+ * "not worth roaming to without more evidence" for the pre-scan step
+ * and a scan is requested instead. The main accept decision still
+ * flows through wpa_supplicant_need_to_roam_within_ess().
+ */
+#define WNM_BSS_ACCEPTABLE_SIGNAL_2GHZ (-80)
+#define WNM_BSS_ACCEPTABLE_SIGNAL_5GHZ (-75)
+#define WNM_BSS_ACCEPTABLE_SIGNAL_6GHZ (-70)
+
+static int wnm_min_acceptable_signal(int freq)
+{
+ if (is_6ghz_freq(freq))
+ return WNM_BSS_ACCEPTABLE_SIGNAL_6GHZ;
+ if (is_5ghz_freq(freq))
+ return WNM_BSS_ACCEPTABLE_SIGNAL_5GHZ;
+ return WNM_BSS_ACCEPTABLE_SIGNAL_2GHZ;
+}
+
/* get the TFS IE from driver */
static int ieee80211_11_get_tfs_ie(struct wpa_supplicant *wpa_s, u8 *buf,
@@ -1200,6 +1225,7 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check)
*/
if (pre_scan_check) {
struct os_reltime age;
+ int min_signal;
if (!bss)
return 0;
@@ -1208,6 +1234,24 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check)
if (age.sec >= 10)
return 0;
+ /*
+ * If the cached signal is below the per-band acceptable
+ * floor, request a scan before accepting rather than
+ * committing to the roam. On 6 GHz in particular, a cached
+ * sample well below the floor is unlikely to represent a
+ * usable link. See WNM_BSS_ACCEPTABLE_SIGNAL_* definitions.
+ */
+ min_signal = wnm_min_acceptable_signal(bss->freq);
+ if (bss->level < min_signal) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "WNM: Candidate " MACSTR
+ " signal %d < acceptable %d for %s - request scan",
+ MAC2STR(bss->bssid), bss->level, min_signal,
+ is_6ghz_freq(bss->freq) ? "6 GHz" :
+ is_5ghz_freq(bss->freq) ? "5 GHz" : "2.4 GHz");
+ return 0;
+ }
+
#ifndef CONFIG_NO_ROAMING
if (current_bss && bss != current_bss &&
wpa_supplicant_need_to_roam_within_ess(wpa_s, bss,
--
2.34.1
More information about the Hostap
mailing list