diff mbox

[BUG,REPORT] brcmfmac: wrong logic in finding control/primary channel relative location

Message ID 1419099904-13303-1-git-send-email-zajec5@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Rafał Miłecki Dec. 20, 2014, 6:25 p.m. UTC
---
Hi guys,

Let me report something I think is a bug in this unusual-patch way ;)
---
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Arend van Spriel Dec. 21, 2014, 1:03 p.m. UTC | #1
On 12/20/14 19:25, Rafa? Mi?ecki wrote:
> ---
> Hi guys,
>
> Let me report something I think is a bug in this unusual-patch way ;)
> ---
>   drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> index 39b45c0..2c9e88b 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> @@ -313,11 +313,13 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
>   	case NL80211_CHAN_WIDTH_80:
>   		ch_inf.bw = BRCMU_CHAN_BW_80;
>   		if (primary_offset<  0) {
> +			/* FIXME: We compare frequencies offset with a value -2. Looks like a wrong logic. */
>   			if (primary_offset<  -CH_10MHZ_APART)

You are right. The primary_offset is in MHz, but the logical expression 
is for channel spacing (1 channel == 5MHz). So here it should be -10 
instead. Thanks for reporting this.

Regards,
Arend
>   				ch_inf.sb = BRCMU_CHAN_SB_UU;
>   			else
>   				ch_inf.sb = BRCMU_CHAN_SB_UL;
>   		} else {
> +			/* FIXME: We compare frequencies offset with a value 2. Looks like a wrong logic. */
>   			if (primary_offset>  CH_10MHZ_APART)
>   				ch_inf.sb = BRCMU_CHAN_SB_LL;
>   			else

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafał Miłecki May 31, 2015, 8:18 a.m. UTC | #2
On 21 December 2014 at 14:03, Arend van Spriel <arend@broadcom.com> wrote:
> On 12/20/14 19:25, Rafa? Mi?ecki wrote:
>> Hi guys,
>>
>> Let me report something I think is a bug in this unusual-patch way ;)
>> ---
>>   drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>> b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>> index 39b45c0..2c9e88b 100644
>> --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>> @@ -313,11 +313,13 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf
>> *d11inf,
>>         case NL80211_CHAN_WIDTH_80:
>>                 ch_inf.bw = BRCMU_CHAN_BW_80;
>>                 if (primary_offset<  0) {
>> +                       /* FIXME: We compare frequencies offset with a
>> value -2. Looks like a wrong logic. */
>>                         if (primary_offset<  -CH_10MHZ_APART)
>
>
> You are right. The primary_offset is in MHz, but the logical expression is
> for channel spacing (1 channel == 5MHz). So here it should be -10 instead.
> Thanks for reporting this.

Will you fix it?
Arend van Spriel June 1, 2015, 11:55 a.m. UTC | #3
On 05/31/15 10:18, Rafa? Mi?ecki wrote:
> On 21 December 2014 at 14:03, Arend van Spriel<arend@broadcom.com>  wrote:
>> On 12/20/14 19:25, Rafa? Mi?ecki wrote:
>>> Hi guys,
>>>
>>> Let me report something I think is a bug in this unusual-patch way ;)
>>> ---
>>>    drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>>> b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>>> index 39b45c0..2c9e88b 100644
>>> --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
>>> @@ -313,11 +313,13 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf
>>> *d11inf,
>>>          case NL80211_CHAN_WIDTH_80:
>>>                  ch_inf.bw = BRCMU_CHAN_BW_80;
>>>                  if (primary_offset<   0) {
>>> +                       /* FIXME: We compare frequencies offset with a
>>> value -2. Looks like a wrong logic. */
>>>                          if (primary_offset<   -CH_10MHZ_APART)
>>
>>
>> You are right. The primary_offset is in MHz, but the logical expression is
>> for channel spacing (1 channel == 5MHz). So here it should be -10 instead.
>> Thanks for reporting this.
>
> Will you fix it?

Completely forgot about this one. Feel free to submit a patch for it.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 39b45c0..2c9e88b 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -313,11 +313,13 @@  static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
 	case NL80211_CHAN_WIDTH_80:
 		ch_inf.bw = BRCMU_CHAN_BW_80;
 		if (primary_offset < 0) {
+			/* FIXME: We compare frequencies offset with a value -2. Looks like a wrong logic. */
 			if (primary_offset < -CH_10MHZ_APART)
 				ch_inf.sb = BRCMU_CHAN_SB_UU;
 			else
 				ch_inf.sb = BRCMU_CHAN_SB_UL;
 		} else {
+			/* FIXME: We compare frequencies offset with a value 2. Looks like a wrong logic. */
 			if (primary_offset > CH_10MHZ_APART)
 				ch_inf.sb = BRCMU_CHAN_SB_LL;
 			else