Skip to content

Commit 3cce9bb

Browse files
committed
Merge tag 'iwlwifi-for-kalle-2016-02-15' into HEAD
These are a few fixes for the current cycle. 3 out of the 5 patches fix a bugzilla. * fix a race that users reported when we try to load the firmware and the hardware rfkill interrupt triggers at the same time. * Luca fixes a very visible bug in scheduled scan: our firmware doesn't support scheduled scan with no profile configured and the supplicant sometimes requests such scheduled scans. * build system fix * firmware name update for 8265 * typo fix in return value
2 parents dd4d316 + 20aa99b commit 3cce9bb

File tree

12 files changed

+243
-127
lines changed

12 files changed

+243
-127
lines changed

drivers/net/wireless/intel/iwlwifi/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ config IWLWIFI_LEDS
5353

5454
config IWLDVM
5555
tristate "Intel Wireless WiFi DVM Firmware support"
56-
depends on m
5756
help
5857
This is the driver that supports the DVM firmware. The list
5958
of the devices that use this firmware is available here:

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,19 @@
7474
#define IWL7260_UCODE_API_MAX 17
7575
#define IWL7265_UCODE_API_MAX 17
7676
#define IWL7265D_UCODE_API_MAX 20
77+
#define IWL3168_UCODE_API_MAX 20
7778

7879
/* Oldest version we won't warn about */
7980
#define IWL7260_UCODE_API_OK 13
8081
#define IWL7265_UCODE_API_OK 13
8182
#define IWL7265D_UCODE_API_OK 13
83+
#define IWL3168_UCODE_API_OK 20
8284

8385
/* Lowest firmware API version supported */
8486
#define IWL7260_UCODE_API_MIN 13
8587
#define IWL7265_UCODE_API_MIN 13
8688
#define IWL7265D_UCODE_API_MIN 13
89+
#define IWL3168_UCODE_API_MIN 20
8790

8891
/* NVM versions */
8992
#define IWL7260_NVM_VERSION 0x0a1d
@@ -92,6 +95,8 @@
9295
#define IWL3160_TX_POWER_VERSION 0xffff /* meaningless */
9396
#define IWL3165_NVM_VERSION 0x709
9497
#define IWL3165_TX_POWER_VERSION 0xffff /* meaningless */
98+
#define IWL3168_NVM_VERSION 0xd01
99+
#define IWL3168_TX_POWER_VERSION 0xffff /* meaningless */
95100
#define IWL7265_NVM_VERSION 0x0a1d
96101
#define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */
97102
#define IWL7265D_NVM_VERSION 0x0c11
@@ -109,6 +114,9 @@
109114
#define IWL3160_FW_PRE "iwlwifi-3160-"
110115
#define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode"
111116

117+
#define IWL3168_FW_PRE "iwlwifi-3168-"
118+
#define IWL3168_MODULE_FIRMWARE(api) IWL3168_FW_PRE __stringify(api) ".ucode"
119+
112120
#define IWL7265_FW_PRE "iwlwifi-7265-"
113121
#define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode"
114122

@@ -180,6 +188,12 @@ static const struct iwl_ht_params iwl7000_ht_params = {
180188
.ucode_api_ok = IWL7265_UCODE_API_OK, \
181189
.ucode_api_min = IWL7265_UCODE_API_MIN
182190

191+
#define IWL_DEVICE_3008 \
192+
IWL_DEVICE_7000_COMMON, \
193+
.ucode_api_max = IWL3168_UCODE_API_MAX, \
194+
.ucode_api_ok = IWL3168_UCODE_API_OK, \
195+
.ucode_api_min = IWL3168_UCODE_API_MIN
196+
183197
#define IWL_DEVICE_7005D \
184198
IWL_DEVICE_7000_COMMON, \
185199
.ucode_api_max = IWL7265D_UCODE_API_MAX, \
@@ -299,11 +313,11 @@ const struct iwl_cfg iwl3165_2ac_cfg = {
299313

300314
const struct iwl_cfg iwl3168_2ac_cfg = {
301315
.name = "Intel(R) Dual Band Wireless AC 3168",
302-
.fw_name_pre = IWL7265D_FW_PRE,
303-
IWL_DEVICE_7000,
316+
.fw_name_pre = IWL3168_FW_PRE,
317+
IWL_DEVICE_3008,
304318
.ht_params = &iwl7000_ht_params,
305-
.nvm_ver = IWL3165_NVM_VERSION,
306-
.nvm_calib_ver = IWL3165_TX_POWER_VERSION,
319+
.nvm_ver = IWL3168_NVM_VERSION,
320+
.nvm_calib_ver = IWL3168_TX_POWER_VERSION,
307321
.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
308322
.dccm_len = IWL7265_DCCM_LEN,
309323
};
@@ -376,5 +390,6 @@ const struct iwl_cfg iwl7265d_n_cfg = {
376390

377391
MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
378392
MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
393+
MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE(IWL3168_UCODE_API_OK));
379394
MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK));
380395
MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK));

