diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2008-12-10 01:09:53 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-10 01:09:53 -0800 |
commit | 5e8427e5e25e3f844113cf67d07e7806bbe8c0e2 (patch) | |
tree | 80851d045a850dc981c071fc4bb9ea763dbd8cd4 /drivers/net/igb/e1000_mac.c | |
parent | b4557be23dc959f38eed21d359ec7164e42bcbd6 (diff) | |
download | blackbird-op-linux-5e8427e5e25e3f844113cf67d07e7806bbe8c0e2.tar.gz blackbird-op-linux-5e8427e5e25e3f844113cf67d07e7806bbe8c0e2.zip |
igb: Correctly determine pci-e function number in virtual environment
When running in a virtual environment the ports of an 82575/6 can appear to
be single function devices which is not correct. To resolve this we rely
on the function number stored in the status register.
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/e1000_mac.c')
-rw-r--r-- | drivers/net/igb/e1000_mac.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index e18747c70bec..137269daeb2e 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c @@ -83,8 +83,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw) { struct e1000_bus_info *bus = &hw->bus; s32 ret_val; - u32 status; - u16 pcie_link_status, pci_header_type; + u32 reg; + u16 pcie_link_status; bus->type = e1000_bus_type_pci_express; bus->speed = e1000_bus_speed_2500; @@ -99,14 +99,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw) PCIE_LINK_WIDTH_MASK) >> PCIE_LINK_WIDTH_SHIFT); - igb_read_pci_cfg(hw, PCI_HEADER_TYPE_REGISTER, &pci_header_type); - if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) { - status = rd32(E1000_STATUS); - bus->func = (status & E1000_STATUS_FUNC_MASK) - >> E1000_STATUS_FUNC_SHIFT; - } else { - bus->func = 0; - } + reg = rd32(E1000_STATUS); + bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT; return 0; } @@ -229,8 +223,8 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) if (!hw->mac.disable_av) rar_high |= E1000_RAH_AV; - array_wr32(E1000_RA, (index << 1), rar_low); - array_wr32(E1000_RA, ((index << 1) + 1), rar_high); + wr32(E1000_RAL(index), rar_low); + wr32(E1000_RAH(index), rar_high); } /** |