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>
This commit is contained in:

committed by
John W. Linville

parent
915a824e30
commit
97359d1235
@@ -31,15 +31,14 @@
|
||||
|
||||
enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
|
||||
{
|
||||
switch (key->alg) {
|
||||
case ALG_WEP:
|
||||
if (key->keylen == WLAN_KEY_LEN_WEP40)
|
||||
return CIPHER_WEP64;
|
||||
else
|
||||
return CIPHER_WEP128;
|
||||
case ALG_TKIP:
|
||||
switch (key->cipher) {
|
||||
case WLAN_CIPHER_SUITE_WEP40:
|
||||
return CIPHER_WEP64;
|
||||
case WLAN_CIPHER_SUITE_WEP104:
|
||||
return CIPHER_WEP128;
|
||||
case WLAN_CIPHER_SUITE_TKIP:
|
||||
return CIPHER_TKIP;
|
||||
case ALG_CCMP:
|
||||
case WLAN_CIPHER_SUITE_CCMP:
|
||||
return CIPHER_AES;
|
||||
default:
|
||||
return CIPHER_NONE;
|
||||
@@ -95,7 +94,7 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
|
||||
overhead += key->iv_len;
|
||||
|
||||
if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) {
|
||||
if (key->alg == ALG_TKIP)
|
||||
if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
|
||||
overhead += 8;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user