e1000: Use device_set_wakeup_enable

Since dev->power.should_wakeup bit is used by the PCI core to
decide whether the device should wake up the system from sleep
states, set/unset this bit whenever WOL is enabled/disabled using
e1000_set_wol(). Accordingly, use device_can_wakeup() for checking
if wake-up is supported by the device.

Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by \"Rafael J. Wysocki\ and committed by David S. Miller de126489 6ff68026

+7 -2
+6 -2
drivers/net/e1000/e1000_ethtool.c
··· 1774 1774 1775 1775 /* this function will set ->supported = 0 and return 1 if wol is not 1776 1776 * supported by this hardware */ 1777 - if (e1000_wol_exclusion(adapter, wol)) 1777 + if (e1000_wol_exclusion(adapter, wol) || 1778 + !device_can_wakeup(&adapter->pdev->dev)) 1778 1779 return; 1779 1780 1780 1781 /* apply any specific unsupported masks here */ ··· 1812 1811 if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) 1813 1812 return -EOPNOTSUPP; 1814 1813 1815 - if (e1000_wol_exclusion(adapter, wol)) 1814 + if (e1000_wol_exclusion(adapter, wol) || 1815 + !device_can_wakeup(&adapter->pdev->dev)) 1816 1816 return wol->wolopts ? -EOPNOTSUPP : 0; 1817 1817 1818 1818 switch (hw->device_id) { ··· 1839 1837 adapter->wol |= E1000_WUFC_BC; 1840 1838 if (wol->wolopts & WAKE_MAGIC) 1841 1839 adapter->wol |= E1000_WUFC_MAG; 1840 + 1841 + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 1842 1842 1843 1843 return 0; 1844 1844 }
+1
drivers/net/e1000/e1000_main.c
··· 1179 1179 1180 1180 /* initialize the wol settings based on the eeprom settings */ 1181 1181 adapter->wol = adapter->eeprom_wol; 1182 + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 1182 1183 1183 1184 /* print bus type/speed/width info */ 1184 1185 DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ",