[rt2x00-users] [RFC 3/3] rt2x00: do not generate seqno in h/w if QOS is disabled

Stanislaw Gruszka sgruszka at redhat.com
Wed Mar 28 23:02:31 EST 2012


This is workaround H/W or F/W bug, see in code comments.

Reported-by: Walter Goldens <goldenstranger at yahoo.com>
Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
---
 drivers/net/wireless/rt2x00/rt2x00.h      |    1 +
 drivers/net/wireless/rt2x00/rt2x00mac.c   |    2 ++
 drivers/net/wireless/rt2x00/rt2x00queue.c |   15 +++++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 8de9bfc..5583214 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -693,6 +693,7 @@ enum rt2x00_state_flags {
 	CONFIG_CHANNEL_HT40,
 	CONFIG_POWERSAVING,
 	CONFIG_HT_DISABLED,
+	CONFIG_QOS_DISABLED,
 
 	/*
 	 * Mark we currently are sequentially reading TX_STA_FIFO register
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index f1b47d4..c0f7b86 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -729,6 +729,8 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
 		rt2x00dev->ops->hw->conf_tx(hw, NULL, 1, &params);
 		rt2x00dev->ops->hw->conf_tx(hw, NULL, 2, &params);
 		rt2x00dev->ops->hw->conf_tx(hw, NULL, 3, &params);
+
+		set_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);
 	}
 
 	/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 03068bd..3dbd181 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -213,8 +213,19 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
 
 	__set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
 
-	if (!test_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags))
-		return;
+	if (!test_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags)) {
+		/*
+		 * rt2800 has a H/W or F/W bug, device incorrectly increase
+		 * seqno on retransmited data (non-QOS) frames. To workaround
+		 * the problem let's generate seqno in software if QOS is
+		 * disabled.
+		 */
+		if (test_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags))
+			__clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
+		else
+			/* H/W will generate sequence number */
+			return;
+	}
 
 	/*
 	 * The hardware is not able to insert a sequence number. Assign a
-- 
1.7.1




More information about the users mailing list