diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2010-04-26 21:02:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 15:53:28 -0400 |
commit | ff846f52935e6c8dfb0c97df7c2c1bf777454684 (patch) | |
tree | f7b17c3e0e76f221809e509b749df6ae5caf868b /drivers/net/igb | |
parent | ef021194d262bdfa706dc5755596e252175a6bbc (diff) |
igb: add support for reporting 5GT/s during probe on PCIe Gen2
This change corrects the fact that we were not reporting Gen2 link speeds
when we were in fact connected at Gen2 rates.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/e1000_defines.h | 4 | ||||
-rw-r--r-- | drivers/net/igb/e1000_mac.c | 27 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 1 |
3 files changed, 21 insertions, 11 deletions
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h index 31d24e0e76de..24d9be64342f 100644 --- a/drivers/net/igb/e1000_defines.h +++ b/drivers/net/igb/e1000_defines.h | |||
@@ -610,11 +610,7 @@ | |||
610 | #define IGP_LED3_MODE 0x07000000 | 610 | #define IGP_LED3_MODE 0x07000000 |
611 | 611 | ||
612 | /* PCI/PCI-X/PCI-EX Config space */ | 612 | /* PCI/PCI-X/PCI-EX Config space */ |
613 | #define PCIE_LINK_STATUS 0x12 | ||
614 | #define PCIE_DEVICE_CONTROL2 0x28 | 613 | #define PCIE_DEVICE_CONTROL2 0x28 |
615 | |||
616 | #define PCIE_LINK_WIDTH_MASK 0x3F0 | ||
617 | #define PCIE_LINK_WIDTH_SHIFT 4 | ||
618 | #define PCIE_DEVICE_CONTROL2_16ms 0x0005 | 614 | #define PCIE_DEVICE_CONTROL2_16ms 0x0005 |
619 | 615 | ||
620 | #define PHY_REVISION_MASK 0xFFFFFFF0 | 616 | #define PHY_REVISION_MASK 0xFFFFFFF0 |
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index be8d010e4021..90c5e01e9235 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c | |||
@@ -53,17 +53,30 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw) | |||
53 | u16 pcie_link_status; | 53 | u16 pcie_link_status; |
54 | 54 | ||
55 | bus->type = e1000_bus_type_pci_express; | 55 | bus->type = e1000_bus_type_pci_express; |
56 | bus->speed = e1000_bus_speed_2500; | ||
57 | 56 | ||
58 | ret_val = igb_read_pcie_cap_reg(hw, | 57 | ret_val = igb_read_pcie_cap_reg(hw, |
59 | PCIE_LINK_STATUS, | 58 | PCI_EXP_LNKSTA, |
60 | &pcie_link_status); | 59 | &pcie_link_status); |
61 | if (ret_val) | 60 | if (ret_val) { |
62 | bus->width = e1000_bus_width_unknown; | 61 | bus->width = e1000_bus_width_unknown; |
63 | else | 62 | bus->speed = e1000_bus_speed_unknown; |
63 | } else { | ||
64 | switch (pcie_link_status & PCI_EXP_LNKSTA_CLS) { | ||
65 | case PCI_EXP_LNKSTA_CLS_2_5GB: | ||
66 | bus->speed = e1000_bus_speed_2500; | ||
67 | break; | ||
68 | case PCI_EXP_LNKSTA_CLS_5_0GB: | ||
69 | bus->speed = e1000_bus_speed_5000; | ||
70 | break; | ||
71 | default: | ||
72 | bus->speed = e1000_bus_speed_unknown; | ||
73 | break; | ||
74 | } | ||
75 | |||
64 | bus->width = (enum e1000_bus_width)((pcie_link_status & | 76 | bus->width = (enum e1000_bus_width)((pcie_link_status & |
65 | PCIE_LINK_WIDTH_MASK) >> | 77 | PCI_EXP_LNKSTA_NLW) >> |
66 | PCIE_LINK_WIDTH_SHIFT); | 78 | PCI_EXP_LNKSTA_NLW_SHIFT); |
79 | } | ||
67 | 80 | ||
68 | reg = rd32(E1000_STATUS); | 81 | reg = rd32(E1000_STATUS); |
69 | bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT; | 82 | bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index a14303a0ad7b..919e36386675 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1638,6 +1638,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1638 | dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n", | 1638 | dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n", |
1639 | netdev->name, | 1639 | netdev->name, |
1640 | ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5Gb/s" : | 1640 | ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5Gb/s" : |
1641 | (hw->bus.speed == e1000_bus_speed_5000) ? "5.0Gb/s" : | ||
1641 | "unknown"), | 1642 | "unknown"), |
1642 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : | 1643 | ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : |
1643 | (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" : | 1644 | (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" : |