diff options
author | Michael Chan <mchan@broadcom.com> | 2012-06-16 15:45:43 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-16 22:22:59 -0700 |
commit | aefd90e41476223c95e3c84c7dd22a65a21b1e40 (patch) | |
tree | 56575fff967f7b86d168429648a6aba6188baac8 /drivers/net/ethernet/broadcom/bnx2.c | |
parent | 13e63517f4bc425a17888e6497c59a9663c2b520 (diff) | |
download | op-kernel-dev-aefd90e41476223c95e3c84c7dd22a65a21b1e40.zip op-kernel-dev-aefd90e41476223c95e3c84c7dd22a65a21b1e40.tar.gz |
bnx2: Read PCI function number from internal register
so that it will work on any hypervisor.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index da88de7..c6d3943 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -7903,7 +7903,7 @@ bnx2_get_5709_media(struct bnx2 *bp) else strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8; - if (PCI_FUNC(bp->pdev->devfn) == 0) { + if (bp->func == 0) { switch (strap) { case 0x4: case 0x5: @@ -8202,9 +8202,12 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) reg = bnx2_reg_rd_ind(bp, BNX2_SHM_HDR_SIGNATURE); + if (bnx2_reg_rd_ind(bp, BNX2_MCP_TOE_ID) & BNX2_MCP_TOE_ID_FUNCTION_ID) + bp->func = 1; + if ((reg & BNX2_SHM_HDR_SIGNATURE_SIG_MASK) == BNX2_SHM_HDR_SIGNATURE_SIG) { - u32 off = PCI_FUNC(pdev->devfn) << 2; + u32 off = bp->func << 2; bp->shmem_base = bnx2_reg_rd_ind(bp, BNX2_SHM_HDR_ADDR_0 + off); } else |