drivers/net/wireless/intel/iwlwifi/iwl-8000.c

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*
88
* Copyright(c) 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
10+
* Copyright(c) 2016 Intel Deutschland GmbH
1011
*
1112
* This program is free software; you can redistribute it and/or modify
1213
* it under the terms of version 2 of the GNU General Public License as
@@ -70,12 +71,15 @@
7071

7172
/* Highest firmware API version supported */
7273
#define IWL8000_UCODE_API_MAX 20
74+
#define IWL8265_UCODE_API_MAX 20
7375

7476
/* Oldest version we won't warn about */
7577
#define IWL8000_UCODE_API_OK 13
78+
#define IWL8265_UCODE_API_OK 20
7679

7780
/* Lowest firmware API version supported */
7881
#define IWL8000_UCODE_API_MIN 13
82+
#define IWL8265_UCODE_API_MIN 20
7983

8084
/* NVM versions */
8185
#define IWL8000_NVM_VERSION 0x0a1d
@@ -93,6 +97,10 @@
9397
#define IWL8000_MODULE_FIRMWARE(api) \
9498
IWL8000_FW_PRE "-" __stringify(api) ".ucode"
9599

100+
#define IWL8265_FW_PRE "iwlwifi-8265-"
101+
#define IWL8265_MODULE_FIRMWARE(api) \
102+
IWL8265_FW_PRE __stringify(api) ".ucode"
103+
96104
#define NVM_HW_SECTION_NUM_FAMILY_8000 10
97105
#define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B"
98106
#define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C"
@@ -144,10 +152,7 @@ static const struct iwl_tt_params iwl8000_tt_params = {
144152
.support_tx_backoff = true,
145153
};
146154

