Skip to content

Commit 5da083d

Browse files
lkaufman-helucacoelho
authored andcommitted
iwlwifi: add support for 9000 HW B-step NICs
Once we remove support for A-step, we'll be able to clean the code back again. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
1 parent bd31dd9 commit 5da083d

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* GPL LICENSE SUMMARY
77
*
8-
* Copyright(c) 2015-2016 Intel Deutschland GmbH
8+
* Copyright(c) 2015-2017 Intel Deutschland GmbH
99
*
1010
* This program is free software; you can redistribute it and/or modify
1111
* it under the terms of version 2 of the GNU General Public License as
@@ -18,7 +18,7 @@
1818
*
1919
* BSD LICENSE
2020
*
21-
* Copyright(c) 2015-2016 Intel Deutschland GmbH
21+
* Copyright(c) 2015-2017 Intel Deutschland GmbH
2222
* All rights reserved.
2323
*
2424
* Redistribution and use in source and binary forms, with or without
@@ -73,11 +73,14 @@
7373
#define IWL9000_SMEM_LEN 0x68000
7474

7575
#define IWL9000_FW_PRE "iwlwifi-9000-pu-a0-jf-a0-"
76-
#define IWL9260_FW_PRE "iwlwifi-9260-th-a0-jf-a0-"
76+
#define IWL9260A_FW_PRE "iwlwifi-9260-th-a0-jf-a0-"
77+
#define IWL9260B_FW_PRE "iwlwifi-9260-th-b0-jf-b0-"
7778
#define IWL9000_MODULE_FIRMWARE(api) \
7879
IWL9000_FW_PRE "-" __stringify(api) ".ucode"
79-
#define IWL9260_MODULE_FIRMWARE(api) \
80-
IWL9260_FW_PRE "-" __stringify(api) ".ucode"
80+
#define IWL9260A_MODULE_FIRMWARE(api) \
81+
IWL9260A_FW_PRE "-" __stringify(api) ".ucode"
82+
#define IWL9260B_MODULE_FIRMWARE(api) \
83+
IWL9260B_FW_PRE "-" __stringify(api) ".ucode"
8184

8285
#define NVM_HW_SECTION_NUM_FAMILY_9000 10
8386

