diff options
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index add8dc4aa7b0..ac1e8387416b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -4515,21 +4515,13 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4515 | 4515 | ||
4516 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); | 4516 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); |
4517 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); | 4517 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); |
4518 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); | 4518 | pci_enable_wake(pdev, PCI_D3hot, 1); |
4519 | if (retval) | 4519 | pci_enable_wake(pdev, PCI_D3cold, 1); |
4520 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4521 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4522 | if (retval) | ||
4523 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4524 | } else { | 4520 | } else { |
4525 | E1000_WRITE_REG(&adapter->hw, WUC, 0); | 4521 | E1000_WRITE_REG(&adapter->hw, WUC, 0); |
4526 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); | 4522 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); |
4527 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); | 4523 | pci_enable_wake(pdev, PCI_D3hot, 0); |
4528 | if (retval) | 4524 | pci_enable_wake(pdev, PCI_D3cold, 0); |
4529 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4530 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); | ||
4531 | if (retval) | ||
4532 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4533 | } | 4525 | } |
4534 | 4526 | ||
4535 | if (adapter->hw.mac_type >= e1000_82540 && | 4527 | if (adapter->hw.mac_type >= e1000_82540 && |
@@ -4538,13 +4530,8 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4538 | if (manc & E1000_MANC_SMBUS_EN) { | 4530 | if (manc & E1000_MANC_SMBUS_EN) { |
4539 | manc |= E1000_MANC_ARP_EN; | 4531 | manc |= E1000_MANC_ARP_EN; |
4540 | E1000_WRITE_REG(&adapter->hw, MANC, manc); | 4532 | E1000_WRITE_REG(&adapter->hw, MANC, manc); |
4541 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); | 4533 | pci_enable_wake(pdev, PCI_D3hot, 1); |
4542 | if (retval) | 4534 | pci_enable_wake(pdev, PCI_D3cold, 1); |
4543 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4544 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4545 | if (retval) | ||
4546 | DPRINTK(PROBE, ERR, | ||
4547 | "Error enabling D3 cold wake\n"); | ||
4548 | } | 4535 | } |
4549 | } | 4536 | } |
4550 | 4537 | ||
@@ -4554,9 +4541,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4554 | 4541 | ||
4555 | pci_disable_device(pdev); | 4542 | pci_disable_device(pdev); |
4556 | 4543 | ||
4557 | retval = pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 4544 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
4558 | if (retval) | ||
4559 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4560 | 4545 | ||
4561 | return 0; | 4546 | return 0; |
4562 | } | 4547 | } |
@@ -4567,22 +4552,15 @@ e1000_resume(struct pci_dev *pdev) | |||
4567 | { | 4552 | { |
4568 | struct net_device *netdev = pci_get_drvdata(pdev); | 4553 | struct net_device *netdev = pci_get_drvdata(pdev); |
4569 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4554 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4570 | int retval; | ||
4571 | uint32_t manc, ret_val; | 4555 | uint32_t manc, ret_val; |
4572 | 4556 | ||
4573 | retval = pci_set_power_state(pdev, PCI_D0); | 4557 | pci_set_power_state(pdev, PCI_D0); |
4574 | if (retval) | ||
4575 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4576 | e1000_pci_restore_state(adapter); | 4558 | e1000_pci_restore_state(adapter); |
4577 | ret_val = pci_enable_device(pdev); | 4559 | ret_val = pci_enable_device(pdev); |
4578 | pci_set_master(pdev); | 4560 | pci_set_master(pdev); |
4579 | 4561 | ||
4580 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); | 4562 | pci_enable_wake(pdev, PCI_D3hot, 0); |
4581 | if (retval) | 4563 | pci_enable_wake(pdev, PCI_D3cold, 0); |
4582 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4583 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); | ||
4584 | if (retval) | ||
4585 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4586 | 4564 | ||
4587 | e1000_reset(adapter); | 4565 | e1000_reset(adapter); |
4588 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); | 4566 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); |