Commit 2700f8b0 authored by Mattias Nissler's avatar Mattias Nissler Committed by David S. Miller

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: default avatarMattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d82346c
...@@ -1072,7 +1072,7 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1072,7 +1072,7 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_ACK, rt2x00_set_field32(&word, TXD_W0_ACK,
!(control->flags & IEEE80211_TXCTL_NO_ACK)); test_bit(ENTRY_TXD_ACK, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_RTS, rt2x00_set_field32(&word, TXD_W0_RTS,
......
...@@ -1203,7 +1203,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1203,7 +1203,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_ACK, rt2x00_set_field32(&word, TXD_W0_ACK,
!(control->flags & IEEE80211_TXCTL_NO_ACK)); test_bit(ENTRY_TXD_ACK, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_OFDM, rt2x00_set_field32(&word, TXD_W0_OFDM,
......
...@@ -1058,7 +1058,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1058,7 +1058,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_ACK, rt2x00_set_field32(&word, TXD_W0_ACK,
!(control->flags & IEEE80211_TXCTL_NO_ACK)); test_bit(ENTRY_TXD_ACK, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_OFDM, rt2x00_set_field32(&word, TXD_W0_OFDM,
......
...@@ -628,13 +628,22 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -628,13 +628,22 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
tx_rate = control->tx_rate; tx_rate = control->tx_rate;
/*
* Check whether this frame is to be acked
*/
if (!(control->flags & IEEE80211_TXCTL_NO_ACK))
__set_bit(ENTRY_TXD_ACK, &desc.flags);
/* /*
* Check if this is a RTS/CTS frame * Check if this is a RTS/CTS frame
*/ */
if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) {
__set_bit(ENTRY_TXD_BURST, &desc.flags); __set_bit(ENTRY_TXD_BURST, &desc.flags);
if (is_rts_frame(frame_control)) if (is_rts_frame(frame_control)) {
__set_bit(ENTRY_TXD_RTS_FRAME, &desc.flags); __set_bit(ENTRY_TXD_RTS_FRAME, &desc.flags);
__set_bit(ENTRY_TXD_ACK, &desc.flags);
} else
__clear_bit(ENTRY_TXD_ACK, &desc.flags);
if (control->rts_cts_rate) if (control->rts_cts_rate)
tx_rate = control->rts_cts_rate; tx_rate = control->rts_cts_rate;
} }
......
...@@ -52,6 +52,7 @@ struct txdata_entry_desc { ...@@ -52,6 +52,7 @@ struct txdata_entry_desc {
#define ENTRY_TXD_MORE_FRAG 4 #define ENTRY_TXD_MORE_FRAG 4
#define ENTRY_TXD_REQ_TIMESTAMP 5 #define ENTRY_TXD_REQ_TIMESTAMP 5
#define ENTRY_TXD_BURST 6 #define ENTRY_TXD_BURST 6
#define ENTRY_TXD_ACK 7
/* /*
* Queue ID. ID's 0-4 are data TX rings * Queue ID. ID's 0-4 are data TX rings
......
...@@ -1578,7 +1578,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1578,7 +1578,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_ACK, rt2x00_set_field32(&word, TXD_W0_ACK,
!(control->flags & IEEE80211_TXCTL_NO_ACK)); test_bit(ENTRY_TXD_ACK, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_OFDM, rt2x00_set_field32(&word, TXD_W0_OFDM,
......
...@@ -1275,7 +1275,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1275,7 +1275,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags)); test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_ACK, rt2x00_set_field32(&word, TXD_W0_ACK,
!(control->flags & IEEE80211_TXCTL_NO_ACK)); test_bit(ENTRY_TXD_ACK, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags)); test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_OFDM, rt2x00_set_field32(&word, TXD_W0_OFDM,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment