aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-08-29 14:30:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-31 14:42:14 -0400
commitdaee6c092aa49ea090612738253ef0d11d120344 (patch)
tree97ab49a8a465b2e0fa470a6e9c5f0264e5db94d3 /drivers/net/wireless/rt2x00/rt2x00dev.c
parent2e27cff871dec9371e41022aaaebb3452ec069c0 (diff)
rt2x00: Reorganize padding & L2 padding
The old function rt2x00queue_payload_align() handled both adding and removing L2 padding and some basic frame alignment. The entire function was being abused because it had multiple functions and the header length argument was somtimes used to align the header instead of the payload. Additionally there was a bug when inserting L2 padding that only the payload was aligned but not the header. This happens when the header wasn't aligned properly by mac80211, but rt2x00lib only moves the payload. A secondary problem was that when removing L2 padding during TXdone or RX the skb wasn't resized to the proper size. Split the function into seperate functions each handling its task as it should. 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/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 0647e514dde1..71761b343839 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -217,7 +217,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
217 * Remove L2 padding which was added during 217 * Remove L2 padding which was added during
218 */ 218 */
219 if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) 219 if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
220 rt2x00queue_payload_align(entry->skb, true, header_length); 220 rt2x00queue_remove_l2pad(entry->skb, header_length);
221 221
222 /* 222 /*
223 * If the IV/EIV data was stripped from the frame before it was 223 * If the IV/EIV data was stripped from the frame before it was
@@ -364,7 +364,6 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
364 struct sk_buff *skb; 364 struct sk_buff *skb;
365 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status; 365 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status;
366 unsigned int header_length; 366 unsigned int header_length;
367 bool l2pad;
368 int rate_idx; 367 int rate_idx;
369 /* 368 /*
370 * Allocate a new sk_buffer. If no new buffer available, drop the 369 * Allocate a new sk_buffer. If no new buffer available, drop the
@@ -393,7 +392,6 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
393 * aligned on a 4 byte boundary. 392 * aligned on a 4 byte boundary.
394 */ 393 */
395 header_length = ieee80211_get_hdrlen_from_skb(entry->skb); 394 header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
396 l2pad = !!(rxdesc.dev_flags & RXDONE_L2PAD);
397 395
398 /* 396 /*
399 * Hardware might have stripped the IV/EIV/ICV data, 397 * Hardware might have stripped the IV/EIV/ICV data,
@@ -403,10 +401,12 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
403 */ 401 */
404 if ((rxdesc.dev_flags & RXDONE_CRYPTO_IV) && 402 if ((rxdesc.dev_flags & RXDONE_CRYPTO_IV) &&
405 (rxdesc.flags & RX_FLAG_IV_STRIPPED)) 403 (rxdesc.flags & RX_FLAG_IV_STRIPPED))
406 rt2x00crypto_rx_insert_iv(entry->skb, l2pad, header_length, 404 rt2x00crypto_rx_insert_iv(entry->skb, header_length,
407 &rxdesc); 405 &rxdesc);
406 else if (rxdesc.dev_flags & RXDONE_L2PAD)
407 rt2x00queue_remove_l2pad(entry->skb, header_length);
408 else 408 else
409 rt2x00queue_payload_align(entry->skb, l2pad, header_length); 409 rt2x00queue_align_payload(entry->skb, header_length);
410 410
411 /* 411 /*
412 * Check if the frame was received using HT. In that case, 412 * Check if the frame was received using HT. In that case,