From caeccb682a2483a79162bb66a431175d4134ae0b Mon Sep 17 00:00:00 2001 From: Jeff Kirsher Date: Wed, 27 Sep 2006 12:53:57 -0700 Subject: e1000: add PCI-E capability detection code Add code to display the detected PCI-E bus width. Signed-off-by: Jeff Kirsher Signed-off-by: Auke Kok --- drivers/net/e1000/e1000_main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/net/e1000/e1000_main.c') diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index fd30161d2f1..e2615782966 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -4473,6 +4473,22 @@ e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value) pci_write_config_word(adapter->pdev, reg, *value); } +int32_t +e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value) +{ + struct e1000_adapter *adapter = hw->back; + uint16_t cap_offset; + + cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP); + if (!cap_offset) + return -E1000_ERR_CONFIG; + + pci_read_config_word(adapter->pdev, cap_offset + reg, value); + + return E1000_SUCCESS; +} + + void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) { -- cgit v1.2.3-18-g5258