103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 46f24cd5980de4302982d38ebb6620560ead10b3 Mon Sep 17 00:00:00 2001
  2. From: Arend van Spriel <[email protected]>
  3. Date: Thu, 11 Jul 2019 10:45:30 +0200
  4. Subject: [PATCH 1/3] brcmfmac: add 160MHz in chandef_to_chanspec()
  5. The function chandef_to_chanspec() was not handling 160MHz bandwidth
  6. resulting in wrong encoding of the channel. That resulting in firmware
  7. rejecting the provided channel specification.
  8. Reviewed-by: Hante Meuleman <[email protected]>
  9. Reviewed-by: Pieter-Paul Giesberts <[email protected]>
  10. Reviewed-by: Franky Lin <[email protected]>
  11. Signed-off-by: Arend van Spriel <[email protected]>
  12. ---
  13. .../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 ++++++++++++++++++-
  14. 1 file changed, 20 insertions(+), 1 deletion(-)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  17. @@ -276,8 +276,26 @@ static u16 chandef_to_chanspec(struct br
  18. else
  19. ch_inf.sb = BRCMU_CHAN_SB_UU;
  20. break;
  21. - case NL80211_CHAN_WIDTH_80P80:
  22. case NL80211_CHAN_WIDTH_160:
  23. + ch_inf.bw = BRCMU_CHAN_BW_160;
  24. + if (primary_offset == -70)
  25. + ch_inf.sb = BRCMU_CHAN_SB_LLL;
  26. + else if (primary_offset == -50)
  27. + ch_inf.sb = BRCMU_CHAN_SB_LLU;
  28. + else if (primary_offset == -30)
  29. + ch_inf.sb = BRCMU_CHAN_SB_LUL;
  30. + else if (primary_offset == -10)
  31. + ch_inf.sb = BRCMU_CHAN_SB_LUU;
  32. + else if (primary_offset == 10)
  33. + ch_inf.sb = BRCMU_CHAN_SB_ULL;
  34. + else if (primary_offset == 30)
  35. + ch_inf.sb = BRCMU_CHAN_SB_ULU;
  36. + else if (primary_offset == 50)
  37. + ch_inf.sb = BRCMU_CHAN_SB_UUL;
  38. + else
  39. + ch_inf.sb = BRCMU_CHAN_SB_UUU;
  40. + break;
  41. + case NL80211_CHAN_WIDTH_80P80:
  42. case NL80211_CHAN_WIDTH_5:
  43. case NL80211_CHAN_WIDTH_10:
  44. default:
  45. @@ -296,6 +314,7 @@ static u16 chandef_to_chanspec(struct br
  46. }
  47. d11inf->encchspec(&ch_inf);
  48. + brcmf_dbg(TRACE, "chanspec: 0x%x\n", ch_inf.chspec);
  49. return ch_inf.chspec;
  50. }