Skip to content

Commit

Permalink
rt2x00: Ensure TX-ed frames are returned in the original state.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Helmut Schaa <[email protected]>
Cc: Jay Hung <[email protected]>
Signed-off-by: Ivo van Doorn <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
gwingerde authored and linvjw committed Dec 13, 2010
1 parent d7bb5f8 commit a061a93
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,18 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)

void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)
{
unsigned int l2pad = L2PAD_SIZE(header_length);
/*
* L2 padding is only present if the skb contains more than just the
* IEEE 802.11 header.
*/
unsigned int l2pad = (skb->len > header_length) ?
L2PAD_SIZE(header_length) : 0;

if (!l2pad)
return;

memmove(skb->data + header_length, skb->data + header_length + l2pad,
skb->len - header_length - l2pad);

skb_trim(skb, skb->len - l2pad);
memmove(skb->data + l2pad, skb->data, header_length);
skb_pull(skb, l2pad);
}

static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
Expand Down

0 comments on commit a061a93

Please sign in to comment.