From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net
Subject: Re: [PATCH 10/10] rt2x00: Rework alignment check.
Date: Sun, 8 Jun 2008 23:46:48 +0200 [thread overview]
Message-ID: <200806082346.49080.IvDoorn@gmail.com> (raw)
In-Reply-To: <200806082346.27372.IvDoorn@gmail.com>
From: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
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>
---
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 ce1f7bb..9ea6773 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,
/*
* The data behind the ieee80211 header must be
- * aligned on a 4 byte boundary. We already reserved
- * 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.
+ * aligned on a 4 byte boundary.
*/
- align = (header_size + 2) % 4;
+ align = ((unsigned long)(entry->skb->data + header_size)) & 3;
if (align) {
skb_push(entry->skb, align);
--
1.5.5.3
prev parent reply other threads:[~2008-06-08 21:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-08 21:41 Please pull 'upstream' branch of rt2x00 Ivo van Doorn
2008-06-08 21:42 ` [PATCH 01/10] rt2x00: Implement rt2x00usb_kick_tx_queue() Ivo van Doorn
2008-06-08 21:43 ` [PATCH 02/10] rt2x00: Move generic TX frame writing code into rt2x00queue Ivo van Doorn
2008-06-08 21:43 ` [PATCH 03/10] rt2x00: Don't kick TX queue after each frame Ivo van Doorn
2008-06-08 21:44 ` [PATCH 04/10] rt2x00: Cleanup struct skb_frame_desc Ivo van Doorn
2008-06-08 21:45 ` [PATCH 05/10] rt2x00: Centralize RX packet alignment handling in rt2x00lib Ivo van Doorn
2008-06-08 21:45 ` [PATCH 06/10] rt2x00: Fix double usage of skb->cb in USB RX path Ivo van Doorn
2008-06-08 21:45 ` [PATCH 07/10] rt2x00: Use __builtin_choose_expr() instead of ?: Ivo van Doorn
2008-06-08 21:46 ` [PATCH 08/10] rt2x00: Clear IEEE80211_TX_CTL_USE_RTS_CTS flag for RTS frame Ivo van Doorn
2008-06-08 21:46 ` [PATCH 09/10] rt2x00: Remove unused defines Ivo van Doorn
2008-06-08 21:46 ` Ivo van Doorn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806082346.49080.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=rt2400-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).