Lines Matching full:ab

45 static int ath11k_pci_bus_wake_up(struct ath11k_base *ab)  in ath11k_pci_bus_wake_up()  argument
47 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_bus_wake_up()
52 static void ath11k_pci_bus_release(struct ath11k_base *ab) in ath11k_pci_bus_release() argument
54 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_bus_release()
59 static u32 ath11k_pci_get_window_start(struct ath11k_base *ab, u32 offset) in ath11k_pci_get_window_start() argument
61 if (!ab->hw_params.static_window_map) in ath11k_pci_get_window_start()
67 else if ((offset ^ HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab)) < in ath11k_pci_get_window_start()
77 struct ath11k_base *ab = ab_pci->ab; in ath11k_pci_select_window() local
85 ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS); in ath11k_pci_select_window()
86 ioread32(ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS); in ath11k_pci_select_window()
92 ath11k_pci_window_write32(struct ath11k_base *ab, u32 offset, u32 value) in ath11k_pci_window_write32() argument
94 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_window_write32()
97 window_start = ath11k_pci_get_window_start(ab, offset); in ath11k_pci_window_write32()
102 iowrite32(value, ab->mem + window_start + in ath11k_pci_window_write32()
106 iowrite32(value, ab->mem + window_start + in ath11k_pci_window_write32()
111 static u32 ath11k_pci_window_read32(struct ath11k_base *ab, u32 offset) in ath11k_pci_window_read32() argument
113 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_window_read32()
116 window_start = ath11k_pci_get_window_start(ab, offset); in ath11k_pci_window_read32()
121 val = ioread32(ab->mem + window_start + in ath11k_pci_window_read32()
125 val = ioread32(ab->mem + window_start + in ath11k_pci_window_read32()
132 int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector) in ath11k_pci_get_msi_irq() argument
134 struct pci_dev *pci_dev = to_pci_dev(ab->dev); in ath11k_pci_get_msi_irq()
177 ab_pci->ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS); in ath11k_pci_select_static_window()
180 static void ath11k_pci_soc_global_reset(struct ath11k_base *ab) in ath11k_pci_soc_global_reset() argument
184 val = ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET); in ath11k_pci_soc_global_reset()
188 ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val); in ath11k_pci_soc_global_reset()
197 ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val); in ath11k_pci_soc_global_reset()
201 val = ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET); in ath11k_pci_soc_global_reset()
203 ath11k_warn(ab, "link down error during global reset\n"); in ath11k_pci_soc_global_reset()
206 static void ath11k_pci_clear_dbg_registers(struct ath11k_base *ab) in ath11k_pci_clear_dbg_registers() argument
211 val = ath11k_pcic_read32(ab, PCIE_Q6_COOKIE_ADDR); in ath11k_pci_clear_dbg_registers()
212 ath11k_dbg(ab, ATH11K_DBG_PCI, "pcie_q6_cookie_addr 0x%x\n", val); in ath11k_pci_clear_dbg_registers()
214 val = ath11k_pcic_read32(ab, WLAON_WARM_SW_ENTRY); in ath11k_pci_clear_dbg_registers()
215 ath11k_dbg(ab, ATH11K_DBG_PCI, "wlaon_warm_sw_entry 0x%x\n", val); in ath11k_pci_clear_dbg_registers()
223 ath11k_pcic_write32(ab, WLAON_WARM_SW_ENTRY, 0); in ath11k_pci_clear_dbg_registers()
226 val = ath11k_pcic_read32(ab, WLAON_WARM_SW_ENTRY); in ath11k_pci_clear_dbg_registers()
227 ath11k_dbg(ab, ATH11K_DBG_PCI, "wlaon_warm_sw_entry 0x%x\n", val); in ath11k_pci_clear_dbg_registers()
232 val = ath11k_pcic_read32(ab, WLAON_SOC_RESET_CAUSE_REG); in ath11k_pci_clear_dbg_registers()
233 ath11k_dbg(ab, ATH11K_DBG_PCI, "soc reset cause %d\n", val); in ath11k_pci_clear_dbg_registers()
236 static int ath11k_pci_set_link_reg(struct ath11k_base *ab, in ath11k_pci_set_link_reg() argument
242 v = ath11k_pcic_read32(ab, offset); in ath11k_pci_set_link_reg()
247 ath11k_pcic_write32(ab, offset, (v & ~mask) | value); in ath11k_pci_set_link_reg()
249 v = ath11k_pcic_read32(ab, offset); in ath11k_pci_set_link_reg()
256 ath11k_warn(ab, "failed to set pcie link register 0x%08x: 0x%08x != 0x%08x\n", in ath11k_pci_set_link_reg()
262 static int ath11k_pci_fix_l1ss(struct ath11k_base *ab) in ath11k_pci_fix_l1ss() argument
266 ret = ath11k_pci_set_link_reg(ab, in ath11k_pci_fix_l1ss()
267 PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(ab), in ath11k_pci_fix_l1ss()
271 ath11k_warn(ab, "failed to set sysclk: %d\n", ret); in ath11k_pci_fix_l1ss()
275 ret = ath11k_pci_set_link_reg(ab, in ath11k_pci_fix_l1ss()
276 PCIE_PCS_OSC_DTCT_CONFIG1_REG(ab), in ath11k_pci_fix_l1ss()
280 ath11k_warn(ab, "failed to set dtct config1 error: %d\n", ret); in ath11k_pci_fix_l1ss()
284 ret = ath11k_pci_set_link_reg(ab, in ath11k_pci_fix_l1ss()
285 PCIE_PCS_OSC_DTCT_CONFIG2_REG(ab), in ath11k_pci_fix_l1ss()
289 ath11k_warn(ab, "failed to set dtct config2: %d\n", ret); in ath11k_pci_fix_l1ss()
293 ret = ath11k_pci_set_link_reg(ab, in ath11k_pci_fix_l1ss()
294 PCIE_PCS_OSC_DTCT_CONFIG4_REG(ab), in ath11k_pci_fix_l1ss()
298 ath11k_warn(ab, "failed to set dtct config4: %d\n", ret); in ath11k_pci_fix_l1ss()
305 static void ath11k_pci_enable_ltssm(struct ath11k_base *ab) in ath11k_pci_enable_ltssm() argument
310 val = ath11k_pcic_read32(ab, PCIE_PCIE_PARF_LTSSM); in ath11k_pci_enable_ltssm()
317 ath11k_pcic_write32(ab, PCIE_PCIE_PARF_LTSSM, PARM_LTSSM_VALUE); in ath11k_pci_enable_ltssm()
318 val = ath11k_pcic_read32(ab, PCIE_PCIE_PARF_LTSSM); in ath11k_pci_enable_ltssm()
321 ath11k_dbg(ab, ATH11K_DBG_PCI, "ltssm 0x%x\n", val); in ath11k_pci_enable_ltssm()
323 val = ath11k_pcic_read32(ab, GCC_GCC_PCIE_HOT_RST); in ath11k_pci_enable_ltssm()
325 ath11k_pcic_write32(ab, GCC_GCC_PCIE_HOT_RST, val); in ath11k_pci_enable_ltssm()
326 val = ath11k_pcic_read32(ab, GCC_GCC_PCIE_HOT_RST); in ath11k_pci_enable_ltssm()
328 ath11k_dbg(ab, ATH11K_DBG_PCI, "pcie_hot_rst 0x%x\n", val); in ath11k_pci_enable_ltssm()
333 static void ath11k_pci_clear_all_intrs(struct ath11k_base *ab) in ath11k_pci_clear_all_intrs() argument
340 ath11k_pcic_write32(ab, PCIE_PCIE_INT_ALL_CLEAR, PCIE_INT_CLEAR_ALL); in ath11k_pci_clear_all_intrs()
343 static void ath11k_pci_set_wlaon_pwr_ctrl(struct ath11k_base *ab) in ath11k_pci_set_wlaon_pwr_ctrl() argument
347 val = ath11k_pcic_read32(ab, WLAON_QFPROM_PWR_CTRL_REG); in ath11k_pci_set_wlaon_pwr_ctrl()
349 ath11k_pcic_write32(ab, WLAON_QFPROM_PWR_CTRL_REG, val); in ath11k_pci_set_wlaon_pwr_ctrl()
352 static void ath11k_pci_force_wake(struct ath11k_base *ab) in ath11k_pci_force_wake() argument
354 ath11k_pcic_write32(ab, PCIE_SOC_WAKE_PCIE_LOCAL_REG, 1); in ath11k_pci_force_wake()
358 static void ath11k_pci_sw_reset(struct ath11k_base *ab, bool power_on) in ath11k_pci_sw_reset() argument
363 ath11k_pci_enable_ltssm(ab); in ath11k_pci_sw_reset()
364 ath11k_pci_clear_all_intrs(ab); in ath11k_pci_sw_reset()
365 ath11k_pci_set_wlaon_pwr_ctrl(ab); in ath11k_pci_sw_reset()
366 if (ab->hw_params.fix_l1ss) in ath11k_pci_sw_reset()
367 ath11k_pci_fix_l1ss(ab); in ath11k_pci_sw_reset()
370 ath11k_mhi_clear_vector(ab); in ath11k_pci_sw_reset()
371 ath11k_pci_clear_dbg_registers(ab); in ath11k_pci_sw_reset()
372 ath11k_pci_soc_global_reset(ab); in ath11k_pci_sw_reset()
373 ath11k_mhi_set_mhictrl_reset(ab); in ath11k_pci_sw_reset()
376 static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab) in ath11k_pci_init_qmi_ce_config() argument
378 struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; in ath11k_pci_init_qmi_ce_config()
380 cfg->tgt_ce = ab->hw_params.target_ce_config; in ath11k_pci_init_qmi_ce_config()
381 cfg->tgt_ce_len = ab->hw_params.target_ce_count; in ath11k_pci_init_qmi_ce_config()
383 cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; in ath11k_pci_init_qmi_ce_config()
384 cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; in ath11k_pci_init_qmi_ce_config()
385 ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; in ath11k_pci_init_qmi_ce_config()
387 ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2, in ath11k_pci_init_qmi_ce_config()
418 struct ath11k_base *ab = ab_pci->ab; in ath11k_pci_alloc_msi() local
419 const struct ath11k_msi_config *msi_config = ab->pci.msi.config; in ath11k_pci_alloc_msi()
430 set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags); in ath11k_pci_alloc_msi()
440 clear_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags); in ath11k_pci_alloc_msi()
441 ab->pci.msi.config = &msi_config_one_msi; in ath11k_pci_alloc_msi()
442 ath11k_dbg(ab, ATH11K_DBG_PCI, "request one msi vector\n"); in ath11k_pci_alloc_msi()
444 ath11k_info(ab, "MSI vectors: %d\n", num_vectors); in ath11k_pci_alloc_msi()
450 ath11k_err(ab, "msi_desc is NULL!\n"); in ath11k_pci_alloc_msi()
455 ab->pci.msi.ep_base_data = msi_desc->msg.data; in ath11k_pci_alloc_msi()
458 &ab->pci.msi.addr_lo); in ath11k_pci_alloc_msi()
462 &ab->pci.msi.addr_hi); in ath11k_pci_alloc_msi()
464 ab->pci.msi.addr_hi = 0; in ath11k_pci_alloc_msi()
467 ath11k_dbg(ab, ATH11K_DBG_PCI, "msi base data is %d\n", ab->pci.msi.ep_base_data); in ath11k_pci_alloc_msi()
489 ath11k_err(ab_pci->ab, "msi_desc is NULL!\n"); in ath11k_pci_config_msi_data()
494 ab_pci->ab->pci.msi.ep_base_data = msi_desc->msg.data; in ath11k_pci_config_msi_data()
496 ath11k_dbg(ab_pci->ab, ATH11K_DBG_PCI, "after request_irq msi_ep_base_data %d\n", in ath11k_pci_config_msi_data()
497 ab_pci->ab->pci.msi.ep_base_data); in ath11k_pci_config_msi_data()
504 struct ath11k_base *ab = ab_pci->ab; in ath11k_pci_claim() local
510 ath11k_err(ab, "pci device id mismatch: 0x%x 0x%x\n", in ath11k_pci_claim()
518 ath11k_err(ab, "failed to assign pci resource: %d\n", ret); in ath11k_pci_claim()
524 ath11k_err(ab, "failed to enable pci device: %d\n", ret); in ath11k_pci_claim()
530 ath11k_err(ab, "failed to request pci region: %d\n", ret); in ath11k_pci_claim()
537 ath11k_err(ab, "failed to set pci dma mask to %d: %d\n", in ath11k_pci_claim()
547 ath11k_err(ab, "failed to set pci coherent dma mask to %d: %d\n", in ath11k_pci_claim()
554 ab->mem_len = pci_resource_len(pdev, ATH11K_PCI_BAR_NUM); in ath11k_pci_claim()
555 ab->mem = pci_iomap(pdev, ATH11K_PCI_BAR_NUM, 0); in ath11k_pci_claim()
556 if (!ab->mem) { in ath11k_pci_claim()
557 ath11k_err(ab, "failed to map pci bar %d\n", ATH11K_PCI_BAR_NUM); in ath11k_pci_claim()
562 ab->mem_ce = ab->mem; in ath11k_pci_claim()
564 ath11k_dbg(ab, ATH11K_DBG_BOOT, "pci_mem 0x%p\n", ab->mem); in ath11k_pci_claim()
577 struct ath11k_base *ab = ab_pci->ab; in ath11k_pci_free_region() local
580 pci_iounmap(pci_dev, ab->mem); in ath11k_pci_free_region()
581 ab->mem = NULL; in ath11k_pci_free_region()
589 struct ath11k_base *ab = ab_pci->ab; in ath11k_pci_aspm_disable() local
594 ath11k_dbg(ab, ATH11K_DBG_PCI, "link_ctl 0x%04x L0s %d L1 %d\n", in ath11k_pci_aspm_disable()
616 static int ath11k_pci_coredump_calculate_size(struct ath11k_base *ab, u32 *dump_seg_sz) in ath11k_pci_coredump_calculate_size() argument
618 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_coredump_calculate_size()
629 ath11k_err(ab, "No RDDM dump found\n"); in ath11k_pci_coredump_calculate_size()
651 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath11k_pci_coredump_calculate_size()
652 mem_type = ath11k_coredump_get_dump_type(ab->qmi.target_mem[i].type); in ath11k_pci_coredump_calculate_size()
658 ath11k_dbg(ab, ATH11K_DBG_PCI, in ath11k_pci_coredump_calculate_size()
660 ab->qmi.target_mem[i].type); in ath11k_pci_coredump_calculate_size()
664 if (!ab->qmi.target_mem[i].anyaddr) in ath11k_pci_coredump_calculate_size()
667 dump_seg_sz[mem_type] += ab->qmi.target_mem[i].size; in ath11k_pci_coredump_calculate_size()
683 static void ath11k_pci_coredump_download(struct ath11k_base *ab) in ath11k_pci_coredump_download() argument
685 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_coredump_download()
699 len = ath11k_pci_coredump_calculate_size(ab, dump_seg_sz); in ath11k_pci_coredump_download()
701 ath11k_warn(ab, "No crash dump data found for devcoredump"); in ath11k_pci_coredump_download()
713 ab->dump_data = buf; in ath11k_pci_coredump_download()
714 ab->ath11k_coredump_len = len; in ath11k_pci_coredump_download()
715 file_data = ab->dump_data; in ath11k_pci_coredump_download()
720 file_data->qrtr_id = cpu_to_le32(ab_pci->ab->qmi.service_ins_id); in ath11k_pci_coredump_download()
766 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath11k_pci_coredump_download()
768 (ab->qmi.target_mem[i].type); in ath11k_pci_coredump_download()
773 if (!ab->qmi.target_mem[i].anyaddr) { in ath11k_pci_coredump_download()
774 ath11k_dbg(ab, ATH11K_DBG_PCI, in ath11k_pci_coredump_download()
776 ab->qmi.target_mem[i].type); in ath11k_pci_coredump_download()
785 memcpy_fromio(buf, ab->qmi.target_mem[i].iaddr, in ath11k_pci_coredump_download()
786 ab->qmi.target_mem[i].size); in ath11k_pci_coredump_download()
788 buf += ab->qmi.target_mem[i].size; in ath11k_pci_coredump_download()
792 queue_work(ab->workqueue, &ab->dump_work); in ath11k_pci_coredump_download()
796 static int ath11k_pci_power_up(struct ath11k_base *ab) in ath11k_pci_power_up() argument
798 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_power_up()
802 clear_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags); in ath11k_pci_power_up()
803 ath11k_pci_sw_reset(ab_pci->ab, true); in ath11k_pci_power_up()
814 ath11k_err(ab, "failed to start mhi: %d\n", ret); in ath11k_pci_power_up()
818 if (ab->hw_params.static_window_map) in ath11k_pci_power_up()
824 static void ath11k_pci_power_down(struct ath11k_base *ab, bool is_suspend) in ath11k_pci_power_down() argument
826 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_power_down()
831 ath11k_pci_force_wake(ab_pci->ab); in ath11k_pci_power_down()
836 clear_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags); in ath11k_pci_power_down()
837 ath11k_pci_sw_reset(ab_pci->ab, false); in ath11k_pci_power_down()
840 static int ath11k_pci_hif_suspend(struct ath11k_base *ab) in ath11k_pci_hif_suspend() argument
842 struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); in ath11k_pci_hif_suspend()
847 static int ath11k_pci_hif_resume(struct ath11k_base *ab) in ath11k_pci_hif_resume() argument
849 struct ath11k_pci *ar_pci = ath11k_pci_priv(ab); in ath11k_pci_hif_resume()
854 static void ath11k_pci_hif_ce_irq_enable(struct ath11k_base *ab) in ath11k_pci_hif_ce_irq_enable() argument
856 ath11k_pcic_ce_irqs_enable(ab); in ath11k_pci_hif_ce_irq_enable()
859 static void ath11k_pci_hif_ce_irq_disable(struct ath11k_base *ab) in ath11k_pci_hif_ce_irq_disable() argument
861 ath11k_pcic_ce_irq_disable_sync(ab); in ath11k_pci_hif_ce_irq_disable()
864 static int ath11k_pci_start(struct ath11k_base *ab) in ath11k_pci_start() argument
866 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_start()
871 if (test_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags)) in ath11k_pci_start()
874 ath11k_info(ab, "leaving PCI ASPM disabled to avoid MHI M2 problems\n"); in ath11k_pci_start()
876 ath11k_pcic_start(ab); in ath11k_pci_start()
904 static void ath11k_pci_read_hw_version(struct ath11k_base *ab, u32 *major, u32 *minor) in ath11k_pci_read_hw_version() argument
908 soc_hw_version = ath11k_pcic_read32(ab, TCSR_SOC_HW_VERSION); in ath11k_pci_read_hw_version()
914 ath11k_dbg(ab, ATH11K_DBG_PCI, "tcsr_soc_hw_version major %d minor %d\n", in ath11k_pci_read_hw_version()
921 if (test_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab_pci->ab->dev_flags)) in ath11k_pci_set_irq_affinity_hint()
930 struct ath11k_base *ab; in ath11k_pci_probe() local
936 ab = ath11k_core_alloc(&pdev->dev, sizeof(*ab_pci), ATH11K_BUS_PCI); in ath11k_pci_probe()
938 if (!ab) { in ath11k_pci_probe()
943 ab->dev = &pdev->dev; in ath11k_pci_probe()
944 pci_set_drvdata(pdev, ab); in ath11k_pci_probe()
945 ab_pci = ath11k_pci_priv(ab); in ath11k_pci_probe()
947 ab_pci->ab = ab; in ath11k_pci_probe()
949 ab->hif.ops = &ath11k_pci_hif_ops; in ath11k_pci_probe()
950 ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; in ath11k_pci_probe()
951 pci_set_drvdata(pdev, ab); in ath11k_pci_probe()
958 if (of_property_present(ab->dev->of_node, "memory-region")) in ath11k_pci_probe()
959 set_bit(ATH11K_FLAG_FIXED_MEM_RGN, &ab->dev_flags); in ath11k_pci_probe()
963 ath11k_err(ab, "failed to claim device: %d\n", ret); in ath11k_pci_probe()
967 ath11k_dbg(ab, ATH11K_DBG_BOOT, "pci probe %04x:%04x %04x:%04x\n", in ath11k_pci_probe()
971 ab->id.vendor = pdev->vendor; in ath11k_pci_probe()
972 ab->id.device = pdev->device; in ath11k_pci_probe()
973 ab->id.subsystem_vendor = pdev->subsystem_vendor; in ath11k_pci_probe()
974 ab->id.subsystem_device = pdev->subsystem_device; in ath11k_pci_probe()
978 ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qca6390); in ath11k_pci_probe()
980 ath11k_err(ab, "failed to register PCI ops: %d\n", ret); in ath11k_pci_probe()
984 ath11k_pci_read_hw_version(ab, &soc_hw_version_major, in ath11k_pci_probe()
988 ab->hw_rev = ATH11K_HW_QCA6390_HW20; in ath11k_pci_probe()
999 ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qcn9074); in ath11k_pci_probe()
1001 ath11k_err(ab, "failed to register PCI ops: %d\n", ret); in ath11k_pci_probe()
1004 ab->hw_rev = ATH11K_HW_QCN9074_HW10; in ath11k_pci_probe()
1007 ret = ath11k_pcic_register_pci_ops(ab, &ath11k_pci_ops_qca6390); in ath11k_pci_probe()
1009 ath11k_err(ab, "failed to register PCI ops: %d\n", ret); in ath11k_pci_probe()
1012 ab->id.bdf_search = ATH11K_BDF_SEARCH_BUS_AND_BOARD; in ath11k_pci_probe()
1013 ath11k_pci_read_hw_version(ab, &soc_hw_version_major, in ath11k_pci_probe()
1020 ab->hw_rev = ATH11K_HW_WCN6855_HW20; in ath11k_pci_probe()
1024 sub_version = ath11k_pcic_read32(ab, TCSR_SOC_HW_SUB_VER); in ath11k_pci_probe()
1025 ath11k_dbg(ab, ATH11K_DBG_PCI, "sub_version 0x%x\n", in ath11k_pci_probe()
1032 ab->hw_rev = ATH11K_HW_QCA2066_HW21; in ath11k_pci_probe()
1035 ab->hw_rev = ATH11K_HW_QCA6698AQ_HW21; in ath11k_pci_probe()
1038 ab->hw_rev = ATH11K_HW_WCN6855_HW21; in ath11k_pci_probe()
1061 ret = ath11k_pcic_init_msi_config(ab); in ath11k_pci_probe()
1063 ath11k_err(ab, "failed to init msi config: %d\n", ret); in ath11k_pci_probe()
1069 ath11k_err(ab, "failed to enable msi: %d\n", ret); in ath11k_pci_probe()
1073 ret = ath11k_core_pre_init(ab); in ath11k_pci_probe()
1079 ath11k_err(ab, "failed to set irq affinity %d\n", ret); in ath11k_pci_probe()
1085 ath11k_err(ab, "failed to register mhi: %d\n", ret); in ath11k_pci_probe()
1089 ret = ath11k_hal_srng_init(ab); in ath11k_pci_probe()
1093 ret = ath11k_ce_alloc_pipes(ab); in ath11k_pci_probe()
1095 ath11k_err(ab, "failed to allocate ce pipes: %d\n", ret); in ath11k_pci_probe()
1099 ath11k_pci_init_qmi_ce_config(ab); in ath11k_pci_probe()
1101 ret = ath11k_pcic_config_irq(ab); in ath11k_pci_probe()
1103 ath11k_err(ab, "failed to config irq: %d\n", ret); in ath11k_pci_probe()
1114 ath11k_err(ab, "failed to config msi_data: %d\n", ret); in ath11k_pci_probe()
1118 ret = ath11k_core_init(ab); in ath11k_pci_probe()
1120 ath11k_err(ab, "failed to init core: %d\n", ret); in ath11k_pci_probe()
1123 ath11k_qmi_fwreset_from_cold_boot(ab); in ath11k_pci_probe()
1129 ath11k_pcic_free_irq(ab); in ath11k_pci_probe()
1132 ath11k_ce_free_pipes(ab); in ath11k_pci_probe()
1135 ath11k_hal_srng_deinit(ab); in ath11k_pci_probe()
1150 ath11k_core_free(ab); in ath11k_pci_probe()
1157 struct ath11k_base *ab = pci_get_drvdata(pdev); in ath11k_pci_remove() local
1158 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_remove()
1162 if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { in ath11k_pci_remove()
1163 ath11k_pci_power_down(ab, false); in ath11k_pci_remove()
1164 ath11k_debugfs_soc_destroy(ab); in ath11k_pci_remove()
1165 ath11k_qmi_deinit_service(ab); in ath11k_pci_remove()
1166 ath11k_core_pm_notifier_unregister(ab); in ath11k_pci_remove()
1170 set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); in ath11k_pci_remove()
1172 cancel_work_sync(&ab->reset_work); in ath11k_pci_remove()
1173 cancel_work_sync(&ab->dump_work); in ath11k_pci_remove()
1174 ath11k_core_deinit(ab); in ath11k_pci_remove()
1177 ath11k_fw_destroy(ab); in ath11k_pci_remove()
1180 ath11k_pcic_free_irq(ab); in ath11k_pci_remove()
1184 ath11k_hal_srng_deinit(ab); in ath11k_pci_remove()
1185 ath11k_ce_free_pipes(ab); in ath11k_pci_remove()
1186 ath11k_core_free(ab); in ath11k_pci_remove()
1191 struct ath11k_base *ab = pci_get_drvdata(pdev); in ath11k_pci_shutdown() local
1192 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); in ath11k_pci_shutdown()
1195 ath11k_pci_power_down(ab, false); in ath11k_pci_shutdown()
1200 struct ath11k_base *ab = dev_get_drvdata(dev); in ath11k_pci_pm_suspend() local
1203 if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { in ath11k_pci_pm_suspend()
1204 ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot skipping pci suspend as qmi is not initialised\n"); in ath11k_pci_pm_suspend()
1208 ret = ath11k_core_suspend(ab); in ath11k_pci_pm_suspend()
1210 ath11k_warn(ab, "failed to suspend core: %d\n", ret); in ath11k_pci_pm_suspend()
1217 struct ath11k_base *ab = dev_get_drvdata(dev); in ath11k_pci_pm_resume() local
1220 if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { in ath11k_pci_pm_resume()
1221 ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot skipping pci resume as qmi is not initialised\n"); in ath11k_pci_pm_resume()
1225 ret = ath11k_core_resume(ab); in ath11k_pci_pm_resume()
1227 ath11k_warn(ab, "failed to resume core: %d\n", ret); in ath11k_pci_pm_resume()
1234 struct ath11k_base *ab = dev_get_drvdata(dev); in ath11k_pci_pm_suspend_late() local
1237 ret = ath11k_core_suspend_late(ab); in ath11k_pci_pm_suspend_late()
1239 ath11k_warn(ab, "failed to late suspend core: %d\n", ret); in ath11k_pci_pm_suspend_late()
1249 struct ath11k_base *ab = dev_get_drvdata(dev); in ath11k_pci_pm_resume_early() local
1252 ret = ath11k_core_resume_early(ab); in ath11k_pci_pm_resume_early()
1254 ath11k_warn(ab, "failed to early resume core: %d\n", ret); in ath11k_pci_pm_resume_early()