diff mbox series

[v4,1/3] wifi: brcmfmac: correctly remove all p2p vif

Message ID 20221024085215.27616-2-ian.lin@infineon.com (mailing list archive)
State Accepted
Commit c7caaa6f727871ff00b49c3bb7260137a05491bf
Delegated to: Kalle Valo
Headers show
Series Fix connect/p2p issue series | expand

Commit Message

Ian Lin Oct. 24, 2022, 8:52 a.m. UTC
From: Brian Henriquez <brian.henriquez@cypress.com>

When deleting a P2P AGO interface we should make sure that
relevant entry in bss_idx[] array is removed. We were always
removing only 'vif' at P2PAPI_BSSCFG_CONNECTION before,
regardless of the number of created P2P AGO interfaces.
brcmfmac: correctly remove all p2p vif

Signed-off-by: Brian Henriquez <brian.henriquez@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
Signed-off-by: Ian Lin <ian.lin@infineon.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Kalle Valo Nov. 8, 2022, 7:38 a.m. UTC | #1
Ian Lin <ian.lin@infineon.com> wrote:

> From: Brian Henriquez <brian.henriquez@cypress.com>
> 
> When deleting a P2P AGO interface we should make sure that
> relevant entry in bss_idx[] array is removed. We were always
> removing only 'vif' at P2PAPI_BSSCFG_CONNECTION before,
> regardless of the number of created P2P AGO interfaces.
> brcmfmac: correctly remove all p2p vif
> 
> Signed-off-by: Brian Henriquez <brian.henriquez@cypress.com>
> Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
> Signed-off-by: Ian Lin <ian.lin@infineon.com>

3 patches applied to wireless-next.git, thanks.

c7caaa6f7278 wifi: brcmfmac: correctly remove all p2p vif
52617bee3718 wifi: brcmfmac: Fix for when connect request is not success
c81c1fd4e907 wifi: brcmfmac: Avoiding Connection delay
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 479041f070f9..b3d706a2e68c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2424,8 +2424,12 @@  int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
 	brcmf_remove_interface(vif->ifp, true);
 
 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
-	if (iftype != NL80211_IFTYPE_P2P_DEVICE)
-		p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL;
+	if (iftype != NL80211_IFTYPE_P2P_DEVICE) {
+		if (vif == p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif)
+			p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL;
+		if (vif == p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION2].vif)
+			p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION2].vif = NULL;
+	}
 
 	return err;
 }