aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index f06dd3941bac..9a22c478dd1b 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -56,6 +56,7 @@ static const struct pci_device_id ath10k_pci_id_table[] = {
56 { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */ 56 { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
57 { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */ 57 { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */
58 { PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */ 58 { PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
59 { PCI_VDEVICE(ATHEROS, QCA9888_2_0_DEVICE_ID) }, /* PCI-E QCA9888 V2 */
59 { PCI_VDEVICE(ATHEROS, QCA9984_1_0_DEVICE_ID) }, /* PCI-E QCA9984 V1 */ 60 { PCI_VDEVICE(ATHEROS, QCA9984_1_0_DEVICE_ID) }, /* PCI-E QCA9984 V1 */
60 { PCI_VDEVICE(ATHEROS, QCA9377_1_0_DEVICE_ID) }, /* PCI-E QCA9377 V1 */ 61 { PCI_VDEVICE(ATHEROS, QCA9377_1_0_DEVICE_ID) }, /* PCI-E QCA9377 V1 */
61 { PCI_VDEVICE(ATHEROS, QCA9887_1_0_DEVICE_ID) }, /* PCI-E QCA9887 */ 62 { PCI_VDEVICE(ATHEROS, QCA9887_1_0_DEVICE_ID) }, /* PCI-E QCA9887 */
@@ -85,6 +86,8 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
85 86
86 { QCA9984_1_0_DEVICE_ID, QCA9984_HW_1_0_CHIP_ID_REV }, 87 { QCA9984_1_0_DEVICE_ID, QCA9984_HW_1_0_CHIP_ID_REV },
87 88
89 { QCA9888_2_0_DEVICE_ID, QCA9888_HW_2_0_CHIP_ID_REV },
90
88 { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV }, 91 { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
89 { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV }, 92 { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
90 93
@@ -850,6 +853,7 @@ static u32 ath10k_pci_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
850 CORE_CTRL_ADDRESS) & 853 CORE_CTRL_ADDRESS) &
851 0x7ff) << 21; 854 0x7ff) << 21;
852 break; 855 break;
856 case ATH10K_HW_QCA9888:
853 case ATH10K_HW_QCA99X0: 857 case ATH10K_HW_QCA99X0:
854 case ATH10K_HW_QCA9984: 858 case ATH10K_HW_QCA9984:
855 case ATH10K_HW_QCA4019: 859 case ATH10K_HW_QCA4019:
@@ -1583,6 +1587,7 @@ static void ath10k_pci_irq_msi_fw_mask(struct ath10k *ar)
1583 break; 1587 break;
1584 case ATH10K_HW_QCA99X0: 1588 case ATH10K_HW_QCA99X0:
1585 case ATH10K_HW_QCA9984: 1589 case ATH10K_HW_QCA9984:
1590 case ATH10K_HW_QCA9888:
1586 case ATH10K_HW_QCA4019: 1591 case ATH10K_HW_QCA4019:
1587 /* TODO: Find appropriate register configuration for QCA99X0 1592 /* TODO: Find appropriate register configuration for QCA99X0
1588 * to mask irq/MSI. 1593 * to mask irq/MSI.
@@ -1608,6 +1613,7 @@ static void ath10k_pci_irq_msi_fw_unmask(struct ath10k *ar)
1608 break; 1613 break;
1609 case ATH10K_HW_QCA99X0: 1614 case ATH10K_HW_QCA99X0:
1610 case ATH10K_HW_QCA9984: 1615 case ATH10K_HW_QCA9984:
1616 case ATH10K_HW_QCA9888:
1611 case ATH10K_HW_QCA4019: 1617 case ATH10K_HW_QCA4019:
1612 /* TODO: Find appropriate register configuration for QCA99X0 1618 /* TODO: Find appropriate register configuration for QCA99X0
1613 * to unmask irq/MSI. 1619 * to unmask irq/MSI.
@@ -1948,6 +1954,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
1948 switch (ar_pci->pdev->device) { 1954 switch (ar_pci->pdev->device) {
1949 case QCA988X_2_0_DEVICE_ID: 1955 case QCA988X_2_0_DEVICE_ID:
1950 case QCA99X0_2_0_DEVICE_ID: 1956 case QCA99X0_2_0_DEVICE_ID:
1957 case QCA9888_2_0_DEVICE_ID:
1951 case QCA9984_1_0_DEVICE_ID: 1958 case QCA9984_1_0_DEVICE_ID:
1952 case QCA9887_1_0_DEVICE_ID: 1959 case QCA9887_1_0_DEVICE_ID:
1953 return 1; 1960 return 1;
@@ -2216,6 +2223,14 @@ static void ath10k_pci_fw_crashed_clear(struct ath10k *ar)
2216 ath10k_pci_write32(ar, FW_INDICATOR_ADDRESS, val); 2223 ath10k_pci_write32(ar, FW_INDICATOR_ADDRESS, val);
2217} 2224}
2218 2225
2226static bool ath10k_pci_has_device_gone(struct ath10k *ar)
2227{
2228 u32 val;
2229
2230 val = ath10k_pci_read32(ar, FW_INDICATOR_ADDRESS);
2231 return (val == 0xffffffff);
2232}
2233
2219/* this function effectively clears target memory controller assert line */ 2234/* this function effectively clears target memory controller assert line */
2220static void ath10k_pci_warm_reset_si0(struct ath10k *ar) 2235static void ath10k_pci_warm_reset_si0(struct ath10k *ar)
2221{ 2236{
@@ -2748,6 +2763,9 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg)
2748 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); 2763 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
2749 int ret; 2764 int ret;
2750 2765
2766 if (ath10k_pci_has_device_gone(ar))
2767 return IRQ_NONE;
2768
2751 ret = ath10k_pci_force_wake(ar); 2769 ret = ath10k_pci_force_wake(ar);
2752 if (ret) { 2770 if (ret) {
2753 ath10k_warn(ar, "failed to wake device up on irq: %d\n", ret); 2771 ath10k_warn(ar, "failed to wake device up on irq: %d\n", ret);
@@ -3169,6 +3187,12 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
3169 pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset; 3187 pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
3170 pci_hard_reset = ath10k_pci_qca99x0_chip_reset; 3188 pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
3171 break; 3189 break;
3190 case QCA9888_2_0_DEVICE_ID:
3191 hw_rev = ATH10K_HW_QCA9888;
3192 pci_ps = false;
3193 pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
3194 pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
3195 break;
3172 case QCA9377_1_0_DEVICE_ID: 3196 case QCA9377_1_0_DEVICE_ID:
3173 hw_rev = ATH10K_HW_QCA9377; 3197 hw_rev = ATH10K_HW_QCA9377;
3174 pci_ps = true; 3198 pci_ps = true;