Lines Matching refs:bus

130 	dhd_bus_t	*bus;  member
202 static int dhdpcie_set_suspend_resume(dhd_bus_t *bus, bool state);
204 static int dhdpcie_resume_host_dev(dhd_bus_t *bus);
205 static int dhdpcie_suspend_host_dev(dhd_bus_t *bus);
238 static void dhdpcie_config_save_restore_coherent(dhd_bus_t *bus, bool state);
402 dhd_bus_get_tpoweron(dhd_bus_t *bus) in dhd_bus_get_tpoweron() argument
408 tpoweron_rc = dhdpcie_rc_access_cap(bus, PCIE_EXTCAP_ID_L1SS, in dhd_bus_get_tpoweron()
410 tpoweron_ep = dhdpcie_ep_access_cap(bus, PCIE_EXTCAP_ID_L1SS, in dhd_bus_get_tpoweron()
417 dhd_bus_set_tpoweron(dhd_bus_t *bus, uint16 tpoweron) in dhd_bus_set_tpoweron() argument
420 dhd_bus_get_tpoweron(bus); in dhd_bus_set_tpoweron()
423 dhdpcie_rc_access_cap(bus, PCIE_EXTCAP_ID_L1SS, in dhd_bus_set_tpoweron()
425 dhdpcie_ep_access_cap(bus, PCIE_EXTCAP_ID_L1SS, in dhd_bus_set_tpoweron()
428 dhd_bus_get_tpoweron(bus); in dhd_bus_set_tpoweron()
433 dhdpcie_chip_req_forced_tpoweron(dhd_bus_t *bus) in dhdpcie_chip_req_forced_tpoweron() argument
443 if (si_chipid(bus->sih) == BCM4377_CHIP_ID) { in dhdpcie_chip_req_forced_tpoweron()
472 bool dhdpcie_is_btop_chip(struct dhd_bus *bus) in dhdpcie_is_btop_chip() argument
488 dhd_bus_aspm_enable_dev(dhd_bus_t *bus, struct pci_dev *dev, bool enable) in dhd_bus_aspm_enable_dev() argument
495 device = (dev == bus->dev) ? "EP" : "RC"; in dhd_bus_aspm_enable_dev()
531 dhd_bus_is_rc_ep_aspm_capable(dhd_bus_t *bus) in dhd_bus_is_rc_ep_aspm_capable() argument
537 rc_aspm_cap = dhdpcie_access_cap(bus->rc_dev, PCIE_CAP_ID_EXP, PCIE_CAP_LINKCTRL_OFFSET, in dhd_bus_is_rc_ep_aspm_capable()
545 ep_aspm_cap = dhdpcie_access_cap(bus->dev, PCIE_CAP_ID_EXP, PCIE_CAP_LINKCTRL_OFFSET, in dhd_bus_is_rc_ep_aspm_capable()
556 dhd_bus_aspm_enable_rc_ep(dhd_bus_t *bus, bool enable) in dhd_bus_aspm_enable_rc_ep() argument
560 if (!bus->rc_ep_aspm_cap) { in dhd_bus_aspm_enable_rc_ep()
562 __FUNCTION__, bus->rc_ep_aspm_cap)); in dhd_bus_aspm_enable_rc_ep()
568 ret = dhd_bus_aspm_enable_dev(bus, bus->rc_dev, enable); in dhd_bus_aspm_enable_rc_ep()
569 ret = dhd_bus_aspm_enable_dev(bus, bus->dev, enable); in dhd_bus_aspm_enable_rc_ep()
572 ret = dhd_bus_aspm_enable_dev(bus, bus->dev, enable); in dhd_bus_aspm_enable_rc_ep()
573 ret = dhd_bus_aspm_enable_dev(bus, bus->rc_dev, enable); in dhd_bus_aspm_enable_rc_ep()
580 dhd_bus_l1ss_enable_dev(dhd_bus_t *bus, struct pci_dev *dev, bool enable) in dhd_bus_l1ss_enable_dev() argument
587 device = (dev == bus->dev) ? "EP" : "RC"; in dhd_bus_l1ss_enable_dev()
620 dhd_bus_is_rc_ep_l1ss_capable(dhd_bus_t *bus) in dhd_bus_is_rc_ep_l1ss_capable() argument
628 return rk_dhd_bus_is_rc_ep_l1ss_capable(bus); in dhd_bus_is_rc_ep_l1ss_capable()
632 rc_l1ss_cap = dhdpcie_access_cap(bus->rc_dev, PCIE_EXTCAP_ID_L1SS, in dhd_bus_is_rc_ep_l1ss_capable()
640 ep_l1ss_cap = dhdpcie_access_cap(bus->dev, PCIE_EXTCAP_ID_L1SS, in dhd_bus_is_rc_ep_l1ss_capable()
651 dhd_bus_l1ss_enable_rc_ep(dhd_bus_t *bus, bool enable) in dhd_bus_l1ss_enable_rc_ep() argument
655 if ((!bus->rc_ep_aspm_cap) || (!bus->rc_ep_l1ss_cap)) { in dhd_bus_l1ss_enable_rc_ep()
657 __FUNCTION__, bus->rc_ep_aspm_cap, bus->rc_ep_l1ss_cap)); in dhd_bus_l1ss_enable_rc_ep()
662 ret = dhd_bus_aspm_enable_rc_ep(bus, FALSE); in dhd_bus_l1ss_enable_rc_ep()
666 dhd_bus_l1ss_enable_dev(bus, bus->rc_dev, enable); in dhd_bus_l1ss_enable_rc_ep()
667 dhd_bus_l1ss_enable_dev(bus, bus->dev, enable); in dhd_bus_l1ss_enable_rc_ep()
670 dhd_bus_l1ss_enable_dev(bus, bus->dev, enable); in dhd_bus_l1ss_enable_rc_ep()
671 dhd_bus_l1ss_enable_dev(bus, bus->rc_dev, enable); in dhd_bus_l1ss_enable_rc_ep()
676 dhd_bus_aspm_enable_rc_ep(bus, TRUE); in dhd_bus_l1ss_enable_rc_ep()
681 dhd_bus_aer_config(dhd_bus_t *bus) in dhd_bus_aer_config() argument
686 val = dhdpcie_ep_access_cap(bus, PCIE_ADVERRREP_CAPID, in dhd_bus_aer_config()
690 dhdpcie_ep_access_cap(bus, PCIE_ADVERRREP_CAPID, in dhd_bus_aer_config()
698 val = dhdpcie_rc_access_cap(bus, PCIE_ADVERRREP_CAPID, in dhd_bus_aer_config()
702 dhdpcie_rc_access_cap(bus, PCIE_ADVERRREP_CAPID, in dhd_bus_aer_config()
716 dhd_bus_t *bus = NULL; in dhdpcie_pm_suspend() local
722 bus = pch->bus; in dhdpcie_pm_suspend()
724 if (!bus) { in dhdpcie_pm_suspend()
728 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pm_suspend()
729 if (!DHD_BUS_BUSY_CHECK_IDLE(bus->dhd)) { in dhdpcie_pm_suspend()
731 __FUNCTION__, bus->dhd->dhd_bus_busy_state)); in dhdpcie_pm_suspend()
732 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pm_suspend()
735 DHD_BUS_BUSY_SET_SUSPEND_IN_PROGRESS(bus->dhd); in dhdpcie_pm_suspend()
736 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pm_suspend()
739 if (bus->dhd->up) in dhdpcie_pm_suspend()
740 ret = dhdpcie_set_suspend_resume(bus, TRUE); in dhdpcie_pm_suspend()
742 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pm_suspend()
743 DHD_BUS_BUSY_CLEAR_SUSPEND_IN_PROGRESS(bus->dhd); in dhdpcie_pm_suspend()
744 dhd_os_busbusy_wake(bus->dhd); in dhdpcie_pm_suspend()
747 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pm_suspend()
757 dhd_bus_t *bus = NULL; in dhdpcie_pm_prepare() local
759 if (!pch || !pch->bus) { in dhdpcie_pm_prepare()
763 bus = pch->bus; in dhdpcie_pm_prepare()
764 DHD_DISABLE_RUNTIME_PM(bus->dhd); in dhdpcie_pm_prepare()
765 bus->chk_pm = TRUE; in dhdpcie_pm_prepare()
775 dhd_bus_t *bus = NULL; in dhdpcie_pm_resume() local
781 bus = pch->bus; in dhdpcie_pm_resume()
783 if (!bus) { in dhdpcie_pm_resume()
787 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pm_resume()
788 DHD_BUS_BUSY_SET_RESUME_IN_PROGRESS(bus->dhd); in dhdpcie_pm_resume()
789 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pm_resume()
792 if (bus->dhd->up) in dhdpcie_pm_resume()
793 ret = dhdpcie_set_suspend_resume(bus, FALSE); in dhdpcie_pm_resume()
795 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pm_resume()
796 DHD_BUS_BUSY_CLEAR_RESUME_IN_PROGRESS(bus->dhd); in dhdpcie_pm_resume()
797 dhd_os_busbusy_wake(bus->dhd); in dhdpcie_pm_resume()
800 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pm_resume()
809 dhd_bus_t *bus = NULL; in dhdpcie_pm_complete() local
811 if (!pch || !pch->bus) { in dhdpcie_pm_complete()
815 bus = pch->bus; in dhdpcie_pm_complete()
816 DHD_ENABLE_RUNTIME_PM(bus->dhd); in dhdpcie_pm_complete()
817 bus->chk_pm = FALSE; in dhdpcie_pm_complete()
826 dhd_bus_t *bus = NULL; in dhdpcie_pci_suspend() local
832 bus = pch->bus; in dhdpcie_pci_suspend()
834 if (!bus) { in dhdpcie_pci_suspend()
840 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
841 if (!DHD_BUS_BUSY_CHECK_IDLE(bus->dhd)) { in dhdpcie_pci_suspend()
843 __FUNCTION__, bus->dhd->dhd_bus_busy_state)); in dhdpcie_pci_suspend()
845 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
852 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
853 if (DHD_BUS_BUSY_CHECK_IDLE(bus->dhd)) { in dhdpcie_pci_suspend()
859 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
862 if (!DHD_BUS_BUSY_CHECK_IDLE(bus->dhd)) { in dhdpcie_pci_suspend()
863 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
866 __FUNCTION__, i, bus->dhd->dhd_bus_busy_state)); in dhdpcie_pci_suspend()
870 DHD_BUS_BUSY_SET_SUSPEND_IN_PROGRESS(bus->dhd); in dhdpcie_pci_suspend()
871 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
874 dhd_cfg80211_suspend(bus->dhd); in dhdpcie_pci_suspend()
877 if (!bus->dhd->dongle_reset) in dhdpcie_pci_suspend()
878 ret = dhdpcie_set_suspend_resume(bus, TRUE); in dhdpcie_pci_suspend()
880 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
881 DHD_BUS_BUSY_CLEAR_SUSPEND_IN_PROGRESS(bus->dhd); in dhdpcie_pci_suspend()
882 dhd_os_busbusy_wake(bus->dhd); in dhdpcie_pci_suspend()
884 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_suspend()
894 dhd_bus_t *bus = NULL; in dhdpcie_pci_resume_early() local
898 bus = pch->bus; in dhdpcie_pci_resume_early()
900 if (!bus) { in dhdpcie_pci_resume_early()
909 if (bus->sih->buscorerev >= 64) { in dhdpcie_pci_resume_early()
911 volatile void *regsva = (volatile void *)bus->regs; in dhdpcie_pci_resume_early()
913 ftnctrl = pcie_corereg(bus->osh, regsva, in dhdpcie_pci_resume_early()
915 pmcsr = OSL_PCI_READ_CONFIG(bus->osh, PCIE_CFG_PMCSR, sizeof(pmcsr)); in dhdpcie_pci_resume_early()
925 pmcsr = OSL_PCI_READ_CONFIG(bus->osh, PCIE_CFG_PMCSR, sizeof(pmcsr)); in dhdpcie_pci_resume_early()
945 dhd_bus_t *bus = NULL; in dhdpcie_pci_resume() local
950 bus = pch->bus; in dhdpcie_pci_resume()
952 if (!bus) { in dhdpcie_pci_resume()
956 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pci_resume()
957 DHD_BUS_BUSY_SET_RESUME_IN_PROGRESS(bus->dhd); in dhdpcie_pci_resume()
958 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_resume()
960 if (!bus->dhd->dongle_reset) in dhdpcie_pci_resume()
961 ret = dhdpcie_set_suspend_resume(bus, FALSE); in dhdpcie_pci_resume()
963 DHD_GENERAL_LOCK(bus->dhd, flags); in dhdpcie_pci_resume()
964 DHD_BUS_BUSY_CLEAR_RESUME_IN_PROGRESS(bus->dhd); in dhdpcie_pci_resume()
965 dhd_os_busbusy_wake(bus->dhd); in dhdpcie_pci_resume()
967 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhdpcie_pci_resume()
970 dhd_cfg80211_resume(bus->dhd); in dhdpcie_pci_resume()
979 dhdpcie_set_suspend_resume(dhd_bus_t *bus, bool state, bool byint) in dhdpcie_set_suspend_resume() argument
981 dhdpcie_set_suspend_resume(dhd_bus_t *bus, bool state) in dhdpcie_set_suspend_resume()
986 ASSERT(bus && !bus->dhd->dongle_reset); in dhdpcie_set_suspend_resume()
990 if (state == TRUE && dhd_os_check_wakelock_all(bus->dhd)) { in dhdpcie_set_suspend_resume()
993 mutex_lock(&bus->pm_lock); in dhdpcie_set_suspend_resume()
999 if (bus->dhd->busstate == DHD_BUS_DOWN) { in dhdpcie_set_suspend_resume()
1000 ret = dhdpcie_pci_suspend_resume(bus, state); in dhdpcie_set_suspend_resume()
1002 mutex_unlock(&bus->pm_lock); in dhdpcie_set_suspend_resume()
1007 ret = dhdpcie_bus_suspend(bus, state, byint); in dhdpcie_set_suspend_resume()
1009 ret = dhdpcie_bus_suspend(bus, state); in dhdpcie_set_suspend_resume()
1028 mutex_unlock(&bus->pm_lock); in dhdpcie_set_suspend_resume()
1039 dhd_bus_t *bus = NULL; in dhdpcie_pm_runtime_suspend() local
1045 bus = pch->bus; in dhdpcie_pm_runtime_suspend()
1049 if (atomic_read(&bus->dhd->block_bus)) in dhdpcie_pm_runtime_suspend()
1052 dhd_netif_stop_queue(bus); in dhdpcie_pm_runtime_suspend()
1053 atomic_set(&bus->dhd->block_bus, TRUE); in dhdpcie_pm_runtime_suspend()
1060 atomic_set(&bus->dhd->block_bus, FALSE); in dhdpcie_pm_runtime_suspend()
1061 dhd_bus_start_queue(bus); in dhdpcie_pm_runtime_suspend()
1070 dhd_bus_t *bus = pch->bus; in dhdpcie_pm_runtime_resume() local
1074 if (atomic_read(&bus->dhd->block_bus)) in dhdpcie_pm_runtime_resume()
1087 dhd_bus_t *bus = NULL; in dhdpcie_pm_system_suspend_noirq() local
1095 bus = pch->bus; in dhdpcie_pm_system_suspend_noirq()
1097 if (atomic_read(&bus->dhd->block_bus)) in dhdpcie_pm_system_suspend_noirq()
1100 dhd_netif_stop_queue(bus); in dhdpcie_pm_system_suspend_noirq()
1101 atomic_set(&bus->dhd->block_bus, TRUE); in dhdpcie_pm_system_suspend_noirq()
1106 dhd_bus_start_queue(bus); in dhdpcie_pm_system_suspend_noirq()
1107 atomic_set(&bus->dhd->block_bus, FALSE); in dhdpcie_pm_system_suspend_noirq()
1117 dhd_bus_t *bus = NULL; in dhdpcie_pm_system_resume_noirq() local
1123 bus = pch->bus; in dhdpcie_pm_system_resume_noirq()
1129 atomic_set(&bus->dhd->block_bus, FALSE); in dhdpcie_pm_system_resume_noirq()
1130 dhd_bus_start_queue(bus); in dhdpcie_pm_system_resume_noirq()
1131 pm_runtime_mark_last_busy(dhd_bus_to_dev(bus)); in dhdpcie_pm_system_resume_noirq()
1142 dhdpcie_suspend_dump_cfgregs(struct dhd_bus *bus, char *suspend_state) in dhdpcie_suspend_dump_cfgregs() argument
1149 dhd_pcie_config_read(bus, in dhdpcie_suspend_dump_cfgregs()
1152 dhd_pcie_config_read(bus, in dhdpcie_suspend_dump_cfgregs()
1155 dhd_pcie_config_read(bus, in dhdpcie_suspend_dump_cfgregs()
1158 dhd_pcie_config_read(bus, in dhdpcie_suspend_dump_cfgregs()
1166 dhd_bus_t *bus = pch->bus; in dhdpcie_suspend_dev() local
1169 if (bus->is_linkdown) { in dhdpcie_suspend_dev()
1189 dhdpcie_suspend_dump_cfgregs(bus, "BEFORE_EP_SUSPEND"); in dhdpcie_suspend_dev()
1191 dhd_dpc_tasklet_kill(bus->dhd); in dhdpcie_suspend_dev()
1209 dhdpcie_suspend_dump_cfgregs(bus, "AFTER_EP_SUSPEND"); in dhdpcie_suspend_dev()
1214 int bcmpcie_get_total_wake(struct dhd_bus *bus) in bcmpcie_get_total_wake() argument
1216 dhdpcie_info_t *pch = pci_get_drvdata(bus->dev); in bcmpcie_get_total_wake()
1221 int bcmpcie_set_get_wake(struct dhd_bus *bus, int flag) in bcmpcie_set_get_wake() argument
1223 dhdpcie_info_t *pch = pci_get_drvdata(bus->dev); in bcmpcie_set_get_wake()
1252 OSL_PCI_WRITE_CONFIG(pch->bus->osh, PCI_BAR1_WIN, 4, pch->bus->curr_bar1_win); in dhdpcie_resume_dev()
1255 if (dhdpcie_chip_req_forced_tpoweron(pch->bus)) { in dhdpcie_resume_dev()
1256 dhd_bus_set_tpoweron(pch->bus, tpoweron_scale); in dhdpcie_resume_dev()
1271 dhdpcie_suspend_dump_cfgregs(pch->bus, "AFTER_EP_RESUME"); in dhdpcie_resume_dev()
1290 static int dhdpcie_resume_host_dev(dhd_bus_t *bus) in dhdpcie_resume_host_dev() argument
1294 bcmerror = dhdpcie_start_host_dev(bus); in dhdpcie_resume_host_dev()
1298 bus->is_linkdown = 1; in dhdpcie_resume_host_dev()
1301 bus->no_cfg_restore = 1; in dhdpcie_resume_host_dev()
1309 static int dhdpcie_suspend_host_dev(dhd_bus_t *bus) in dhdpcie_suspend_host_dev() argument
1319 if (bus->rc_dev) { in dhdpcie_suspend_host_dev()
1320 pci_save_state(bus->rc_dev); in dhdpcie_suspend_host_dev()
1326 bcmerror = dhdpcie_stop_host_dev(bus); in dhdpcie_suspend_host_dev()
1331 dhdpcie_set_master_and_d0_pwrstate(dhd_bus_t *bus) in dhdpcie_set_master_and_d0_pwrstate() argument
1334 pci_set_master(bus->dev); in dhdpcie_set_master_and_d0_pwrstate()
1335 err = pci_set_power_state(bus->dev, PCI_D0); in dhdpcie_set_master_and_d0_pwrstate()
1343 dhdpcie_rc_config_read(dhd_bus_t *bus, uint offset) in dhdpcie_rc_config_read() argument
1346 if (bus->rc_dev) { in dhdpcie_rc_config_read()
1347 pci_read_config_dword(bus->rc_dev, offset, &val); in dhdpcie_rc_config_read()
1425 dhdpcie_rc_access_cap(dhd_bus_t *bus, int cap, uint offset, bool is_ext, bool is_write, in dhdpcie_rc_access_cap() argument
1428 if (!(bus->rc_dev)) { in dhdpcie_rc_access_cap()
1434 return dhdpcie_access_cap(bus->rc_dev, cap, offset, is_ext, is_write, writeval); in dhdpcie_rc_access_cap()
1438 dhdpcie_ep_access_cap(dhd_bus_t *bus, int cap, uint offset, bool is_ext, bool is_write, in dhdpcie_ep_access_cap() argument
1441 if (!(bus->dev)) { in dhdpcie_ep_access_cap()
1446 return dhdpcie_access_cap(bus->dev, cap, offset, is_ext, is_write, writeval); in dhdpcie_ep_access_cap()
1453 uint32 dhd_debug_get_rc_linkcap(dhd_bus_t *bus) in dhd_debug_get_rc_linkcap() argument
1456 linkcap = dhdpcie_rc_access_cap(bus, PCIE_CAP_ID_EXP, in dhd_debug_get_rc_linkcap()
1462 static void dhdpcie_config_save_restore_coherent(dhd_bus_t *bus, bool state) in dhdpcie_config_save_restore_coherent() argument
1464 if (bus->coreid == ARMCA7_CORE_ID) { in dhdpcie_config_save_restore_coherent()
1467 bus->coherent_state = dhdpcie_bus_cfg_read_dword(bus, in dhdpcie_config_save_restore_coherent()
1470 uint32 val = (dhdpcie_bus_cfg_read_dword(bus, PCIE_CFG_SUBSYSTEM_CONTROL, in dhdpcie_config_save_restore_coherent()
1471 4) & ~PCIE_BARCOHERENTACCEN_MASK) | bus->coherent_state; in dhdpcie_config_save_restore_coherent()
1472 dhdpcie_bus_cfg_write_dword(bus, PCIE_CFG_SUBSYSTEM_CONTROL, 4, val); in dhdpcie_config_save_restore_coherent()
1477 int dhdpcie_pci_suspend_resume(dhd_bus_t *bus, bool state) in dhdpcie_pci_suspend_resume() argument
1481 struct pci_dev *dev = bus->dev; in dhdpcie_pci_suspend_resume()
1484 dhdpcie_config_save_restore_coherent(bus, state); in dhdpcie_pci_suspend_resume()
1486 dhdpcie_pme_active(bus->osh, state); in dhdpcie_pci_suspend_resume()
1490 dhdpcie_suspend_host_dev(bus); in dhdpcie_pci_suspend_resume()
1493 rc = dhdpcie_resume_host_dev(bus); in dhdpcie_pci_suspend_resume()
1496 if (PCIECTO_ENAB(bus)) { in dhdpcie_pci_suspend_resume()
1500 dhdpcie_cto_cfg_init(bus, TRUE); in dhdpcie_pci_suspend_resume()
1502 if (PCIE_ENUM_RESET_WAR_ENAB(bus->sih->buscorerev)) { in dhdpcie_pci_suspend_resume()
1503 dhdpcie_ssreset_dis_enum_rst(bus); in dhdpcie_pci_suspend_resume()
1506 dhdpcie_pme_active(bus->osh, state); in dhdpcie_pci_suspend_resume()
1509 dhdpcie_config_save_restore_coherent(bus, state); in dhdpcie_pci_suspend_resume()
1512 if (bus->is_linkdown || in dhdpcie_pci_suspend_resume()
1513 bus->dhd->req_hang_type == HANG_REASON_PCIE_RC_LINK_UP_FAIL) in dhdpcie_pci_suspend_resume()
1515 if (bus->is_linkdown) in dhdpcie_pci_suspend_resume()
1518 bus->dhd->hang_reason = HANG_REASON_PCIE_RC_LINK_UP_FAIL; in dhdpcie_pci_suspend_resume()
1519 dhd_os_send_hang_message(bus->dhd); in dhdpcie_pci_suspend_resume()
1553 bus_for_each_dev(dhdpcie_driver.driver.bus, NULL, &error, dhdpcie_device_scan); in dhdpcie_bus_register()
1591 "(good PCI location)\n", pdev->bus->number, in dhdpcie_pci_probe()
1649 dhd_bus_t *bus = NULL; in dhdpcie_pci_remove() local
1656 bus = pch->bus; in dhdpcie_pci_remove()
1664 if (bus) { in dhdpcie_pci_remove()
1667 msm_pcie_deregister_event(&bus->pcie_event); in dhdpcie_pci_remove()
1670 exynos_pcie_deregister_event(&bus->pcie_event); in dhdpcie_pci_remove()
1674 bus->rc_dev = NULL; in dhdpcie_pci_remove()
1676 dhdpcie_bus_release(bus); in dhdpcie_pci_remove()
1749 dhd_bus_t *bus = dhdpcie_info->bus; in dhdpcie_request_irq() local
1750 struct pci_dev *pdev = dhdpcie_info->bus->dev; in dhdpcie_request_irq()
1753 if (!bus->irq_registered) { in dhdpcie_request_irq()
1757 if (bus->d2h_intr_method == PCIE_MSI) { in dhdpcie_request_irq()
1761 bus->d2h_intr_method = PCIE_INTX; in dhdpcie_request_irq()
1765 if (bus->d2h_intr_method == PCIE_MSI) in dhdpcie_request_irq()
1771 dhdpcie_info->pciname, bus); in dhdpcie_request_irq()
1774 if (bus->d2h_intr_method == PCIE_MSI) { in dhdpcie_request_irq()
1780 bus->irq_registered = TRUE; in dhdpcie_request_irq()
1786 host_irq_disabled = dhdpcie_irq_disabled(bus); in dhdpcie_request_irq()
1790 dhdpcie_enable_irq(bus); in dhdpcie_request_irq()
1802 dhdpcie_get_pcieirq(struct dhd_bus *bus, unsigned int *irq) in dhdpcie_get_pcieirq() argument
1804 struct pci_dev *pdev = bus->dev; in dhdpcie_get_pcieirq()
1960 void dhdpcie_dump_resource(dhd_bus_t *bus) in dhdpcie_dump_resource() argument
1964 if (bus == NULL) { in dhdpcie_dump_resource()
1969 if (bus->dev == NULL) { in dhdpcie_dump_resource()
1974 pch = pci_get_drvdata(bus->dev); in dhdpcie_dump_resource()
1982 __FUNCTION__, pch->regs, pci_resource_start(bus->dev, 0), in dhdpcie_dump_resource()
1987 __FUNCTION__, pch->tcm, pci_resource_start(bus->dev, 2), in dhdpcie_dump_resource()
2001 dhd_bus_t *bus = pch->bus; in dhdpcie_linkdown_cb() local
2002 if (bus) { in dhdpcie_linkdown_cb()
2003 dhd_pub_t *dhd = bus->dhd; in dhdpcie_linkdown_cb()
2008 bus->no_cfg_restore = 1; in dhdpcie_linkdown_cb()
2020 bus->is_linkdown = 1; in dhdpcie_linkdown_cb()
2038 dhd_bus_t *bus = NULL; in dhdpcie_init() local
2057 adapter = dhd_wifi_platform_get_adapter(PCI_BUS, pdev->bus->number, in dhdpcie_init()
2062 adapter->bus_num = pdev->bus->number; in dhdpcie_init()
2136 ret = dhdpcie_bus_attach(osh, &bus, dhdpcie_info->regs, dhdpcie_info->tcm, pdev, adapter); in dhdpcie_init()
2142 dhdpcie_info->bus = bus; in dhdpcie_init()
2143 bus->bar1_size = dhdpcie_info->bar1_size; in dhdpcie_init()
2144 bus->is_linkdown = 0; in dhdpcie_init()
2145 bus->no_bus_init = FALSE; in dhdpcie_init()
2146 bus->cto_triggered = 0; in dhdpcie_init()
2148 bus->rc_dev = NULL; in dhdpcie_init()
2151 if (bus->dev->bus) { in dhdpcie_init()
2153 bus->rc_dev = bus->dev->bus->self; in dhdpcie_init()
2154 if (bus->rc_dev) in dhdpcie_init()
2156 bus->rc_dev->vendor, bus->rc_dev->device, bus->rc_dev)); in dhdpcie_init()
2164 if (bus->rc_dev == NULL) { in dhdpcie_init()
2165 bus->rc_dev = pci_get_device(PCIE_RC_VENDOR_ID, PCIE_RC_DEVICE_ID, NULL); in dhdpcie_init()
2167 PCIE_RC_VENDOR_ID, PCIE_RC_DEVICE_ID, bus->rc_dev)); in dhdpcie_init()
2170 bus->rc_ep_aspm_cap = dhd_bus_is_rc_ep_aspm_capable(bus); in dhdpcie_init()
2171 bus->rc_ep_l1ss_cap = dhd_bus_is_rc_ep_l1ss_capable(bus); in dhdpcie_init()
2173 __FUNCTION__, bus->rc_ep_aspm_cap, bus->rc_ep_l1ss_cap)); in dhdpcie_init()
2176 if (dhdpcie_chip_req_forced_tpoweron(bus)) { in dhdpcie_init()
2177 dhd_bus_set_tpoweron(bus, tpoweron_scale); in dhdpcie_init()
2184 brcm_pcie_wake.data = bus; in dhdpcie_init()
2188 bus->dhd->dongle_isolation = TRUE; in dhdpcie_init()
2192 bus->pcie_event.events = MSM_PCIE_EVENT_LINKDOWN; in dhdpcie_init()
2193 bus->pcie_event.user = pdev; in dhdpcie_init()
2194 bus->pcie_event.mode = MSM_PCIE_TRIGGER_CALLBACK; in dhdpcie_init()
2195 bus->pcie_event.callback = dhdpcie_linkdown_cb; in dhdpcie_init()
2196 bus->pcie_event.options = MSM_PCIE_CONFIG_NO_RECOVERY; in dhdpcie_init()
2197 msm_pcie_register_event(&bus->pcie_event); in dhdpcie_init()
2198 bus->no_cfg_restore = FALSE; in dhdpcie_init()
2201 bus->pcie_event.events = EXYNOS_PCIE_EVENT_LINKDOWN; in dhdpcie_init()
2202 bus->pcie_event.user = pdev; in dhdpcie_init()
2203 bus->pcie_event.mode = EXYNOS_PCIE_TRIGGER_CALLBACK; in dhdpcie_init()
2204 bus->pcie_event.callback = dhdpcie_linkdown_cb; in dhdpcie_init()
2205 exynos_pcie_register_event(&bus->pcie_event); in dhdpcie_init()
2207 bus->read_shm_fail = FALSE; in dhdpcie_init()
2210 if (bus->intr) { in dhdpcie_init()
2213 bus->intr_enabled = FALSE; in dhdpcie_init()
2214 dhdpcie_bus_intr_disable(bus); in dhdpcie_init()
2221 bus->pollrate = 1; in dhdpcie_init()
2227 if (dhd_bus_download_firmware(bus, osh, NULL, NULL) < 0) { in dhdpcie_init()
2230 bus->nv_path = NULL; in dhdpcie_init()
2231 bus->fw_path = NULL; in dhdpcie_init()
2238 dhdpcie_bar1_window_switch_enab(bus); in dhdpcie_init()
2246 if (dhd_bus_start(bus->dhd)) { in dhdpcie_init()
2253 get_random_bytes(&bus->dhd->mac.octet[3], 3); in dhdpcie_init()
2255 bus->dhd->mac.octet[0] = 0; in dhdpcie_init()
2256 bus->dhd->mac.octet[1] = 0x90; in dhdpcie_init()
2257 bus->dhd->mac.octet[2] = 0x4C; in dhdpcie_init()
2262 if (dhd_attach_net(bus->dhd, TRUE)) { in dhdpcie_init()
2269 sec_pcie_set_use_ep_loaded(bus->rc_dev); in dhdpcie_init()
2274 atomic_set(&bus->dhd->block_bus, FALSE); in dhdpcie_init()
2287 if (bus) in dhdpcie_init()
2288 dhdpcie_bus_release(bus); in dhdpcie_init()
2324 dhdpcie_free_irq(dhd_bus_t *bus) in dhdpcie_free_irq() argument
2329 if (bus) { in dhdpcie_free_irq()
2330 pdev = bus->dev; in dhdpcie_free_irq()
2331 if (bus->irq_registered) { in dhdpcie_free_irq()
2338 free_irq(pdev->irq, bus); in dhdpcie_free_irq()
2339 bus->irq_registered = FALSE; in dhdpcie_free_irq()
2340 if (bus->d2h_intr_method == PCIE_MSI) { in dhdpcie_free_irq()
2372 dhd_bus_t *bus = (dhd_bus_t*)arg; in dhdpcie_isr() local
2373 bus->isr_entry_time = OSL_LOCALTIME_NS(); in dhdpcie_isr()
2374 if (!dhdpcie_bus_isr(bus)) { in dhdpcie_isr()
2377 bus->isr_exit_time = OSL_LOCALTIME_NS(); in dhdpcie_isr()
2382 dhdpcie_disable_irq_nosync(dhd_bus_t *bus) in dhdpcie_disable_irq_nosync() argument
2385 if ((bus == NULL) || (bus->dev == NULL)) { in dhdpcie_disable_irq_nosync()
2390 dev = bus->dev; in dhdpcie_disable_irq_nosync()
2396 dhdpcie_disable_irq(dhd_bus_t *bus) in dhdpcie_disable_irq() argument
2399 if ((bus == NULL) || (bus->dev == NULL)) { in dhdpcie_disable_irq()
2404 dev = bus->dev; in dhdpcie_disable_irq()
2410 dhdpcie_enable_irq(dhd_bus_t *bus) in dhdpcie_enable_irq() argument
2413 if ((bus == NULL) || (bus->dev == NULL)) { in dhdpcie_enable_irq()
2418 dev = bus->dev; in dhdpcie_enable_irq()
2424 dhdpcie_irq_disabled(dhd_bus_t *bus) in dhdpcie_irq_disabled() argument
2429 desc = irq_data_to_desc(irq_get_irq_data(bus->dev->irq)); in dhdpcie_irq_disabled()
2431 desc = irq_to_desc(bus->dev->irq); in dhdpcie_irq_disabled()
2442 dhdpcie_start_host_dev(dhd_bus_t *bus) in dhdpcie_start_host_dev() argument
2452 if (bus == NULL) { in dhdpcie_start_host_dev()
2456 if (bus->dev == NULL) { in dhdpcie_start_host_dev()
2465 if (bus->no_cfg_restore) { in dhdpcie_start_host_dev()
2468 ret = msm_pcie_pm_control(MSM_PCIE_RESUME, bus->dev->bus->number, in dhdpcie_start_host_dev()
2469 bus->dev, NULL, options); in dhdpcie_start_host_dev()
2470 if (bus->no_cfg_restore && !ret) { in dhdpcie_start_host_dev()
2471 msm_pcie_recover_config(bus->dev); in dhdpcie_start_host_dev()
2472 bus->no_cfg_restore = 0; in dhdpcie_start_host_dev()
2475 ret = msm_pcie_pm_control(MSM_PCIE_RESUME, bus->dev->bus->number, in dhdpcie_start_host_dev()
2476 bus->dev, NULL, 0); in dhdpcie_start_host_dev()
2494 dhdpcie_stop_host_dev(dhd_bus_t *bus) in dhdpcie_stop_host_dev() argument
2505 if (bus == NULL) { in dhdpcie_stop_host_dev()
2509 if (bus->dev == NULL) { in dhdpcie_stop_host_dev()
2518 if (bus->no_cfg_restore) { in dhdpcie_stop_host_dev()
2522 ret = msm_pcie_pm_control(MSM_PCIE_SUSPEND, bus->dev->bus->number, in dhdpcie_stop_host_dev()
2523 bus->dev, NULL, options); in dhdpcie_stop_host_dev()
2525 ret = msm_pcie_pm_control(MSM_PCIE_SUSPEND, bus->dev->bus->number, in dhdpcie_stop_host_dev()
2526 bus->dev, NULL, 0); in dhdpcie_stop_host_dev()
2542 dhdpcie_disable_device(dhd_bus_t *bus) in dhdpcie_disable_device() argument
2546 if (bus == NULL) { in dhdpcie_disable_device()
2550 if (bus->dev == NULL) { in dhdpcie_disable_device()
2554 if (pci_is_enabled(bus->dev)) in dhdpcie_disable_device()
2555 pci_disable_device(bus->dev); in dhdpcie_disable_device()
2561 dhdpcie_enable_device(dhd_bus_t *bus) in dhdpcie_enable_device() argument
2570 if (bus == NULL) { in dhdpcie_enable_device()
2574 if (bus->dev == NULL) { in dhdpcie_enable_device()
2579 pch = pci_get_drvdata(bus->dev); in dhdpcie_enable_device()
2589 pci_load_and_free_saved_state(bus->dev, &pch->default_state); in dhdpcie_enable_device()
2590 pch->default_state = pci_store_saved_state(bus->dev); in dhdpcie_enable_device()
2592 pci_load_saved_state(bus->dev, pch->default_state); in dhdpcie_enable_device()
2596 if (bus->dev->state_saved) { in dhdpcie_enable_device()
2598 pci_read_config_dword(bus->dev, PCI_CFG_VID, &vid); in dhdpcie_enable_device()
2599 saved_vid = bus->dev->saved_config_space[PCI_CFG_VID]; in dhdpcie_enable_device()
2603 bus->no_bus_init = TRUE; in dhdpcie_enable_device()
2606 bus->is_linkdown = 1; in dhdpcie_enable_device()
2609 bus->no_cfg_restore = TRUE; in dhdpcie_enable_device()
2617 pci_restore_state(bus->dev); in dhdpcie_enable_device()
2620 ret = pci_enable_device(bus->dev); in dhdpcie_enable_device()
2622 pci_disable_device(bus->dev); in dhdpcie_enable_device()
2624 pci_set_master(bus->dev); in dhdpcie_enable_device()
2631 dhdpcie_alloc_resource(dhd_bus_t *bus) in dhdpcie_alloc_resource() argument
2638 if (bus == NULL) { in dhdpcie_alloc_resource()
2643 if (bus->dev == NULL) { in dhdpcie_alloc_resource()
2648 dhdpcie_info = pci_get_drvdata(bus->dev); in dhdpcie_alloc_resource()
2654 bar0_addr = pci_resource_start(bus->dev, 0); /* Bar-0 mapped address */ in dhdpcie_alloc_resource()
2655 bar1_addr = pci_resource_start(bus->dev, 2); /* Bar-1 mapped address */ in dhdpcie_alloc_resource()
2658 bar1_size = pci_resource_len(bus->dev, 2); in dhdpcie_alloc_resource()
2673 bus->regs = dhdpcie_info->regs; in dhdpcie_alloc_resource()
2680 bus->regs = NULL; in dhdpcie_alloc_resource()
2684 bus->tcm = dhdpcie_info->tcm; in dhdpcie_alloc_resource()
2685 bus->bar1_size = dhdpcie_info->bar1_size; in dhdpcie_alloc_resource()
2699 dhdpcie_free_resource(dhd_bus_t *bus) in dhdpcie_free_resource() argument
2703 if (bus == NULL) { in dhdpcie_free_resource()
2708 if (bus->dev == NULL) { in dhdpcie_free_resource()
2713 dhdpcie_info = pci_get_drvdata(bus->dev); in dhdpcie_free_resource()
2719 if (bus->regs) { in dhdpcie_free_resource()
2721 bus->regs = NULL; in dhdpcie_free_resource()
2724 if (bus->tcm) { in dhdpcie_free_resource()
2726 bus->tcm = NULL; in dhdpcie_free_resource()
2731 dhdpcie_bus_request_irq(struct dhd_bus *bus) in dhdpcie_bus_request_irq() argument
2736 if (bus == NULL) { in dhdpcie_bus_request_irq()
2741 if (bus->dev == NULL) { in dhdpcie_bus_request_irq()
2746 dhdpcie_info = pci_get_drvdata(bus->dev); in dhdpcie_bus_request_irq()
2752 if (bus->intr) { in dhdpcie_bus_request_irq()
2755 bus->intr_enabled = FALSE; in dhdpcie_bus_request_irq()
2756 dhdpcie_bus_intr_disable(bus); in dhdpcie_bus_request_irq()
2785 int dhdpcie_get_oob_irq_status(struct dhd_bus *bus) in dhdpcie_get_oob_irq_status() argument
2790 if (bus == NULL) { in dhdpcie_get_oob_irq_status()
2795 if (bus->dev == NULL) { in dhdpcie_get_oob_irq_status()
2800 pch = pci_get_drvdata(bus->dev); in dhdpcie_get_oob_irq_status()
2811 int dhdpcie_get_oob_irq_num(struct dhd_bus *bus) in dhdpcie_get_oob_irq_num() argument
2816 if (bus == NULL) { in dhdpcie_get_oob_irq_num()
2821 if (bus->dev == NULL) { in dhdpcie_get_oob_irq_num()
2826 pch = pci_get_drvdata(bus->dev); in dhdpcie_get_oob_irq_num()
2837 void dhdpcie_oob_intr_set(dhd_bus_t *bus, bool enable) in dhdpcie_oob_intr_set() argument
2843 if (bus == NULL) { in dhdpcie_oob_intr_set()
2848 if (bus->dev == NULL) { in dhdpcie_oob_intr_set()
2853 pch = pci_get_drvdata(bus->dev); in dhdpcie_oob_intr_set()
2865 bus->oob_intr_enable_count++; in dhdpcie_oob_intr_set()
2866 bus->last_oob_irq_enable_time = OSL_LOCALTIME_NS(); in dhdpcie_oob_intr_set()
2869 bus->oob_intr_disable_count++; in dhdpcie_oob_intr_set()
2870 bus->last_oob_irq_disable_time = OSL_LOCALTIME_NS(); in dhdpcie_oob_intr_set()
2884 dhd_bus_t *bus = (dhd_bus_t *)data; in wlan_oob_irq_isr() local
2886 bus->last_oob_irq_isr_time = OSL_LOCALTIME_NS(); in wlan_oob_irq_isr()
2893 dhd_bus_t *bus; in wlan_oob_irq() local
2894 bus = (dhd_bus_t *)data; in wlan_oob_irq()
2895 dhdpcie_oob_intr_set(bus, FALSE); in wlan_oob_irq()
2898 bus->last_oob_irq_thr_time = OSL_LOCALTIME_NS(); in wlan_oob_irq()
2901 bus->last_oob_irq_isr_time = OSL_LOCALTIME_NS(); in wlan_oob_irq()
2904 if (bus->dhd->up == 0) { in wlan_oob_irq()
2909 bus->oob_intr_count++; in wlan_oob_irq()
2913 if (bus->chk_pm) in wlan_oob_irq()
2916 bcmpcie_set_get_wake(bus, 1); in wlan_oob_irq()
2920 dhdpcie_runtime_bus_wake(bus->dhd, FALSE, wlan_oob_irq); in wlan_oob_irq()
2923 dhd_bus_wakeup_work(bus->dhd); in wlan_oob_irq()
2928 if (bus->dhd->up && DHD_CHK_BUS_IN_LPS(bus)) { in wlan_oob_irq()
2929 DHD_OS_OOB_IRQ_WAKE_LOCK_TIMEOUT(bus->dhd, OOB_WAKE_LOCK_TIMEOUT); in wlan_oob_irq()
2934 int dhdpcie_oob_intr_register(dhd_bus_t *bus) in dhdpcie_oob_intr_register() argument
2941 if (bus == NULL) { in dhdpcie_oob_intr_register()
2946 if (bus->dev == NULL) { in dhdpcie_oob_intr_register()
2951 pch = pci_get_drvdata(bus->dev); in dhdpcie_oob_intr_register()
2971 bus); in dhdpcie_oob_intr_register()
2975 bus); in dhdpcie_oob_intr_register()
3001 void dhdpcie_oob_intr_unregister(dhd_bus_t *bus) in dhdpcie_oob_intr_unregister() argument
3008 if (bus == NULL) { in dhdpcie_oob_intr_unregister()
3013 if (bus->dev == NULL) { in dhdpcie_oob_intr_unregister()
3018 pch = pci_get_drvdata(bus->dev); in dhdpcie_oob_intr_unregister()
3040 free_irq(dhdpcie_osinfo->oob_irq_num, bus); in dhdpcie_oob_intr_unregister()
3047 void dhdpcie_oob_init(dhd_bus_t *bus) in dhdpcie_oob_init() argument
3067 bus->oob_enabled = TRUE; in dhdpcie_oob_init()
3068 bus->oob_presuspend = FALSE; in dhdpcie_oob_init()
3071 bus->device_wake_state = TRUE; in dhdpcie_oob_init()
3072 dhd_bus_set_device_wake(bus, FALSE); in dhdpcie_oob_init()
3073 dhd_bus_doorbell_timeout_reset(bus); in dhdpcie_oob_init()
3078 dhd_oob_set_bt_reg_on(struct dhd_bus *bus, bool val) in dhd_oob_set_bt_reg_on() argument
3092 dhd_oob_get_bt_reg_on(struct dhd_bus *bus) in dhd_oob_get_bt_reg_on() argument
3115 dhd_os_oob_set_device_wake(struct dhd_bus *bus, bool val) in dhd_os_oob_set_device_wake() argument
3117 if (bus->device_wake_state != val) in dhd_os_oob_set_device_wake()
3121 if (bus->oob_enabled && !bus->oob_presuspend) in dhd_os_oob_set_device_wake()
3133 bus->device_wake_state = val; in dhd_os_oob_set_device_wake()
3139 dhd_os_ib_set_device_wake(struct dhd_bus *bus, bool val) in dhd_os_ib_set_device_wake() argument
3150 dhd_bus_t *bus; in dhd_runtimepm_state() local
3152 bus = dhd->bus; in dhd_runtimepm_state()
3155 bus->idlecount++; in dhd_runtimepm_state()
3167 if ((bus->idletime > 0) && (bus->idlecount >= bus->idletime)) { in dhd_runtimepm_state()
3168 bus->idlecount = 0; in dhd_runtimepm_state()
3170 !DHD_CHECK_CFG_IN_PROGRESS(dhd) && !dhd_os_check_wakelock_all(bus->dhd)) { in dhd_runtimepm_state()
3172 __FUNCTION__, bus->idletime, dhd_runtimepm_ms)); in dhd_runtimepm_state()
3173 bus->bus_wake = 0; in dhd_runtimepm_state()
3175 bus->runtime_resume_done = FALSE; in dhd_runtimepm_state()
3177 dhd_bus_stop_queue(bus); in dhd_runtimepm_state()
3180 if (dhdpcie_set_suspend_resume(bus, TRUE)) { in dhd_runtimepm_state()
3184 dhd_os_busbusy_wake(bus->dhd); in dhd_runtimepm_state()
3185 bus->runtime_resume_done = TRUE; in dhd_runtimepm_state()
3187 dhd_bus_start_queue(bus); in dhd_runtimepm_state()
3189 if (bus->dhd->rx_pending_due_to_rpm) { in dhd_runtimepm_state()
3194 dhd_schedule_delayed_dpc_on_dpc_cpu(bus->dhd, 0); in dhd_runtimepm_state()
3197 if (dhdpcie_irq_disabled(bus)) { in dhd_runtimepm_state()
3198 dhdpcie_enable_irq(bus); in dhd_runtimepm_state()
3200 bus->resume_intr_enable_count++; in dhd_runtimepm_state()
3204 wake_up(&bus->rpm_queue); in dhd_runtimepm_state()
3212 dhd_bus_start_queue(bus); in dhd_runtimepm_state()
3215 wait_event(bus->rpm_queue, bus->bus_wake); in dhd_runtimepm_state()
3222 dhdpcie_set_suspend_resume(bus, FALSE); in dhd_runtimepm_state()
3226 dhd_os_busbusy_wake(bus->dhd); in dhd_runtimepm_state()
3228 bus->runtime_resume_done = TRUE; in dhd_runtimepm_state()
3230 dhd_bus_start_queue(bus); in dhd_runtimepm_state()
3233 if (bus->dhd->rx_pending_due_to_rpm) { in dhd_runtimepm_state()
3237 bus->rpm_sched_dpc_time = OSL_LOCALTIME_NS(); in dhd_runtimepm_state()
3238 dhd_sched_dpc(bus->dhd); in dhd_runtimepm_state()
3242 if (dhdpcie_irq_disabled(bus)) { in dhd_runtimepm_state()
3243 dhdpcie_enable_irq(bus); in dhd_runtimepm_state()
3245 bus->resume_intr_enable_count++; in dhd_runtimepm_state()
3249 wake_up(&bus->rpm_queue); in dhd_runtimepm_state()
3272 bool dhd_runtime_bus_wake(dhd_bus_t *bus, bool wait, void *func_addr) in dhd_runtime_bus_wake() argument
3275 bus->idlecount = 0; in dhd_runtime_bus_wake()
3277 if (bus->dhd->up == FALSE) { in dhd_runtime_bus_wake()
3282 DHD_GENERAL_LOCK(bus->dhd, flags); in dhd_runtime_bus_wake()
3283 if (DHD_BUS_BUSY_CHECK_RPM_ALL(bus->dhd)) { in dhd_runtime_bus_wake()
3285 if (DHD_BUS_BUSY_CHECK_RPM_SUSPEND_IN_PROGRESS(bus->dhd) || in dhd_runtime_bus_wake()
3286 DHD_BUS_BUSY_CHECK_RPM_SUSPEND_DONE(bus->dhd)) { in dhd_runtime_bus_wake()
3287 bus->bus_wake = 1; in dhd_runtime_bus_wake()
3289 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhd_runtime_bus_wake()
3294 wake_up(&bus->rpm_queue); in dhd_runtime_bus_wake()
3296 } else if (DHD_BUS_BUSY_CHECK_RPM_RESUME_IN_PROGRESS(bus->dhd)) { in dhd_runtime_bus_wake()
3297 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhd_runtime_bus_wake()
3302 if (!wait_event_timeout(bus->rpm_queue, bus->runtime_resume_done, in dhd_runtime_bus_wake()
3314 DHD_GENERAL_UNLOCK(bus->dhd, flags); in dhd_runtime_bus_wake()
3321 dhd_bus_t *bus = dhdp->bus; in dhdpcie_runtime_bus_wake() local
3322 return dhd_runtime_bus_wake(bus, wait, func_addr); in dhdpcie_runtime_bus_wake()
3327 dhd_bus_t *bus = dhdp->bus; in dhdpcie_block_runtime_pm() local
3328 bus->idletime = 0; in dhdpcie_block_runtime_pm()
3333 dhd_bus_t *bus = dhdp->bus; in dhdpcie_is_resume_done() local
3334 return bus->runtime_resume_done; in dhdpcie_is_resume_done()
3338 struct device * dhd_bus_to_dev(dhd_bus_t *bus) in dhd_bus_to_dev() argument
3341 pdev = bus->dev; in dhd_bus_to_dev()
3380 sec_pcie_set_ep_driver_loaded(dhdp->bus->rc_dev, up); in dhd_bus_inform_ep_loaded_to_rc()
3387 dhd_bus_t *bus; in dhd_bus_check_driver_up() local
3391 bus = (dhd_bus_t *)g_dhd_bus; in dhd_bus_check_driver_up()
3392 if (!bus) { in dhd_bus_check_driver_up()
3397 dhdp = bus->dhd; in dhd_bus_check_driver_up()