147-
#define IWL_DEVICE_8000 \
148-
.ucode_api_max = IWL8000_UCODE_API_MAX, \
149-
.ucode_api_ok = IWL8000_UCODE_API_OK, \
150-
.ucode_api_min = IWL8000_UCODE_API_MIN, \
155+
#define IWL_DEVICE_8000_COMMON \
151156
.device_family = IWL_DEVICE_FAMILY_8000, \
152157
.max_inst_size = IWL60_RTC_INST_SIZE, \
153158
.max_data_size = IWL60_RTC_DATA_SIZE, \
@@ -167,10 +172,28 @@ static const struct iwl_tt_params iwl8000_tt_params = {
167172
.thermal_params = &iwl8000_tt_params, \
168173
.apmg_not_supported = true
169174

175+
#define IWL_DEVICE_8000 \
176+
IWL_DEVICE_8000_COMMON, \
177+
.ucode_api_max = IWL8000_UCODE_API_MAX, \
178+
.ucode_api_ok = IWL8000_UCODE_API_OK, \
179+
.ucode_api_min = IWL8000_UCODE_API_MIN \
180+
181+
#define IWL_DEVICE_8260 \
182+
IWL_DEVICE_8000_COMMON, \
183+
.ucode_api_max = IWL8000_UCODE_API_MAX, \
184+
.ucode_api_ok = IWL8000_UCODE_API_OK, \
185+
.ucode_api_min = IWL8000_UCODE_API_MIN \
186+
187+
#define IWL_DEVICE_8265 \
188+
IWL_DEVICE_8000_COMMON, \
189+
.ucode_api_max = IWL8265_UCODE_API_MAX, \
190+
.ucode_api_ok = IWL8265_UCODE_API_OK, \
191+
.ucode_api_min = IWL8265_UCODE_API_MIN \
192+
170193
const struct iwl_cfg iwl8260_2n_cfg = {
171194
.name = "Intel(R) Dual Band Wireless N 8260",
172195
.fw_name_pre = IWL8000_FW_PRE,
173-
IWL_DEVICE_8000,
196+
IWL_DEVICE_8260,
174197
.ht_params = &iwl8000_ht_params,
175198
.nvm_ver = IWL8000_NVM_VERSION,
176199
.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
@@ -179,7 +202,7 @@ const struct iwl_cfg iwl8260_2n_cfg = {
179202
const struct iwl_cfg iwl8260_2ac_cfg = {
180203
.name = "Intel(R) Dual Band Wireless AC 8260",
181204
.fw_name_pre = IWL8000_FW_PRE,
182-
IWL_DEVICE_8000,
205+
IWL_DEVICE_8260,
183206
.ht_params = &iwl8000_ht_params,
184207
.nvm_ver = IWL8000_NVM_VERSION,
185208
.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
@@ -188,8 +211,8 @@ const struct iwl_cfg iwl8260_2ac_cfg = {
188211

189212
const struct iwl_cfg iwl8265_2ac_cfg = {
190213
.name = "Intel(R) Dual Band Wireless AC 8265",
191-
.fw_name_pre = IWL8000_FW_PRE,
192-
IWL_DEVICE_8000,
214+
.fw_name_pre = IWL8265_FW_PRE,
215+
IWL_DEVICE_8265,
193216
.ht_params = &iwl8000_ht_params,
194217
.nvm_ver = IWL8000_NVM_VERSION,
195218
.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
@@ -209,7 +232,7 @@ const struct iwl_cfg iwl4165_2ac_cfg = {
209232
const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
210233
.name = "Intel(R) Dual Band Wireless-AC 8260",
211234
.fw_name_pre = IWL8000_FW_PRE,
212-
IWL_DEVICE_8000,
235+
IWL_DEVICE_8260,
213236
.ht_params = &iwl8000_ht_params,
214237
.nvm_ver = IWL8000_NVM_VERSION,
215238
.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
@@ -236,3 +259,4 @@ const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
236259
};
237260

238261
MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_OK));
262+
MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_OK));

drivers/net/wireless/intel/iwlwifi/iwl-drv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,10 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
243243
if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) {
244244
char rev_step = 'A' + CSR_HW_REV_STEP(drv->trans->hw_rev);
245245

246-
snprintf(drv->firmware_name, sizeof(drv->firmware_name),
247-
"%s%c-%s.ucode", name_pre, rev_step, tag);
246+
if (rev_step != 'A')
247+
snprintf(drv->firmware_name,
248+
sizeof(drv->firmware_name), "%s%c-%s.ucode",
249+
name_pre, rev_step, tag);
248250
}
249251

250252
IWL_DEBUG_INFO(drv, "attempting to load firmware %s'%s'\n",

drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ struct iwl_mvm_tx_resp {
510510
* @scd_ssn: the index of the last contiguously sent packet
511511
* @txed: number of Txed frames in this batch
512512
* @txed_2_done: number of Acked frames in this batch
513+
* @reduced_txp: power reduced according to TPC. This is the actual value and
514+
* not a copy from the LQ command. Thus, if not the first rate was used
515+
* for Tx-ing then this value will be set to 0 by FW.
513516
*/
514517
struct iwl_mvm_ba_notif {
515518
__le32 sta_addr_lo32;
@@ -524,7 +527,8 @@ struct iwl_mvm_ba_notif {
524527
__le16 scd_ssn;
525528
u8 txed;
526529
u8 txed_2_done;
527-
__le16 reserved1;
530+
u8 reduced_txp;
531+
u8 reserved1;
528532
} __packed;
529533

530534
/*

drivers/net/wireless/intel/iwlwifi/mvm/rs.c

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*
33
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
44
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
5+
* Copyright(c) 2016 Intel Deutschland GmbH
56
*
67
* This program is free software; you can redistribute it and/or modify it
78
* under the terms of version 2 of the GNU General Public License as
@@ -724,14 +725,28 @@ static int _rs_collect_tx_data(struct iwl_mvm *mvm,
724725
return 0;
725726
}
726727

727-
static int rs_collect_tx_data(struct iwl_mvm *mvm,
728-
struct iwl_lq_sta *lq_sta,
729-
struct iwl_scale_tbl_info *tbl,
730-
int scale_index, int attempts, int successes,
731-
u8 reduced_txp)
728+
static int rs_collect_tpc_data(struct iwl_mvm *mvm,
729+
struct iwl_lq_sta *lq_sta,
730+
struct iwl_scale_tbl_info *tbl,
731+
int scale_index, int attempts, int successes,
732+
u8 reduced_txp)
733+
{
734+
struct iwl_rate_scale_data *window = NULL;
735+
736+
if (WARN_ON_ONCE(reduced_txp > TPC_MAX_REDUCTION))
737+
return -EINVAL;
738+
739+
window = &tbl->tpc_win[reduced_txp];
740+
return _rs_collect_tx_data(mvm, tbl, scale_index, attempts, successes,
741+
window);
742+
}
743+
744+
static int rs_collect_tlc_data(struct iwl_mvm *mvm,
745+
struct iwl_lq_sta *lq_sta,
746+
struct iwl_scale_tbl_info *tbl,
747+
int scale_index, int attempts, int successes)
732748
{
733749
struct iwl_rate_scale_data *window = NULL;
734-
int ret;
735750

736751
if (scale_index < 0 || scale_index >= IWL_RATE_COUNT)
737752
return -EINVAL;
@@ -745,16 +760,6 @@ static int rs_collect_tx_data(struct iwl_mvm *mvm,
745760

746761
/* Select window for current tx bit rate */
747762
window = &(tbl->win[scale_index]);
748-
749-
ret = _rs_collect_tx_data(mvm, tbl, scale_index, attempts, successes,
750-
window);
751-
if (ret)
752-
return ret;
753-
754-
if (WARN_ON_ONCE(reduced_txp > TPC_MAX_REDUCTION))
755-
return -EINVAL;
756-
757-
window = &tbl->tpc_win[reduced_txp];
758763
return _rs_collect_tx_data(mvm, tbl, scale_index, attempts, successes,
759764
window);
760765
}
@@ -1301,17 +1306,30 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
13011306
* first index into rate scale table.
13021307
*/
13031308
if (info->flags & IEEE80211_TX_STAT_AMPDU) {
1304-
/* ampdu_ack_len = 0 marks no BA was received. In this case
1305-
* treat it as a single frame loss as we don't want the success
1306-
* ratio to dip too quickly because a BA wasn't received
1309+
rs_collect_tpc_data(mvm, lq_sta, curr_tbl, lq_rate.index,
1310+
info->status.ampdu_len,
1311+
info->status.ampdu_ack_len,
1312+
reduced_txp);
1313+
1314+
/* ampdu_ack_len = 0 marks no BA was received. For TLC, treat
1315+
* it as a single frame loss as we don't want the success ratio
1316+
* to dip too quickly because a BA wasn't received.
1317+
* For TPC, there's no need for this optimisation since we want
1318+
* to recover very quickly from a bad power reduction and,
1319+
* therefore we'd like the success ratio to get an immediate hit
1320+
* when failing to get a BA, so we'd switch back to a lower or
1321+
* zero power reduction. When FW transmits agg with a rate
1322+
* different from the initial rate, it will not use reduced txp
1323+
* and will send BA notification twice (one empty with reduced
1324+
* txp equal to the value from LQ and one with reduced txp 0).
1325+
* We need to update counters for each txp level accordingly.
13071326
*/
13081327
if (info->status.ampdu_ack_len == 0)
13091328
info->status.ampdu_len = 1;
13101329

1311-
rs_collect_tx_data(mvm, lq_sta, curr_tbl, lq_rate.index,
1312-
info->status.ampdu_len,
1313-
info->status.ampdu_ack_len,
1314-
reduced_txp);
1330+
rs_collect_tlc_data(mvm, lq_sta, curr_tbl, lq_rate.index,
1331+
info->status.ampdu_len,
1332+
info->status.ampdu_ack_len);
13151333

13161334
/* Update success/fail counts if not searching for new mode */
13171335
if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
@@ -1344,9 +1362,13 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
13441362
else
13451363
continue;
13461364

1347-
rs_collect_tx_data(mvm, lq_sta, tmp_tbl, lq_rate.index,
1348-
1, i < retries ? 0 : legacy_success,
1349-
reduced_txp);
1365+
rs_collect_tpc_data(mvm, lq_sta, tmp_tbl,
1366+
lq_rate.index, 1,
1367+
i < retries ? 0 : legacy_success,
1368+
reduced_txp);
1369+
rs_collect_tlc_data(mvm, lq_sta, tmp_tbl,
1370+
lq_rate.index, 1,
1371+
i < retries ? 0 : legacy_success);
13501372
}
13511373

13521374
/* Update success/fail counts if not searching for new mode */

drivers/net/wireless/intel/iwlwifi/mvm/scan.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,10 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
13011301
return -EBUSY;
13021302
}
13031303

1304+
/* we don't support "match all" in the firmware */
1305+
if (!req->n_match_sets)
1306+
return -EOPNOTSUPP;
1307+
13041308
ret = iwl_mvm_check_running_scans(mvm, type);
13051309
if (ret)
13061310
return ret;

drivers/net/wireless/intel/iwlwifi/mvm/tx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm,
10641064
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
10651065
mvmsta->tid_data[tid].rate_n_flags =
10661066
le32_to_cpu(tx_resp->initial_rate);
1067-
mvmsta->tid_data[tid].reduced_tpc = tx_resp->reduced_tpc;
10681067
mvmsta->tid_data[tid].tx_time =
10691068
le16_to_cpu(tx_resp->wireless_media_time);
10701069
}
@@ -1095,7 +1094,7 @@ static void iwl_mvm_tx_info_from_ba_notif(struct ieee80211_tx_info *info,
10951094
/* TODO: not accounted if the whole A-MPDU failed */
10961095
info->status.tx_time = tid_data->tx_time;
10971096
info->status.status_driver_data[0] =
1098-
(void *)(uintptr_t)tid_data->reduced_tpc;
1097+
(void *)(uintptr_t)ba_notif->reduced_txp;
10991098
info->status.status_driver_data[1] =
11001099
(void *)(uintptr_t)tid_data->rate_n_flags;
11011100
}
@@ -1168,6 +1167,8 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
11681167
scd_flow, ba_resp_scd_ssn, ba_notif->txed,
11691168
ba_notif->txed_2_done);
11701169

