e1000e: 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 6ff68026 5f5c4bdb

+7 -2
+6 -2
drivers/net/e1000e/ethtool.c
··· 1713 1713 wol->supported = 0; 1714 1714 wol->wolopts = 0; 1715 1715 1716 - if (!(adapter->flags & FLAG_HAS_WOL)) 1716 + if (!(adapter->flags & FLAG_HAS_WOL) || 1717 + !device_can_wakeup(&adapter->pdev->dev)) 1717 1718 return; 1718 1719 1719 1720 wol->supported = WAKE_UCAST | WAKE_MCAST | ··· 1752 1751 if (wol->wolopts & WAKE_MAGICSECURE) 1753 1752 return -EOPNOTSUPP; 1754 1753 1755 - if (!(adapter->flags & FLAG_HAS_WOL)) 1754 + if (!(adapter->flags & FLAG_HAS_WOL) || 1755 + !device_can_wakeup(&adapter->pdev->dev)) 1756 1756 return wol->wolopts ? -EOPNOTSUPP : 0; 1757 1757 1758 1758 /* these settings will always override what we currently have */ ··· 1771 1769 adapter->wol |= E1000_WUFC_LNKC; 1772 1770 if (wol->wolopts & WAKE_ARP) 1773 1771 adapter->wol |= E1000_WUFC_ARP; 1772 + 1773 + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 1774 1774 1775 1775 return 0; 1776 1776 }
+1
drivers/net/e1000e/netdev.c
··· 4970 4970 4971 4971 /* initialize the wol settings based on the eeprom settings */ 4972 4972 adapter->wol = adapter->eeprom_wol; 4973 + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 4973 4974 4974 4975 /* reset the hardware with the new settings */ 4975 4976 e1000e_reset(adapter);