Skip to content

Commit

Permalink
brcm80211: fmac: move tx flow ctrl flag to bus layer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Franky Lin authored and John W. Linville committed Dec 19, 2011
1 parent 9c1a043 commit c8bf348
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ struct brcmf_pub {
struct device *dev; /* fullmac dongle device pointer */

/* Internal brcmf items */
bool txoff; /* Transmit flow-controlled */
uint hdrlen; /* Total BRCMF header length (proto + bus) */
uint rxsz; /* Rx buffer size bus module should use */
u8 wme_dp; /* wme discard priority */
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ void brcmf_txflowcontrol(struct device *dev, int ifidx, bool state)

brcmf_dbg(TRACE, "Enter\n");

drvr->txoff = state;
ndev = drvr->iflist[ifidx]->ndev;
if (state == ON)
netif_stop_queue(ndev);
Expand Down
10 changes: 8 additions & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ struct brcmf_sdio {

const struct firmware *firmware;
u32 fw_ptr;

bool txoff; /* Transmit flow-controlled */
};

/* clkstate */
Expand Down Expand Up @@ -2297,8 +2299,10 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
/* Deflow-control stack if needed */
if (drvr->bus_if->drvr_up &&
(drvr->bus_if->state == BRCMF_BUS_DATA) &&
drvr->txoff && (pktq_len(&bus->txq) < TXLOW))
bus->txoff && (pktq_len(&bus->txq) < TXLOW)) {
bus->txoff = OFF;
brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF);
}

return cnt;
}
Expand Down Expand Up @@ -2611,8 +2615,10 @@ int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
}
spin_unlock_bh(&bus->txqlock);

if (pktq_len(&bus->txq) >= TXHI)
if (pktq_len(&bus->txq) >= TXHI) {
bus->txoff = ON;
brcmf_txflowcontrol(bus->sdiodev->dev, 0, ON);
}

#ifdef BCMDBG
if (pktq_plen(&bus->txq, prec) > qcount[prec])
Expand Down

0 comments on commit c8bf348

Please sign in to comment.