aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r--drivers/net/e100.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index bb4b6e285245..084127fe0813 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2322,7 +2322,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2322{ 2322{
2323 struct nic *nic = netdev_priv(netdev); 2323 struct nic *nic = netdev_priv(netdev);
2324 2324
2325 if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) 2325 if ((wol->wolopts && wol->wolopts != WAKE_MAGIC) ||
2326 !device_can_wakeup(&nic->pdev->dev))
2326 return -EOPNOTSUPP; 2327 return -EOPNOTSUPP;
2327 2328
2328 if(wol->wolopts) 2329 if(wol->wolopts)
@@ -2330,6 +2331,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2330 else 2331 else
2331 nic->flags &= ~wol_magic; 2332 nic->flags &= ~wol_magic;
2332 2333
2334 device_set_wakeup_enable(&nic->pdev->dev, wol->wolopts);
2335
2333 e100_exec_cb(nic, NULL, e100_configure); 2336 e100_exec_cb(nic, NULL, e100_configure);
2334 2337
2335 return 0; 2338 return 0;
@@ -2733,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2733 2736
2734 /* Wol magic packet can be enabled from eeprom */ 2737 /* Wol magic packet can be enabled from eeprom */
2735 if((nic->mac >= mac_82558_D101_A4) && 2738 if((nic->mac >= mac_82558_D101_A4) &&
2736 (nic->eeprom[eeprom_id] & eeprom_id_wol)) 2739 (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
2737 nic->flags |= wol_magic; 2740 nic->flags |= wol_magic;
2741 device_set_wakeup_enable(&pdev->dev, true);
2742 }
2738 2743
2739 /* ack any pending wake events, disable PME */ 2744 /* ack any pending wake events, disable PME */
2740 pci_pme_active(pdev, false); 2745 pci_pme_active(pdev, false);
@@ -2793,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2793 pci_save_state(pdev); 2798 pci_save_state(pdev);
2794 2799
2795 if ((nic->flags & wol_magic) | e100_asf(nic)) { 2800 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2796 pci_enable_wake(pdev, PCI_D3hot, 1); 2801 if (pci_enable_wake(pdev, PCI_D3cold, true))
2797 pci_enable_wake(pdev, PCI_D3cold, 1); 2802 pci_enable_wake(pdev, PCI_D3hot, true);
2798 } else { 2803 } else {
2799 pci_enable_wake(pdev, PCI_D3hot, 0); 2804 pci_enable_wake(pdev, PCI_D3hot, false);
2800 pci_enable_wake(pdev, PCI_D3cold, 0);
2801 } 2805 }
2802 2806
2803 pci_disable_device(pdev); 2807 pci_disable_device(pdev);