aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00crypto.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/rt2x00crypto.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/rt2x00crypto.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index 30fbd3bbe08b..de36837dcf86 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -154,7 +154,7 @@ void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length)
154 skbdesc->flags &= ~SKBDESC_IV_STRIPPED; 154 skbdesc->flags &= ~SKBDESC_IV_STRIPPED;
155} 155}
156 156
157void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad, 157void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
158 unsigned int header_length, 158 unsigned int header_length,
159 struct rxdone_entry_desc *rxdesc) 159 struct rxdone_entry_desc *rxdesc)
160{ 160{
@@ -199,7 +199,7 @@ void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
199 * move the header more then iv_len since we must 199 * move the header more then iv_len since we must
200 * make room for the payload move as well. 200 * make room for the payload move as well.
201 */ 201 */
202 if (l2pad) { 202 if (rxdesc->dev_flags & RXDONE_L2PAD) {
203 skb_push(skb, iv_len - align); 203 skb_push(skb, iv_len - align);
204 skb_put(skb, icv_len); 204 skb_put(skb, icv_len);
205 205
@@ -230,7 +230,7 @@ void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
230 * Move payload for alignment purposes. Note that 230 * Move payload for alignment purposes. Note that
231 * this is only needed when no l2 padding is present. 231 * this is only needed when no l2 padding is present.
232 */ 232 */
233 if (!l2pad) { 233 if (!(rxdesc->dev_flags & RXDONE_L2PAD)) {
234 memmove(skb->data + transfer, 234 memmove(skb->data + transfer,
235 skb->data + transfer + align, 235 skb->data + transfer + align,
236 payload_len); 236 payload_len);