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