842-brcmfmac-setup-wiphy-bands-after-registering-it-firs.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  2. Date: Sat, 7 Jan 2017 21:36:05 +0100
  3. Subject: [PATCH] brcmfmac: setup wiphy bands after registering it first
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. During bands setup we disable all channels that firmware doesn't support
  8. in the current regulatory setup. If we do this before wiphy_register
  9. it will result in copying set flags (including IEEE80211_CHAN_DISABLED)
  10. to the orig_flags which is supposed to be persistent. We don't want this
  11. as regulatory change may result in enabling some channels. We shouldn't
  12. mess with orig_flags then (by changing them or ignoring them) so it's
  13. better to just take care of their proper values.
  14. This patch cleanups code a bit (by taking orig_flags more seriously) and
  15. allows further improvements like disabling really unavailable channels.
  16. We will need that e.g. if some frequencies should be disabled for good
  17. due to hardware setup (design).
  18. Signed-off-by: Rafał Miłecki <[email protected]>
  19. Acked-by: Arend van Spriel <[email protected]>
  20. ---
  21. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  22. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  23. @@ -6564,8 +6564,7 @@ static int brcmf_setup_wiphy(struct wiph
  24. wiphy->bands[NL80211_BAND_5GHZ] = band;
  25. }
  26. }
  27. - err = brcmf_setup_wiphybands(wiphy);
  28. - return err;
  29. + return 0;
  30. }
  31. static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
  32. @@ -6930,6 +6929,12 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  33. goto priv_out;
  34. }
  35. + err = brcmf_setup_wiphybands(wiphy);
  36. + if (err) {
  37. + brcmf_err("Setting wiphy bands failed (%d)\n", err);
  38. + goto wiphy_unreg_out;
  39. + }
  40. +
  41. /* If cfg80211 didn't disable 40MHz HT CAP in wiphy_register(),
  42. * setup 40MHz in 2GHz band and enable OBSS scanning.
  43. */