linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	<linux-wireless@vger.kernel.org>, <users@rt2x00.serialmonkey.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 6/9] rt2x00: Clean up generic procedures on descriptor writing.
Date: Sat,  8 May 2010 23:40:23 +0200	[thread overview]
Message-ID: <1273354826-4335-7-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1273354826-4335-1-git-send-email-gwingerde@gmail.com>

With a little bit of restructuring it isn't necessary to have special
cases in rt2x00queue_write_tx_descriptor for writing the descriptor
for beacons.
Simply split off the kicking of the TX queue to a separate function
with is only called for non-beacons.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00queue.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 59d9459..8768c6f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -428,20 +428,23 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
 	 * it is now ready to be dumped to userspace through debugfs.
 	 */
 	rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb);
+}
+
+static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
+				      struct txentry_desc *txdesc)
+{
+	struct data_queue *queue = entry->queue;
+	struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
 
 	/*
 	 * Check if we need to kick the queue, there are however a few rules
-	 *	1) Don't kick beacon queue
-	 *	2) Don't kick unless this is the last in frame in a burst.
+	 *	1) Don't kick unless this is the last in frame in a burst.
 	 *	   When the burst flag is set, this frame is always followed
 	 *	   by another frame which in some way are related to eachother.
 	 *	   This is true for fragments, RTS or CTS-to-self frames.
-	 *	3) Rule 2 can be broken when the available entries
+	 *	2) Rule 2 can be broken when the available entries
 	 *	   in the queue are less then a certain threshold.
 	 */
-	if (entry->queue->qid == QID_BEACON)
-		return;
-
 	if (rt2x00queue_threshold(queue) ||
 	    !test_bit(ENTRY_TXD_BURST, &txdesc->flags))
 		rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid);
@@ -537,6 +540,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
 
 	rt2x00queue_index_inc(queue, Q_INDEX);
 	rt2x00queue_write_tx_descriptor(entry, &txdesc);
+	rt2x00queue_kick_tx_queue(entry, &txdesc);
 
 	return 0;
 }
-- 
1.7.1


  parent reply	other threads:[~2010-05-08 21:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08 21:40 [PATCH 0/9] rt2x00: Cleanups and fixes Gertjan van Wingerde
2010-05-08 21:40 ` [PATCH 1/9] rt2x00: Fix setting of txdesc->length field Gertjan van Wingerde
2010-05-09  9:03   ` Ivo Van Doorn
2010-05-09  9:18     ` Pavel Roskin
2010-05-08 21:40 ` [PATCH 2/9] rt2x00: Clean up rt2800usb.h Gertjan van Wingerde
2010-05-09  9:04   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 3/9] rt2x00: Don't check whether hardware crypto is enabled when reading RXD Gertjan van Wingerde
2010-05-09  9:08   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 4/9] rt2x00: Factor out TXWI writing to common rt2800 code Gertjan van Wingerde
2010-05-09  9:09   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 5/9] rt2x00: Factor out RXWI processing " Gertjan van Wingerde
2010-05-09  9:10   ` Ivo Van Doorn
2010-05-08 21:40 ` Gertjan van Wingerde [this message]
2010-05-09  9:11   ` [PATCH 6/9] rt2x00: Clean up generic procedures on descriptor writing Ivo Van Doorn
2010-05-09 18:54   ` Adam Baker
2010-05-09 19:23     ` Gertjan van Wingerde
2010-05-08 21:40 ` [PATCH 7/9] rt2x00: Clean up all driver's kick_tx_queue callback functions Gertjan van Wingerde
2010-05-09  9:16   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 8/9] rt2x00: provide beacon's txdesc to write_beacon callback function Gertjan van Wingerde
2010-05-09  9:17   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 9/9] rt2x00: Fix beaconing on rt2800 Gertjan van Wingerde
2010-05-09  9:21   ` Ivo Van Doorn
2010-05-09  9:41     ` Gertjan van Wingerde
2010-05-09  9:42       ` Ivo Van Doorn

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=1273354826-4335-7-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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).