From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH V2 14/15] brcmfmac: rename brcmf_fws_mac_desc_ready()
Date: Thu, 11 Apr 2013 17:12:04 +0200 [thread overview]
Message-ID: <1365693124-3043-1-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1365679740-25679-15-git-send-email-arend@broadcom.com>
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>
---
Hi John,
Can not blame merging this time. The original patch has some checkpatch
warnings that this patch fixes. Sorry about that.
Regards,
Arend
---
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 31 ++++++++------------
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index d9572fb..1234de3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -714,26 +714,19 @@ done:
return entry;
}
-static bool brcmf_fws_mac_desc_ready(struct brcmf_fws_mac_descriptor *entry,
- int fifo)
+static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_mac_descriptor *entry,
+ int fifo)
{
- bool ready;
+ bool closed;
- /*
- * destination entry is ready when firmware says it is OPEN
- * and there are no packets enqueued for it.
+ /* an entry is closed when the state is closed and
+ * the firmware did not request anything.
*/
- ready = entry->state == BRCMF_FWS_STATE_OPEN &&
- !entry->suppressed &&
- brcmu_pktq_mlen(&entry->psq, 3 << (fifo * 2)) == 0;
+ closed = entry->state == BRCMF_FWS_STATE_CLOSE &&
+ !entry->requested_credit && !entry->requested_packet;
- /*
- * Or when the destination entry is CLOSED, but firmware has
- * specifically requested packets for this entry.
- */
- ready = ready || (entry->state == BRCMF_FWS_STATE_CLOSE &&
- (entry->requested_credit + entry->requested_packet));
- return ready;
+ /* Or firmware does not allow traffic for given fifo */
+ return closed || !(entry->ac_bitmap & BIT(fifo));
}
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)
for (i = 0; i < num_nodes; i++) {
entry = &table[(node_pos + i) % num_nodes];
- if (!entry->occupied)
+ if (!entry->occupied || brcmf_fws_mac_desc_closed(entry, fifo))
continue;
if (entry->suppressed)
@@ -1758,7 +1751,9 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
multicast, fifo);
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 &&
brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) {
/* enqueue the packet in delayQ */
--
1.7.10.4
next prev parent reply other threads:[~2013-04-11 15:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 11:28 [PATCH 00/15] brcmfmac: new device support and fixes Arend van Spriel
2013-04-11 11:28 ` [PATCH 01/15] brcmfmac: support save&restore firmware feature Arend van Spriel
2013-04-11 11:28 ` [PATCH 02/15] brcmfmac: aggregate dongle ram access interface Arend van Spriel
2013-04-11 11:28 ` [PATCH 03/15] brcmfmac: move chip download state code to sdio_chip.c Arend van Spriel
2013-04-11 11:28 ` [PATCH 04/15] brcmutil: add new d11 interface support Arend van Spriel
2013-04-11 11:28 ` [PATCH 05/15] brcmfmac: adopt new d11 interface Arend van Spriel
2013-04-11 11:28 ` [PATCH 06/15] brcmfmac: add support for dongle ARM CR4 core Arend van Spriel
2013-04-11 11:28 ` [PATCH 07/15] brcmfmac: setup SDIO reset behavior Arend van Spriel
2013-04-11 11:28 ` [PATCH 08/15] brcmfmac: add BCM4335 sdio interface support Arend van Spriel
2013-04-11 11:28 ` [PATCH 09/15] brcmfmac: Add 43143 SDIO support Arend van Spriel
2013-04-11 11:28 ` [PATCH 10/15] brcmfmac: Add drive strength programming for SDIO 43143 Arend van Spriel
2013-04-11 11:28 ` [PATCH 11/15] brcmfmac: define and use platform specific data for SDIO Arend van Spriel
2013-04-11 12:06 ` Hauke Mehrtens
2013-04-11 13:09 ` Arend van Spriel
2013-04-11 23:15 ` Hauke Mehrtens
2013-04-12 7:44 ` Arend van Spriel
2013-04-12 8:55 ` [PATCH V2 " Arend van Spriel
2013-04-11 11:28 ` [PATCH 12/15] brcmfmac: obtain iftype for firmware-signal descriptor lookup Arend van Spriel
2013-04-11 15:08 ` [PATCH V2 " Arend van Spriel
2013-04-11 11:28 ` [PATCH 13/15] brcmfmac: pass ifp pointer in brcmf_fws_find_mac_desc() Arend van Spriel
2013-04-11 11:28 ` [PATCH 14/15] brcmfmac: rename brcmf_fws_mac_desc_ready() Arend van Spriel
2013-04-11 15:12 ` Arend van Spriel [this message]
2013-04-11 11:29 ` [PATCH 15/15] brcmfmac: remove ifidx variable from brcmf_fws_process_skb() Arend van Spriel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365693124-3043-1-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).