MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pci_pme_active

Function pci_pme_active

components/drivers/pci/pme.c:91–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static void pci_pme_active(struct rt_pci_device *pdev, rt_bool_t enable)
92{
93 rt_uint16_t pmcsr;
94
95 if (!pdev->pme_support)
96 {
97 return;
98 }
99
100 rt_pci_read_config_u16(pdev, pdev->pme_cap + PCIR_POWER_STATUS, &pmcsr);
101 /* Clear PME_Status by writing 1 to it and enable PME# */
102 pmcsr |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
103
104 if (!enable)
105 {
106 pmcsr &= ~PCIM_PSTAT_PMEENABLE;
107 }
108
109 rt_pci_write_config_u16(pdev, pdev->pme_cap + PCIR_POWER_STATUS, pmcsr);
110 pdev->pm_enabled = enable;
111}
112
113void rt_pci_pme_active(struct rt_pci_device *pdev, rt_bool_t enable)
114{

Callers 1

rt_pci_pme_activeFunction · 0.85

Calls 2

rt_pci_read_config_u16Function · 0.85
rt_pci_write_config_u16Function · 0.85

Tested by

no test coverage detected