1170+
IWL_DEBUG_TX_REPLY(mvm, "reduced txp from ba notif %d\n",
1171+
ba_notif->reduced_txp);
11711172
tid_data->next_reclaimed = ba_resp_scd_ssn;
11721173

11731174
iwl_mvm_check_ratid_empty(mvm, sta, tid);

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
380380
{IWL_PCI_DEVICE(0x3165, 0x8110, iwl3165_2ac_cfg)},
381381

382382
/* 3168 Series */
383+
{IWL_PCI_DEVICE(0x24FB, 0x2010, iwl3168_2ac_cfg)},
383384
{IWL_PCI_DEVICE(0x24FB, 0x2110, iwl3168_2ac_cfg)},
385+
{IWL_PCI_DEVICE(0x24FB, 0x2050, iwl3168_2ac_cfg)},
386+
{IWL_PCI_DEVICE(0x24FB, 0x2150, iwl3168_2ac_cfg)},
384387
{IWL_PCI_DEVICE(0x24FB, 0x0000, iwl3168_2ac_cfg)},
385388

386389
/* 7265 Series */
@@ -477,6 +480,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
477480
{IWL_PCI_DEVICE(0x24F3, 0x0000, iwl8265_2ac_cfg)},
478481
{IWL_PCI_DEVICE(0x24FD, 0x0010, iwl8265_2ac_cfg)},
479482
{IWL_PCI_DEVICE(0x24FD, 0x8010, iwl8265_2ac_cfg)},
483+
{IWL_PCI_DEVICE(0x24FD, 0x0810, iwl8265_2ac_cfg)},
480484

481485
/* 9000 Series */
482486
{IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl5165_2ac_cfg)},

0 commit comments

Comments
 (0)