diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-15 06:55:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:11 -0400 |
commit | e039fa4a4195ac4ee895e6f3d1334beed63256fe (patch) | |
tree | cfd0762d73df96b73052378be7b157c4ac6e7035 /net/mac80211/wep.c | |
parent | e24549485f859be6518929bb1c9c0257d79f033d (diff) |
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit
information and status in skb->cb rather than allocating extra
memory for it and copying all the data around. To make it fit,
a union is used where only data that is necessary for all steps
is kept outside of the union.
A number of fixes were done by Ivo, as well as the rt2x00 part
of this patch.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wep.c')
-rw-r--r-- | net/mac80211/wep.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 3cbae42ec504..1e7f03dd8f6b 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -333,11 +333,16 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) | |||
333 | 333 | ||
334 | static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | 334 | static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) |
335 | { | 335 | { |
336 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
337 | |||
338 | info->control.iv_len = WEP_IV_LEN; | ||
339 | info->control.icv_len = WEP_ICV_LEN; | ||
340 | |||
336 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { | 341 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { |
342 | info->control.hw_key = &tx->key->conf; | ||
337 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) | 343 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) |
338 | return -1; | 344 | return -1; |
339 | } else { | 345 | } else { |
340 | tx->control->hw_key = &tx->key->conf; | ||
341 | if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) { | 346 | if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) { |
342 | if (!ieee80211_wep_add_iv(tx->local, skb, tx->key)) | 347 | if (!ieee80211_wep_add_iv(tx->local, skb, tx->key)) |
343 | return -1; | 348 | return -1; |
@@ -349,8 +354,6 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
349 | ieee80211_tx_result | 354 | ieee80211_tx_result |
350 | ieee80211_crypto_wep_encrypt(struct ieee80211_tx_data *tx) | 355 | ieee80211_crypto_wep_encrypt(struct ieee80211_tx_data *tx) |
351 | { | 356 | { |
352 | tx->control->iv_len = WEP_IV_LEN; | ||
353 | tx->control->icv_len = WEP_ICV_LEN; | ||
354 | ieee80211_tx_set_protected(tx); | 357 | ieee80211_tx_set_protected(tx); |
355 | 358 | ||
356 | if (wep_encrypt_skb(tx, tx->skb) < 0) { | 359 | if (wep_encrypt_skb(tx, tx->skb) < 0) { |