pci.c (0847684cfc5f0e9f009919bfdcb041d60e19b856) pci.c (de3ef1eb1cd0cc3a75f7a3661e10ed827f370ab8)
1/*
2 * PCI Bus Services, see include/linux/pci.h for further explanation.
3 *
4 * Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
5 * David Mosberger-Tang
6 *
7 * Copyright 1997 -- 2000 Martin Mares <mj@ucw.cz>
8 */

--- 2091 unchanged lines hidden (view full) ---

2100 * Return true if the device itself is capable of generating wake-up events
2101 * (through the platform or using the native PCIe PME) or if the device supports
2102 * PME and one of its upstream bridges can generate wake-up events.
2103 */
2104bool pci_dev_run_wake(struct pci_dev *dev)
2105{
2106 struct pci_bus *bus = dev->bus;
2107
1/*
2 * PCI Bus Services, see include/linux/pci.h for further explanation.
3 *
4 * Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
5 * David Mosberger-Tang
6 *
7 * Copyright 1997 -- 2000 Martin Mares <mj@ucw.cz>
8 */

--- 2091 unchanged lines hidden (view full) ---

2100 * Return true if the device itself is capable of generating wake-up events
2101 * (through the platform or using the native PCIe PME) or if the device supports
2102 * PME and one of its upstream bridges can generate wake-up events.
2103 */
2104bool pci_dev_run_wake(struct pci_dev *dev)
2105{
2106 struct pci_bus *bus = dev->bus;
2107
2108 if (device_run_wake(&dev->dev))
2108 if (device_can_wakeup(&dev->dev))
2109 return true;
2110
2111 if (!dev->pme_support)
2112 return false;
2113
2114 /* PME-capable in principle, but not from the intended sleep state */
2115 if (!pci_pme_capable(dev, pci_target_state(dev)))
2116 return false;
2117
2118 while (bus->parent) {
2119 struct pci_dev *bridge = bus->self;
2120
2109 return true;
2110
2111 if (!dev->pme_support)
2112 return false;
2113
2114 /* PME-capable in principle, but not from the intended sleep state */
2115 if (!pci_pme_capable(dev, pci_target_state(dev)))
2116 return false;
2117
2118 while (bus->parent) {
2119 struct pci_dev *bridge = bus->self;
2120
2121 if (device_run_wake(&bridge->dev))
2121 if (device_can_wakeup(&bridge->dev))
2122 return true;
2123
2124 bus = bus->parent;
2125 }
2126
2127 /* We have reached the root bus. */
2128 if (bus->bridge)
2122 return true;
2123
2124 bus = bus->parent;
2125 }
2126
2127 /* We have reached the root bus. */
2128 if (bus->bridge)
2129 return device_run_wake(bus->bridge);
2129 return device_can_wakeup(bus->bridge);
2130
2131 return false;
2132}
2133EXPORT_SYMBOL_GPL(pci_dev_run_wake);
2134
2135/**
2136 * pci_dev_keep_suspended - Check if the device can stay in the suspended state.
2137 * @pci_dev: Device to check.

--- 3349 unchanged lines hidden ---
2130
2131 return false;
2132}
2133EXPORT_SYMBOL_GPL(pci_dev_run_wake);
2134
2135/**
2136 * pci_dev_keep_suspended - Check if the device can stay in the suspended state.
2137 * @pci_dev: Device to check.

--- 3349 unchanged lines hidden ---