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>
This commit is contained in:
Yaniv Rosner 2013-09-22 14:59:26 +03:00 committed by David S. Miller
parent 869952e350
commit 343f7dc430
1 changed files with 33 additions and 24 deletions

View File

@ -9765,32 +9765,41 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL, MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL,
an_1000_val); an_1000_val);
/* set 100 speed advertisement */ /* Set 10/100 speed advertisement */
if ((phy->req_line_speed == SPEED_AUTO_NEG) && if (phy->req_line_speed == SPEED_AUTO_NEG) {
(phy->speed_cap_mask & if (phy->speed_cap_mask &
(PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) {
PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) { /* Enable autoneg and restart autoneg for legacy speeds
an_10_100_val |= (1<<7); */
/* Enable autoneg and restart autoneg for legacy speeds */ autoneg_val |= (1<<9 | 1<<12);
autoneg_val |= (1<<9 | 1<<12);
if (phy->req_duplex == DUPLEX_FULL)
an_10_100_val |= (1<<8); an_10_100_val |= (1<<8);
DP(NETIF_MSG_LINK, "Advertising 100M\n"); DP(NETIF_MSG_LINK, "Advertising 100M-FD\n");
} }
/* set 10 speed advertisement */
if (((phy->req_line_speed == SPEED_AUTO_NEG) && if (phy->speed_cap_mask &
(phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) {
(PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL | /* Enable autoneg and restart autoneg for legacy speeds
PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)) && */
(phy->supported & autoneg_val |= (1<<9 | 1<<12);
(SUPPORTED_10baseT_Half | an_10_100_val |= (1<<7);
SUPPORTED_10baseT_Full)))) { DP(NETIF_MSG_LINK, "Advertising 100M-HD\n");
an_10_100_val |= (1<<5); }
autoneg_val |= (1<<9 | 1<<12);
if (phy->req_duplex == DUPLEX_FULL) if ((phy->speed_cap_mask &
PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) &&
(phy->supported & SUPPORTED_10baseT_Full)) {
an_10_100_val |= (1<<6); an_10_100_val |= (1<<6);
DP(NETIF_MSG_LINK, "Advertising 10M\n"); autoneg_val |= (1<<9 | 1<<12);
DP(NETIF_MSG_LINK, "Advertising 10M-FD\n");
}
if ((phy->speed_cap_mask &
PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) &&
(phy->supported & SUPPORTED_10baseT_Half)) {
an_10_100_val |= (1<<5);
autoneg_val |= (1<<9 | 1<<12);
DP(NETIF_MSG_LINK, "Advertising 10M-HD\n");
}
} }
/* Only 10/100 are allowed to work in FORCE mode */ /* Only 10/100 are allowed to work in FORCE mode */