diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-10-05 12:02:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-06 18:14:57 -0400 |
commit | 76708dee382a69b2f9d0e50f413f99fefb2dc509 (patch) | |
tree | ce1b8014520c08641423a0842d03eace38da0c4e /drivers/net/wireless/rt2x00 | |
parent | 417bd25ac4c6f76c8aafe8a584f3620f4a936b72 (diff) |
mac80211: free up 2 bytes in skb->cb
Free up 2 bytes in skb->cb to be used for multi-rate retry later.
Move iv_len and icv_len initialization into key alloc.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00crypto.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c index e1448cfa9444..5a858e5106c4 100644 --- a/drivers/net/wireless/rt2x00/rt2x00crypto.c +++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c | |||
@@ -56,10 +56,10 @@ unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info) | |||
56 | * note that these lengths should only be added when | 56 | * note that these lengths should only be added when |
57 | * mac80211 does not generate it. | 57 | * mac80211 does not generate it. |
58 | */ | 58 | */ |
59 | overhead += tx_info->control.icv_len; | 59 | overhead += key->icv_len; |
60 | 60 | ||
61 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_IV)) | 61 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_IV)) |
62 | overhead += tx_info->control.iv_len; | 62 | overhead += key->iv_len; |
63 | 63 | ||
64 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) { | 64 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) { |
65 | if (key->alg == ALG_TKIP) | 65 | if (key->alg == ALG_TKIP) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index b7f4fe8fba6e..1676ac484790 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -374,7 +374,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb) | |||
374 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); | 374 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); |
375 | struct txentry_desc txdesc; | 375 | struct txentry_desc txdesc; |
376 | struct skb_frame_desc *skbdesc; | 376 | struct skb_frame_desc *skbdesc; |
377 | unsigned int iv_len = IEEE80211_SKB_CB(skb)->control.iv_len; | 377 | unsigned int iv_len; |
378 | 378 | ||
379 | if (unlikely(rt2x00queue_full(queue))) | 379 | if (unlikely(rt2x00queue_full(queue))) |
380 | return -EINVAL; | 380 | return -EINVAL; |
@@ -410,8 +410,11 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb) | |||
410 | * the frame so we can provide it to the driver seperately. | 410 | * the frame so we can provide it to the driver seperately. |
411 | */ | 411 | */ |
412 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) && | 412 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) && |
413 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags)) | 413 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags) && |
414 | (IEEE80211_SKB_CB(skb)->control.hw_key != NULL)) { | ||
415 | iv_len = IEEE80211_SKB_CB(skb)->control.hw_key->iv_len; | ||
414 | rt2x00crypto_tx_remove_iv(skb, iv_len); | 416 | rt2x00crypto_tx_remove_iv(skb, iv_len); |
417 | } | ||
415 | 418 | ||
416 | /* | 419 | /* |
417 | * It could be possible that the queue was corrupted and this | 420 | * It could be possible that the queue was corrupted and this |