diff options
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r-- | drivers/net/e100.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3d69fae781cf..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; |
@@ -2616,7 +2619,6 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2616 | struct net_device *netdev; | 2619 | struct net_device *netdev; |
2617 | struct nic *nic; | 2620 | struct nic *nic; |
2618 | int err; | 2621 | int err; |
2619 | DECLARE_MAC_BUF(mac); | ||
2620 | 2622 | ||
2621 | if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { | 2623 | if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { |
2622 | if(((1 << debug) - 1) & NETIF_MSG_PROBE) | 2624 | if(((1 << debug) - 1) & NETIF_MSG_PROBE) |
@@ -2734,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2734 | 2736 | ||
2735 | /* Wol magic packet can be enabled from eeprom */ | 2737 | /* Wol magic packet can be enabled from eeprom */ |
2736 | if((nic->mac >= mac_82558_D101_A4) && | 2738 | if((nic->mac >= mac_82558_D101_A4) && |
2737 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) | 2739 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) { |
2738 | nic->flags |= wol_magic; | 2740 | nic->flags |= wol_magic; |
2741 | device_set_wakeup_enable(&pdev->dev, true); | ||
2742 | } | ||
2739 | 2743 | ||
2740 | /* ack any pending wake events, disable PME */ | 2744 | /* ack any pending wake events, disable PME */ |
2741 | pci_pme_active(pdev, false); | 2745 | pci_pme_active(pdev, false); |
@@ -2746,9 +2750,9 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2746 | goto err_out_free; | 2750 | goto err_out_free; |
2747 | } | 2751 | } |
2748 | 2752 | ||
2749 | DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %s\n", | 2753 | DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", |
2750 | (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), | 2754 | (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), |
2751 | pdev->irq, print_mac(mac, netdev->dev_addr)); | 2755 | pdev->irq, netdev->dev_addr); |
2752 | 2756 | ||
2753 | return 0; | 2757 | return 0; |
2754 | 2758 | ||
@@ -2794,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2794 | pci_save_state(pdev); | 2798 | pci_save_state(pdev); |
2795 | 2799 | ||
2796 | if ((nic->flags & wol_magic) | e100_asf(nic)) { | 2800 | if ((nic->flags & wol_magic) | e100_asf(nic)) { |
2797 | pci_enable_wake(pdev, PCI_D3hot, 1); | 2801 | if (pci_enable_wake(pdev, PCI_D3cold, true)) |
2798 | pci_enable_wake(pdev, PCI_D3cold, 1); | 2802 | pci_enable_wake(pdev, PCI_D3hot, true); |
2799 | } else { | 2803 | } else { |
2800 | pci_enable_wake(pdev, PCI_D3hot, 0); | 2804 | pci_enable_wake(pdev, PCI_D3hot, false); |
2801 | pci_enable_wake(pdev, PCI_D3cold, 0); | ||
2802 | } | 2805 | } |
2803 | 2806 | ||
2804 | pci_disable_device(pdev); | 2807 | pci_disable_device(pdev); |