]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From bc79fc8409b3dccbde072e8113cc1fb3fd876fc5 Mon Sep 17 00:00:00 2001 |
2 | From: Rafael J. Wysocki <rjw@sisk.pl> | |
3 | Date: Wed, 29 Oct 2008 14:22:18 -0700 | |
4 | Subject: [PATCH] e100: adapt to the reworked PCI PM | |
5 | References: bnc#504646 | |
6 | Acked-by: Brandon Philips <bphilips@suse.de> | |
7 | ||
8 | Adapt the e100 driver to the reworked PCI PM | |
9 | ||
10 | * Use the observation that it is sufficient to call pci_enable_wake() | |
11 | once, unless it fails | |
12 | ||
13 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | |
14 | Tested-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | |
15 | Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | |
16 | Cc: Jesse Barnes <jbarnes@virtuousgeek.org> | |
17 | Cc: Jeff Garzik <jeff@garzik.org> | |
18 | Cc: Frans Pop <elendil@planet.nl> | |
19 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
20 | Signed-off-by: Jeff Garzik <jgarzik@redhat.com> | |
21 | --- | |
22 | drivers/net/e100.c | 16 ++++++++++------ | |
23 | 1 files changed, 10 insertions(+), 6 deletions(-) | |
24 | ||
25 | diff --git a/drivers/net/e100.c b/drivers/net/e100.c | |
26 | index bb4b6e2..084127f 100644 | |
27 | --- a/drivers/net/e100.c | |
28 | +++ b/drivers/net/e100.c | |
29 | @@ -2322,7 +2322,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |
30 | { | |
31 | struct nic *nic = netdev_priv(netdev); | |
32 | ||
33 | - if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) | |
34 | + if ((wol->wolopts && wol->wolopts != WAKE_MAGIC) || | |
35 | + !device_can_wakeup(&nic->pdev->dev)) | |
36 | return -EOPNOTSUPP; | |
37 | ||
38 | if(wol->wolopts) | |
39 | @@ -2330,6 +2331,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |
40 | else | |
41 | nic->flags &= ~wol_magic; | |
42 | ||
43 | + device_set_wakeup_enable(&nic->pdev->dev, wol->wolopts); | |
44 | + | |
45 | e100_exec_cb(nic, NULL, e100_configure); | |
46 | ||
47 | return 0; | |
48 | @@ -2733,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |
49 | ||
50 | /* Wol magic packet can be enabled from eeprom */ | |
51 | if((nic->mac >= mac_82558_D101_A4) && | |
52 | - (nic->eeprom[eeprom_id] & eeprom_id_wol)) | |
53 | + (nic->eeprom[eeprom_id] & eeprom_id_wol)) { | |
54 | nic->flags |= wol_magic; | |
55 | + device_set_wakeup_enable(&pdev->dev, true); | |
56 | + } | |
57 | ||
58 | /* ack any pending wake events, disable PME */ | |
59 | pci_pme_active(pdev, false); | |
60 | @@ -2793,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |
61 | pci_save_state(pdev); | |
62 | ||
63 | if ((nic->flags & wol_magic) | e100_asf(nic)) { | |
64 | - pci_enable_wake(pdev, PCI_D3hot, 1); | |
65 | - pci_enable_wake(pdev, PCI_D3cold, 1); | |
66 | + if (pci_enable_wake(pdev, PCI_D3cold, true)) | |
67 | + pci_enable_wake(pdev, PCI_D3hot, true); | |
68 | } else { | |
69 | - pci_enable_wake(pdev, PCI_D3hot, 0); | |
70 | - pci_enable_wake(pdev, PCI_D3cold, 0); | |
71 | + pci_enable_wake(pdev, PCI_D3hot, false); | |
72 | } | |
73 | ||
74 | pci_disable_device(pdev); | |
75 | -- | |
76 | 1.6.2 | |
77 |