326-v4.14-0002-brcmfmac-fix-wrong-num_different_channels-when-mchan.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 99976fc084129e07df3a066dc15651853386da19 Mon Sep 17 00:00:00 2001
  2. From: Wright Feng <wright.feng@cypress.com>
  3. Date: Thu, 3 Aug 2017 17:37:59 +0800
  4. Subject: [PATCH] brcmfmac: fix wrong num_different_channels when mchan feature
  5. enabled
  6. When the device/firmware supports multi-channel, it can have P2P
  7. connection and regular connection with AP simultaneous. In this case,
  8. the num_different_channels in wiphy info was not correct when firmware
  9. supports multi-channel (The iw wiphy# info showed "#channels <= 1" in
  10. interface combinations). It caused association failed and error message
  11. "CTRL-EVENT-FREQ-CONFLICT error" in wpa_supplicant when P2P GO interface
  12. was running at the same time.
  13. The root cause is that the num_different_channels was always overridden
  14. to 1 in brcmf_setup_ifmodes even multi-channel was enabled.
  15. We correct the logic by moving num_different_channels setting forward.
  16. Signed-off-by: Wright Feng <wright.feng@cypress.com>
  17. Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  18. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  19. ---
  20. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++-
  21. 1 file changed, 3 insertions(+), 1 deletion(-)
  22. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  23. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  24. @@ -6311,6 +6311,8 @@ static int brcmf_setup_ifmodes(struct wi
  25. if (p2p) {
  26. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
  27. combo[c].num_different_channels = 2;
  28. + else
  29. + combo[c].num_different_channels = 1;
  30. wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
  31. BIT(NL80211_IFTYPE_P2P_GO) |
  32. BIT(NL80211_IFTYPE_P2P_DEVICE);
  33. @@ -6320,10 +6322,10 @@ static int brcmf_setup_ifmodes(struct wi
  34. c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
  35. BIT(NL80211_IFTYPE_P2P_GO);
  36. } else {
  37. + combo[c].num_different_channels = 1;
  38. c0_limits[i].max = 1;
  39. c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
  40. }
  41. - combo[c].num_different_channels = 1;
  42. combo[c].max_interfaces = i;
  43. combo[c].n_limits = i;
  44. combo[c].limits = c0_limits;