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.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index e8bfcce6b319..c9c707980865 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1880,7 +1880,6 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
1880 } else { 1880 } else {
1881 dev->stats.rx_packets++; 1881 dev->stats.rx_packets++;
1882 dev->stats.rx_bytes += actual_size; 1882 dev->stats.rx_bytes += actual_size;
1883 nic->netdev->last_rx = jiffies;
1884 netif_receive_skb(skb); 1883 netif_receive_skb(skb);
1885 if(work_done) 1884 if(work_done)
1886 (*work_done)++; 1885 (*work_done)++;
@@ -2322,7 +2321,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2322{ 2321{
2323 struct nic *nic = netdev_priv(netdev); 2322 struct nic *nic = netdev_priv(netdev);
2324 2323
2325 if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) 2324 if ((wol->wolopts && wol->wolopts != WAKE_MAGIC) ||
2325 !device_can_wakeup(&nic->pdev->dev))
2326 return -EOPNOTSUPP; 2326 return -EOPNOTSUPP;
2327 2327
2328 if(wol->wolopts) 2328 if(wol->wolopts)
@@ -2330,6 +2330,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2330 else 2330 else
2331 nic->flags &= ~wol_magic; 2331 nic->flags &= ~wol_magic;
2332 2332
2333 device_set_wakeup_enable(&nic->pdev->dev, wol->wolopts);
2334
2333 e100_exec_cb(nic, NULL, e100_configure); 2335 e100_exec_cb(nic, NULL, e100_configure);
2334 2336
2335 return 0; 2337 return 0;
@@ -2616,7 +2618,6 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2616 struct net_device *netdev; 2618 struct net_device *netdev;
2617 struct nic *nic; 2619 struct nic *nic;
2618 int err; 2620 int err;
2619 DECLARE_MAC_BUF(mac);
2620 2621
2621 if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { 2622 if(!(netdev = alloc_etherdev(sizeof(struct nic)))) {
2622 if(((1 << debug) - 1) & NETIF_MSG_PROBE) 2623 if(((1 << debug) - 1) & NETIF_MSG_PROBE)
@@ -2734,8 +2735,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2734 2735
2735 /* Wol magic packet can be enabled from eeprom */ 2736 /* Wol magic packet can be enabled from eeprom */
2736 if((nic->mac >= mac_82558_D101_A4) && 2737 if((nic->mac >= mac_82558_D101_A4) &&
2737 (nic->eeprom[eeprom_id] & eeprom_id_wol)) 2738 (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
2738 nic->flags |= wol_magic; 2739 nic->flags |= wol_magic;
2740 device_set_wakeup_enable(&pdev->dev, true);
2741 }
2739 2742
2740 /* ack any pending wake events, disable PME */ 2743 /* ack any pending wake events, disable PME */
2741 pci_pme_active(pdev, false); 2744 pci_pme_active(pdev, false);
@@ -2746,9 +2749,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2746 goto err_out_free; 2749 goto err_out_free;
2747 } 2750 }
2748 2751
2749 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %s\n", 2752 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
2750 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), 2753 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
2751 pdev->irq, print_mac(mac, netdev->dev_addr)); 2754 pdev->irq, netdev->dev_addr);
2752 2755
2753 return 0; 2756 return 0;
2754 2757
@@ -2794,11 +2797,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2794 pci_save_state(pdev); 2797 pci_save_state(pdev);
2795 2798
2796 if ((nic->flags & wol_magic) | e100_asf(nic)) { 2799 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2797 pci_enable_wake(pdev, PCI_D3hot, 1); 2800 if (pci_enable_wake(pdev, PCI_D3cold, true))
2798 pci_enable_wake(pdev, PCI_D3cold, 1); 2801 pci_enable_wake(pdev, PCI_D3hot, true);
2799 } else { 2802 } else {
2800 pci_enable_wake(pdev, PCI_D3hot, 0); 2803 pci_enable_wake(pdev, PCI_D3hot, false);
2801 pci_enable_wake(pdev, PCI_D3cold, 0);
2802 } 2804 }
2803 2805
2804 pci_disable_device(pdev); 2806 pci_disable_device(pdev);