aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1251_main.c
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/wl12xx/wl1251_main.c
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/wl12xx/wl1251_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 861a5f33761e..6d31c855fcfe 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -725,8 +725,9 @@ static int wl1251_set_key_type(struct wl1251 *wl,
725 struct ieee80211_key_conf *mac80211_key, 725 struct ieee80211_key_conf *mac80211_key,
726 const u8 *addr) 726 const u8 *addr)
727{ 727{
728 switch (mac80211_key->alg) { 728 switch (mac80211_key->cipher) {
729 case ALG_WEP: 729 case WLAN_CIPHER_SUITE_WEP40:
730 case WLAN_CIPHER_SUITE_WEP104:
730 if (is_broadcast_ether_addr(addr)) 731 if (is_broadcast_ether_addr(addr))
731 key->key_type = KEY_WEP_DEFAULT; 732 key->key_type = KEY_WEP_DEFAULT;
732 else 733 else
@@ -734,7 +735,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
734 735
735 mac80211_key->hw_key_idx = mac80211_key->keyidx; 736 mac80211_key->hw_key_idx = mac80211_key->keyidx;
736 break; 737 break;
737 case ALG_TKIP: 738 case WLAN_CIPHER_SUITE_TKIP:
738 if (is_broadcast_ether_addr(addr)) 739 if (is_broadcast_ether_addr(addr))
739 key->key_type = KEY_TKIP_MIC_GROUP; 740 key->key_type = KEY_TKIP_MIC_GROUP;
740 else 741 else
@@ -742,7 +743,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
742 743
743 mac80211_key->hw_key_idx = mac80211_key->keyidx; 744 mac80211_key->hw_key_idx = mac80211_key->keyidx;
744 break; 745 break;
745 case ALG_CCMP: 746 case WLAN_CIPHER_SUITE_CCMP:
746 if (is_broadcast_ether_addr(addr)) 747 if (is_broadcast_ether_addr(addr))
747 key->key_type = KEY_AES_GROUP; 748 key->key_type = KEY_AES_GROUP;
748 else 749 else
@@ -750,7 +751,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
750 mac80211_key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 751 mac80211_key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
751 break; 752 break;
752 default: 753 default:
753 wl1251_error("Unknown key algo 0x%x", mac80211_key->alg); 754 wl1251_error("Unknown key cipher 0x%x", mac80211_key->cipher);
754 return -EOPNOTSUPP; 755 return -EOPNOTSUPP;
755 } 756 }
756 757
@@ -783,7 +784,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
783 wl1251_debug(DEBUG_CRYPT, "CMD: 0x%x", cmd); 784 wl1251_debug(DEBUG_CRYPT, "CMD: 0x%x", cmd);
784 wl1251_dump(DEBUG_CRYPT, "ADDR: ", addr, ETH_ALEN); 785 wl1251_dump(DEBUG_CRYPT, "ADDR: ", addr, ETH_ALEN);
785 wl1251_debug(DEBUG_CRYPT, "Key: algo:0x%x, id:%d, len:%d flags 0x%x", 786 wl1251_debug(DEBUG_CRYPT, "Key: algo:0x%x, id:%d, len:%d flags 0x%x",
786 key->alg, key->keyidx, key->keylen, key->flags); 787 key->cipher, key->keyidx, key->keylen, key->flags);
787 wl1251_dump(DEBUG_CRYPT, "KEY: ", key->key, key->keylen); 788 wl1251_dump(DEBUG_CRYPT, "KEY: ", key->key, key->keylen);
788 789
789 if (is_zero_ether_addr(addr)) { 790 if (is_zero_ether_addr(addr)) {