diff mbox series

[v2] wifi: cfg80211: Classification of BSS with different frequencies in the S1G Band.

Message ID 20221110054801.7992-1-jk.shin@newratek.com (mailing list archive)
State Superseded
Delegated to: Johannes Berg
Headers show
Series [v2] wifi: cfg80211: Classification of BSS with different frequencies in the S1G Band. | expand

Commit Message

JUN-KYU SHIN Nov. 10, 2022, 5:48 a.m. UTC
If the "channel->freq_offset" comparison is omitted in cmp_bss(),
BSS with different kHz units cannot be distinguished in the S1G Band.
So "freq_offset" should also be included in the comparison.

Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
---
 net/wireless/scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Johannes Berg Nov. 10, 2022, 8 a.m. UTC | #1
On Thu, 2022-11-10 at 14:48 +0900, JUN-KYU SHIN wrote:
> If the "channel->freq_offset" comparison is omitted in cmp_bss(),
> BSS with different kHz units cannot be distinguished in the S1G Band.
> So "freq_offset" should also be included in the comparison.
> 
> Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
> ---
>  net/wireless/scan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 22ae8996ada3..6bba130ea670 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -1289,8 +1289,8 @@ static int cmp_bss(struct cfg80211_bss *a,
>  	int i, r;
>  
>  	if (a->channel != b->channel)
> -		return ((b->channel->center_freq + (u32)b->channel->freq_offset) -
> -					(a->channel->center_freq + (u32)a->channel->freq_offset));
> +		return ((b->channel->center_freq * 1000 + b->channel->freq_offset) -
> +					(a->channel->center_freq * 1000 + a->channel->freq_offset));
> 

Looks like that patch would apply on top of your other patch, you need
to resend a complete new patch instead please.

johannes
diff mbox series

Patch

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 22ae8996ada3..6bba130ea670 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1289,8 +1289,8 @@  static int cmp_bss(struct cfg80211_bss *a,
 	int i, r;
 
 	if (a->channel != b->channel)
-		return ((b->channel->center_freq + (u32)b->channel->freq_offset) -
-					(a->channel->center_freq + (u32)a->channel->freq_offset));
+		return ((b->channel->center_freq * 1000 + b->channel->freq_offset) -
+					(a->channel->center_freq * 1000 + a->channel->freq_offset));
 
 	a_ies = rcu_access_pointer(a->ies);
 	if (!a_ies)