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

Commit b99d2a57 authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller
Browse files

tg3: Check all adv bits when checking config



This patch makes sure the driver checks all advertisement bits when
checking the current hw advertisements.

Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
Reviewed-by: default avatarBenjamin Li <benli@broadcom.com>
Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aaba215c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -3334,8 +3334,9 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
	if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
	if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
		return 0;
		return 0;


	if ((adv_reg & all_mask) != all_mask)
	if ((adv_reg & ADVERTISE_ALL) != all_mask)
		return 0;
		return 0;

	if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
	if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
		u32 tg3_ctrl;
		u32 tg3_ctrl;


@@ -3348,7 +3349,8 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
		if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl))
		if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl))
			return 0;
			return 0;


		if ((tg3_ctrl & all_mask) != all_mask)
		tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL);
		if (tg3_ctrl != all_mask)
			return 0;
			return 0;
	}
	}
	return 1;
	return 1;