diff options
author | Arend van Spriel <arend@broadcom.com> | 2013-06-26 08:20:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-27 13:42:16 -0400 |
commit | 2086374658ae580fc0575c9ab7c1ec033458dbf6 (patch) | |
tree | de419dd15cbc5b201a0c13c171fc68eaa834d0a1 /drivers/net/wireless/brcm80211 | |
parent | 88f9b65d444794bb607f71644362ba0642585206 (diff) |
brcmfmac: simplify transmit path
When getting a transmit packet from the networking layer simply
enqueue the packet unconditional and have it handled by the dequeue
worker. The transfer of the packet to the bus-specific driver part
is now done from one context.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c index 13e75c4b1a6b..41f902d0ec2d 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | |||
@@ -1707,37 +1707,6 @@ static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws) | |||
1707 | return -ENAVAIL; | 1707 | return -ENAVAIL; |
1708 | } | 1708 | } |
1709 | 1709 | ||
1710 | static int brcmf_fws_consume_credit(struct brcmf_fws_info *fws, int fifo, | ||
1711 | struct sk_buff *skb) | ||
1712 | { | ||
1713 | struct brcmf_fws_mac_descriptor *entry = brcmf_skbcb(skb)->mac; | ||
1714 | int *credit = &fws->fifo_credit[fifo]; | ||
1715 | |||
1716 | if (fifo != BRCMF_FWS_FIFO_AC_BE) | ||
1717 | fws->borrow_defer_timestamp = jiffies + | ||
1718 | BRCMF_FWS_BORROW_DEFER_PERIOD; | ||
1719 | |||
1720 | if (!(*credit)) { | ||
1721 | /* Try to borrow a credit from other queue */ | ||
1722 | if (fifo != BRCMF_FWS_FIFO_AC_BE || | ||
1723 | (brcmf_fws_borrow_credit(fws) != 0)) { | ||
1724 | brcmf_dbg(DATA, "ac=%d, credits depleted\n", fifo); | ||
1725 | return -ENAVAIL; | ||
1726 | } | ||
1727 | } else { | ||
1728 | (*credit)--; | ||
1729 | if (!(*credit)) | ||
1730 | fws->fifo_credit_map &= ~(1 << fifo); | ||
1731 | } | ||
1732 | |||
1733 | brcmf_fws_macdesc_use_req_credit(entry, skb); | ||
1734 | |||
1735 | brcmf_dbg(DATA, "ac=%d, credits=%02d:%02d:%02d:%02d\n", fifo, | ||
1736 | fws->fifo_credit[0], fws->fifo_credit[1], | ||
1737 | fws->fifo_credit[2], fws->fifo_credit[3]); | ||
1738 | return 0; | ||
1739 | } | ||
1740 | |||
1741 | static int brcmf_fws_commit_skb(struct brcmf_fws_info *fws, int fifo, | 1710 | static int brcmf_fws_commit_skb(struct brcmf_fws_info *fws, int fifo, |
1742 | struct sk_buff *skb) | 1711 | struct sk_buff *skb) |
1743 | { | 1712 | { |
@@ -1819,25 +1788,12 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) | |||
1819 | eh->h_dest, multicast, fifo); | 1788 | eh->h_dest, multicast, fifo); |
1820 | 1789 | ||
1821 | brcmf_fws_lock(drvr, flags); | 1790 | brcmf_fws_lock(drvr, flags); |
1822 | /* multicast credit support is conditional, setting | 1791 | brcmf_fws_enq(fws, BRCMF_FWS_SKBSTATE_DELAYED, fifo, skb); |
1823 | * flag to false to assure credit is consumed below. | 1792 | if (fifo != BRCMF_FWS_FIFO_AC_BE && fifo < BRCMF_FWS_FIFO_BCMC) |
1824 | */ | 1793 | fws->borrow_defer_timestamp = jiffies + |
1825 | if (fws->bcmc_credit_check) | 1794 | BRCMF_FWS_BORROW_DEFER_PERIOD; |
1826 | multicast = false; | ||
1827 | |||
1828 | if (skcb->mac->suppressed || | ||
1829 | fws->bus_flow_blocked || | ||
1830 | brcmf_fws_macdesc_closed(fws, skcb->mac, fifo) || | ||
1831 | brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) || | ||
1832 | (!multicast && | ||
1833 | brcmf_fws_consume_credit(fws, fifo, skb) < 0)) { | ||
1834 | /* enqueue the packet in delayQ */ | ||
1835 | drvr->fws->fifo_delay_map |= 1 << fifo; | ||
1836 | brcmf_fws_enq(fws, BRCMF_FWS_SKBSTATE_DELAYED, fifo, skb); | ||
1837 | } else { | ||
1838 | brcmf_fws_commit_skb(fws, fifo, skb); | ||
1839 | } | ||
1840 | brcmf_fws_unlock(drvr, flags); | 1795 | brcmf_fws_unlock(drvr, flags); |
1796 | brcmf_fws_schedule_deq(fws); | ||
1841 | return 0; | 1797 | return 0; |
1842 | } | 1798 | } |
1843 | 1799 | ||