aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-10-29 17:22:18 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-10-31 00:52:26 -0400
commitbc79fc8409b3dccbde072e8113cc1fb3fd876fc5 (patch)
tree35a507bd393e5df83b155af1aa2f4053ab9df3ae /drivers/net/e100.c
parent6b1abbaefa31b84cc02bf4006ba8a63393de1136 (diff)
e100: adapt to the reworked PCI PM
Adapt the e100 driver to the reworked PCI PM * Use the observation that it is sufficient to call pci_enable_wake() once, unless it fails Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Tested-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Frans Pop <elendil@planet.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
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);