mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8723bs: fix network selection in rtw_mlme.c
@ 2024-12-25  5:17 Atharva Tiwari
  0 siblings, 0 replies; 3+ messages in thread
From: Atharva Tiwari @ 2024-12-25  5:17 UTC (permalink / raw)
  Cc: evepolonium, Greg Kroah-Hartman, Meir Elisha, Philipp Hortmann,
	Dan Carpenter, linux-staging, linux-kernel

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

Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
---
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(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 5ded183aa08c..6604619d1b99 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -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;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] staging: rtl8723bs: fix network selection in rtw_mlme.c
  2024-12-24 13:20 Atharva Tiwari
@ 2025-01-06 10:32 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-01-06 10:32 UTC (permalink / raw)
  To: Atharva Tiwari
  Cc: Greg Kroah-Hartman, Meir Elisha, Philipp Hortmann, linux-staging,
	linux-kernel

On Tue, Dec 24, 2024 at 06:50:17PM +0530, Atharva Tiwari wrote:
> 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

You need to try use proper capitalization and add periods to the end of
sentences.

> 
> 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

If you don't know then just leave it as-is.  Don't just guess.
If you have a spec or an expert to consult, that's fine, go ahead and
change it in that case.  But probably if the answer was really obvious,
then someone would already have changed it.

> 
> Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
> ---
> 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(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 5ded183aa08c..6604619d1b99 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -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)))

This casting is unnecessary and puzzling.

> +				continue;
> +			}

This line is indented too far.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] staging: rtl8723bs: fix network selection in rtw_mlme.c
@ 2024-12-24 13:20 Atharva Tiwari
  2025-01-06 10:32 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Atharva Tiwari @ 2024-12-24 13:20 UTC (permalink / raw)
  Cc: evepolonium, Greg Kroah-Hartman, Meir Elisha, Philipp Hortmann,
	Dan Carpenter, linux-staging, linux-kernel

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

Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
---
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(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 5ded183aa08c..6604619d1b99 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -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;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-06 10:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-25  5:17 [PATCH v2] staging: rtl8723bs: fix network selection in rtw_mlme.c Atharva Tiwari
  -- strict thread matches above, loose matches on Subject: below --
2024-12-24 13:20 Atharva Tiwari
2025-01-06 10:32 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®