From 7d6c28c7cf3420d40d16285459bbcdce268bc367 Mon Sep 17 00:00:00 2001 From: Andrey Smolnikov Date: Mon, 2 Apr 2012 10:19:30 -0700 Subject: [PATCH] net: wireless: bcmdhd: Fix frame sequence lag issue Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/dhd_sdio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c index 8461d88bcfff..f751bc7ce0a6 100644 --- a/drivers/net/wireless/bcmdhd/dhd_sdio.c +++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c @@ -21,7 +21,7 @@ * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * - * $Id: dhd_sdio.c 315747 2012-02-18 00:16:06Z $ + * $Id: dhd_sdio.c 324417 2012-03-29 03:15:15Z $ */ #include @@ -754,7 +754,8 @@ dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok) uint oldstate = bus->clkstate; #endif /* DHD_DEBUG */ - DHD_TRACE(("%s: Enter\n", __FUNCTION__)); + DHD_TRACE(("%s: Enter bus->clkstate %u target %u\n", __FUNCTION__, + bus->clkstate, target)); /* Early exit if we're already there */ if (bus->clkstate == target) { @@ -4597,6 +4598,15 @@ clkwait: if (TXCTLOK(bus) && bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL)) { int ret, i; + uint8* frame_seq = bus->ctrl_frame_buf + SDPCM_FRAMETAG_LEN; + + if (((bus->sih->chip == BCM4329_CHIP_ID) || /* limit to 4329 & 4330 for now */ + (bus->sih->chip == BCM4330_CHIP_ID)) && (*frame_seq != bus->tx_seq)) { + DHD_ERROR(("%s IOCTL frame seq lag detected!" + " frm_seq:%d != bus->tx_seq:%d, corrected\n", + __FUNCTION__, *frame_seq, bus->tx_seq)); + *frame_seq = bus->tx_seq; + } ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, (uint8 *)bus->ctrl_frame_buf, (uint32)bus->ctrl_frame_len, @@ -6289,11 +6299,12 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag) return bcmerror; } +/* Get Chip ID version */ uint dhd_bus_chip_id(dhd_pub_t *dhdp) { dhd_bus_t *bus = dhdp->bus; - return bus->sih->chip; + return bus->sih->chip; } int -- 2.34.1