diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-10 03:46:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 16:45:11 -0400 |
commit | 97359d1235eaf634fe706c9faa6e40181cc95fb8 (patch) | |
tree | 5799455c94622eaa6a4fb065bd3b5c350bb705e0 /drivers/net/wireless/ath/ath5k | |
parent | 915a824e30c503157c38115eb6a85f60bb653738 (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/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/pcu.c | 19 |
2 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 373dcfec689c..a729b8774670 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -3297,11 +3297,12 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3297 | if (sc->opmode == NL80211_IFTYPE_AP) | 3297 | if (sc->opmode == NL80211_IFTYPE_AP) |
3298 | return -EOPNOTSUPP; | 3298 | return -EOPNOTSUPP; |
3299 | 3299 | ||
3300 | switch (key->alg) { | 3300 | switch (key->cipher) { |
3301 | case ALG_WEP: | 3301 | case WLAN_CIPHER_SUITE_WEP40: |
3302 | case ALG_TKIP: | 3302 | case WLAN_CIPHER_SUITE_WEP104: |
3303 | case WLAN_CIPHER_SUITE_TKIP: | ||
3303 | break; | 3304 | break; |
3304 | case ALG_CCMP: | 3305 | case WLAN_CIPHER_SUITE_CCMP: |
3305 | if (sc->ah->ah_aes_support) | 3306 | if (sc->ah->ah_aes_support) |
3306 | break; | 3307 | break; |
3307 | 3308 | ||
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c index 86fdb6ddfaaa..af273358c7cb 100644 --- a/drivers/net/wireless/ath/ath5k/pcu.c +++ b/drivers/net/wireless/ath/ath5k/pcu.c | |||
@@ -695,21 +695,18 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry) | |||
695 | static | 695 | static |
696 | int ath5k_keycache_type(const struct ieee80211_key_conf *key) | 696 | int ath5k_keycache_type(const struct ieee80211_key_conf *key) |
697 | { | 697 | { |
698 | switch (key->alg) { | 698 | switch (key->cipher) { |
699 | case ALG_TKIP: | 699 | case WLAN_CIPHER_SUITE_TKIP: |
700 | return AR5K_KEYTABLE_TYPE_TKIP; | 700 | return AR5K_KEYTABLE_TYPE_TKIP; |
701 | case ALG_CCMP: | 701 | case WLAN_CIPHER_SUITE_CCMP: |
702 | return AR5K_KEYTABLE_TYPE_CCM; | 702 | return AR5K_KEYTABLE_TYPE_CCM; |
703 | case ALG_WEP: | 703 | case WLAN_CIPHER_SUITE_WEP40: |
704 | if (key->keylen == WLAN_KEY_LEN_WEP40) | 704 | return AR5K_KEYTABLE_TYPE_40; |
705 | return AR5K_KEYTABLE_TYPE_40; | 705 | case WLAN_CIPHER_SUITE_WEP104: |
706 | else if (key->keylen == WLAN_KEY_LEN_WEP104) | 706 | return AR5K_KEYTABLE_TYPE_104; |
707 | return AR5K_KEYTABLE_TYPE_104; | ||
708 | return -EINVAL; | ||
709 | default: | 707 | default: |
710 | return -EINVAL; | 708 | return -EINVAL; |
711 | } | 709 | } |
712 | return -EINVAL; | ||
713 | } | 710 | } |
714 | 711 | ||
715 | /* | 712 | /* |
@@ -728,7 +725,7 @@ int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry, | |||
728 | bool is_tkip; | 725 | bool is_tkip; |
729 | const u8 *key_ptr; | 726 | const u8 *key_ptr; |
730 | 727 | ||
731 | is_tkip = (key->alg == ALG_TKIP); | 728 | is_tkip = (key->cipher == WLAN_CIPHER_SUITE_TKIP); |
732 | 729 | ||
733 | /* | 730 | /* |
734 | * key->keylen comes in from mac80211 in bytes. | 731 | * key->keylen comes in from mac80211 in bytes. |