Merge tag 'wireless-drivers-for-davem-2014-12-26' of git://git.kernel.org/pub/scm...
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / pcie / drv.c
index 6ced854..2f0c4b1 100644 (file)
@@ -367,7 +367,11 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 
 /* 3165 Series */
        {IWL_PCI_DEVICE(0x3165, 0x4010, iwl3165_2ac_cfg)},
+       {IWL_PCI_DEVICE(0x3165, 0x4012, iwl3165_2ac_cfg)},
+       {IWL_PCI_DEVICE(0x3165, 0x4110, iwl3165_2ac_cfg)},
        {IWL_PCI_DEVICE(0x3165, 0x4210, iwl3165_2ac_cfg)},
+       {IWL_PCI_DEVICE(0x3165, 0x4410, iwl3165_2ac_cfg)},
+       {IWL_PCI_DEVICE(0x3165, 0x4510, iwl3165_2ac_cfg)},
 
 /* 7265 Series */
        {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)},
@@ -499,6 +503,7 @@ static void set_dflt_pwr_limit(struct iwl_trans *trans, struct pci_dev *pdev) {}
 static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
+       const struct iwl_cfg *cfg_7265d __maybe_unused = NULL;
        struct iwl_trans *iwl_trans;
        struct iwl_trans_pcie *trans_pcie;
        int ret;
@@ -507,6 +512,25 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (IS_ERR(iwl_trans))
                return PTR_ERR(iwl_trans);
 
+#if IS_ENABLED(CONFIG_IWLMVM)
+       /*
+        * special-case 7265D, it has the same PCI IDs.
+        *
+        * Note that because we already pass the cfg to the transport above,
+        * all the parameters that the transport uses must, until that is
+        * changed, be identical to the ones in the 7265D configuration.
+        */
+       if (cfg == &iwl7265_2ac_cfg)
+               cfg_7265d = &iwl7265d_2ac_cfg;
+       else if (cfg == &iwl7265_2n_cfg)
+               cfg_7265d = &iwl7265d_2n_cfg;
+       else if (cfg == &iwl7265_n_cfg)
+               cfg_7265d = &iwl7265d_n_cfg;
+       if (cfg_7265d &&
+           (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D)
+               cfg = cfg_7265d;
+#endif
+
        pci_set_drvdata(pdev, iwl_trans);
 
        trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans);