iwlwifi: support two phys for a000 devices
authorSara Sharon <sara.sharon@intel.com>
Wed, 23 Nov 2016 15:08:20 +0000 (17:08 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 6 Feb 2017 17:19:26 +0000 (19:19 +0200)
Support differentiating between two phys for a000 devices
in order to load the correct firmware.
Eventually when moving completely to the new phy we will be
able to remove this.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-a000.c
drivers/net/wireless/intel/iwlwifi/iwl-config.h
drivers/net/wireless/intel/iwlwifi/iwl-csr.h
drivers/net/wireless/intel/iwlwifi/pcie/drv.c

index 82f18d967c4058547c65a47d508521546dcba52d..15dd7f6137c8fff1bae35a9b8eb165ab8ce7d3b6 100644 (file)
 #define IWL_A000_SMEM_OFFSET           0x400000
 #define IWL_A000_SMEM_LEN              0x68000
 
-#define IWL_A000_FW_PRE "iwlwifi-Qu-a0-jf-b0-"
-#define IWL_A000_MODULE_FIRMWARE(api) \
-       IWL_A000_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_A000_JF_FW_PRE "iwlwifi-Qu-a0-jf-b0-"
+#define IWL_A000_HR_FW_PRE "iwlwifi-Qu-a0-hr-a0-"
+
+#define IWL_A000_HR_MODULE_FIRMWARE(api) \
+       IWL_A000_HR_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_A000_JF_MODULE_FIRMWARE(api) \
+       IWL_A000_JF_FW_PRE "-" __stringify(api) ".ucode"
 
 #define NVM_HW_SECTION_NUM_FAMILY_A000         10
 
@@ -116,11 +120,22 @@ static const struct iwl_ht_params iwl_a000_ht_params = {
        .mq_rx_supported = true,                                        \
        .vht_mu_mimo_supported = true,                                  \
        .mac_addr_from_csr = true,                                      \
-       .use_tfh = true
+       .use_tfh = true,                                                \
+       .rf_id = true
+
+const struct iwl_cfg iwla000_2ac_cfg_hr = {
+               .name = "Intel(R) Dual Band Wireless AC a000",
+               .fw_name_pre = IWL_A000_HR_FW_PRE,
+               IWL_DEVICE_A000,
+               .ht_params = &iwl_a000_ht_params,
+               .nvm_ver = IWL_A000_NVM_VERSION,
+               .nvm_calib_ver = IWL_A000_TX_POWER_VERSION,
+               .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+};
 
-const struct iwl_cfg iwla000_2ac_cfg = {
+const struct iwl_cfg iwla000_2ac_cfg_jf = {
                .name = "Intel(R) Dual Band Wireless AC a000",
-               .fw_name_pre = IWL_A000_FW_PRE,
+               .fw_name_pre = IWL_A000_JF_FW_PRE,
                IWL_DEVICE_A000,
                .ht_params = &iwl_a000_ht_params,
                .nvm_ver = IWL_A000_NVM_VERSION,
@@ -128,4 +143,5 @@ const struct iwl_cfg iwla000_2ac_cfg = {
                .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
 };
 
-MODULE_FIRMWARE(IWL_A000_MODULE_FIRMWARE(IWL_A000_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_A000_HR_MODULE_FIRMWARE(IWL_A000_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_A000_JF_MODULE_FIRMWARE(IWL_A000_UCODE_API_MAX));
index 2660cc4b9f8ca848a5bc865525dc0afbf7ce1683..94f8a51b633eb25e7c5731944c5e5f00b5673743 100644 (file)
@@ -455,7 +455,8 @@ extern const struct iwl_cfg iwl9260_2ac_cfg;
 extern const struct iwl_cfg iwl9270_2ac_cfg;
 extern const struct iwl_cfg iwl9460_2ac_cfg;
 extern const struct iwl_cfg iwl9560_2ac_cfg;
-extern const struct iwl_cfg iwla000_2ac_cfg;
+extern const struct iwl_cfg iwla000_2ac_cfg_hr;
+extern const struct iwl_cfg iwla000_2ac_cfg_jf;
 #endif /* CONFIG_IWLMVM */
 
 #endif /* __IWL_CONFIG_H__ */
index d73e9d436027dec465d1146269b9fd9df3257359..4ee3b621ec27ab58c899e91c6552f15fc0d5a57a 100644 (file)
@@ -349,6 +349,7 @@ enum {
 /* RF_ID value */
 #define CSR_HW_RF_ID_TYPE_JF           (0x00105000)
 #define CSR_HW_RF_ID_TYPE_LC           (0x00101000)
+#define CSR_HW_RF_ID_TYPE_HR           (0x00109000)
 
 /* EEPROM REG */
 #define CSR_EEPROM_REG_READ_VALID_MSK  (0x00000001)
index 43c2475346ace5edaf0b5dc6ae3499eecfdeb86c..618894ecfd223b8986074ace69c781a4e4c6d138 100644 (file)
@@ -533,7 +533,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
        {IWL_PCI_DEVICE(0xA370, 0x1030, iwl9560_2ac_cfg)},
 
 /* a000 Series */
-       {IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg)},
+       {IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg_hr)},
 #endif /* CONFIG_IWLMVM */
 
        {0}
@@ -673,6 +673,12 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                        cfg = &iwl9000lc_2ac_cfg;
                        iwl_trans->cfg = cfg;
                }
+
+               if (cfg == &iwla000_2ac_cfg_hr &&
+                   iwl_trans->hw_rf_id == CSR_HW_RF_ID_TYPE_JF) {
+                       cfg = &iwla000_2ac_cfg_jf;
+                       iwl_trans->cfg = cfg;
+               }
        }
 #endif