diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2009-08-08 17:53:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:52 -0400 |
commit | 93354cbbcbfca920495377158c0f61c36be79e13 (patch) | |
tree | 01a5a58b7bb9a907d69201743146726dacb92331 /drivers/net/wireless/rt2x00 | |
parent | 267e898755d7fc6249e26208e7ce97f415fd8c31 (diff) |
rt2x00: Align ieee80211 header to 4-byte boundary for PCI devices
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | 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 65435c9fe4bc..e67e339d9dfd 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) | |||
453 | rt2x00crypto_tx_remove_iv(skb, &txdesc); | 453 | rt2x00crypto_tx_remove_iv(skb, &txdesc); |
454 | } | 454 | } |
455 | 455 | ||
456 | /* | ||
457 | * When DMA allocation is required we should guarentee to the | ||
458 | * driver that the DMA is aligned to a 4-byte boundary. | ||
459 | * Aligning the header to this boundary can be done by calling | ||
460 | * rt2x00queue_payload_align with the header length of 0. | ||
461 | * However some drivers require L2 padding to pad the payload | ||
462 | * rather then the header. This could be a requirement for | ||
463 | * PCI and USB devices, while header alignment only is valid | ||
464 | * for PCI devices. | ||
465 | */ | ||
456 | if (test_bit(DRIVER_REQUIRE_L2PAD, &queue->rt2x00dev->flags)) | 466 | if (test_bit(DRIVER_REQUIRE_L2PAD, &queue->rt2x00dev->flags)) |
457 | rt2x00queue_payload_align(entry->skb, true, | 467 | rt2x00queue_payload_align(entry->skb, true, |
458 | txdesc.header_length); | 468 | txdesc.header_length); |
469 | else if (test_bit(DRIVER_REQUIRE_DMA, &queue->rt2x00dev->flags)) | ||
470 | rt2x00queue_payload_align(entry->skb, false, 0); | ||
459 | 471 | ||
460 | /* | 472 | /* |
461 | * It could be possible that the queue was corrupted and this | 473 | * It could be possible that the queue was corrupted and this |