Skip to contentSkip to conversation

staging: rtl8723bs: fix network selection in rtw_mlme.c

PATCH Superseded Atharva Tiwari 1 participant 1 message Dec 25, 2024 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: fix network selection in rtw_mlme.c

this patch fixes the network selection logic to avoid selecting a network with the same ESSID as the olddest scanned network if it was scanned within the last 500 millisecounds

and please give a specific value for "new enough" on line 481, i have estimated 500 millisecound but inform me if the value needs to be changed

---
Changes since v1:
- Changed the "new enough" value from 1000 millisecounds to 500
- fixed some styling issue

 drivers/staging/rtl8723bs/core/rtw_mlme.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +5 -2
index 5ded183aa08c..6604619d1b99 100644
@@ -481,8 +481,11 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 		}
 
 		if (rtw_roam_flags(adapter)) {
-			/* TODO: don't select network in the same ess as oldest if it's new enough*/
-		}
+			if (is_same_ess(&pnetwork->network, &oldest->network) &&
+				time_after(pnetwork->last_scanned,
+					(unsigned long)msecs_to_jiffies(500)))
+				continue;
+			}
 
 		if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
 			oldest = pnetwork;
Signature · 1 line
2.39.5