diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00crypto.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00crypto.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c index c6709b392165..37ad0d2fb64c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00crypto.c +++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c | |||
@@ -46,6 +46,29 @@ enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key) | |||
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, | ||
50 | struct txentry_desc *txdesc) | ||
51 | { | ||
52 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | ||
53 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; | ||
54 | |||
55 | __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags); | ||
56 | |||
57 | txdesc->cipher = rt2x00crypto_key_to_cipher(hw_key); | ||
58 | |||
59 | if (hw_key->flags & IEEE80211_KEY_FLAG_PAIRWISE) | ||
60 | __set_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags); | ||
61 | |||
62 | txdesc->key_idx = hw_key->hw_key_idx; | ||
63 | txdesc->iv_offset = ieee80211_get_hdrlen_from_skb(entry->skb); | ||
64 | |||
65 | if (!(hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV)) | ||
66 | __set_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags); | ||
67 | |||
68 | if (!(hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | ||
69 | __set_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags); | ||
70 | } | ||
71 | |||
49 | unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info) | 72 | unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info) |
50 | { | 73 | { |
51 | struct ieee80211_key_conf *key = tx_info->control.hw_key; | 74 | struct ieee80211_key_conf *key = tx_info->control.hw_key; |