From: Ivo van Doorn <ivdoorn@gmail.com>
To: John Linville <linville@tuxdriver.com>
Cc: users@rt2x00.serialmonkey.com,
"linux-wireless" <linux-wireless@vger.kernel.org>
Subject: [PATCH 3/7] rt2x00: Align ieee80211 header to 4-byte boundary for PCI devices
Date: Sat, 8 Aug 2009 23:53:47 +0200 [thread overview]
Message-ID: <200908082353.47835.IvDoorn@gmail.com> (raw)
In-Reply-To: <200908082353.26986.IvDoorn@gmail.com>
Some hardware require the ieee80211 header to be aligned to a
4-byte boundary before mapping it to the DMA. Otherwise some
frames (like beacons) will not be send out correctly by the
device.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 65435c9..e67e339 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -453,9 +453,21 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)
rt2x00crypto_tx_remove_iv(skb, &txdesc);
}
+ /*
+ * When DMA allocation is required we should guarentee to the
+ * driver that the DMA is aligned to a 4-byte boundary.
+ * Aligning the header to this boundary can be done by calling
+ * rt2x00queue_payload_align with the header length of 0.
+ * However some drivers require L2 padding to pad the payload
+ * rather then the header. This could be a requirement for
+ * PCI and USB devices, while header alignment only is valid
+ * for PCI devices.
+ */
if (test_bit(DRIVER_REQUIRE_L2PAD, &queue->rt2x00dev->flags))
rt2x00queue_payload_align(entry->skb, true,
txdesc.header_length);
+ else if (test_bit(DRIVER_REQUIRE_DMA, &queue->rt2x00dev->flags))
+ rt2x00queue_payload_align(entry->skb, false, 0);
/*
* It could be possible that the queue was corrupted and this
--
1.6.3.3
next prev parent reply other threads:[~2009-08-08 21:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 21:53 [PATCH 1/7] rt2x00: Remove usage of deprecated radio_enabled & IEEE80211_CONF_CHANGE_RADIO_ENABLED Ivo van Doorn
2009-08-08 21:53 ` [PATCH 2/7] rt2x00: Use IEEE80211_TX_CTL_MORE_FRAMES flag Ivo van Doorn
2009-08-08 21:53 ` Ivo van Doorn [this message]
2009-08-08 21:54 ` [PATCH 4/7] rt2x00: Fix quality houskeeping for software diversity Ivo van Doorn
2009-08-08 21:54 ` [PATCH 5/7] rt2x00: Fix rounding errors in RSSI average calculation Ivo van Doorn
2009-08-08 21:55 ` [PATCH 6/7] rt2x00: Fix for race condition while update beacon Ivo van Doorn
2009-08-08 21:55 ` [PATCH 7/7] [PATCH] rt2x00: FIF_PSPOLL filter flag support Ivo van Doorn
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=200908082353.47835.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=users@rt2x00.serialmonkey.com \
/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).