diff options
author | Beni Lev <beni.lev@intel.com> | 2013-02-06 10:22:18 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-11 05:56:12 -0500 |
commit | c3eb536aabb966542a0b6b09ad38cc43abe9ad1a (patch) | |
tree | ee35397656fcda9e5f8feb8330d70b108b33c602 | |
parent | 8115efbdc82acc935b54f0a849eb834129ea1fd0 (diff) |
iwlwifi: mvm: fix TKIP key updating
When a TKIP key is updated with a station pointer that is NULL it is
a GTK, so it should use the AP's station ID. Fix the code to do that.
Signed-off-by: Beni Lev <beni.lev@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 8f8b66ea07ee..6b22bacdc1df 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -1155,14 +1155,26 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1155 | struct ieee80211_sta *sta, u32 iv32, | 1155 | struct ieee80211_sta *sta, u32 iv32, |
1156 | u16 *phase1key) | 1156 | u16 *phase1key) |
1157 | { | 1157 | { |
1158 | struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv; | 1158 | struct iwl_mvm_sta *mvm_sta; |
1159 | u8 sta_id = iwl_mvm_get_key_sta_id(vif, sta); | 1159 | u8 sta_id = iwl_mvm_get_key_sta_id(vif, sta); |
1160 | 1160 | ||
1161 | if (sta_id == IWL_INVALID_STATION) | 1161 | if (WARN_ON_ONCE(sta_id == IWL_INVALID_STATION)) |
1162 | return; | 1162 | return; |
1163 | 1163 | ||
1164 | rcu_read_lock(); | ||
1165 | |||
1166 | if (!sta) { | ||
1167 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); | ||
1168 | if (WARN_ON(IS_ERR_OR_NULL(sta))) { | ||
1169 | rcu_read_unlock(); | ||
1170 | return; | ||
1171 | } | ||
1172 | } | ||
1173 | |||
1174 | mvm_sta = (void *)sta->drv_priv; | ||
1164 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, sta_id, | 1175 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, sta_id, |
1165 | iv32, phase1key, CMD_ASYNC); | 1176 | iv32, phase1key, CMD_ASYNC); |
1177 | rcu_read_unlock(); | ||
1166 | } | 1178 | } |
1167 | 1179 | ||
1168 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, int sta_id) | 1180 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, int sta_id) |