From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: [PATCH 06/19] rt2x00: Generate sw sequence numbers only for devices that need it
Date: Thu, 3 Mar 2011 19:42:01 +0100 [thread overview]
Message-ID: <201103031942.02498.IvDoorn@gmail.com> (raw)
In-Reply-To: <201103031941.04133.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
Newer devices like rt2800* own a hardware sequence counter and thus
don't need to use a software sequence counter at all. Add a new driver
flag to shortcut the software sequence number generation on devices that
don't need it.
rt61pci, rt73usb and rt2800* seem to make use of a hw sequence counter
while rt2400pci and rt2500* need to do it in software.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2400pci.c | 1 +
drivers/net/wireless/rt2x00/rt2500pci.c | 1 +
drivers/net/wireless/rt2x00/rt2500usb.c | 1 +
drivers/net/wireless/rt2x00/rt2x00.h | 1 +
drivers/net/wireless/rt2x00/rt2x00queue.c | 11 +++++++----
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 2725f3c..d38acf4 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1641,6 +1641,7 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
*/
__set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
+ __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
/*
* Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 3ef1fb4..b00e4d4 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1959,6 +1959,7 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
*/
__set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
+ __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
/*
* Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 01f385d..b71df29 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1795,6 +1795,7 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
__set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags);
}
__set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags);
+ __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
/*
* Set the rssi offset.
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 391669b..be4d4cd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -662,6 +662,7 @@ enum rt2x00_flags {
DRIVER_REQUIRE_L2PAD,
DRIVER_REQUIRE_TXSTATUS_FIFO,
DRIVER_REQUIRE_TASKLET_CONTEXT,
+ DRIVER_REQUIRE_SW_SEQNO,
/*
* Driver features
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index b32ca31..eebb564 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -224,10 +224,14 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
return;
+ __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
+
+ if (!test_bit(DRIVER_REQUIRE_SW_SEQNO, &entry->queue->rt2x00dev->flags))
+ return;
+
/*
- * Hardware should insert sequence counter.
- * FIXME: We insert a software sequence counter first for
- * hardware that doesn't support hardware sequence counting.
+ * The hardware is not able to insert a sequence number. Assign a
+ * software generated one here.
*
* This is wrong because beacons are not getting sequence
* numbers assigned properly.
@@ -245,7 +249,6 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
spin_unlock_irqrestore(&intf->seqlock, irqflags);
- __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
}
static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
--
1.7.2.3
next prev parent reply other threads:[~2011-03-03 18:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 18:38 [PATCH 01/19] rt2x00: Optimize calls to rt2x00queue_get_queue Ivo van Doorn
2011-03-03 18:39 ` [PATCH 02/19] rt2x00: Make use of unlikely during tx status processing Ivo van Doorn
2011-03-03 18:39 ` [PATCH 03/19] rt2x00: Remove useless NULL check Ivo van Doorn
2011-03-03 18:40 ` [PATCH 04/19] rt2x00: Add unlikely macro to special case tx status handling Ivo van Doorn
2011-03-03 18:41 ` [PATCH 05/19] rt2x00: Use unlikely for unexpected error condition in rt2x00_mac_tx Ivo van Doorn
2011-03-03 18:42 ` Ivo van Doorn [this message]
2011-03-03 18:42 ` [PATCH 07/19] rt2x00: Optimize TX descriptor handling Ivo van Doorn
2011-03-03 18:42 ` [PATCH 08/19] rt2x00: Optimize TX descriptor memory layout Ivo van Doorn
2011-03-03 18:43 ` [PATCH 09/19] rt2x00: Move TX descriptor field "ifs" into plcp substruct Ivo van Doorn
2011-03-03 18:43 ` [PATCH 10/19] rt2x00: Don't call ieee80211_get_tx_rate for MCS rates Ivo van Doorn
2011-03-03 18:44 ` [PATCH 11/19] rt2x00: Use an enum instead of u16 for the rate_mode TX descriptor field Ivo van Doorn
2011-03-03 18:44 ` [PATCH 12/19] rt2x00: Fix rt2800 key assignment in multi bssid setups Ivo van Doorn
2011-03-03 18:44 ` [PATCH 13/19] rt2x00: Remove now unused crypto.aid field Ivo van Doorn
2011-03-03 18:45 ` [PATCH 14/19] rt2x00: Revise irqmask locking for PCI devices Ivo van Doorn
2011-03-03 18:45 ` [PATCH 15/19] rt2x00: Fix comment in rt2800pci Ivo van Doorn
2011-03-03 18:46 ` [PATCH 16/19] rt2x00: Don't treat ATIM queue as second beacon queue Ivo van Doorn
2011-03-03 18:46 ` [PATCH 17/19] rt2x00: Include ATIM queue support in rt2x00queue_get_tx_queue Ivo van Doorn
2011-03-03 18:46 ` [PATCH 18/19] rt2x00: Optimize getting the beacon queue structure Ivo van Doorn
2011-03-03 18:47 ` [PATCH 19/19] rt2x00: Remove unused rt2x00queue_get_queue function 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=201103031942.02498.IvDoorn@gmail.com \
--to=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).