aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-04-11 11:12:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-12 14:27:56 -0400
commit9fc60224ba7a3ca94c4f988ee0eadf0c5eebbc39 (patch)
treee85697df1fe125b56de1bb21148cd6b6af320db9 /drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
parentf97a7f06b8a3a887875475b4caee4e2cce259a61 (diff)
brcmfmac: rename brcmf_fws_mac_desc_ready()
Replace the function by brcmf_fws_mac_desc_closed(). The new function is used in the transmit path and in the dequeue worker. Reviewed-by: Hante Meuleman <meuleman@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/brcmfmac/fwsignal.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index d9572fb74356..1234de361cf2 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -714,26 +714,19 @@ done:
714 return entry; 714 return entry;
715} 715}
716 716
717static bool brcmf_fws_mac_desc_ready(struct brcmf_fws_mac_descriptor *entry, 717static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_mac_descriptor *entry,
718 int fifo) 718 int fifo)
719{ 719{
720 bool ready; 720 bool closed;
721 721
722 /* 722 /* an entry is closed when the state is closed and
723 * destination entry is ready when firmware says it is OPEN 723 * the firmware did not request anything.
724 * and there are no packets enqueued for it.
725 */ 724 */
726 ready = entry->state == BRCMF_FWS_STATE_OPEN && 725 closed = entry->state == BRCMF_FWS_STATE_CLOSE &&
727 !entry->suppressed && 726 !entry->requested_credit && !entry->requested_packet;
728 brcmu_pktq_mlen(&entry->psq, 3 << (fifo * 2)) == 0;
729 727
730 /* 728 /* Or firmware does not allow traffic for given fifo */
731 * Or when the destination entry is CLOSED, but firmware has 729 return closed || !(entry->ac_bitmap & BIT(fifo));
732 * specifically requested packets for this entry.
733 */
734 ready = ready || (entry->state == BRCMF_FWS_STATE_CLOSE &&
735 (entry->requested_credit + entry->requested_packet));
736 return ready;
737} 730}
738 731
739static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws, 732static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws,
@@ -1086,7 +1079,7 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
1086 1079
1087 for (i = 0; i < num_nodes; i++) { 1080 for (i = 0; i < num_nodes; i++) {
1088 entry = &table[(node_pos + i) % num_nodes]; 1081 entry = &table[(node_pos + i) % num_nodes];
1089 if (!entry->occupied) 1082 if (!entry->occupied || brcmf_fws_mac_desc_closed(entry, fifo))
1090 continue; 1083 continue;
1091 1084
1092 if (entry->suppressed) 1085 if (entry->suppressed)
@@ -1758,7 +1751,9 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
1758 multicast, fifo); 1751 multicast, fifo);
1759 1752
1760 brcmf_fws_lock(drvr, flags); 1753 brcmf_fws_lock(drvr, flags);
1761 if (!brcmf_fws_mac_desc_ready(skcb->mac, fifo) || 1754 if (skcb->mac->suppressed ||
1755 brcmf_fws_mac_desc_closed(skcb->mac, fifo) ||
1756 brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
1762 (!multicast && 1757 (!multicast &&
1763 brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) { 1758 brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) {
1764 /* enqueue the packet in delayQ */ 1759 /* enqueue the packet in delayQ */