aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/e100.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 67b99353acfe..394fb019c4f4 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2665,7 +2665,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2665 nic->flags |= wol_magic; 2665 nic->flags |= wol_magic;
2666 2666
2667 /* ack any pending wake events, disable PME */ 2667 /* ack any pending wake events, disable PME */
2668 pci_enable_wake(pdev, 0, 0); 2668 err = pci_enable_wake(pdev, 0, 0);
2669 if (err)
2670 DPRINTK(PROBE, ERR, "Error clearing wake event\n");
2669 2671
2670 strcpy(netdev->name, "eth%d"); 2672 strcpy(netdev->name, "eth%d");
2671 if((err = register_netdev(netdev))) { 2673 if((err = register_netdev(netdev))) {
@@ -2716,6 +2718,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2716{ 2718{
2717 struct net_device *netdev = pci_get_drvdata(pdev); 2719 struct net_device *netdev = pci_get_drvdata(pdev);
2718 struct nic *nic = netdev_priv(netdev); 2720 struct nic *nic = netdev_priv(netdev);
2721 int retval;
2719 2722
2720 if(netif_running(netdev)) 2723 if(netif_running(netdev))
2721 e100_down(nic); 2724 e100_down(nic);
@@ -2723,9 +2726,14 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2723 netif_device_detach(netdev); 2726 netif_device_detach(netdev);
2724 2727
2725 pci_save_state(pdev); 2728 pci_save_state(pdev);
2726 pci_enable_wake(pdev, pci_choose_state(pdev, state), nic->flags & (wol_magic | e100_asf(nic))); 2729 retval = pci_enable_wake(pdev, pci_choose_state(pdev, state),
2730 nic->flags & (wol_magic | e100_asf(nic)));
2731 if (retval)
2732 DPRINTK(PROBE,ERR, "Error enabling wake\n");
2727 pci_disable_device(pdev); 2733 pci_disable_device(pdev);
2728 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 2734 retval = pci_set_power_state(pdev, pci_choose_state(pdev, state));
2735 if (retval)
2736 DPRINTK(PROBE,ERR, "Error %d setting power state\n", retval);
2729 2737
2730 return 0; 2738 return 0;
2731} 2739}
@@ -2734,11 +2742,16 @@ static int e100_resume(struct pci_dev *pdev)
2734{ 2742{
2735 struct net_device *netdev = pci_get_drvdata(pdev); 2743 struct net_device *netdev = pci_get_drvdata(pdev);
2736 struct nic *nic = netdev_priv(netdev); 2744 struct nic *nic = netdev_priv(netdev);
2745 int retval;
2737 2746
2738 pci_set_power_state(pdev, PCI_D0); 2747 retval = pci_set_power_state(pdev, PCI_D0);
2748 if (retval)
2749 DPRINTK(PROBE,ERR, "Error waking adapter\n");
2739 pci_restore_state(pdev); 2750 pci_restore_state(pdev);
2740 /* ack any pending wake events, disable PME */ 2751 /* ack any pending wake events, disable PME */
2741 pci_enable_wake(pdev, 0, 0); 2752 retval = pci_enable_wake(pdev, 0, 0);
2753 if (retval)
2754 DPRINTK(PROBE,ERR, "Error clearing wake events\n");
2742 if(e100_hw_init(nic)) 2755 if(e100_hw_init(nic))
2743 DPRINTK(HW, ERR, "e100_hw_init failed\n"); 2756 DPRINTK(HW, ERR, "e100_hw_init failed\n");
2744 2757
@@ -2755,12 +2768,15 @@ static void e100_shutdown(struct pci_dev *pdev)
2755{ 2768{
2756 struct net_device *netdev = pci_get_drvdata(pdev); 2769 struct net_device *netdev = pci_get_drvdata(pdev);
2757 struct nic *nic = netdev_priv(netdev); 2770 struct nic *nic = netdev_priv(netdev);
2771 int retval;
2758 2772
2759#ifdef CONFIG_PM 2773#ifdef CONFIG_PM
2760 pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); 2774 retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
2761#else 2775#else
2762 pci_enable_wake(pdev, 0, nic->flags & (wol_magic)); 2776 retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic));
2763#endif 2777#endif
2778 if (retval)
2779 DPRINTK(PROBE,ERR, "Error enabling wake\n");
2764} 2780}
2765 2781
2766 2782