diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-04-30 16:53:37 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-10 18:09:06 -0400 |
commit | bdbb612fb2c49111d393a69a08b0328e51913c17 (patch) | |
tree | ec86ab9c1dccdaf11e17e1dc236d030581850e75 /drivers/net/wireless/iwlwifi | |
parent | 619753ff57a2e15b58546b856536928d1a3daef9 (diff) |
iwlwifi: use iwl_sta_id() for TKIP key update
With the station ID being stored in the
station struct, which mac80211 gives us
for TKIP phase 1 key updates, we can also
remove the use of iwl_find_station() in
that code path.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 2 |
3 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 3265b637db2e..dd26965e75f3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3057,8 +3057,7 @@ static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
3057 | struct iwl_priv *priv = hw->priv; | 3057 | struct iwl_priv *priv = hw->priv; |
3058 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 3058 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
3059 | 3059 | ||
3060 | iwl_update_tkip_key(priv, keyconf, | 3060 | iwl_update_tkip_key(priv, keyconf, sta, |
3061 | sta ? sta->addr : iwl_bcast_addr, | ||
3062 | iv32, phase1key); | 3061 | iv32, phase1key); |
3063 | 3062 | ||
3064 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3063 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 8fec0263f016..b8053e7f16ac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -1012,18 +1012,23 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
1012 | 1012 | ||
1013 | void iwl_update_tkip_key(struct iwl_priv *priv, | 1013 | void iwl_update_tkip_key(struct iwl_priv *priv, |
1014 | struct ieee80211_key_conf *keyconf, | 1014 | struct ieee80211_key_conf *keyconf, |
1015 | const u8 *addr, u32 iv32, u16 *phase1key) | 1015 | struct ieee80211_sta *sta, u32 iv32, u16 *phase1key) |
1016 | { | 1016 | { |
1017 | u8 sta_id = IWL_INVALID_STATION; | 1017 | u8 sta_id; |
1018 | unsigned long flags; | 1018 | unsigned long flags; |
1019 | int i; | 1019 | int i; |
1020 | 1020 | ||
1021 | sta_id = iwl_find_station(priv, addr); | 1021 | if (sta) { |
1022 | if (sta_id == IWL_INVALID_STATION) { | 1022 | sta_id = iwl_sta_id(sta); |
1023 | IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n", | 1023 | |
1024 | addr); | 1024 | if (sta_id == IWL_INVALID_STATION) { |
1025 | return; | 1025 | IWL_DEBUG_MAC80211(priv, "leave - %pM not initialised.\n", |
1026 | } | 1026 | sta->addr); |
1027 | return; | ||
1028 | } | ||
1029 | } else | ||
1030 | sta_id = priv->hw_params.bcast_sta_id; | ||
1031 | |||
1027 | 1032 | ||
1028 | if (iwl_scan_cancel(priv)) { | 1033 | if (iwl_scan_cancel(priv)) { |
1029 | /* cancel scan failed, just live w/ bad key and rely | 1034 | /* cancel scan failed, just live w/ bad key and rely |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index d0ab3f8f7c0f..08d4bc1363f1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -60,7 +60,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
60 | struct ieee80211_key_conf *key, u8 sta_id); | 60 | struct ieee80211_key_conf *key, u8 sta_id); |
61 | void iwl_update_tkip_key(struct iwl_priv *priv, | 61 | void iwl_update_tkip_key(struct iwl_priv *priv, |
62 | struct ieee80211_key_conf *keyconf, | 62 | struct ieee80211_key_conf *keyconf, |
63 | const u8 *addr, u32 iv32, u16 *phase1key); | 63 | struct ieee80211_sta *sta, u32 iv32, u16 *phase1key); |
64 | 64 | ||
65 | void iwl_restore_stations(struct iwl_priv *priv); | 65 | void iwl_restore_stations(struct iwl_priv *priv); |
66 | void iwl_clear_ucode_stations(struct iwl_priv *priv); | 66 | void iwl_clear_ucode_stations(struct iwl_priv *priv); |