diff mbox

[v2,3/3] brcmfmac: fix wrong num_different_channels when mchan feature enabled

Message ID 1501753079-1758-3-git-send-email-wright.feng@cypress.com (mailing list archive)
State Accepted
Commit 99976fc084129e07df3a066dc15651853386da19
Delegated to: Kalle Valo
Headers show

Commit Message

Wright Feng Aug. 3, 2017, 9:37 a.m. UTC
brcmfmac: fix wrong num_different_channels when mchan feature enabled

When the device/firmware supports multi-channel, it can have P2P
connection and regular connection with AP simultaneous. In this case,
the num_different_channels in wiphy info was not correct when firmware
supports multi-channel (The iw wiphy# info showed "#channels <= 1" in 
interface combinations). It caused association failed and error message
"CTRL-EVENT-FREQ-CONFLICT error" in wpa_supplicant when P2P GO interface
was running at the same time.
The root cause is that the num_different_channels was always overridden
to 1 in brcmf_setup_ifmodes even multi-channel was enabled.
We correct the logic by moving num_different_channels setting forward.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
v2: Describe the motivation and reason for this patch in commit message
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Kalle Valo Aug. 3, 2017, 10:05 a.m. UTC | #1
Wright Feng <wright.feng@cypress.com> writes:

> brcmfmac: fix wrong num_different_channels when mchan feature enabled

Here also the title is duplicated, but I'll fix that.

> When the device/firmware supports multi-channel, it can have P2P
> connection and regular connection with AP simultaneous. In this case,
> the num_different_channels in wiphy info was not correct when firmware
> supports multi-channel (The iw wiphy# info showed "#channels <= 1" in 
> interface combinations). It caused association failed and error message
> "CTRL-EVENT-FREQ-CONFLICT error" in wpa_supplicant when P2P GO interface
> was running at the same time.
> The root cause is that the num_different_channels was always overridden
> to 1 in brcmf_setup_ifmodes even multi-channel was enabled.
> We correct the logic by moving num_different_channels setting forward.
>
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
> v2: Describe the motivation and reason for this patch in commit message

Perfect, thanks.
Arend van Spriel Aug. 7, 2017, 12:33 p.m. UTC | #2
On 8/3/2017 11:37 AM, Wright Feng wrote:
> brcmfmac: fix wrong num_different_channels when mchan feature enabled
>
> When the device/firmware supports multi-channel, it can have P2P
> connection and regular connection with AP simultaneous. In this case,
> the num_different_channels in wiphy info was not correct when firmware
> supports multi-channel (The iw wiphy# info showed "#channels <= 1" in
> interface combinations). It caused association failed and error message
> "CTRL-EVENT-FREQ-CONFLICT error" in wpa_supplicant when P2P GO interface
> was running at the same time.
> The root cause is that the num_different_channels was always overridden
> to 1 in brcmf_setup_ifmodes even multi-channel was enabled.
> We correct the logic by moving num_different_channels setting forward.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
> v2: Describe the motivation and reason for this patch in commit message
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 0281a22..0bb3b0b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6315,6 +6315,8 @@  static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 	if (p2p) {
 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
 			combo[c].num_different_channels = 2;
+		else
+			combo[c].num_different_channels = 1;
 		wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
 					  BIT(NL80211_IFTYPE_P2P_GO) |
 					  BIT(NL80211_IFTYPE_P2P_DEVICE);
@@ -6324,10 +6326,10 @@  static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 		c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
 				       BIT(NL80211_IFTYPE_P2P_GO);
 	} else {
+		combo[c].num_different_channels = 1;
 		c0_limits[i].max = 1;
 		c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
 	}
-	combo[c].num_different_channels = 1;
 	combo[c].max_interfaces = i;
 	combo[c].n_limits = i;
 	combo[c].limits = c0_limits;