diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-12-29 06:55:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:42 -0500 |
commit | dc822b5db479dc0178d5c04cbb656dad0b6564fb (patch) | |
tree | f06d09fb4d70830ce1489f4589cb03a491833955 /drivers/net/wireless/iwlwifi | |
parent | b3093664c931aa06fc50da42e25b3b6dc307a915 (diff) |
mac80211: clean up set_key callback
The set_key callback now seems rather odd, passing a MAC address
instead of a station struct, and a local address instead of a
vif struct. Change that.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Bob Copeland <me@bobcopeland.com> [ath5k]
Acked-by: Ivo van Doorn <ivdoorn@gmail.com> [rt2x00]
Acked-by: Christian Lamparter <chunkeey@web.de> [p54]
Tested-by: Kalle Valo <kalle.valo@nokia.com> [iwl3945]
Tested-by: Samuel Ortiz <samuel@sortiz.org> [iwl3945]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index f3f6dba7a673..dbfee28107a5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3021,13 +3021,17 @@ static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
3021 | } | 3021 | } |
3022 | 3022 | ||
3023 | static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 3023 | static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
3024 | const u8 *local_addr, const u8 *addr, | 3024 | struct ieee80211_vif *vif, |
3025 | struct ieee80211_sta *sta, | ||
3025 | struct ieee80211_key_conf *key) | 3026 | struct ieee80211_key_conf *key) |
3026 | { | 3027 | { |
3027 | struct iwl_priv *priv = hw->priv; | 3028 | struct iwl_priv *priv = hw->priv; |
3028 | int ret = 0; | 3029 | int ret = 0; |
3029 | u8 sta_id = IWL_INVALID_STATION; | 3030 | u8 sta_id = IWL_INVALID_STATION; |
3030 | u8 is_default_wep_key = 0; | 3031 | u8 is_default_wep_key = 0; |
3032 | static const u8 bcast_addr[ETH_ALEN] = | ||
3033 | { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; | ||
3034 | static const u8 *addr; | ||
3031 | 3035 | ||
3032 | IWL_DEBUG_MAC80211("enter\n"); | 3036 | IWL_DEBUG_MAC80211("enter\n"); |
3033 | 3037 | ||
@@ -3036,9 +3040,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3036 | return -EOPNOTSUPP; | 3040 | return -EOPNOTSUPP; |
3037 | } | 3041 | } |
3038 | 3042 | ||
3039 | if (is_zero_ether_addr(addr)) | 3043 | addr = sta ? sta->addr : bcast_addr; |
3040 | /* only support pairwise keys */ | ||
3041 | return -EOPNOTSUPP; | ||
3042 | 3044 | ||
3043 | sta_id = iwl_find_station(priv, addr); | 3045 | sta_id = iwl_find_station(priv, addr); |
3044 | if (sta_id == IWL_INVALID_STATION) { | 3046 | if (sta_id == IWL_INVALID_STATION) { |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index a176f42fd7cf..43cfc6ec5163 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6546,12 +6546,16 @@ out_unlock: | |||
6546 | } | 6546 | } |
6547 | 6547 | ||
6548 | static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 6548 | static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
6549 | const u8 *local_addr, const u8 *addr, | 6549 | struct ieee80211_vif *vif, |
6550 | struct ieee80211_key_conf *key) | 6550 | struct ieee80211_sta *sta, |
6551 | struct ieee80211_key_conf *key) | ||
6551 | { | 6552 | { |
6552 | struct iwl_priv *priv = hw->priv; | 6553 | struct iwl_priv *priv = hw->priv; |
6554 | const u8 *addr; | ||
6553 | int rc = 0; | 6555 | int rc = 0; |
6554 | u8 sta_id; | 6556 | u8 sta_id; |
6557 | static const u8 bcast_addr[ETH_ALEN] = | ||
6558 | { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | ||
6555 | 6559 | ||
6556 | IWL_DEBUG_MAC80211("enter\n"); | 6560 | IWL_DEBUG_MAC80211("enter\n"); |
6557 | 6561 | ||
@@ -6560,9 +6564,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6560 | return -EOPNOTSUPP; | 6564 | return -EOPNOTSUPP; |
6561 | } | 6565 | } |
6562 | 6566 | ||
6563 | if (is_zero_ether_addr(addr)) | 6567 | addr = sta ? sta->addr : bcast_addr; |
6564 | /* only support pairwise keys */ | ||
6565 | return -EOPNOTSUPP; | ||
6566 | 6568 | ||
6567 | sta_id = iwl3945_hw_find_station(priv, addr); | 6569 | sta_id = iwl3945_hw_find_station(priv, addr); |
6568 | if (sta_id == IWL_INVALID_STATION) { | 6570 | if (sta_id == IWL_INVALID_STATION) { |