Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a429ec23 authored by Yaniv Rosner's avatar Yaniv Rosner Committed by David S. Miller
Browse files

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: default avatarYaniv Rosner <yanivr@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e803d33a
Loading
Loading
Loading
Loading
+28 −26
Original line number Diff line number Diff line
@@ -10859,30 +10859,32 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
			0x09,
			&an_1000_val);

	/* Set 100 speed advertisement */
	if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
			(phy->speed_cap_mask &
			(PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL |
			PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)))) {
	/* Advertise 10/100 link speed */
	if (phy->req_line_speed == SPEED_AUTO_NEG) {
		if (phy->speed_cap_mask &
		    PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) {
			an_10_100_val |= (1<<5);
			autoneg_val |= (1<<9 | 1<<12);
			DP(NETIF_MSG_LINK, "Advertising 10M-HD\n");
		}
		if (phy->speed_cap_mask &
		    PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) {
			an_10_100_val |= (1<<6);
			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);
		/* Enable autoneg and restart autoneg for legacy speeds */
			autoneg_val |= (1<<9 | 1<<12);

		if (phy->req_duplex == DUPLEX_FULL)
			an_10_100_val |= (1<<8);
		DP(NETIF_MSG_LINK, "Advertising 100M\n");
			DP(NETIF_MSG_LINK, "Advertising 100M-HD\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);
		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);
		if (phy->req_duplex == DUPLEX_FULL)
			an_10_100_val |= (1<<6);
		DP(NETIF_MSG_LINK, "Advertising 10M\n");
			DP(NETIF_MSG_LINK, "Advertising 100M-FD\n");
		}
	}

	/* Only 10/100 are allowed to work in FORCE mode */