diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2015-12-18 07:57:02 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-12-18 07:57:02 -0500 |
commit | 01d85b9b2b6bec2b0773cf2afc58699dc4b052f8 (patch) | |
tree | cdf5c3c1aafad46b7009f9d26bb2aa087626be01 | |
parent | eeec5d0ef7ee54a75e09e861c3cc44177b8752c7 (diff) | |
parent | 4585436091cd812b1165aab71bd4847ea1cb08ec (diff) |
Merge tag 'iwlwifi-for-kalle-2015-12-16' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
* don't load firmware that won't exist for 7260
* fix RCU splat
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-7000.c | 49 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.c | 15 |
2 files changed, 44 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c index bf88ec3a65fa..d9a4aee246a6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/iwlwifi/iwl-7000.c | |||
@@ -69,13 +69,19 @@ | |||
69 | #include "iwl-agn-hw.h" | 69 | #include "iwl-agn-hw.h" |
70 | 70 | ||
71 | /* Highest firmware API version supported */ | 71 | /* Highest firmware API version supported */ |
72 | #define IWL7260_UCODE_API_MAX 19 | 72 | #define IWL7260_UCODE_API_MAX 17 |
73 | #define IWL7265_UCODE_API_MAX 19 | ||
74 | #define IWL7265D_UCODE_API_MAX 19 | ||
73 | 75 | ||
74 | /* Oldest version we won't warn about */ | 76 | /* Oldest version we won't warn about */ |
75 | #define IWL7260_UCODE_API_OK 13 | 77 | #define IWL7260_UCODE_API_OK 13 |
78 | #define IWL7265_UCODE_API_OK 13 | ||
79 | #define IWL7265D_UCODE_API_OK 13 | ||
76 | 80 | ||
77 | /* Lowest firmware API version supported */ | 81 | /* Lowest firmware API version supported */ |
78 | #define IWL7260_UCODE_API_MIN 13 | 82 | #define IWL7260_UCODE_API_MIN 13 |
83 | #define IWL7265_UCODE_API_MIN 13 | ||
84 | #define IWL7265D_UCODE_API_MIN 13 | ||
79 | 85 | ||
80 | /* NVM versions */ | 86 | /* NVM versions */ |
81 | #define IWL7260_NVM_VERSION 0x0a1d | 87 | #define IWL7260_NVM_VERSION 0x0a1d |
@@ -149,10 +155,7 @@ static const struct iwl_ht_params iwl7000_ht_params = { | |||
149 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), | 155 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), |
150 | }; | 156 | }; |
151 | 157 | ||
152 | #define IWL_DEVICE_7000 \ | 158 | #define IWL_DEVICE_7000_COMMON \ |
153 | .ucode_api_max = IWL7260_UCODE_API_MAX, \ | ||
154 | .ucode_api_ok = IWL7260_UCODE_API_OK, \ | ||
155 | .ucode_api_min = IWL7260_UCODE_API_MIN, \ | ||
156 | .device_family = IWL_DEVICE_FAMILY_7000, \ | 159 | .device_family = IWL_DEVICE_FAMILY_7000, \ |
157 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 160 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
158 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 161 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
@@ -163,6 +166,24 @@ static const struct iwl_ht_params iwl7000_ht_params = { | |||
163 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ | 166 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ |
164 | .dccm_offset = IWL7000_DCCM_OFFSET | 167 | .dccm_offset = IWL7000_DCCM_OFFSET |
165 | 168 | ||
169 | #define IWL_DEVICE_7000 \ | ||
170 | IWL_DEVICE_7000_COMMON, \ | ||
171 | .ucode_api_max = IWL7260_UCODE_API_MAX, \ | ||
172 | .ucode_api_ok = IWL7260_UCODE_API_OK, \ | ||
173 | .ucode_api_min = IWL7260_UCODE_API_MIN | ||
174 | |||
175 | #define IWL_DEVICE_7005 \ | ||
176 | IWL_DEVICE_7000_COMMON, \ | ||
177 | .ucode_api_max = IWL7265_UCODE_API_MAX, \ | ||
178 | .ucode_api_ok = IWL7265_UCODE_API_OK, \ | ||
179 | .ucode_api_min = IWL7265_UCODE_API_MIN | ||
180 | |||
181 | #define IWL_DEVICE_7005D \ | ||
182 | IWL_DEVICE_7000_COMMON, \ | ||
183 | .ucode_api_max = IWL7265D_UCODE_API_MAX, \ | ||
184 | .ucode_api_ok = IWL7265D_UCODE_API_OK, \ | ||
185 | .ucode_api_min = IWL7265D_UCODE_API_MIN | ||
186 | |||
166 | const struct iwl_cfg iwl7260_2ac_cfg = { | 187 | const struct iwl_cfg iwl7260_2ac_cfg = { |
167 | .name = "Intel(R) Dual Band Wireless AC 7260", | 188 | .name = "Intel(R) Dual Band Wireless AC 7260", |
168 | .fw_name_pre = IWL7260_FW_PRE, | 189 | .fw_name_pre = IWL7260_FW_PRE, |
@@ -266,7 +287,7 @@ static const struct iwl_ht_params iwl7265_ht_params = { | |||
266 | const struct iwl_cfg iwl3165_2ac_cfg = { | 287 | const struct iwl_cfg iwl3165_2ac_cfg = { |
267 | .name = "Intel(R) Dual Band Wireless AC 3165", | 288 | .name = "Intel(R) Dual Band Wireless AC 3165", |
268 | .fw_name_pre = IWL7265D_FW_PRE, | 289 | .fw_name_pre = IWL7265D_FW_PRE, |
269 | IWL_DEVICE_7000, | 290 | IWL_DEVICE_7005D, |
270 | .ht_params = &iwl7000_ht_params, | 291 | .ht_params = &iwl7000_ht_params, |
271 | .nvm_ver = IWL3165_NVM_VERSION, | 292 | .nvm_ver = IWL3165_NVM_VERSION, |
272 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, | 293 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, |
@@ -277,7 +298,7 @@ const struct iwl_cfg iwl3165_2ac_cfg = { | |||
277 | const struct iwl_cfg iwl7265_2ac_cfg = { | 298 | const struct iwl_cfg iwl7265_2ac_cfg = { |
278 | .name = "Intel(R) Dual Band Wireless AC 7265", | 299 | .name = "Intel(R) Dual Band Wireless AC 7265", |
279 | .fw_name_pre = IWL7265_FW_PRE, | 300 | .fw_name_pre = IWL7265_FW_PRE, |
280 | IWL_DEVICE_7000, | 301 | IWL_DEVICE_7005, |
281 | .ht_params = &iwl7265_ht_params, | 302 | .ht_params = &iwl7265_ht_params, |
282 | .nvm_ver = IWL7265_NVM_VERSION, | 303 | .nvm_ver = IWL7265_NVM_VERSION, |
283 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 304 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -288,7 +309,7 @@ const struct iwl_cfg iwl7265_2ac_cfg = { | |||
288 | const struct iwl_cfg iwl7265_2n_cfg = { | 309 | const struct iwl_cfg iwl7265_2n_cfg = { |
289 | .name = "Intel(R) Dual Band Wireless N 7265", | 310 | .name = "Intel(R) Dual Band Wireless N 7265", |
290 | .fw_name_pre = IWL7265_FW_PRE, | 311 | .fw_name_pre = IWL7265_FW_PRE, |
291 | IWL_DEVICE_7000, | 312 | IWL_DEVICE_7005, |
292 | .ht_params = &iwl7265_ht_params, | 313 | .ht_params = &iwl7265_ht_params, |
293 | .nvm_ver = IWL7265_NVM_VERSION, | 314 | .nvm_ver = IWL7265_NVM_VERSION, |
294 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 315 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -299,7 +320,7 @@ const struct iwl_cfg iwl7265_2n_cfg = { | |||
299 | const struct iwl_cfg iwl7265_n_cfg = { | 320 | const struct iwl_cfg iwl7265_n_cfg = { |
300 | .name = "Intel(R) Wireless N 7265", | 321 | .name = "Intel(R) Wireless N 7265", |
301 | .fw_name_pre = IWL7265_FW_PRE, | 322 | .fw_name_pre = IWL7265_FW_PRE, |
302 | IWL_DEVICE_7000, | 323 | IWL_DEVICE_7005, |
303 | .ht_params = &iwl7265_ht_params, | 324 | .ht_params = &iwl7265_ht_params, |
304 | .nvm_ver = IWL7265_NVM_VERSION, | 325 | .nvm_ver = IWL7265_NVM_VERSION, |
305 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 326 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -310,7 +331,7 @@ const struct iwl_cfg iwl7265_n_cfg = { | |||
310 | const struct iwl_cfg iwl7265d_2ac_cfg = { | 331 | const struct iwl_cfg iwl7265d_2ac_cfg = { |
311 | .name = "Intel(R) Dual Band Wireless AC 7265", | 332 | .name = "Intel(R) Dual Band Wireless AC 7265", |
312 | .fw_name_pre = IWL7265D_FW_PRE, | 333 | .fw_name_pre = IWL7265D_FW_PRE, |
313 | IWL_DEVICE_7000, | 334 | IWL_DEVICE_7005D, |
314 | .ht_params = &iwl7265_ht_params, | 335 | .ht_params = &iwl7265_ht_params, |
315 | .nvm_ver = IWL7265D_NVM_VERSION, | 336 | .nvm_ver = IWL7265D_NVM_VERSION, |
316 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 337 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -321,7 +342,7 @@ const struct iwl_cfg iwl7265d_2ac_cfg = { | |||
321 | const struct iwl_cfg iwl7265d_2n_cfg = { | 342 | const struct iwl_cfg iwl7265d_2n_cfg = { |
322 | .name = "Intel(R) Dual Band Wireless N 7265", | 343 | .name = "Intel(R) Dual Band Wireless N 7265", |
323 | .fw_name_pre = IWL7265D_FW_PRE, | 344 | .fw_name_pre = IWL7265D_FW_PRE, |
324 | IWL_DEVICE_7000, | 345 | IWL_DEVICE_7005D, |
325 | .ht_params = &iwl7265_ht_params, | 346 | .ht_params = &iwl7265_ht_params, |
326 | .nvm_ver = IWL7265D_NVM_VERSION, | 347 | .nvm_ver = IWL7265D_NVM_VERSION, |
327 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 348 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -332,7 +353,7 @@ const struct iwl_cfg iwl7265d_2n_cfg = { | |||
332 | const struct iwl_cfg iwl7265d_n_cfg = { | 353 | const struct iwl_cfg iwl7265d_n_cfg = { |
333 | .name = "Intel(R) Wireless N 7265", | 354 | .name = "Intel(R) Wireless N 7265", |
334 | .fw_name_pre = IWL7265D_FW_PRE, | 355 | .fw_name_pre = IWL7265D_FW_PRE, |
335 | IWL_DEVICE_7000, | 356 | IWL_DEVICE_7005D, |
336 | .ht_params = &iwl7265_ht_params, | 357 | .ht_params = &iwl7265_ht_params, |
337 | .nvm_ver = IWL7265D_NVM_VERSION, | 358 | .nvm_ver = IWL7265D_NVM_VERSION, |
338 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | 359 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, |
@@ -342,5 +363,5 @@ const struct iwl_cfg iwl7265d_n_cfg = { | |||
342 | 363 | ||
343 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 364 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
344 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 365 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
345 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 366 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK)); |
346 | MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 367 | MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 354acbde088e..2b976b110207 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -1222,8 +1222,8 @@ static u8 iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm, | |||
1222 | mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { | 1222 | mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { |
1223 | u8 sta_id = mvmvif->ap_sta_id; | 1223 | u8 sta_id = mvmvif->ap_sta_id; |
1224 | 1224 | ||
1225 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], | 1225 | sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id], |
1226 | lockdep_is_held(&mvm->mutex)); | 1226 | lockdep_is_held(&mvm->mutex)); |
1227 | /* | 1227 | /* |
1228 | * It is possible that the 'sta' parameter is NULL, | 1228 | * It is possible that the 'sta' parameter is NULL, |
1229 | * for example when a GTK is removed - the sta_id will then | 1229 | * for example when a GTK is removed - the sta_id will then |
@@ -1590,14 +1590,15 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1590 | u16 *phase1key) | 1590 | u16 *phase1key) |
1591 | { | 1591 | { |
1592 | struct iwl_mvm_sta *mvm_sta; | 1592 | struct iwl_mvm_sta *mvm_sta; |
1593 | u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); | 1593 | u8 sta_id; |
1594 | bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); | 1594 | bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); |
1595 | 1595 | ||
1596 | if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) | ||
1597 | return; | ||
1598 | |||
1599 | rcu_read_lock(); | 1596 | rcu_read_lock(); |
1600 | 1597 | ||
1598 | sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); | ||
1599 | if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) | ||
1600 | goto unlock; | ||
1601 | |||
1601 | if (!sta) { | 1602 | if (!sta) { |
1602 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); | 1603 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); |
1603 | if (WARN_ON(IS_ERR_OR_NULL(sta))) { | 1604 | if (WARN_ON(IS_ERR_OR_NULL(sta))) { |
@@ -1609,6 +1610,8 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1609 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); | 1610 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); |
1610 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, | 1611 | iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, |
1611 | iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); | 1612 | iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); |
1613 | |||
1614 | unlock: | ||
1612 | rcu_read_unlock(); | 1615 | rcu_read_unlock(); |
1613 | } | 1616 | } |
1614 | 1617 | ||