diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-12-13 06:33:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-13 15:23:34 -0500 |
commit | a061a93b6eb8db8227b251666436da1e344771a0 (patch) | |
tree | 8145775182d681ded6b21bf998325708ac9e9f67 /drivers | |
parent | d7bb5f845f437662296adbfeaab8fbfce1c32289 (diff) |
rt2x00: Ensure TX-ed frames are returned in the original state.
Recent changes to the TX-done code of rt2x00 resulted in TX-ed frames not
being returned to mac80211 in the original state, and therefore with
insufficient headroom for re-transmissions.
Fix this by reverting the changes done and by ensuring we remove the inserted
L2pad by moving the header backwards instead of the data forwards.
At the same time also make sure that the rt2x00queue_remove_l2pad will not
move any memory when a frame has no data at all.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: Jay Hung <Jay_Hung@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index a3d79c7a21c6..35133d8558b5 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -199,15 +199,18 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length) | |||
199 | 199 | ||
200 | void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length) | 200 | void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length) |
201 | { | 201 | { |
202 | unsigned int l2pad = L2PAD_SIZE(header_length); | 202 | /* |
203 | * L2 padding is only present if the skb contains more than just the | ||
204 | * IEEE 802.11 header. | ||
205 | */ | ||
206 | unsigned int l2pad = (skb->len > header_length) ? | ||
207 | L2PAD_SIZE(header_length) : 0; | ||
203 | 208 | ||
204 | if (!l2pad) | 209 | if (!l2pad) |
205 | return; | 210 | return; |
206 | 211 | ||
207 | memmove(skb->data + header_length, skb->data + header_length + l2pad, | 212 | memmove(skb->data + l2pad, skb->data, header_length); |
208 | skb->len - header_length - l2pad); | 213 | skb_pull(skb, l2pad); |
209 | |||
210 | skb_trim(skb, skb->len - l2pad); | ||
211 | } | 214 | } |
212 | 215 | ||
213 | static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry, | 216 | static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry, |