bnx2x: Fix Duplex setting for 54618se

BCM54618SE is used to advertise half-duplex even if HD was not requested by the
user. This change makes the legacy speed/duplex advertisement for this PHY
exactly according to the requested speed and duplex.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Yaniv Rosner 2014-01-01 11:06:43 +02:00 committed by David S. Miller
parent e803d33a32
commit a429ec239c

View file

@ -10841,9 +10841,9 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
(1<<11)); (1<<11));
if (((phy->req_line_speed == SPEED_AUTO_NEG) && if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
(phy->speed_cap_mask & (phy->speed_cap_mask &
PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) || PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) ||
(phy->req_line_speed == SPEED_1000)) { (phy->req_line_speed == SPEED_1000)) {
an_1000_val |= (1<<8); an_1000_val |= (1<<8);
autoneg_val |= (1<<9 | 1<<12); autoneg_val |= (1<<9 | 1<<12);
if (phy->req_duplex == DUPLEX_FULL) if (phy->req_duplex == DUPLEX_FULL)
@ -10859,30 +10859,32 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
0x09, 0x09,
&an_1000_val); &an_1000_val);
/* Set 100 speed advertisement */ /* Advertise 10/100 link speed */
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_10M_HALF) {
PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)))) { an_10_100_val |= (1<<5);
an_10_100_val |= (1<<7); autoneg_val |= (1<<9 | 1<<12);
/* Enable autoneg and restart autoneg for legacy speeds */ DP(NETIF_MSG_LINK, "Advertising 10M-HD\n");
autoneg_val |= (1<<9 | 1<<12); }
if (phy->speed_cap_mask &
if (phy->req_duplex == DUPLEX_FULL) PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) {
an_10_100_val |= (1<<8);
DP(NETIF_MSG_LINK, "Advertising 100M\n");
}
/* Set 10 speed advertisement */
if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
(phy->speed_cap_mask &
(PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL |
PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)))) {
an_10_100_val |= (1<<5);
autoneg_val |= (1<<9 | 1<<12);
if (phy->req_duplex == DUPLEX_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_100M_HALF) {
an_10_100_val |= (1<<7);
autoneg_val |= (1<<9 | 1<<12);
DP(NETIF_MSG_LINK, "Advertising 100M-HD\n");
}
if (phy->speed_cap_mask &
PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) {
an_10_100_val |= (1<<8);
autoneg_val |= (1<<9 | 1<<12);
DP(NETIF_MSG_LINK, "Advertising 100M-FD\n");
}
} }
/* Only 10/100 are allowed to work in FORCE mode */ /* Only 10/100 are allowed to work in FORCE mode */