Use the standard #defines for PCIe Capability ASPM fields.

Previously we used PCIE_LINK_STATE_L0S and PCIE_LINK_STATE_L1 directly, but
these are defined for the Linux ASPM interfaces, e.g.,
pci_disable_link_state(), and only coincidentally match the actual register
bits.  PCIE_LINK_STATE_CLKPM, also part of that interface, does not match
the register bit.

Signed-off-by: Bjorn Helgaas <[email protected]>
CC: Jeff Kirsher <[email protected]>
CC: Jesse Brandeburg <[email protected]>
CC: Bruce Allan <[email protected]>
CC: Carolyn Wyborny <[email protected]>
CC: Don Skidmore <[email protected]>
CC: Greg Rose <[email protected]>
CC: Peter P Waskiewicz Jr <[email protected]>
CC: Alex Duyck <[email protected]>
CC: John Ronciak <[email protected]>
CC: [email protected]
---
 drivers/net/ethernet/intel/e1000e/netdev.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c 
b/drivers/net/ethernet/intel/e1000e/netdev.c
index f444eb0..b8561ef 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5613,15 +5613,22 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, 
u16 state)
 #else
 static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
 {
+       u16 aspm_ctl = 0;
+
+       if (state & PCIE_LINK_STATE_L0S)
+               aspm_ctl |= PCI_EXP_LNKCTL_ASPM_L0S;
+       if (state & PCIE_LINK_STATE_L1)
+               aspm_ctl |= PCI_EXP_LNKCTL_ASPM_L1;
+
        /*
         * Both device and parent should have the same ASPM setting.
         * Disable ASPM in downstream component first and then upstream.
         */
-       pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, state);
+       pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, aspm_ctl);
 
        if (pdev->bus->self)
                pcie_capability_clear_word(pdev->bus->self, PCI_EXP_LNKCTL,
-                                          state);
+                                          aspm_ctl);
 }
 #endif
 static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to