Skip to content

Commit

Permalink
rt2x00: Remove obsolete rt2x00queue_align_payload
Browse files Browse the repository at this point in the history
Since commit d1c3a37 ("mac80211:
clarify alignment docs, fix up alignment") removed the requirement
for a 4-byte aligned payload rt2x00queue_align_payload is obsolete
as mac80211 will align the payload when it passes the frame to the
net stack.

As a result we can remove the call to rt2x00queue_align_payload in the
rx path and since that's the last user we can remove
rt2x00queue_align_payload altogether.

One advantage is that we save some alignment operations for frames
that don't need to be aligned (for example beause they are not passed
to the net stack).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Apr 4, 2011
1 parent fa71a16 commit 2f2bb7e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
2 changes: 0 additions & 2 deletions drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,6 @@ void rt2x00lib_rxdone(struct queue_entry *entry)
(rxdesc.size > header_length) &&
(rxdesc.dev_flags & RXDONE_L2PAD))
rt2x00queue_remove_l2pad(entry->skb, header_length);
else
rt2x00queue_align_payload(entry->skb, header_length);

/* Trim buffer to correct size */
skb_trim(entry->skb, rxdesc.size);
Expand Down
10 changes: 0 additions & 10 deletions drivers/net/wireless/rt2x00/rt2x00lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ void rt2x00queue_free_skb(struct queue_entry *entry);
*/
void rt2x00queue_align_frame(struct sk_buff *skb);

/**
* rt2x00queue_align_payload - Align 802.11 payload to 4-byte boundary
* @skb: The skb to align
* @header_length: Length of 802.11 header
*
* Align the 802.11 payload to a 4-byte boundary, this could
* mean the header is not aligned properly though.
*/
void rt2x00queue_align_payload(struct sk_buff *skb, unsigned int header_length);

/**
* rt2x00queue_insert_l2pad - Align 802.11 header & payload to 4-byte boundary
* @skb: The skb to align
Expand Down
13 changes: 0 additions & 13 deletions drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@ void rt2x00queue_align_frame(struct sk_buff *skb)
skb_trim(skb, frame_length);
}

void rt2x00queue_align_payload(struct sk_buff *skb, unsigned int header_length)
{
unsigned int frame_length = skb->len;
unsigned int align = ALIGN_SIZE(skb, header_length);

if (!align)
return;

skb_push(skb, align);
memmove(skb->data, skb->data + align, frame_length);
skb_trim(skb, frame_length);
}

void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
{
unsigned int payload_length = skb->len - header_length;
Expand Down

0 comments on commit 2f2bb7e

Please sign in to comment.