| 89 | } |
| 90 | |
| 91 | static 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 | |
| 113 | void rt_pci_pme_active(struct rt_pci_device *pdev, rt_bool_t enable) |
| 114 | { |
no test coverage detected