diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-11-18 09:39:51 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-11-24 01:30:12 -0500 |
commit | 3fd0d3c170ad6ba8b64e16938f699d0b43cc782e (patch) | |
tree | df8d6c257c72d9aa9b0fa12ab60a7dbe075e82d3 | |
parent | fe45773b5baa154468416aac1304f6325939f775 (diff) |
iwlwifi: pcie: support 7265-D devices
Identify 7265-D devices using the hardware revision (they have the
same PCI IDs as 7265) and change the configuration for them taking
the differences (currently only the firmware image) into account.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-7000.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-config.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-csr.h | 35 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/drv.c | 20 |
4 files changed, 75 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c index b4e9bc7cc929..84d2a4280694 100644 --- a/drivers/net/wireless/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/iwlwifi/iwl-7000.c | |||
@@ -102,6 +102,9 @@ | |||
102 | #define IWL7265_FW_PRE "iwlwifi-7265-" | 102 | #define IWL7265_FW_PRE "iwlwifi-7265-" |
103 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" | 103 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" |
104 | 104 | ||
105 | #define IWL7265D_FW_PRE "iwlwifi-7265D-" | ||
106 | #define IWL7265D_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" | ||
107 | |||
105 | #define NVM_HW_SECTION_NUM_FAMILY_7000 0 | 108 | #define NVM_HW_SECTION_NUM_FAMILY_7000 0 |
106 | 109 | ||
107 | static const struct iwl_base_params iwl7000_base_params = { | 110 | static const struct iwl_base_params iwl7000_base_params = { |
@@ -267,7 +270,38 @@ const struct iwl_cfg iwl7265_n_cfg = { | |||
267 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | 270 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, |
268 | }; | 271 | }; |
269 | 272 | ||
273 | const struct iwl_cfg iwl7265d_2ac_cfg = { | ||
274 | .name = "Intel(R) Dual Band Wireless AC 7265", | ||
275 | .fw_name_pre = IWL7265D_FW_PRE, | ||
276 | IWL_DEVICE_7000, | ||
277 | .ht_params = &iwl7265_ht_params, | ||
278 | .nvm_ver = IWL7265_NVM_VERSION, | ||
279 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | ||
280 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | ||
281 | }; | ||
282 | |||
283 | const struct iwl_cfg iwl7265d_2n_cfg = { | ||
284 | .name = "Intel(R) Dual Band Wireless N 7265", | ||
285 | .fw_name_pre = IWL7265D_FW_PRE, | ||
286 | IWL_DEVICE_7000, | ||
287 | .ht_params = &iwl7265_ht_params, | ||
288 | .nvm_ver = IWL7265_NVM_VERSION, | ||
289 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | ||
290 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | ||
291 | }; | ||
292 | |||
293 | const struct iwl_cfg iwl7265d_n_cfg = { | ||
294 | .name = "Intel(R) Wireless N 7265", | ||
295 | .fw_name_pre = IWL7265D_FW_PRE, | ||
296 | IWL_DEVICE_7000, | ||
297 | .ht_params = &iwl7265_ht_params, | ||
298 | .nvm_ver = IWL7265_NVM_VERSION, | ||
299 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, | ||
300 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, | ||
301 | }; | ||
302 | |||
270 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 303 | MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
271 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); | 304 | MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); |
272 | MODULE_FIRMWARE(IWL3165_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); | 305 | MODULE_FIRMWARE(IWL3165_MODULE_FIRMWARE(IWL3160_UCODE_API_OK)); |
273 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | 306 | MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); |
307 | MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index c6ae4d4ec202..d43e90d894ec 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -364,6 +364,9 @@ extern const struct iwl_cfg iwl3165_2ac_cfg; | |||
364 | extern const struct iwl_cfg iwl7265_2ac_cfg; | 364 | extern const struct iwl_cfg iwl7265_2ac_cfg; |
365 | extern const struct iwl_cfg iwl7265_2n_cfg; | 365 | extern const struct iwl_cfg iwl7265_2n_cfg; |
366 | extern const struct iwl_cfg iwl7265_n_cfg; | 366 | extern const struct iwl_cfg iwl7265_n_cfg; |
367 | extern const struct iwl_cfg iwl7265d_2ac_cfg; | ||
368 | extern const struct iwl_cfg iwl7265d_2n_cfg; | ||
369 | extern const struct iwl_cfg iwl7265d_n_cfg; | ||
367 | extern const struct iwl_cfg iwl8260_2n_cfg; | 370 | extern const struct iwl_cfg iwl8260_2n_cfg; |
368 | extern const struct iwl_cfg iwl8260_2ac_cfg; | 371 | extern const struct iwl_cfg iwl8260_2ac_cfg; |
369 | extern const struct iwl_cfg iwl8260_2ac_sdio_cfg; | 372 | extern const struct iwl_cfg iwl8260_2ac_sdio_cfg; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h index 99657172ab85..aff63c3f5bf8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-csr.h +++ b/drivers/net/wireless/iwlwifi/iwl-csr.h | |||
@@ -309,23 +309,24 @@ enum { | |||
309 | }; | 309 | }; |
310 | 310 | ||
311 | 311 | ||
312 | #define CSR_HW_REV_TYPE_MSK (0x000FFF0) | 312 | #define CSR_HW_REV_TYPE_MSK (0x000FFF0) |
313 | #define CSR_HW_REV_TYPE_5300 (0x0000020) | 313 | #define CSR_HW_REV_TYPE_5300 (0x0000020) |
314 | #define CSR_HW_REV_TYPE_5350 (0x0000030) | 314 | #define CSR_HW_REV_TYPE_5350 (0x0000030) |
315 | #define CSR_HW_REV_TYPE_5100 (0x0000050) | 315 | #define CSR_HW_REV_TYPE_5100 (0x0000050) |
316 | #define CSR_HW_REV_TYPE_5150 (0x0000040) | 316 | #define CSR_HW_REV_TYPE_5150 (0x0000040) |
317 | #define CSR_HW_REV_TYPE_1000 (0x0000060) | 317 | #define CSR_HW_REV_TYPE_1000 (0x0000060) |
318 | #define CSR_HW_REV_TYPE_6x00 (0x0000070) | 318 | #define CSR_HW_REV_TYPE_6x00 (0x0000070) |
319 | #define CSR_HW_REV_TYPE_6x50 (0x0000080) | 319 | #define CSR_HW_REV_TYPE_6x50 (0x0000080) |
320 | #define CSR_HW_REV_TYPE_6150 (0x0000084) | 320 | #define CSR_HW_REV_TYPE_6150 (0x0000084) |
321 | #define CSR_HW_REV_TYPE_6x05 (0x00000B0) | 321 | #define CSR_HW_REV_TYPE_6x05 (0x00000B0) |
322 | #define CSR_HW_REV_TYPE_6x30 CSR_HW_REV_TYPE_6x05 | 322 | #define CSR_HW_REV_TYPE_6x30 CSR_HW_REV_TYPE_6x05 |
323 | #define CSR_HW_REV_TYPE_6x35 CSR_HW_REV_TYPE_6x05 | 323 | #define CSR_HW_REV_TYPE_6x35 CSR_HW_REV_TYPE_6x05 |
324 | #define CSR_HW_REV_TYPE_2x30 (0x00000C0) | 324 | #define CSR_HW_REV_TYPE_2x30 (0x00000C0) |
325 | #define CSR_HW_REV_TYPE_2x00 (0x0000100) | 325 | #define CSR_HW_REV_TYPE_2x00 (0x0000100) |
326 | #define CSR_HW_REV_TYPE_105 (0x0000110) | 326 | #define CSR_HW_REV_TYPE_105 (0x0000110) |
327 | #define CSR_HW_REV_TYPE_135 (0x0000120) | 327 | #define CSR_HW_REV_TYPE_135 (0x0000120) |
328 | #define CSR_HW_REV_TYPE_NONE (0x00001F0) | 328 | #define CSR_HW_REV_TYPE_7265D (0x0000210) |
329 | #define CSR_HW_REV_TYPE_NONE (0x00001F0) | ||
329 | 330 | ||
330 | /* EEPROM REG */ | 331 | /* EEPROM REG */ |
331 | #define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001) | 332 | #define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index 6ced8549eb3a..3ee8e3848876 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -499,6 +499,7 @@ static void set_dflt_pwr_limit(struct iwl_trans *trans, struct pci_dev *pdev) {} | |||
499 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 499 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
500 | { | 500 | { |
501 | const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); | 501 | const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); |
502 | const struct iwl_cfg *cfg_7265d __maybe_unused = NULL; | ||
502 | struct iwl_trans *iwl_trans; | 503 | struct iwl_trans *iwl_trans; |
503 | struct iwl_trans_pcie *trans_pcie; | 504 | struct iwl_trans_pcie *trans_pcie; |
504 | int ret; | 505 | int ret; |
@@ -507,6 +508,25 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
507 | if (IS_ERR(iwl_trans)) | 508 | if (IS_ERR(iwl_trans)) |
508 | return PTR_ERR(iwl_trans); | 509 | return PTR_ERR(iwl_trans); |
509 | 510 | ||
511 | #if IS_ENABLED(CONFIG_IWLMVM) | ||
512 | /* | ||
513 | * special-case 7265D, it has the same PCI IDs. | ||
514 | * | ||
515 | * Note that because we already pass the cfg to the transport above, | ||
516 | * all the parameters that the transport uses must, until that is | ||
517 | * changed, be identical to the ones in the 7265D configuration. | ||
518 | */ | ||
519 | if (cfg == &iwl7265_2ac_cfg) | ||
520 | cfg_7265d = &iwl7265d_2ac_cfg; | ||
521 | else if (cfg == &iwl7265_2n_cfg) | ||
522 | cfg_7265d = &iwl7265d_2n_cfg; | ||
523 | else if (cfg == &iwl7265_n_cfg) | ||
524 | cfg_7265d = &iwl7265d_n_cfg; | ||
525 | if (cfg_7265d && | ||
526 | (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D) | ||
527 | cfg = cfg_7265d; | ||
528 | #endif | ||
529 | |||
510 | pci_set_drvdata(pdev, iwl_trans); | 530 | pci_set_drvdata(pdev, iwl_trans); |
511 | 531 | ||
512 | trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); | 532 | trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); |