diff options
author | Eddie Wai <eddie.wai@broadcom.com> | 2012-06-27 15:08:20 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-28 04:20:09 (GMT) |
commit | 78ea22e8042b8a55c5a047869ed1fd9b3711340c (patch) | |
tree | e7aaf975261091b7360bf9e01a76b2571000b9b4 /drivers/net/ethernet | |
parent | a2028b2376a858cb68a7fcc129f6508f59b45381 (diff) | |
download | linux-78ea22e8042b8a55c5a047869ed1fd9b3711340c.tar.xz |
cnic: Read bnx2x function number from internal register
so that it will work on any hypervisor.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 31b05ad..5980443 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -4988,8 +4988,14 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev) cp->port_mode = CHIP_PORT_MODE_NONE; if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { - u32 val = CNIC_RD(dev, MISC_REG_PORT4MODE_EN_OVWR); + u32 val; + + pci_read_config_dword(dev->pcidev, PCICFG_ME_REGISTER, &val); + cp->func = (u8) ((val & ME_REG_ABS_PF_NUM) >> + ME_REG_ABS_PF_NUM_SHIFT); + func = CNIC_FUNC(cp); + val = CNIC_RD(dev, MISC_REG_PORT4MODE_EN_OVWR); if (!(val & 1)) val = CNIC_RD(dev, MISC_REG_PORT4MODE_EN); else |