338-v5.0-0005-brcmfmac-fix-roamoff-1-modparam.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 8c892df41500469729e0d662816300196e4f463d Mon Sep 17 00:00:00 2001
  2. From: Stijn Tintel <stijn@linux-ipv6.be>
  3. Date: Tue, 4 Dec 2018 20:29:05 +0200
  4. Subject: [PATCH] brcmfmac: fix roamoff=1 modparam
  5. When the update_connect_param callback is set, nl80211 expects the flag
  6. WIPHY_FLAG_SUPPORTS_FW_ROAM to be set as well. However, this flag is
  7. only set when modparam roamoff=0, while the callback is set
  8. unconditionally. Since commit 7f9a3e150ec7 this causes a warning in
  9. wiphy_register, which breaks brcmfmac.
  10. Disable the update_connect_param callback when roamoff=0 to fix this.
  11. Fixes: 7f9a3e150ec7 ("nl80211: Update ERP info using NL80211_CMD_UPDATE_CONNECT_PARAMS")
  12. Cc: Stable <stable@vger.kernel.org> # 4.19+
  13. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  14. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
  15. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  16. ---
  17. .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 11 +++++++++--
  18. .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +-
  19. .../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
  20. 3 files changed, 11 insertions(+), 4 deletions(-)
  21. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  22. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  23. @@ -5190,10 +5190,17 @@ static struct cfg80211_ops brcmf_cfg8021
  24. .update_connect_params = brcmf_cfg80211_update_conn_params,
  25. };
  26. -struct cfg80211_ops *brcmf_cfg80211_get_ops(void)
  27. +struct cfg80211_ops *brcmf_cfg80211_get_ops(struct brcmf_mp_device *settings)
  28. {
  29. - return kmemdup(&brcmf_cfg80211_ops, sizeof(brcmf_cfg80211_ops),
  30. + struct cfg80211_ops *ops;
  31. +
  32. + ops = kmemdup(&brcmf_cfg80211_ops, sizeof(brcmf_cfg80211_ops),
  33. GFP_KERNEL);
  34. +
  35. + if (ops && settings->roamoff)
  36. + ops->update_connect_params = NULL;
  37. +
  38. + return ops;
  39. }
  40. struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
  41. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
  42. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
  43. @@ -391,7 +391,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  44. void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
  45. s32 brcmf_cfg80211_up(struct net_device *ndev);
  46. s32 brcmf_cfg80211_down(struct net_device *ndev);
  47. -struct cfg80211_ops *brcmf_cfg80211_get_ops(void);
  48. +struct cfg80211_ops *brcmf_cfg80211_get_ops(struct brcmf_mp_device *settings);
  49. enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp);
  50. struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
  51. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  52. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  53. @@ -1100,7 +1100,7 @@ int brcmf_attach(struct device *dev, str
  54. brcmf_dbg(TRACE, "Enter\n");
  55. - ops = brcmf_cfg80211_get_ops();
  56. + ops = brcmf_cfg80211_get_ops(settings);
  57. if (!ops)
  58. return -ENOMEM;