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.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 27d5d2f02533..19ab3441269c 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2039,7 +2039,6 @@ static int e100_change_mtu(struct net_device *netdev, int new_mtu)
2039 return 0; 2039 return 0;
2040} 2040}
2041 2041
2042#ifdef CONFIG_PM
2043static int e100_asf(struct nic *nic) 2042static int e100_asf(struct nic *nic)
2044{ 2043{
2045 /* ASF can be enabled from eeprom */ 2044 /* ASF can be enabled from eeprom */
@@ -2048,7 +2047,6 @@ static int e100_asf(struct nic *nic)
2048 !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && 2047 !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) &&
2049 ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE)); 2048 ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE));
2050} 2049}
2051#endif
2052 2050
2053static int e100_up(struct nic *nic) 2051static int e100_up(struct nic *nic)
2054{ 2052{
@@ -2715,34 +2713,35 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2715 } 2713 }
2716} 2714}
2717 2715
2716#ifdef CONFIG_PM
2718static int e100_suspend(struct pci_dev *pdev, pm_message_t state) 2717static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2719{ 2718{
2720 struct net_device *netdev = pci_get_drvdata(pdev); 2719 struct net_device *netdev = pci_get_drvdata(pdev);
2721 struct nic *nic = netdev_priv(netdev); 2720 struct nic *nic = netdev_priv(netdev);
2722 2721
2722#ifdef CONFIG_E100_NAPI
2723 if (netif_running(netdev)) 2723 if (netif_running(netdev))
2724 e100_down(nic); 2724 netif_poll_disable(nic->netdev);
2725 e100_hw_reset(nic); 2725#endif
2726 netif_device_detach(netdev); 2726 del_timer_sync(&nic->watchdog);
2727 netif_carrier_off(nic->netdev);
2727 2728
2728#ifdef CONFIG_PM
2729 pci_save_state(pdev); 2729 pci_save_state(pdev);
2730 if (nic->flags & (wol_magic | e100_asf(nic))) 2730
2731#else 2731 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2732 if (nic->flags & (wol_magic)) 2732 pci_enable_wake(pdev, PCI_D3hot, 1);
2733#endif 2733 pci_enable_wake(pdev, PCI_D3cold, 1);
2734 pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); 2734 } else {
2735 else 2735 pci_enable_wake(pdev, PCI_D3hot, 0);
2736 /* disable PME */ 2736 pci_enable_wake(pdev, PCI_D3cold, 0);
2737 pci_enable_wake(pdev, 0, 0); 2737 }
2738 2738
2739 pci_disable_device(pdev); 2739 pci_disable_device(pdev);
2740 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 2740 pci_set_power_state(pdev, PCI_D3hot);
2741 2741
2742 return 0; 2742 return 0;
2743} 2743}
2744 2744
2745#ifdef CONFIG_PM
2746static int e100_resume(struct pci_dev *pdev) 2745static int e100_resume(struct pci_dev *pdev)
2747{ 2746{
2748 struct net_device *netdev = pci_get_drvdata(pdev); 2747 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2764,7 +2763,26 @@ static int e100_resume(struct pci_dev *pdev)
2764 2763
2765static void e100_shutdown(struct pci_dev *pdev) 2764static void e100_shutdown(struct pci_dev *pdev)
2766{ 2765{
2767 e100_suspend(pdev, PMSG_SUSPEND); 2766 struct net_device *netdev = pci_get_drvdata(pdev);
2767 struct nic *nic = netdev_priv(netdev);
2768
2769#ifdef CONFIG_E100_NAPI
2770 if (netif_running(netdev))
2771 netif_poll_disable(nic->netdev);
2772#endif
2773 del_timer_sync(&nic->watchdog);
2774 netif_carrier_off(nic->netdev);
2775
2776 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2777 pci_enable_wake(pdev, PCI_D3hot, 1);
2778 pci_enable_wake(pdev, PCI_D3cold, 1);
2779 } else {
2780 pci_enable_wake(pdev, PCI_D3hot, 0);
2781 pci_enable_wake(pdev, PCI_D3cold, 0);
2782 }
2783
2784 pci_disable_device(pdev);
2785 pci_set_power_state(pdev, PCI_D3hot);
2768} 2786}
2769 2787
2770/* ------------------ PCI Error Recovery infrastructure -------------- */ 2788/* ------------------ PCI Error Recovery infrastructure -------------- */
@@ -2848,9 +2866,9 @@ static struct pci_driver e100_driver = {
2848 .id_table = e100_id_table, 2866 .id_table = e100_id_table,
2849 .probe = e100_probe, 2867 .probe = e100_probe,
2850 .remove = __devexit_p(e100_remove), 2868 .remove = __devexit_p(e100_remove),
2869#ifdef CONFIG_PM
2851 /* Power Management hooks */ 2870 /* Power Management hooks */
2852 .suspend = e100_suspend, 2871 .suspend = e100_suspend,
2853#ifdef CONFIG_PM
2854 .resume = e100_resume, 2872 .resume = e100_resume,
2855#endif 2873#endif
2856 .shutdown = e100_shutdown, 2874 .shutdown = e100_shutdown,