diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2013-09-22 07:59:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-23 02:10:20 -0400 |
commit | 343f7dc4301e554d547c28f9583c8a193f7abb88 (patch) | |
tree | bb3621d90a61aac59ad7f184f145db66346eec90 | |
parent | 869952e350411a769f339da913ec73c4d3f18ec2 (diff) |
bnx2x: Fix 848xx duplex settings
On 848xx PHY (10G-baseT), half-duplex was always advertised regardless of the
actual configuration. Change the 848xx duplex settings to advertise half-duplex
only if configured.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index dc67566645d2..51468227bf3b 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -9765,32 +9765,41 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, | |||
9765 | MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL, | 9765 | MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL, |
9766 | an_1000_val); | 9766 | an_1000_val); |
9767 | 9767 | ||
9768 | /* set 100 speed advertisement */ | 9768 | /* Set 10/100 speed advertisement */ |
9769 | if ((phy->req_line_speed == SPEED_AUTO_NEG) && | 9769 | if (phy->req_line_speed == SPEED_AUTO_NEG) { |
9770 | (phy->speed_cap_mask & | 9770 | if (phy->speed_cap_mask & |
9771 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | | 9771 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) { |
9772 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) { | 9772 | /* Enable autoneg and restart autoneg for legacy speeds |
9773 | an_10_100_val |= (1<<7); | 9773 | */ |
9774 | /* Enable autoneg and restart autoneg for legacy speeds */ | 9774 | autoneg_val |= (1<<9 | 1<<12); |
9775 | autoneg_val |= (1<<9 | 1<<12); | ||
9776 | |||
9777 | if (phy->req_duplex == DUPLEX_FULL) | ||
9778 | an_10_100_val |= (1<<8); | 9775 | an_10_100_val |= (1<<8); |
9779 | DP(NETIF_MSG_LINK, "Advertising 100M\n"); | 9776 | DP(NETIF_MSG_LINK, "Advertising 100M-FD\n"); |
9780 | } | 9777 | } |
9781 | /* set 10 speed advertisement */ | 9778 | |
9782 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | 9779 | if (phy->speed_cap_mask & |
9783 | (phy->speed_cap_mask & | 9780 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) { |
9784 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL | | 9781 | /* Enable autoneg and restart autoneg for legacy speeds |
9785 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)) && | 9782 | */ |
9786 | (phy->supported & | 9783 | autoneg_val |= (1<<9 | 1<<12); |
9787 | (SUPPORTED_10baseT_Half | | 9784 | an_10_100_val |= (1<<7); |
9788 | SUPPORTED_10baseT_Full)))) { | 9785 | DP(NETIF_MSG_LINK, "Advertising 100M-HD\n"); |
9789 | an_10_100_val |= (1<<5); | 9786 | } |
9790 | autoneg_val |= (1<<9 | 1<<12); | 9787 | |
9791 | if (phy->req_duplex == DUPLEX_FULL) | 9788 | if ((phy->speed_cap_mask & |
9789 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) && | ||
9790 | (phy->supported & SUPPORTED_10baseT_Full)) { | ||
9792 | an_10_100_val |= (1<<6); | 9791 | an_10_100_val |= (1<<6); |
9793 | DP(NETIF_MSG_LINK, "Advertising 10M\n"); | 9792 | autoneg_val |= (1<<9 | 1<<12); |
9793 | DP(NETIF_MSG_LINK, "Advertising 10M-FD\n"); | ||
9794 | } | ||
9795 | |||
9796 | if ((phy->speed_cap_mask & | ||
9797 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) && | ||
9798 | (phy->supported & SUPPORTED_10baseT_Half)) { | ||
9799 | an_10_100_val |= (1<<5); | ||
9800 | autoneg_val |= (1<<9 | 1<<12); | ||
9801 | DP(NETIF_MSG_LINK, "Advertising 10M-HD\n"); | ||
9802 | } | ||
9794 | } | 9803 | } |
9795 | 9804 | ||
9796 | /* Only 10/100 are allowed to work in FORCE mode */ | 9805 | /* Only 10/100 are allowed to work in FORCE mode */ |