diff mbox series

[AUTOSEL,4.19,06/68] brcmutil: really fix decoding channel info for 160 MHz bandwidth

Message ID 20181129055559.159228-6-sashal@kernel.org (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show
Series None | expand

Commit Message

Sasha Levin Nov. 29, 2018, 5:54 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

[ Upstream commit 3401d42c7ea2d064d15c66698ff8eb96553179ce ]

Previous commit /adding/ support for 160 MHz chanspecs was incomplete.
It didn't set bandwidth info and didn't extract control channel info. As
the result it was also using uninitialized "sb" var.

This change has been tested for two chanspecs found to be reported by
some devices/firmwares:
1) 60/160 (0xee32)
   Before: chnum:50 control_ch_num:36
    After: chnum:50 control_ch_num:60
2) 120/160 (0xed72)
   Before: chnum:114 control_ch_num:100
    After: chnum:114 control_ch_num:120

Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kalle Valo Nov. 29, 2018, 11:49 a.m. UTC | #1
Sasha Levin <sashal@kernel.org> writes:

> From: Rafał Miłecki <rafal@milecki.pl>
>
> [ Upstream commit 3401d42c7ea2d064d15c66698ff8eb96553179ce ]
>
> Previous commit /adding/ support for 160 MHz chanspecs was incomplete.
> It didn't set bandwidth info and didn't extract control channel info. As
> the result it was also using uninitialized "sb" var.
>
> This change has been tested for two chanspecs found to be reported by
> some devices/firmwares:
> 1) 60/160 (0xee32)
>    Before: chnum:50 control_ch_num:36
>     After: chnum:50 control_ch_num:60
> 2) 120/160 (0xed72)
>    Before: chnum:114 control_ch_num:100
>     After: chnum:114 control_ch_num:120
>
> Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth")
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

Please mark your stable patches with:

X-Patchwork-Hint: ignore

This way patchwork ignores them and this saves my time. Thank you.
Sasha Levin Nov. 29, 2018, 4:54 p.m. UTC | #2
On Thu, Nov 29, 2018 at 01:49:43PM +0200, Kalle Valo wrote:
>Sasha Levin <sashal@kernel.org> writes:
>
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> [ Upstream commit 3401d42c7ea2d064d15c66698ff8eb96553179ce ]
>>
>> Previous commit /adding/ support for 160 MHz chanspecs was incomplete.
>> It didn't set bandwidth info and didn't extract control channel info. As
>> the result it was also using uninitialized "sb" var.
>>
>> This change has been tested for two chanspecs found to be reported by
>> some devices/firmwares:
>> 1) 60/160 (0xee32)
>>    Before: chnum:50 control_ch_num:36
>>     After: chnum:50 control_ch_num:60
>> 2) 120/160 (0xed72)
>>    Before: chnum:114 control_ch_num:100
>>     After: chnum:114 control_ch_num:120
>>
>> Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth")
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
>Please mark your stable patches with:
>
>X-Patchwork-Hint: ignore
>
>This way patchwork ignores them and this saves my time. Thank you.

Will do, thanks!

--
Thanks,
Sasha
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
index e7584b842dce..eb5db94f5745 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
@@ -193,6 +193,9 @@  static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
 		}
 		break;
 	case BRCMU_CHSPEC_D11AC_BW_160:
+		ch->bw = BRCMU_CHAN_BW_160;
+		ch->sb = brcmu_maskget16(ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK,
+					 BRCMU_CHSPEC_D11AC_SB_SHIFT);
 		switch (ch->sb) {
 		case BRCMU_CHAN_SB_LLL:
 			ch->control_ch_num -= CH_70MHZ_APART;