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
@@ -429,8 +429,8 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
|
||||
|
||||
mutex_lock(&priv->conf_mutex);
|
||||
if (cmd == SET_KEY) {
|
||||
switch (key->alg) {
|
||||
case ALG_TKIP:
|
||||
switch (key->cipher) {
|
||||
case WLAN_CIPHER_SUITE_TKIP:
|
||||
if (!(priv->privacy_caps & (BR_DESC_PRIV_CAP_MICHAEL |
|
||||
BR_DESC_PRIV_CAP_TKIP))) {
|
||||
ret = -EOPNOTSUPP;
|
||||
@@ -439,7 +439,8 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
|
||||
algo = P54_CRYPTO_TKIPMICHAEL;
|
||||
break;
|
||||
case ALG_WEP:
|
||||
case WLAN_CIPHER_SUITE_WEP40:
|
||||
case WLAN_CIPHER_SUITE_WEP104:
|
||||
if (!(priv->privacy_caps & BR_DESC_PRIV_CAP_WEP)) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out_unlock;
|
||||
@@ -447,7 +448,7 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
|
||||
algo = P54_CRYPTO_WEP;
|
||||
break;
|
||||
case ALG_CCMP:
|
||||
case WLAN_CIPHER_SUITE_CCMP:
|
||||
if (!(priv->privacy_caps & BR_DESC_PRIV_CAP_AESCCMP)) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out_unlock;
|
||||
|
Reference in New Issue
Block a user