diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 75cd6dfbaa37..8207db44b705 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -4382,6 +4382,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4382 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4382 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4383 | uint32_t ctrl, ctrl_ext, rctl, manc, status; | 4383 | uint32_t ctrl, ctrl_ext, rctl, manc, status; |
4384 | uint32_t wufc = adapter->wol; | 4384 | uint32_t wufc = adapter->wol; |
4385 | int retval = 0; | ||
4385 | 4386 | ||
4386 | netif_device_detach(netdev); | 4387 | netif_device_detach(netdev); |
4387 | 4388 | ||
@@ -4427,13 +4428,21 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4427 | 4428 | ||
4428 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); | 4429 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); |
4429 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); | 4430 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); |
4430 | pci_enable_wake(pdev, 3, 1); | 4431 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); |
4431 | pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */ | 4432 | if (retval) |
4433 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4434 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4435 | if (retval) | ||
4436 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4432 | } else { | 4437 | } else { |
4433 | E1000_WRITE_REG(&adapter->hw, WUC, 0); | 4438 | E1000_WRITE_REG(&adapter->hw, WUC, 0); |
4434 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); | 4439 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); |
4435 | pci_enable_wake(pdev, 3, 0); | 4440 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); |
4436 | pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */ | 4441 | if (retval) |
4442 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4443 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); /* 4 == D3 cold */ | ||
4444 | if (retval) | ||
4445 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4437 | } | 4446 | } |
4438 | 4447 | ||
4439 | pci_save_state(pdev); | 4448 | pci_save_state(pdev); |
@@ -4444,8 +4453,12 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4444 | if(manc & E1000_MANC_SMBUS_EN) { | 4453 | if(manc & E1000_MANC_SMBUS_EN) { |
4445 | manc |= E1000_MANC_ARP_EN; | 4454 | manc |= E1000_MANC_ARP_EN; |
4446 | E1000_WRITE_REG(&adapter->hw, MANC, manc); | 4455 | E1000_WRITE_REG(&adapter->hw, MANC, manc); |
4447 | pci_enable_wake(pdev, 3, 1); | 4456 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); |
4448 | pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */ | 4457 | if (retval) |
4458 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4459 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4460 | if (retval) | ||
4461 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4449 | } | 4462 | } |
4450 | } | 4463 | } |
4451 | 4464 | ||
@@ -4454,7 +4467,10 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4454 | e1000_release_hw_control(adapter); | 4467 | e1000_release_hw_control(adapter); |
4455 | 4468 | ||
4456 | pci_disable_device(pdev); | 4469 | pci_disable_device(pdev); |
4457 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 4470 | |
4471 | retval = pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
4472 | if (retval) | ||
4473 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4458 | 4474 | ||
4459 | return 0; | 4475 | return 0; |
4460 | } | 4476 | } |
@@ -4464,15 +4480,21 @@ e1000_resume(struct pci_dev *pdev) | |||
4464 | { | 4480 | { |
4465 | struct net_device *netdev = pci_get_drvdata(pdev); | 4481 | struct net_device *netdev = pci_get_drvdata(pdev); |
4466 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4482 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4483 | int retval; | ||
4467 | uint32_t manc, ret_val; | 4484 | uint32_t manc, ret_val; |
4468 | 4485 | ||
4469 | pci_set_power_state(pdev, PCI_D0); | 4486 | retval = pci_set_power_state(pdev, PCI_D0); |
4470 | pci_restore_state(pdev); | 4487 | if (retval) |
4488 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4471 | ret_val = pci_enable_device(pdev); | 4489 | ret_val = pci_enable_device(pdev); |
4472 | pci_set_master(pdev); | 4490 | pci_set_master(pdev); |
4473 | 4491 | ||
4474 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4492 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); |
4475 | pci_enable_wake(pdev, PCI_D3cold, 0); | 4493 | if (retval) |
4494 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4495 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); | ||
4496 | if (retval) | ||
4497 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4476 | 4498 | ||
4477 | e1000_reset(adapter); | 4499 | e1000_reset(adapter); |
4478 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); | 4500 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); |