brcmfmac: Accept only first creditmap event.
authorHante Meuleman <meuleman@broadcom.com>
Thu, 6 Jun 2013 11:17:58 +0000 (13:17 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 12 Jun 2013 19:02:20 +0000 (15:02 -0400)
During P2P testing it turned out that the firmware sents multiple
multiple creditmap event messages. Only the first message from the
firmware should be processed. Otherwise the firmware-signalled flow
control can run haywire when it has packets outstanding in firmware.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c

index 5f3874288d6bb9f9b870207ec02d3f4b93edbec0..bba4ff04ee1976cad7ac04b53afda62df6add5d0 100644 (file)
@@ -434,6 +434,7 @@ struct brcmf_fws_info {
        u32 fifo_delay_map;
        unsigned long borrow_defer_timestamp;
        bool bus_flow_blocked;
+       bool creditmap_received;
 };
 
 /*
@@ -1356,6 +1357,10 @@ static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp,
                brcmf_err("event payload too small (%d)\n", e->datalen);
                return -EINVAL;
        }
+       if (fws->creditmap_received)
+               return 0;
+
+       fws->creditmap_received = true;
 
        brcmf_dbg(TRACE, "enter: credits %pM\n", credits);
        brcmf_fws_lock(ifp->drvr, flags);