Search Linux Wireless

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2022-11-10 at 17:18 +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@xxxxxxxxxxxx>
> ---
>  net/wireless/scan.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 806a5f1330ff..6bba130ea670 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -1289,7 +1289,8 @@ static int cmp_bss(struct cfg80211_bss *a,
>  	int i, r;
>  
>  	if (a->channel != b->channel)
> -		return b->channel->center_freq - a->channel->center_freq;
> +		return ((b->channel->center_freq * 1000 + b->channel->freq_offset) -
> +					(a->channel->center_freq * 1000 + a->channel->freq_offset));
> 

And while we're at it - you don't need the outer parentheses on a return
statement, and the indentation could be lining up properly so that a->
is under b->

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux