diff options
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 8d682fc37607..e325f9337225 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -5643,6 +5643,44 @@ poll_bnx2(struct net_device *dev) | |||
5643 | } | 5643 | } |
5644 | #endif | 5644 | #endif |
5645 | 5645 | ||
5646 | static void __devinit | ||
5647 | bnx2_get_5709_media(struct bnx2 *bp) | ||
5648 | { | ||
5649 | u32 val = REG_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL); | ||
5650 | u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID; | ||
5651 | u32 strap; | ||
5652 | |||
5653 | if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C) | ||
5654 | return; | ||
5655 | else if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_S) { | ||
5656 | bp->phy_flags |= PHY_SERDES_FLAG; | ||
5657 | return; | ||
5658 | } | ||
5659 | |||
5660 | if (val & BNX2_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE) | ||
5661 | strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21; | ||
5662 | else | ||
5663 | strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8; | ||
5664 | |||
5665 | if (PCI_FUNC(bp->pdev->devfn) == 0) { | ||
5666 | switch (strap) { | ||
5667 | case 0x4: | ||
5668 | case 0x5: | ||
5669 | case 0x6: | ||
5670 | bp->phy_flags |= PHY_SERDES_FLAG; | ||
5671 | return; | ||
5672 | } | ||
5673 | } else { | ||
5674 | switch (strap) { | ||
5675 | case 0x1: | ||
5676 | case 0x2: | ||
5677 | case 0x4: | ||
5678 | bp->phy_flags |= PHY_SERDES_FLAG; | ||
5679 | return; | ||
5680 | } | ||
5681 | } | ||
5682 | } | ||
5683 | |||
5646 | static int __devinit | 5684 | static int __devinit |
5647 | bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | 5685 | bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) |
5648 | { | 5686 | { |
@@ -5863,10 +5901,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5863 | bp->phy_addr = 1; | 5901 | bp->phy_addr = 1; |
5864 | 5902 | ||
5865 | /* Disable WOL support if we are running on a SERDES chip. */ | 5903 | /* Disable WOL support if we are running on a SERDES chip. */ |
5866 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { | 5904 | if (CHIP_NUM(bp) == CHIP_NUM_5709) |
5867 | if (CHIP_BOND_ID(bp) != BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C) | 5905 | bnx2_get_5709_media(bp); |
5868 | bp->phy_flags |= PHY_SERDES_FLAG; | 5906 | else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT) |
5869 | } else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT) | ||
5870 | bp->phy_flags |= PHY_SERDES_FLAG; | 5907 | bp->phy_flags |= PHY_SERDES_FLAG; |
5871 | 5908 | ||
5872 | if (bp->phy_flags & PHY_SERDES_FLAG) { | 5909 | if (bp->phy_flags & PHY_SERDES_FLAG) { |