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 | |
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')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/xmit.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00crypto.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 7 |
6 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index c151588aa484..47be49acf55e 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -1188,7 +1188,7 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1188 | 1188 | ||
1189 | if (info->control.hw_key) { | 1189 | if (info->control.hw_key) { |
1190 | keyidx = info->control.hw_key->hw_key_idx; | 1190 | keyidx = info->control.hw_key->hw_key_idx; |
1191 | pktlen += info->control.icv_len; | 1191 | pktlen += info->control.hw_key->icv_len; |
1192 | } | 1192 | } |
1193 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, | 1193 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, |
1194 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, | 1194 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index bdcb9e1799ca..3a4757942b3f 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -237,7 +237,7 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
237 | 237 | ||
238 | if (tx_info->control.hw_key) { | 238 | if (tx_info->control.hw_key) { |
239 | txctl->keyix = tx_info->control.hw_key->hw_key_idx; | 239 | txctl->keyix = tx_info->control.hw_key->hw_key_idx; |
240 | txctl->frmlen += tx_info->control.icv_len; | 240 | txctl->frmlen += tx_info->control.hw_key->icv_len; |
241 | 241 | ||
242 | if (tx_info->control.hw_key->alg == ALG_WEP) | 242 | if (tx_info->control.hw_key->alg == ALG_WEP) |
243 | txctl->keytype = ATH9K_KEY_TYPE_WEP; | 243 | txctl->keytype = ATH9K_KEY_TYPE_WEP; |
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c index 5e0b71c3ad02..e0749c0074cc 100644 --- a/drivers/net/wireless/b43/xmit.c +++ b/drivers/net/wireless/b43/xmit.c | |||
@@ -252,7 +252,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
252 | } | 252 | } |
253 | 253 | ||
254 | /* Hardware appends ICV. */ | 254 | /* Hardware appends ICV. */ |
255 | plcp_fragment_len += info->control.icv_len; | 255 | plcp_fragment_len += info->control.hw_key->icv_len; |
256 | 256 | ||
257 | key_idx = b43_kidx_to_fw(dev, key_idx); | 257 | key_idx = b43_kidx_to_fw(dev, key_idx); |
258 | mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) & | 258 | mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) & |
@@ -260,7 +260,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
260 | mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & | 260 | mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & |
261 | B43_TXH_MAC_KEYALG; | 261 | B43_TXH_MAC_KEYALG; |
262 | wlhdr_len = ieee80211_hdrlen(fctl); | 262 | wlhdr_len = ieee80211_hdrlen(fctl); |
263 | iv_len = min((size_t) info->control.iv_len, | 263 | iv_len = min((size_t) info->control.hw_key->iv_len, |
264 | ARRAY_SIZE(txhdr->iv)); | 264 | ARRAY_SIZE(txhdr->iv)); |
265 | memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); | 265 | memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); |
266 | } | 266 | } |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index 6835064758fb..a894169411c5 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -243,7 +243,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
243 | 243 | ||
244 | if (key->enabled) { | 244 | if (key->enabled) { |
245 | /* Hardware appends ICV. */ | 245 | /* Hardware appends ICV. */ |
246 | plcp_fragment_len += info->control.icv_len; | 246 | plcp_fragment_len += info->control.hw_key->icv_len; |
247 | 247 | ||
248 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); | 248 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); |
249 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & | 249 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & |
@@ -252,7 +252,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
252 | B43legacy_TX4_MAC_KEYALG_SHIFT) & | 252 | B43legacy_TX4_MAC_KEYALG_SHIFT) & |
253 | B43legacy_TX4_MAC_KEYALG; | 253 | B43legacy_TX4_MAC_KEYALG; |
254 | wlhdr_len = ieee80211_hdrlen(wlhdr->frame_control); | 254 | wlhdr_len = ieee80211_hdrlen(wlhdr->frame_control); |
255 | iv_len = min((size_t)info->control.iv_len, | 255 | iv_len = min((size_t)info->control.hw_key->iv_len, |
256 | ARRAY_SIZE(txhdr->iv)); | 256 | ARRAY_SIZE(txhdr->iv)); |
257 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); | 257 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); |
258 | } else { | 258 | } else { |
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 |