aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00lib.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-04-26 10:08:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:49 -0400
commit9f1661718c7fcf82e25c6aed20b729ee372d9d65 (patch)
tree099a3305c948f306f46e2cf2f0d24a8ef069f011 /drivers/net/wireless/rt2x00/rt2x00lib.h
parent9eb4e21e289beba9cfe34f24920eee83c144e62f (diff)
rt2x00: Add support for L2 padding during TX/RX
Some hardware require L2 padding between header and payload because both must be aligned to a 4-byte boundary. This hardware also is easier during the RX path since we no longer need to move the entire payload but rather only the header to remove the padding (mac80211 only wants the payload to be 4-byte aligned). 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/rt2x00lib.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index af3c47bd43b..aa284e48d2c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -113,6 +113,23 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
113void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb); 113void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
114 114
115/** 115/**
116 * rt2x00queue_payload_align - Align 802.11 payload to 4-byte boundary
117 * @skb: The skb to align
118 * @l2pad: Should L2 padding be used
119 * @header_length: Length of 802.11 header
120 *
121 * This function prepares the @skb to be send to the device or mac80211.
122 * If @l2pad is set to true padding will occur between the 802.11 header
123 * and payload. Otherwise the padding will be done in front of the 802.11
124 * header.
125 * When @l2pad is set the function will check for the &SKBDESC_L2_PADDED
126 * flag in &skb_frame_desc. If that flag is set, the padding is removed
127 * and the flag cleared. Otherwise the padding is added and the flag is set.
128 */
129void rt2x00queue_payload_align(struct sk_buff *skb,
130 bool l2pad, unsigned int header_length);
131
132/**
116 * rt2x00queue_write_tx_frame - Write TX frame to hardware 133 * rt2x00queue_write_tx_frame - Write TX frame to hardware
117 * @queue: Queue over which the frame should be send 134 * @queue: Queue over which the frame should be send
118 * @skb: The skb to send 135 * @skb: The skb to send
@@ -299,8 +316,8 @@ void rt2x00crypto_tx_copy_iv(struct sk_buff *skb,
299 struct txentry_desc *txdesc); 316 struct txentry_desc *txdesc);
300void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, 317void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
301 struct txentry_desc *txdesc); 318 struct txentry_desc *txdesc);
302void rt2x00crypto_tx_insert_iv(struct sk_buff *skb); 319void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length);
303void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, unsigned int align, 320void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
304 unsigned int header_length, 321 unsigned int header_length,
305 struct rxdone_entry_desc *rxdesc); 322 struct rxdone_entry_desc *rxdesc);
306#else 323#else
@@ -330,12 +347,12 @@ static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
330{ 347{
331} 348}
332 349
333static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb) 350static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb,
351 unsigned int header_length)
334{ 352{
335} 353}
336 354
337static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, 355static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
338 unsigned int align,
339 unsigned int header_length, 356 unsigned int header_length,
340 struct rxdone_entry_desc *rxdesc) 357 struct rxdone_entry_desc *rxdesc)
341{ 358{