Skip to content

Commit a0ccc3f

Browse files
committed
Merge tag 'wireless-drivers-for-davem-2015-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo says: ==================== iwlwifi * don't load firmware that won't exist for 7260 * fix RCU splat ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 574aab1 + 01d85b9 commit a0ccc3f

File tree

2 files changed

+44
-20
lines changed

2 files changed

+44
-20
lines changed

drivers/net/wireless/iwlwifi/iwl-7000.c

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,19 @@
6969
#include "iwl-agn-hw.h"
7070

7171
/* 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
7375

7476
/* Oldest version we won't warn about */
7577
#define IWL7260_UCODE_API_OK 13
78+
#define IWL7265_UCODE_API_OK 13
79+
#define IWL7265D_UCODE_API_OK 13
7680

7781
/* Lowest firmware API version supported */
7882
#define IWL7260_UCODE_API_MIN 13
83+
#define IWL7265_UCODE_API_MIN 13
84+
#define IWL7265D_UCODE_API_MIN 13
7985

8086
/* NVM versions */
8187
#define IWL7260_NVM_VERSION 0x0a1d
@@ -149,10 +155,7 @@ static const struct iwl_ht_params iwl7000_ht_params = {
149155
.ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
150156
};
151157

152-
#define IWL_DEVICE_7000 \
153-
.ucode_api_max = IWL7260_UCODE_API_MAX, \
154-
.ucode_api_ok = IWL7260_UCODE_API_OK, \
155-
.ucode_api_min = IWL7260_UCODE_API_MIN, \
158+
#define IWL_DEVICE_7000_COMMON \
156159
.device_family = IWL_DEVICE_FAMILY_7000, \
157160
.max_inst_size = IWL60_RTC_INST_SIZE, \
158161
.max_data_size = IWL60_RTC_DATA_SIZE, \
@@ -163,6 +166,24 @@ static const struct iwl_ht_params iwl7000_ht_params = {
163166
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
164167
.dccm_offset = IWL7000_DCCM_OFFSET
165168

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+
166187
const struct iwl_cfg iwl7260_2ac_cfg = {
167188
.name = "Intel(R) Dual Band Wireless AC 7260",
168189
.fw_name_pre = IWL7260_FW_PRE,
@@ -266,7 +287,7 @@ static const struct iwl_ht_params iwl7265_ht_params = {
266287
const struct iwl_cfg iwl3165_2ac_cfg = {
267288
.name = "Intel(R) Dual Band Wireless AC 3165",
268289
.fw_name_pre = IWL7265D_FW_PRE,
269-
IWL_DEVICE_7000,
290+
IWL_DEVICE_7005D,
270291
.ht_params = &iwl7000_ht_params,
271292
.nvm_ver = IWL3165_NVM_VERSION,
272293
.nvm_calib_ver = IWL3165_TX_POWER_VERSION,
@@ -277,7 +298,7 @@ const struct iwl_cfg iwl3165_2ac_cfg = {
277298
const struct iwl_cfg iwl7265_2ac_cfg = {
278299
.name = "Intel(R) Dual Band Wireless AC 7265",
279300
.fw_name_pre = IWL7265_FW_PRE,
280-
IWL_DEVICE_7000,
301+
IWL_DEVICE_7005,
281302
.ht_params = &iwl7265_ht_params,
282303
.nvm_ver = IWL7265_NVM_VERSION,
283304
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -288,7 +309,7 @@ const struct iwl_cfg iwl7265_2ac_cfg = {
288309
const struct iwl_cfg iwl7265_2n_cfg = {
289310
.name = "Intel(R) Dual Band Wireless N 7265",
290311
.fw_name_pre = IWL7265_FW_PRE,
291-
IWL_DEVICE_7000,
312+
IWL_DEVICE_7005,
292313
.ht_params = &iwl7265_ht_params,
293314
.nvm_ver = IWL7265_NVM_VERSION,
294315
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -299,7 +320,7 @@ const struct iwl_cfg iwl7265_2n_cfg = {
299320
const struct iwl_cfg iwl7265_n_cfg = {
300321
.name = "Intel(R) Wireless N 7265",
301322
.fw_name_pre = IWL7265_FW_PRE,
302-
IWL_DEVICE_7000,
323+
IWL_DEVICE_7005,
303324
.ht_params = &iwl7265_ht_params,
304325
.nvm_ver = IWL7265_NVM_VERSION,
305326
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -310,7 +331,7 @@ const struct iwl_cfg iwl7265_n_cfg = {
310331
const struct iwl_cfg iwl7265d_2ac_cfg = {
311332
.name = "Intel(R) Dual Band Wireless AC 7265",
312333
.fw_name_pre = IWL7265D_FW_PRE,
313-
IWL_DEVICE_7000,
334+
IWL_DEVICE_7005D,
314335
.ht_params = &iwl7265_ht_params,
315336
.nvm_ver = IWL7265D_NVM_VERSION,
316337
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -321,7 +342,7 @@ const struct iwl_cfg iwl7265d_2ac_cfg = {
321342
const struct iwl_cfg iwl7265d_2n_cfg = {
322343
.name = "Intel(R) Dual Band Wireless N 7265",
323344
.fw_name_pre = IWL7265D_FW_PRE,
324-
IWL_DEVICE_7000,
345+
IWL_DEVICE_7005D,
325346
.ht_params = &iwl7265_ht_params,
326347
.nvm_ver = IWL7265D_NVM_VERSION,
327348
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -332,7 +353,7 @@ const struct iwl_cfg iwl7265d_2n_cfg = {
332353
const struct iwl_cfg iwl7265d_n_cfg = {
333354
.name = "Intel(R) Wireless N 7265",
334355
.fw_name_pre = IWL7265D_FW_PRE,
335-
IWL_DEVICE_7000,
356+
IWL_DEVICE_7005D,
336357
.ht_params = &iwl7265_ht_params,
337358
.nvm_ver = IWL7265D_NVM_VERSION,
338359
.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -342,5 +363,5 @@ const struct iwl_cfg iwl7265d_n_cfg = {
342363

343364
MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
344365
MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
345-
MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
346-
MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
366+
MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK));
367+
MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK));

drivers/net/wireless/iwlwifi/mvm/sta.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,8 @@ static u8 iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm,
12221222
mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
12231223
u8 sta_id = mvmvif->ap_sta_id;
12241224

1225-
sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id],
1226-
lockdep_is_held(&mvm->mutex));
1225+
sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id],
1226+
lockdep_is_held(&mvm->mutex));
12271227
/*
12281228
* It is possible that the 'sta' parameter is NULL,
12291229
* 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,
15901590
u16 *phase1key)
15911591
{
15921592
struct iwl_mvm_sta *mvm_sta;
1593-
u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta);
1593+
u8 sta_id;
15941594
bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE);
15951595

1596-
if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT))
1597-
return;
1598-
15991596
rcu_read_lock();
16001597

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+
16011602
if (!sta) {
16021603
sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
16031604
if (WARN_ON(IS_ERR_OR_NULL(sta))) {
@@ -1609,6 +1610,8 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
16091610
mvm_sta = iwl_mvm_sta_from_mac80211(sta);
16101611
iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast,
16111612
iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx);
1613+
1614+
unlock:
16121615
rcu_read_unlock();
16131616
}
16141617

0 commit comments

Comments
 (0)