aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-05-10 07:42:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:30 -0400
commitfb55f4d1fa252ba1e479284b79da1049d658c371 (patch)
tree0922dcd4e12037026293dd41914d774f06955641 /drivers/net/wireless/rt2x00/rt2400pci.c
parent5a6e59991b82580c3ca00115603b85762ec76104 (diff)
rt2x00: Fix TX status reporting
The tx_status enumeration was broken since the introduction of rt61pci. That driver uses different values to report the status of the tx action. This would lead to frames that were reported as success but actually failed to be send out, or frames that were neither successfull or failure which were reported as failure. Fix this by change the TX status reporting and more explicitely check for failure or success. Note that a third possibility is added "unknown". Not all hardware (USB) can report the actual TX status, for rt61pci some frames will receive this status because the TXdone handler is never called for those frames. This unknown will now be handled as neither success or failure, so we no longer increment the failure counter while this conclusion could not be determined from the real status of the frame. 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/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index afa565c63621..69b1dbd1adf0 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1137,7 +1137,18 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
1137 /* 1137 /*
1138 * Obtain the status about this packet. 1138 * Obtain the status about this packet.
1139 */ 1139 */
1140 txdesc.status = rt2x00_get_field32(word, TXD_W0_RESULT); 1140 txdesc.flags = 0;
1141 switch (rt2x00_get_field32(word, TXD_W0_RESULT)) {
1142 case 0: /* Success */
1143 case 1: /* Success with retry */
1144 __set_bit(TXDONE_SUCCESS, &txdesc.flags);
1145 break;
1146 case 2: /* Failure, excessive retries */
1147 __set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
1148 /* Don't break, this is a failed frame! */
1149 default: /* Failure */
1150 __set_bit(TXDONE_FAILURE, &txdesc.flags);
1151 }
1141 txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT); 1152 txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
1142 1153
1143 rt2x00pci_txdone(rt2x00dev, entry, &txdesc); 1154 rt2x00pci_txdone(rt2x00dev, entry, &txdesc);