@@ -145,7 +148,8 @@ static const struct iwl_tt_params iwl9000_tt_params = {
145148

146149
const struct iwl_cfg iwl9160_2ac_cfg = {
147150
.name = "Intel(R) Dual Band Wireless AC 9160",
148-
.fw_name_pre = IWL9260_FW_PRE,
151+
.fw_name_pre = IWL9260A_FW_PRE,
152+
.fw_name_pre_next_step = IWL9260B_FW_PRE,
149153
IWL_DEVICE_9000,
150154
.ht_params = &iwl9000_ht_params,
151155
.nvm_ver = IWL9000_NVM_VERSION,
@@ -155,7 +159,8 @@ const struct iwl_cfg iwl9160_2ac_cfg = {
155159

156160
const struct iwl_cfg iwl9260_2ac_cfg = {
157161
.name = "Intel(R) Dual Band Wireless AC 9260",
158-
.fw_name_pre = IWL9260_FW_PRE,
162+
.fw_name_pre = IWL9260A_FW_PRE,
163+
.fw_name_pre_next_step = IWL9260B_FW_PRE,
159164
IWL_DEVICE_9000,
160165
.ht_params = &iwl9000_ht_params,
161166
.nvm_ver = IWL9000_NVM_VERSION,
@@ -165,7 +170,8 @@ const struct iwl_cfg iwl9260_2ac_cfg = {
165170

166171
const struct iwl_cfg iwl9270_2ac_cfg = {
167172
.name = "Intel(R) Dual Band Wireless AC 9270",
168-
.fw_name_pre = IWL9260_FW_PRE,
173+
.fw_name_pre = IWL9260A_FW_PRE,
174+
.fw_name_pre_next_step = IWL9260B_FW_PRE,
169175
IWL_DEVICE_9000,
170176
.ht_params = &iwl9000_ht_params,
171177
.nvm_ver = IWL9000_NVM_VERSION,
@@ -196,4 +202,5 @@ const struct iwl_cfg iwl9560_2ac_cfg = {
196202
};
197203

198204
MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
199-
MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
205+
MODULE_FIRMWARE(IWL9260A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
206+
MODULE_FIRMWARE(IWL9260B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));

drivers/net/wireless/intel/iwlwifi/iwl-config.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* GPL LICENSE SUMMARY
77
*
88
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
9-
* Copyright (C) 2016 Intel Deutschland GmbH
9+
* Copyright (C) 2016 - 2017 Intel Deutschland GmbH
1010
*
1111
* This program is free software; you can redistribute it and/or modify
1212
* it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
3232
* BSD LICENSE
3333
*
3434
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
35-
* Copyright (C) 2016 Intel Deutschland GmbH
35+
* Copyright (C) 2016 - 2017 Intel Deutschland GmbH
3636
* All rights reserved.
3737
*
3838
* Redistribution and use in source and binary forms, with or without
@@ -283,6 +283,8 @@ struct iwl_pwr_tx_backoff {
283283
* @fw_name_pre: Firmware filename prefix. The api version and extension
284284
* (.ucode) will be added to filename before loading from disk. The
285285
* filename is constructed as fw_name_pre<api>.ucode.
286+
* @fw_name_pre_next_step: same as @fw_name_pre, only for next step
287+
* (if supported)
286288
* @ucode_api_max: Highest version of uCode API supported by driver.
287289
* @ucode_api_min: Lowest version of uCode API supported by driver.
288290
* @max_inst_size: The maximal length of the fw inst section
@@ -330,6 +332,7 @@ struct iwl_cfg {
330332
/* params specific to an individual device within a device family */
331333
const char *name;
332334
const char *fw_name_pre;
335+
const char *fw_name_pre_next_step;
333336
/* params not likely to change within a device family */
334337
const struct iwl_base_params *base_params;
335338
/* params likely to change within a device family */

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10-
* Copyright(c) 2016 Intel Deutschland GmbH
10+
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
1111
*
1212
* This program is free software; you can redistribute it and/or modify
1313
* it under the terms of version 2 of the GNU General Public License as
@@ -34,7 +34,7 @@
3434
*
3535
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3636
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37-
* Copyright(c) 2016 Intel Deutschland GmbH
37+
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
3838
* All rights reserved.
3939
*
4040
* Redistribution and use in source and binary forms, with or without
@@ -213,6 +213,13 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
213213
{
214214
const struct iwl_cfg *cfg = drv->trans->cfg;
215215
char tag[8];
216+
const char *fw_pre_name;
217+
218+
if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000 &&
219+
CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_B_STEP)
220+
fw_pre_name = cfg->fw_name_pre_next_step;
221+
else
222+
fw_pre_name = cfg->fw_name_pre;
216223

217224
if (first) {
218225
drv->fw_index = cfg->ucode_api_max;
@@ -226,14 +233,14 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
226233
IWL_ERR(drv, "no suitable firmware found!\n");
227234

228235
if (cfg->ucode_api_min == cfg->ucode_api_max) {
229-
IWL_ERR(drv, "%s%d is required\n", cfg->fw_name_pre,
236+
IWL_ERR(drv, "%s%d is required\n", fw_pre_name,
230237
cfg->ucode_api_max);
231238
} else {
232239
IWL_ERR(drv, "minimum version required: %s%d\n",
233-
cfg->fw_name_pre,
240+
fw_pre_name,
234241
cfg->ucode_api_min);
235242
IWL_ERR(drv, "maximum version supported: %s%d\n",
236-
cfg->fw_name_pre,
243+
fw_pre_name,
237244
cfg->ucode_api_max);
238245
}
239246

@@ -243,7 +250,7 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
243250
}
244251

245252
snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode",
246-
cfg->fw_name_pre, tag);
253+
fw_pre_name, tag);
247254

248255
IWL_DEBUG_INFO(drv, "attempting to load firmware '%s'\n",
249256
drv->firmware_name);

0 commit comments

Comments
 (0)