brcmfmac: do not disconnect for disassoc frame from unconnected AP
authorAble Liao <Able.Liao@cypress.com>
Thu, 18 Jun 2020 16:07:39 +0000 (11:07 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 14 Jul 2020 09:48:00 +0000 (12:48 +0300)
Ignore FW event if the event's BSSID is different form the BSSID of the
currently connected AP. Check interface state is connected or not, if
state is not connected that can ignore link down event.

Signed-off-by: Able Liao <Able.Liao@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200618160739.21457-4-chi-hsien.lin@cypress.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

index e7b227714167af8a8cef9c52f824e4255effab69..5d99771c3f648a5f70f3128f688a5004ae6fdb9b 100644 (file)
@@ -6027,7 +6027,12 @@ brcmf_notify_connect_status(struct brcmf_if *ifp,
                brcmf_net_setcarrier(ifp, true);
        } else if (brcmf_is_linkdown(e)) {
                brcmf_dbg(CONN, "Linkdown\n");
-               if (!brcmf_is_ibssmode(ifp->vif)) {
+               if (!brcmf_is_ibssmode(ifp->vif) &&
+                   test_bit(BRCMF_VIF_STATUS_CONNECTED,
+                            &ifp->vif->sme_state)) {
+                       if (memcmp(profile->bssid, e->addr, ETH_ALEN))
+                               return err;
+
                        brcmf_bss_connect_done(cfg, ndev, e, false);
                        brcmf_link_down(ifp->vif,
                                        brcmf_map_fw_linkdown_reason(e),