diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00crypto.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00crypto.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c index 583dacd8d241..1bb9d46077ff 100644 --- a/drivers/net/wireless/rt2x00/rt2x00crypto.c +++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c | |||
@@ -31,15 +31,14 @@ | |||
31 | 31 | ||
32 | enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key) | 32 | enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key) |
33 | { | 33 | { |
34 | switch (key->alg) { | 34 | switch (key->cipher) { |
35 | case ALG_WEP: | 35 | case WLAN_CIPHER_SUITE_WEP40: |
36 | if (key->keylen == WLAN_KEY_LEN_WEP40) | 36 | return CIPHER_WEP64; |
37 | return CIPHER_WEP64; | 37 | case WLAN_CIPHER_SUITE_WEP104: |
38 | else | 38 | return CIPHER_WEP128; |
39 | return CIPHER_WEP128; | 39 | case WLAN_CIPHER_SUITE_TKIP: |
40 | case ALG_TKIP: | ||
41 | return CIPHER_TKIP; | 40 | return CIPHER_TKIP; |
42 | case ALG_CCMP: | 41 | case WLAN_CIPHER_SUITE_CCMP: |
43 | return CIPHER_AES; | 42 | return CIPHER_AES; |
44 | default: | 43 | default: |
45 | return CIPHER_NONE; | 44 | return CIPHER_NONE; |
@@ -53,7 +52,7 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, | |||
53 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 52 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
54 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; | 53 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; |
55 | 54 | ||
56 | if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) || !hw_key) | 55 | if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !hw_key) |
57 | return; | 56 | return; |
58 | 57 | ||
59 | __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags); | 58 | __set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags); |
@@ -81,7 +80,7 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, | |||
81 | struct ieee80211_key_conf *key = tx_info->control.hw_key; | 80 | struct ieee80211_key_conf *key = tx_info->control.hw_key; |
82 | unsigned int overhead = 0; | 81 | unsigned int overhead = 0; |
83 | 82 | ||
84 | if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) || !key) | 83 | if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !key) |
85 | return overhead; | 84 | return overhead; |
86 | 85 | ||
87 | /* | 86 | /* |
@@ -95,7 +94,7 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, | |||
95 | overhead += key->iv_len; | 94 | overhead += key->iv_len; |
96 | 95 | ||
97 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) { | 96 | if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) { |
98 | if (key->alg == ALG_TKIP) | 97 | if (key->cipher == WLAN_CIPHER_SUITE_TKIP) |
99 | overhead += 8; | 98 | overhead += 8; |
100 | } | 99 | } |
101 | 100 | ||
@@ -238,7 +237,7 @@ void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, | |||
238 | } | 237 | } |
239 | 238 | ||
240 | /* | 239 | /* |
241 | * NOTE: Always count the payload as transfered, | 240 | * NOTE: Always count the payload as transferred, |
242 | * even when alignment was set to zero. This is required | 241 | * even when alignment was set to zero. This is required |
243 | * for determining the correct offset for the ICV data. | 242 | * for determining the correct offset for the ICV data. |
244 | */ | 243 | */ |