336-v4.20-0001-brcmutil-really-fix-decoding-channel-info-for-160-MH.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 3401d42c7ea2d064d15c66698ff8eb96553179ce Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Fri, 26 Oct 2018 12:50:39 +0200
  4. Subject: [PATCH] brcmutil: really fix decoding channel info for 160 MHz
  5. bandwidth
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Previous commit /adding/ support for 160 MHz chanspecs was incomplete.
  10. It didn't set bandwidth info and didn't extract control channel info. As
  11. the result it was also using uninitialized "sb" var.
  12. This change has been tested for two chanspecs found to be reported by
  13. some devices/firmwares:
  14. 1) 60/160 (0xee32)
  15. Before: chnum:50 control_ch_num:36
  16. After: chnum:50 control_ch_num:60
  17. 2) 120/160 (0xed72)
  18. Before: chnum:114 control_ch_num:100
  19. After: chnum:114 control_ch_num:120
  20. Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth")
  21. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  22. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  23. ---
  24. drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 3 +++
  25. 1 file changed, 3 insertions(+)
  26. --- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
  27. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
  28. @@ -193,6 +193,9 @@ static void brcmu_d11ac_decchspec(struct
  29. }
  30. break;
  31. case BRCMU_CHSPEC_D11AC_BW_160:
  32. + ch->bw = BRCMU_CHAN_BW_160;
  33. + ch->sb = brcmu_maskget16(ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK,
  34. + BRCMU_CHSPEC_D11AC_SB_SHIFT);
  35. switch (ch->sb) {
  36. case BRCMU_CHAN_SB_LLL:
  37. ch->control_ch_num -= CH_70MHZ_APART;