aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00crypto.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index aee9cba13eb3..e9d3ddae2785 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -49,9 +49,14 @@ enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
49void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, 49void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
50 struct txentry_desc *txdesc) 50 struct txentry_desc *txdesc)
51{ 51{
52 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
52 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 53 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
53 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 54 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
54 55
56 if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) ||
57 !hw_key || entry->skb->do_not_encrypt)
58 return;
59
55 __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags); 60 __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags);
56 61
57 txdesc->cipher = rt2x00crypto_key_to_cipher(hw_key); 62 txdesc->cipher = rt2x00crypto_key_to_cipher(hw_key);
@@ -69,11 +74,17 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
69 __set_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags); 74 __set_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags);
70} 75}
71 76
72unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info) 77unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
78 struct sk_buff *skb)
73{ 79{
80 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
74 struct ieee80211_key_conf *key = tx_info->control.hw_key; 81 struct ieee80211_key_conf *key = tx_info->control.hw_key;
75 unsigned int overhead = 0; 82 unsigned int overhead = 0;
76 83
84 if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) ||
85 !key || skb->do_not_encrypt)
86 return overhead;
87
77 /* 88 /*
78 * Extend frame length to include IV/EIV/ICV/MMIC, 89 * Extend frame length to include IV/EIV/ICV/MMIC,
79 * note that these lengths should only be added when 90 * note that these lengths should only be added when