]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
tg3: Fix copper autoneg adv checks
authorMatt Carlson <mcarlson@broadcom.com>
Mon, 13 Feb 2012 15:20:10 +0000 (15:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Feb 2012 01:45:05 +0000 (20:45 -0500)
When checking the autoneg advertisements, the driver failed to include
the master and master enable bits for the bcm5701.  This patch fixes the
problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c

index 4a0b9af712386d950dd6413e2b6182d39abcbdfc..cb17885cad47f3350aeafde74b5b924f9a3569cc 100644 (file)
@@ -4027,7 +4027,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;
        }