aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-10 03:46:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 16:45:11 -0400
commit97359d1235eaf634fe706c9faa6e40181cc95fb8 (patch)
tree5799455c94622eaa6a4fb065bd3b5c350bb705e0 /drivers/net/wireless/rt2x00
parent915a824e30c503157c38115eb6a85f60bb653738 (diff)
mac80211: use cipher suite selectors
Currently, mac80211 translates the cfg80211 cipher suite selectors into ALG_* values. That isn't all too useful, and some drivers benefit from the distinction between WEP40 and WEP104 as well. Therefore, convert it all to use the cipher suite selectors. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c17
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index cdaf93f48263..97cf72f8bc12 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -355,7 +355,9 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
355 * it is known that not work at least on some hardware. 355 * it is known that not work at least on some hardware.
356 * SW crypto will be used in that case. 356 * SW crypto will be used in that case.
357 */ 357 */
358 if (key->alg == ALG_WEP && key->keyidx != 0) 358 if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
359 key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
360 key->keyidx != 0)
359 return -EOPNOTSUPP; 361 return -EOPNOTSUPP;
360 362
361 /* 363 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index 583dacd8d241..5e9074bf2b8e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -31,15 +31,14 @@
31 31
32enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key) 32enum 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;
@@ -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