diff options
author | Gertjan van Wingerde <gwingerde@kpnplanet.nl> | 2008-06-07 10:57:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-14 12:17:59 -0400 |
commit | a9f853ddd352954815a023c4811629ed117df2f8 (patch) | |
tree | 211a94a72b359480db450dd15a0e916514e25e18 /drivers | |
parent | 99990e0c031c5da2cf7b0a03fc22ab755aa5619f (diff) |
rt2x00: Rework alignment check.
Rework the alignment check in rt2x00dev.c to be independent of any
potential alignment measures that may be taken before. Just check
whether the payload is aligned based on the pointer addresses.
Note: This is preparatory for the dynamically mapped skb buffers
for the PCI drivers, as these need 4-byte alignment instead of the
currently enforced offset by 2 bytes.
Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
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/rt2x00dev.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index ce1f7bbd3d7a..9ea677320daa 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -565,13 +565,9 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
565 | 565 | ||
566 | /* | 566 | /* |
567 | * The data behind the ieee80211 header must be | 567 | * The data behind the ieee80211 header must be |
568 | * aligned on a 4 byte boundary. We already reserved | 568 | * aligned on a 4 byte boundary. |
569 | * 2 bytes for header_size % 4 == 2 optimization. | ||
570 | * To determine the number of bytes which the data | ||
571 | * should be moved to the left, we must add these | ||
572 | * 2 bytes to the header_size. | ||
573 | */ | 569 | */ |
574 | align = (header_size + 2) % 4; | 570 | align = ((unsigned long)(entry->skb->data + header_size)) & 3; |
575 | 571 | ||
576 | if (align) { | 572 | if (align) { |
577 | skb_push(entry->skb, align); | 573 | skb_push(entry->skb, align); |