diff options
author | Mattias Nissler <mattias.nissler@gmx.de> | 2007-10-27 07:43:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:04 -0500 |
commit | 2700f8b0489e00cb6eead31e58f5461812dd31a6 (patch) | |
tree | 5e76ce54410eea89aa593bf39f18a40475ff1af1 /drivers/net | |
parent | 3d82346c5d0ff0a413c387c6edaadc0ca29a0971 (diff) |
rt2x00: Correctly set ACK bit in tx descriptors
Add a flag to struct txdata_entry_desc that specifies whether an ack for the
frame is to be expected. Use this flag to set the ACK bit in the tx descriptor.
Previously, the ACK bit could be set incorrectly on CTS-to-self frames, so they
caused retries and were reported to be failed in the txdone handlers.
Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00ring.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
7 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 8889f6d18dce..d48b6ca9845a 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1072,7 +1072,7 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1072 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1072 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, |
1073 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); | 1073 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); |
1074 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1074 | rt2x00_set_field32(&word, TXD_W0_ACK, |
1075 | !(control->flags & IEEE80211_TXCTL_NO_ACK)); | 1075 | test_bit(ENTRY_TXD_ACK, &desc->flags)); |
1076 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | 1076 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, |
1077 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); | 1077 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); |
1078 | rt2x00_set_field32(&word, TXD_W0_RTS, | 1078 | rt2x00_set_field32(&word, TXD_W0_RTS, |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 1dea9d800d47..e6a0c37d9195 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1203,7 +1203,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1203 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1203 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, |
1204 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); | 1204 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); |
1205 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1205 | rt2x00_set_field32(&word, TXD_W0_ACK, |
1206 | !(control->flags & IEEE80211_TXCTL_NO_ACK)); | 1206 | test_bit(ENTRY_TXD_ACK, &desc->flags)); |
1207 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | 1207 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, |
1208 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); | 1208 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); |
1209 | rt2x00_set_field32(&word, TXD_W0_OFDM, | 1209 | rt2x00_set_field32(&word, TXD_W0_OFDM, |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index a00420e9626b..e9f99c48ef2d 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1058,7 +1058,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1058 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1058 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, |
1059 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); | 1059 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); |
1060 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1060 | rt2x00_set_field32(&word, TXD_W0_ACK, |
1061 | !(control->flags & IEEE80211_TXCTL_NO_ACK)); | 1061 | test_bit(ENTRY_TXD_ACK, &desc->flags)); |
1062 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | 1062 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, |
1063 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); | 1063 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); |
1064 | rt2x00_set_field32(&word, TXD_W0_OFDM, | 1064 | rt2x00_set_field32(&word, TXD_W0_OFDM, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 304830b8d16d..3ab1fb993d6f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -629,12 +629,21 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
629 | tx_rate = control->tx_rate; | 629 | tx_rate = control->tx_rate; |
630 | 630 | ||
631 | /* | 631 | /* |
632 | * Check whether this frame is to be acked | ||
633 | */ | ||
634 | if (!(control->flags & IEEE80211_TXCTL_NO_ACK)) | ||
635 | __set_bit(ENTRY_TXD_ACK, &desc.flags); | ||
636 | |||
637 | /* | ||
632 | * Check if this is a RTS/CTS frame | 638 | * Check if this is a RTS/CTS frame |
633 | */ | 639 | */ |
634 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { | 640 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { |
635 | __set_bit(ENTRY_TXD_BURST, &desc.flags); | 641 | __set_bit(ENTRY_TXD_BURST, &desc.flags); |
636 | if (is_rts_frame(frame_control)) | 642 | if (is_rts_frame(frame_control)) { |
637 | __set_bit(ENTRY_TXD_RTS_FRAME, &desc.flags); | 643 | __set_bit(ENTRY_TXD_RTS_FRAME, &desc.flags); |
644 | __set_bit(ENTRY_TXD_ACK, &desc.flags); | ||
645 | } else | ||
646 | __clear_bit(ENTRY_TXD_ACK, &desc.flags); | ||
638 | if (control->rts_cts_rate) | 647 | if (control->rts_cts_rate) |
639 | tx_rate = control->rts_cts_rate; | 648 | tx_rate = control->rts_cts_rate; |
640 | } | 649 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00ring.h b/drivers/net/wireless/rt2x00/rt2x00ring.h index ee6c423a53d9..5b871adfa22a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ring.h +++ b/drivers/net/wireless/rt2x00/rt2x00ring.h | |||
@@ -52,6 +52,7 @@ struct txdata_entry_desc { | |||
52 | #define ENTRY_TXD_MORE_FRAG 4 | 52 | #define ENTRY_TXD_MORE_FRAG 4 |
53 | #define ENTRY_TXD_REQ_TIMESTAMP 5 | 53 | #define ENTRY_TXD_REQ_TIMESTAMP 5 |
54 | #define ENTRY_TXD_BURST 6 | 54 | #define ENTRY_TXD_BURST 6 |
55 | #define ENTRY_TXD_ACK 7 | ||
55 | 56 | ||
56 | /* | 57 | /* |
57 | * Queue ID. ID's 0-4 are data TX rings | 58 | * Queue ID. ID's 0-4 are data TX rings |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index f3c4cbe734ec..606cf1299fff 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1578,7 +1578,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1578 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1578 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, |
1579 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); | 1579 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); |
1580 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1580 | rt2x00_set_field32(&word, TXD_W0_ACK, |
1581 | !(control->flags & IEEE80211_TXCTL_NO_ACK)); | 1581 | test_bit(ENTRY_TXD_ACK, &desc->flags)); |
1582 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | 1582 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, |
1583 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); | 1583 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); |
1584 | rt2x00_set_field32(&word, TXD_W0_OFDM, | 1584 | rt2x00_set_field32(&word, TXD_W0_OFDM, |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 7caa3639dadf..4d1227aef089 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1275,7 +1275,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1275 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1275 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, |
1276 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); | 1276 | test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); |
1277 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1277 | rt2x00_set_field32(&word, TXD_W0_ACK, |
1278 | !(control->flags & IEEE80211_TXCTL_NO_ACK)); | 1278 | test_bit(ENTRY_TXD_ACK, &desc->flags)); |
1279 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | 1279 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, |
1280 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); | 1280 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); |
1281 | rt2x00_set_field32(&word, TXD_W0_OFDM, | 1281 | rt2x00_set_field32(&word, TXD_W0_OFDM, |