Commit 9fc60224 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

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: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f97a7f06
...@@ -714,26 +714,19 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp, ...@@ -714,26 +714,19 @@ brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
return entry; return entry;
} }
static bool brcmf_fws_mac_desc_ready(struct brcmf_fws_mac_descriptor *entry, static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_mac_descriptor *entry,
int fifo) int fifo)
{ {
bool ready; bool closed;
/* /* an entry is closed when the state is closed and
* destination entry is ready when firmware says it is OPEN * the firmware did not request anything.
* and there are no packets enqueued for it.
*/ */
ready = entry->state == BRCMF_FWS_STATE_OPEN && closed = entry->state == BRCMF_FWS_STATE_CLOSE &&
!entry->suppressed && !entry->requested_credit && !entry->requested_packet;
brcmu_pktq_mlen(&entry->psq, 3 << (fifo * 2)) == 0;
/* /* Or firmware does not allow traffic for given fifo */
* Or when the destination entry is CLOSED, but firmware has return closed || !(entry->ac_bitmap & BIT(fifo));
* specifically requested packets for this entry.
*/
ready = ready || (entry->state == BRCMF_FWS_STATE_CLOSE &&
(entry->requested_credit + entry->requested_packet));
return ready;
} }
static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws, static 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,7 +1079,7 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
for (i = 0; i < num_nodes; i++) { for (i = 0; i < num_nodes; i++) {
entry = &table[(node_pos + i) % num_nodes]; entry = &table[(node_pos + i) % num_nodes];
if (!entry->occupied) if (!entry->occupied || brcmf_fws_mac_desc_closed(entry, fifo))
continue; continue;
if (entry->suppressed) if (entry->suppressed)
...@@ -1758,7 +1751,9 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) ...@@ -1758,7 +1751,9 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
multicast, fifo); multicast, fifo);
brcmf_fws_lock(drvr, flags); brcmf_fws_lock(drvr, flags);
if (!brcmf_fws_mac_desc_ready(skcb->mac, fifo) || if (skcb->mac->suppressed ||
brcmf_fws_mac_desc_closed(skcb->mac, fifo) ||
brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
(!multicast && (!multicast &&
brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) { brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) {
/* enqueue the packet in delayQ */ /* enqueue the packet in delayQ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment