Commit a9f853dd authored by Gertjan van Wingerde's avatar Gertjan van Wingerde Committed by John W. Linville

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: default avatarGertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 99990e0c
...@@ -565,13 +565,9 @@ void rt2x00lib_rxdone(struct queue_entry *entry, ...@@ -565,13 +565,9 @@ void rt2x00lib_rxdone(struct queue_entry *entry,
/* /*
* The data behind the ieee80211 header must be * The data behind the ieee80211 header must be
* aligned on a 4 byte boundary. We already reserved * aligned on a 4 byte boundary.
* 2 bytes for header_size % 4 == 2 optimization.
* To determine the number of bytes which the data
* should be moved to the left, we must add these
* 2 bytes to the header_size.
*/ */
align = (header_size + 2) % 4; align = ((unsigned long)(entry->skb->data + header_size)) & 3;
if (align) { if (align) {
skb_push(entry->skb, align); skb_push(entry->skb, align);
......
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