diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2006-09-27 15:53:57 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-09-27 15:53:57 -0400 |
commit | caeccb682a2483a79162bb66a431175d4134ae0b (patch) | |
tree | b4f79e694f1cd2332c8294371ba15e1b906f768e /drivers/net/e1000/e1000_hw.c | |
parent | 61c2505fd5044d9e108acc6b469d3caa02522043 (diff) |
e1000: add PCI-E capability detection code
Add code to display the detected PCI-E bus width.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index dceaf5bd5f5b..48aff8d054f9 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -6556,6 +6556,8 @@ e1000_tbi_adjust_stats(struct e1000_hw *hw, | |||
6556 | void | 6556 | void |
6557 | e1000_get_bus_info(struct e1000_hw *hw) | 6557 | e1000_get_bus_info(struct e1000_hw *hw) |
6558 | { | 6558 | { |
6559 | int32_t ret_val; | ||
6560 | uint16_t pci_ex_link_status; | ||
6559 | uint32_t status; | 6561 | uint32_t status; |
6560 | 6562 | ||
6561 | switch (hw->mac_type) { | 6563 | switch (hw->mac_type) { |
@@ -6565,18 +6567,25 @@ e1000_get_bus_info(struct e1000_hw *hw) | |||
6565 | hw->bus_speed = e1000_bus_speed_unknown; | 6567 | hw->bus_speed = e1000_bus_speed_unknown; |
6566 | hw->bus_width = e1000_bus_width_unknown; | 6568 | hw->bus_width = e1000_bus_width_unknown; |
6567 | break; | 6569 | break; |
6570 | case e1000_82571: | ||
6568 | case e1000_82572: | 6571 | case e1000_82572: |
6569 | case e1000_82573: | 6572 | case e1000_82573: |
6573 | case e1000_80003es2lan: | ||
6570 | hw->bus_type = e1000_bus_type_pci_express; | 6574 | hw->bus_type = e1000_bus_type_pci_express; |
6571 | hw->bus_speed = e1000_bus_speed_2500; | 6575 | hw->bus_speed = e1000_bus_speed_2500; |
6572 | hw->bus_width = e1000_bus_width_pciex_1; | 6576 | ret_val = e1000_read_pcie_cap_reg(hw, |
6577 | PCI_EX_LINK_STATUS, | ||
6578 | &pci_ex_link_status); | ||
6579 | if (ret_val) | ||
6580 | hw->bus_width = e1000_bus_width_unknown; | ||
6581 | else | ||
6582 | hw->bus_width = (pci_ex_link_status & PCI_EX_LINK_WIDTH_MASK) >> | ||
6583 | PCI_EX_LINK_WIDTH_SHIFT; | ||
6573 | break; | 6584 | break; |
6574 | case e1000_82571: | ||
6575 | case e1000_ich8lan: | 6585 | case e1000_ich8lan: |
6576 | case e1000_80003es2lan: | ||
6577 | hw->bus_type = e1000_bus_type_pci_express; | 6586 | hw->bus_type = e1000_bus_type_pci_express; |
6578 | hw->bus_speed = e1000_bus_speed_2500; | 6587 | hw->bus_speed = e1000_bus_speed_2500; |
6579 | hw->bus_width = e1000_bus_width_pciex_4; | 6588 | hw->bus_width = e1000_bus_width_pciex_1; |
6580 | break; | 6589 | break; |
6581 | default: | 6590 | default: |
6582 | status = E1000_READ_REG(hw, STATUS); | 6591 | status = E1000_READ_REG(hw, STATUS); |