diff options
author | Franky Lin <frankyl@broadcom.com> | 2011-12-16 21:37:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-19 14:40:45 -0500 |
commit | c8bf34849f92c5894a3d7e12573d3789d7851f23 (patch) | |
tree | 0e614f28a16788bc40edf80c52d08f14267ab3fc /drivers/net/wireless/brcm80211/brcmfmac | |
parent | 9c1a043ae688151444578f15208233143526bb88 (diff) |
brcm80211: fmac: move tx flow ctrl flag to bus layer
txoff is the flow control flag for transmit used in sdio layer.
Move it to bus layer data structure brcmf_sdio. Also flag
management code is moved out of brcmf_txflowcontrol(). This is
part of the fullmac bus interface refactoring.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 10 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h index 746156797bcc..980bf70d89fd 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h | |||
@@ -597,7 +597,6 @@ struct brcmf_pub { | |||
597 | struct device *dev; /* fullmac dongle device pointer */ | 597 | struct device *dev; /* fullmac dongle device pointer */ |
598 | 598 | ||
599 | /* Internal brcmf items */ | 599 | /* Internal brcmf items */ |
600 | bool txoff; /* Transmit flow-controlled */ | ||
601 | uint hdrlen; /* Total BRCMF header length (proto + bus) */ | 600 | uint hdrlen; /* Total BRCMF header length (proto + bus) */ |
602 | uint rxsz; /* Rx buffer size bus module should use */ | 601 | uint rxsz; /* Rx buffer size bus module should use */ |
603 | u8 wme_dp; /* wme discard priority */ | 602 | u8 wme_dp; /* wme discard priority */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 1ce632288261..130cab1e2a24 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -356,7 +356,6 @@ void brcmf_txflowcontrol(struct device *dev, int ifidx, bool state) | |||
356 | 356 | ||
357 | brcmf_dbg(TRACE, "Enter\n"); | 357 | brcmf_dbg(TRACE, "Enter\n"); |
358 | 358 | ||
359 | drvr->txoff = state; | ||
360 | ndev = drvr->iflist[ifidx]->ndev; | 359 | ndev = drvr->iflist[ifidx]->ndev; |
361 | if (state == ON) | 360 | if (state == ON) |
362 | netif_stop_queue(ndev); | 361 | netif_stop_queue(ndev); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index e0456e96cbd1..a7fe00fc6843 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -575,6 +575,8 @@ struct brcmf_sdio { | |||
575 | 575 | ||
576 | const struct firmware *firmware; | 576 | const struct firmware *firmware; |
577 | u32 fw_ptr; | 577 | u32 fw_ptr; |
578 | |||
579 | bool txoff; /* Transmit flow-controlled */ | ||
578 | }; | 580 | }; |
579 | 581 | ||
580 | /* clkstate */ | 582 | /* clkstate */ |
@@ -2297,8 +2299,10 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes) | |||
2297 | /* Deflow-control stack if needed */ | 2299 | /* Deflow-control stack if needed */ |
2298 | if (drvr->bus_if->drvr_up && | 2300 | if (drvr->bus_if->drvr_up && |
2299 | (drvr->bus_if->state == BRCMF_BUS_DATA) && | 2301 | (drvr->bus_if->state == BRCMF_BUS_DATA) && |
2300 | drvr->txoff && (pktq_len(&bus->txq) < TXLOW)) | 2302 | bus->txoff && (pktq_len(&bus->txq) < TXLOW)) { |
2303 | bus->txoff = OFF; | ||
2301 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF); | 2304 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF); |
2305 | } | ||
2302 | 2306 | ||
2303 | return cnt; | 2307 | return cnt; |
2304 | } | 2308 | } |
@@ -2611,8 +2615,10 @@ int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt) | |||
2611 | } | 2615 | } |
2612 | spin_unlock_bh(&bus->txqlock); | 2616 | spin_unlock_bh(&bus->txqlock); |
2613 | 2617 | ||
2614 | if (pktq_len(&bus->txq) >= TXHI) | 2618 | if (pktq_len(&bus->txq) >= TXHI) { |
2619 | bus->txoff = ON; | ||
2615 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, ON); | 2620 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, ON); |
2621 | } | ||
2616 | 2622 | ||
2617 | #ifdef BCMDBG | 2623 | #ifdef BCMDBG |
2618 | if (pktq_plen(&bus->txq, prec) > qcount[prec]) | 2624 | if (pktq_plen(&bus->txq, prec) > qcount[prec]) |