318-v4.11-0003-brcmfmac-use-wiphy_read_of_freq_limits-to-respect-li.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 0f83ff69735651cc7a3d150466a5257ff829b62b Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Tue, 17 Jan 2017 23:35:50 +0100
  4. Subject: [PATCH] brcmfmac: use wiphy_read_of_freq_limits to respect limits
  5. from DT
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. This new helper reads extra frequency limits specified in DT and
  10. disables unavailable chanels. This is useful for devices (like home
  11. routers) with chipsets limited e.g. by board design.
  12. In order to respect info read from DT we simply need to check for
  13. IEEE80211_CHAN_DISABLED bit when constructing channel info.
  14. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++
  18. 1 file changed, 6 insertions(+)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  21. @@ -5908,6 +5908,9 @@ static int brcmf_construct_chaninfo(stru
  22. continue;
  23. }
  24. + if (channel->orig_flags & IEEE80211_CHAN_DISABLED)
  25. + continue;
  26. +
  27. /* assuming the chanspecs order is HT20,
  28. * HT40 upper, HT40 lower, and VHT80.
  29. */
  30. @@ -6509,6 +6512,9 @@ static int brcmf_setup_wiphy(struct wiph
  31. wiphy->bands[NL80211_BAND_5GHZ] = band;
  32. }
  33. }
  34. +
  35. + wiphy_read_of_freq_limits(wiphy);
  36. +
  37. return 0;
  38. }