aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2009-12-30 05:36:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-05 16:27:42 -0500
commit7a4a77b7771164d61ce702a588067d1e1d66db7c (patch)
tree9cdc685d8c4fcedc140f1a5ae739b03e37e8bf43 /drivers/net/wireless
parentcf0277e714a0db302a8f80e1b85fd61c32cf00b3 (diff)
rt2x00: Properly request tx headroom for alignment operations.
Current rt2x00 drivers may result in a "ieee80211_tx_status: headroom too small" error message when a frame needs to be properly aligned before transmitting it. This is because the space needed to ensure proper alignment isn't requested from mac80211. Fix this by adding sufficient amount of alignment space to the amount of headroom requested for TX frames. Reported-by: David Ellingsworth <david@identd.dyndns.org> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 4d841c07c970..dcfc8c25d1a7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -113,6 +113,12 @@
113 ( ((unsigned long)((__skb)->data + (__header))) & 3 ) 113 ( ((unsigned long)((__skb)->data + (__header))) & 3 )
114 114
115/* 115/*
116 * Constants for extra TX headroom for alignment purposes.
117 */
118#define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */
119#define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */
120
121/*
116 * Standard timing and size defines. 122 * Standard timing and size defines.
117 * These values should follow the ieee80211 specifications. 123 * These values should follow the ieee80211 specifications.
118 */ 124 */
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 06c43ca39bf8..265e66dba552 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
686 /* 686 /*
687 * Initialize extra TX headroom required. 687 * Initialize extra TX headroom required.
688 */ 688 */
689 rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; 689 rt2x00dev->hw->extra_tx_headroom =
690 max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM,
691 rt2x00dev->ops->extra_tx_headroom);
692
693 /*
694 * Take TX headroom required for alignment into account.
695 */
696 if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
697 rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE;
698 else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
699 rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;
690 700
691 /* 701 /*
692 * Register HW. 702 * Register HW.