aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800.h
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2010-10-02 05:32:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-05 13:35:28 -0400
commitbc8a979e2d85c2bdd507a8b6b09fdafc11ebd73a (patch)
treec529ecfa2e9b193120006061c581bd479a2a7b1e /drivers/net/wireless/rt2x00/rt2800.h
parentba3b9e5e8c7a12d8ea46cb4a8217c2e9b0720e9c (diff)
rt2x00: Improve TX status entry validation
The TX_STA_FIFO contains some information for identifying a outgoing frame, however matching by WCID and ACK status is not sufficient to 100% identify the macthing queue_entry structure (containing the SKB buffer) which belongs to the status report. Within TX_STA_FIFO we have a 4-bit field named PACKETID, which is currently used to encode the queue id. The queue ID is however limited to values from 0 to 3, which means 2 bits are sufficient to encode the value. With the remaining 2 bits we can encode a partial queue_entry index number. The value of PACKETID is not allowed to become 0, with the queue ID ranging from 0 to 3, at least one of the bits for the entry identification must be 1. That leaves us with 3 possible values we can still encode in the bits. Altough this doesn't allow 100% accurate matching of the TX_STA_FIFO queue to a queue_entry structure, it at least improves the accuracy. This allows us to better detect if we have missed the TX_STA_FIFO report, which in turn reduces the number of watchdog warnings regarding the TX status timeout. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 4930d29e1377..2a9f4020af1e 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1,5 +1,6 @@
1/* 1/*
2 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> 2 Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
3 Copyright (C) 2010 Willow Garage <http://www.willowgarage.com>
3 Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com> 4 Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
4 Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> 5 Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
5 Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com> 6 Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
@@ -1353,6 +1354,9 @@
1353 * PID_TYPE: The PID latched from the PID field in the TXWI, can be used 1354 * PID_TYPE: The PID latched from the PID field in the TXWI, can be used
1354 * to match a frame with its tx result (even though the PID is 1355 * to match a frame with its tx result (even though the PID is
1355 * only 4 bits wide). 1356 * only 4 bits wide).
1357 * PID_QUEUE: Part of PID_TYPE, this is the queue index number (0-3)
1358 * PID_ENTRY: Part of PID_TYPE, this is the queue entry index number (1-3)
1359 * This identification number is calculated by ((idx % 3) + 1).
1356 * TX_SUCCESS: Indicates tx success (1) or failure (0) 1360 * TX_SUCCESS: Indicates tx success (1) or failure (0)
1357 * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0) 1361 * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0)
1358 * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0) 1362 * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0)
@@ -1364,6 +1368,8 @@
1364#define TX_STA_FIFO 0x1718 1368#define TX_STA_FIFO 0x1718
1365#define TX_STA_FIFO_VALID FIELD32(0x00000001) 1369#define TX_STA_FIFO_VALID FIELD32(0x00000001)
1366#define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e) 1370#define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e)
1371#define TX_STA_FIFO_PID_QUEUE FIELD32(0x00000006)
1372#define TX_STA_FIFO_PID_ENTRY FIELD32(0x00000018)
1367#define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020) 1373#define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020)
1368#define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040) 1374#define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040)
1369#define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080) 1375#define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080)
@@ -2024,6 +2030,10 @@ struct mac_iveiv_entry {
2024 * frame was processed. If multiple frames are aggregated together 2030 * frame was processed. If multiple frames are aggregated together
2025 * (AMPDU==1) the reported tx status will always contain the packet 2031 * (AMPDU==1) the reported tx status will always contain the packet
2026 * id of the first frame. 0: Don't report tx status for this frame. 2032 * id of the first frame. 0: Don't report tx status for this frame.
2033 * PACKETID_QUEUE: Part of PACKETID, This is the queue index (0-3)
2034 * PACKETID_ENTRY: Part of PACKETID, THis is the queue entry index (1-3)
2035 * This identification number is calculated by ((idx % 3) + 1).
2036 * The (+1) is required to prevent PACKETID to become 0.
2027 */ 2037 */
2028#define TXWI_W1_ACK FIELD32(0x00000001) 2038#define TXWI_W1_ACK FIELD32(0x00000001)
2029#define TXWI_W1_NSEQ FIELD32(0x00000002) 2039#define TXWI_W1_NSEQ FIELD32(0x00000002)
@@ -2031,6 +2041,8 @@ struct mac_iveiv_entry {
2031#define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00) 2041#define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00)
2032#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000) 2042#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000)
2033#define TXWI_W1_PACKETID FIELD32(0xf0000000) 2043#define TXWI_W1_PACKETID FIELD32(0xf0000000)
2044#define TXWI_W1_PACKETID_QUEUE FIELD32(0x30000000)
2045#define TXWI_W1_PACKETID_ENTRY FIELD32(0xc0000000)
2034 2046
2035/* 2047/*
2036 * Word2 2048 * Word2