diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-12-20 07:48:08 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-12-20 07:48:08 -0500 |
commit | 12f17211f75531139ea4394f7f7b4f2090f9778a (patch) | |
tree | 31d2614a4c2cfc72a321283ee245f70a2a4bf2b5 | |
parent | e70d41b59f30d2f26f505890d9a893e924b359bf (diff) | |
parent | 4585436091cd812b1165aab71bd4847ea1cb08ec (diff) |
Merge tag 'iwlwifi-for-kalle-2015-12-16' into next
* don't load firmware that won't exist for 7260
* fix RCU splat
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-7000.c | 49 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 15 |
2 files changed, 44 insertions, 20 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-7000.c b/drivers/net/wireless/intel/iwlwifi/iwl-7000.c index 51fec203a845..390ee4d303db 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-7000.c | |||
@@ -71,13 +71,19 @@ | |||
71 | #include "iwl-agn-hw.h" | 71 | #include "iwl-agn-hw.h" |
72 | 72 | ||
73 | /* Highest firmware API version supported */ | 73 | /* Highest firmware API version supported */ |
74 | #define IWL7260_UCODE_API_MAX 19 | 74 | #define IWL7260_UCODE_API_MAX 17 |
75 | #define IWL7265_UCODE_API_MAX 19 | ||
76 | #define IWL7265D_UCODE_API_MAX 19 | ||
75 | 77 | ||
76 | /* Oldest version we won't warn about */ | 78 | /* Oldest version we won't warn about */ |
77 | #define IWL7260_UCODE_API_OK 13 | 79 | #define IWL7260_UCODE_API_OK 13 |
80 | #define IWL7265_UCODE_API_OK 13 | ||
81 | #define IWL7265D_UCODE_API_OK 13 | ||
78 | 82 | ||
79 | /* Lowest firmware API version supported */ | 83 | /* Lowest firmware API version supported */ |
80 | #define IWL7260_UCODE_API_MIN 13 | 84 | #define IWL7260_UCODE_API_MIN 13 |
85 | #define IWL7265_UCODE_API_MIN 13 | ||
86 | #define IWL7265D_UCODE_API_MIN 13 | ||
81 | 87 | ||
82 | /* NVM versions */ | 88 | /* NVM versions */ |
83 | #define IWL7260_NVM_VERSION 0x0a1d | 89 | #define IWL7260_NVM_VERSION 0x0a1d |
@@ -151,10 +157,7 @@ static const struct iwl_ht_params iwl7000_ht_params = { | |||
151 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), | 157 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), |
152 | }; | 158 | }; |
153 | 159 | ||
154 | #define IWL_DEVICE_7000 \ | 160 | #define IWL_DEVICE_7000_COMMON \ |
155 | .ucode_api_max = IWL7260_UCODE_API_MAX, \ | ||
156 | .ucode_api_ok = IWL7260_UCODE_API_OK, \ | ||
157 | .ucode_api_min = IWL7260_UCODE_API_MIN, \ | ||
158 | .device_family = IWL_DEVICE_FAMILY_7000, \ | 161 | .device_family = IWL_DEVICE_FAMILY_7000, \ |
159 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 162 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
160 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 163 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
@@ -165,6 +168,24 @@ static const struct iwl_ht_params iwl7000_ht_params = { | |||
165 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ | 168 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ |
166 | .dccm_offset = IWL7000_DCCM_OFFSET | 169 | .dccm_offset = IWL7000_DCCM_OFFSET |
167 | 170 | ||
171 | #define IWL_DEVICE_7000 \ | ||
172 | IWL_DEVICE_7000_COMMON, \ | ||
173 | .ucode_api_max = IWL7260_UCODE_API_MAX, \ | ||
174 | .ucode_api_ok = IWL7260_UCODE_API_OK, \ | ||
175 | .ucode_api_min = IWL7260_UCODE_API_MIN | ||
176 | |||
177 | #define IWL_DEVICE_7005 \ | ||
178 | IWL_DEVICE_7000_COMMON, \ | ||
179 | .ucode_api_max = IWL7265_UCODE_API_MAX, \ | ||
180 | .ucode_api_ok = IWL7265_UCODE_API_OK, \ | ||
181 | .ucode_api_min = IWL7265_UCODE_API_MIN | ||
182 | |||
183 | #define IWL_DEVICE_7005D \ | ||
184 | IWL_DEVICE_7000_COMMON, \ | ||
185 | .ucode_api_max = IWL7265D_UCODE_API_MAX, \ | ||
186 | .ucode_api_ok = IWL7265D_UCODE_API_OK, \ | ||
187 | .ucode_api_min = IWL7265D_UCODE_API_MIN | ||
188 | |||
168 | const struct iwl_cfg iwl7260_2ac_cfg = { | 189 | const struct iwl_cfg iwl7260_2ac_cfg = { |
169 | .name = "Intel(R) Dual Band Wireless AC 7260", | 190 | .name = "Intel(R) Dual Band Wireless AC 7260", |
170 | .fw_name_pre = IWL7260_FW_PRE, | 191 | .fw_name_pre = IWL7260_FW_PRE, |
@@ -268,7 +289,7 @@ static const struct iwl_ht_params iwl7265_ht_params = { | |||
268 | const struct iwl_cfg iwl3165_2ac_cfg = { | 289 | const struct iwl_cfg iwl3165_2ac_cfg = { |
269 | .name = "Intel(R) Dual Band Wireless AC 3165", | 290 | .name = "Intel(R) Dual Band Wireless AC 3165", |
270 | .fw_name_pre = IWL7265D_FW_PRE, | 291 | .fw_name_pre = IWL7265D_FW_PRE, |
271 | IWL_DEVICE_7000, | 292 | IWL_DEVICE_7005D, |
272 | .ht_params = &iwl7000_ht_params, | 293 | .ht_params = &iwl7000_ht_params, |
273 | .nvm_ver = IWL3165_NVM_VERSION, | 294 | .nvm_ver = IWL3165_NVM_VERSION, |
274 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, | 295 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, |
@@ -290,7 +311,7 @@ const struct iwl_cfg iwl3168_2ac_cfg = { | |||
290 | const struct iwl_cfg iwl7265_2ac_cfg = { | 311 | const struct iwl_cfg iwl7265_2ac_cfg = { |
291 | .name = "Intel(R) Dual Band Wireless AC 7265", | 312 | .name = "Intel(R) Dual Band Wireless AC 7265", |
292 | .fw_name_pre = IWL7265_FW_PRE, | 313 | .fw_name_pre = IWL7265_FW_PRE, |
293 | IWL_DEVICE_7000, | 314 | IWL_DEVICE_7005, |
294 | .ht_params = &iwl7265_ht_params, | 315 | .ht_params = &iwl7265_ht_params, |
295 | .nvm_ver = IWL7265_NVM_VERSION, | 316 | .nvm_ver = IWL7265_NVM_VERSION, |
296 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 317 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -301,7 +322,7 @@ const struct iwl_cfg iwl7265_2ac_cfg = { | |||
301 | const struct iwl_cfg iwl7265_2n_cfg = { | 322 | const struct iwl_cfg iwl7265_2n_cfg = { |
302 | .name = "Intel(R) Dual Band Wireless N 7265", | 323 | .name = "Intel(R) Dual Band Wireless N 7265", |
303 | .fw_name_pre = IWL7265_FW_PRE, | 324 | .fw_name_pre = IWL7265_FW_PRE, |
304 | IWL_DEVICE_7000, | 325 | IWL_DEVICE_7005, |
305 | .ht_params = &iwl7265_ht_params, | 326 | .ht_params = &iwl7265_ht_params, |
306 | .nvm_ver = IWL7265_NVM_VERSION, | 327 | .nvm_ver = IWL7265_NVM_VERSION, |
307 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 328 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -312,7 +333,7 @@ const struct iwl_cfg iwl7265_2n_cfg = { | |||
312 | const struct iwl_cfg iwl7265_n_cfg = { | 333 | const struct iwl_cfg iwl7265_n_cfg = { |
313 | .name = "Intel(R) Wireless N 7265", | 334 | .name = "Intel(R) Wireless N 7265", |
314 | .fw_name_pre = IWL7265_FW_PRE, | 335 | .fw_name_pre = IWL7265_FW_PRE, |
315 | IWL_DEVICE_7000, | 336 | IWL_DEVICE_7005, |
316 | .ht_params = &iwl7265_ht_params, | 337 | .ht_params = &iwl7265_ht_params, |
317 | .nvm_ver = IWL7265_NVM_VERSION, | 338 | .nvm_ver = IWL7265_NVM_VERSION, |
318 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 339 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -323,7 +344,7 @@ const struct iwl_cfg iwl7265_n_cfg = { | |||
323 | const struct iwl_cfg iwl7265d_2ac_cfg = { | 344 | const struct iwl_cfg iwl7265d_2ac_cfg = { |
324 | .name = "Intel(R) Dual Band Wireless AC 7265", | 345 | .name = "Intel(R) Dual Band Wireless AC 7265", |
325 | .fw_name_pre = IWL7265D_FW_PRE, | 346 | .fw_name_pre = IWL7265D_FW_PRE, |
326 | IWL_DEVICE_7000, | 347 | IWL_DEVICE_7005D, |
327 | .ht_params = &iwl7265_ht_params, | 348 | .ht_params = &iwl7265_ht_params, |
328 | .nvm_ver = IWL7265D_NVM_VERSION, | 349 | .nvm_ver = IWL7265D_NVM_VERSION, |
329 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 350 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -334,7 +355,7 @@ const struct iwl_cfg iwl7265d_2ac_cfg = { | |||
334 | const struct iwl_cfg iwl7265d_2n_cfg = { | 355 | const struct iwl_cfg iwl7265d_2n_cfg = { |
335 | .name = "Intel(R) Dual Band Wireless N 7265", | 356 | .name = "Intel(R) Dual Band Wireless N 7265", |
336 | .fw_name_pre = IWL7265D_FW_PRE, | 357 | .fw_name_pre = IWL7265D_FW_PRE, |
337 | IWL_DEVICE_7000, | 358 | IWL_DEVICE_7005D, |
338 | .ht_params = &iwl7265_ht_params, | 359 | .ht_params = &iwl7265_ht_params, |
339 | .nvm_ver = IWL7265D_NVM_VERSION, | 360 | .nvm_ver = IWL7265D_NVM_VERSION, |
340 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 361 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -345,7 +366,7 @@ const struct iwl_cfg iwl7265d_2n_cfg = { | |||
345 | const struct iwl_cfg iwl7265d_n_cfg = { | 366 | const struct iwl_cfg iwl7265d_n_cfg = { |
346 | .name = "Intel(R) Wireless N 7265", | 367 | .name = "Intel(R) Wireless N 7265", |
347 | .fw_name_pre = IWL7265D_FW_PRE, | 368 | .fw_name_pre = IWL7265D_FW_PRE, |
348 | IWL_DEVICE_7000, | 369 | IWL_DEVICE_7005D, |
349 | .ht_params = &iwl7265_ht_params, | 370 | .ht_params = &iwl7265_ht_params, |
350 | .nvm_ver = IWL7265D_NVM_VERSION, | 371 | .nvm_ver = IWL7265D_NVM_VERSION, |
351 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 372 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -355,5 +376,5 @@ const struct iwl_cfg iwl7265d_n_cfg = { | |||
355 | 376 | ||
356 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 377 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
357 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 378 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
358 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 379 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK)); |
359 | MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 380 | MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 78ff21a88a8b..df1fed7e4c1c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -1224,8 +1224,8 @@ static u8 iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm, | |||
1224 | mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { | 1224 | mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { |
1225 | u8 sta_id = mvmvif->ap_sta_id; | 1225 | u8 sta_id = mvmvif->ap_sta_id; |
1226 | 1226 | ||
1227 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], | 1227 | sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id], |
1228 | lockdep_is_held(&mvm->mutex)); | 1228 | lockdep_is_held(&mvm->mutex)); |
1229 | /* | 1229 | /* |
1230 | * It is possible that the 'sta' parameter is NULL, | 1230 | * It is possible that the 'sta' parameter is NULL, |
1231 | * for example when a GTK is removed - the sta_id will then | 1231 | * for example when a GTK is removed - the sta_id will then |
@@ -1592,14 +1592,15 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1592 | u16 *phase1key) | 1592 | u16 *phase1key) |
1593 | { | 1593 | { |
1594 | struct iwl_mvm_sta *mvm_sta; | 1594 | struct iwl_mvm_sta *mvm_sta; |
1595 | u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); | 1595 | u8 sta_id; |
1596 | bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); | 1596 | bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); |
1597 | 1597 | ||
1598 | if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) | ||
1599 | return; | ||
1600 | |||
1601 | rcu_read_lock(); | 1598 | rcu_read_lock(); |
1602 | 1599 | ||
1600 | sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); | ||
1601 | if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) | ||
1602 | goto unlock; | ||
1603 | |||
1603 | if (!sta) { | 1604 | if (!sta) { |
1604 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); | 1605 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); |
1605 | if (WARN_ON(IS_ERR_OR_NULL(sta))) { | 1606 | if (WARN_ON(IS_ERR_OR_NULL(sta))) { |
@@ -1611,6 +1612,8 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1611 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); | 1612 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); |
1612 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, | 1613 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, |
1613 | iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); | 1614 | iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); |
1615 | |||
1616 | unlock: | ||
1614 | rcu_read_unlock(); | 1617 | rcu_read_unlock(); |
1615 | } | 1618 | } |
1616 | 1619 | ||