From: Matt Carlson Date: Mon, 13 Feb 2012 15:20:10 +0000 (+0000) Subject: tg3: Fix copper autoneg adv checks X-Git-Tag: v2.6.39-400.9.0~338^2~171 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b023bb25017391918845f4d86f91a26de60ee4cc;p=users%2Fjedix%2Flinux-maple.git tg3: Fix copper autoneg adv checks When checking the autoneg advertisements, the driver failed to include the master and master enable bits for the bcm5701. This patch fixes the problem. (cherry picked from commit 3198e07fd64aa8c3a38dda33bcc0f44265eb581e) Signed-off-by: Matt Carlson Reviewed-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 1da1a05c2655..5236c87a944a 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -4032,7 +4032,16 @@ static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv) if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl)) return false; - tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL); + if (tgtadv && + (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0)) { + tgtadv |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; + tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL | + CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER); + } else { + tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL); + } + if (tg3_ctrl != tgtadv) return false; }