]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Check all adv bits when checking config
authorMatt Carlson <mcarlson@broadcom.com>
Wed, 31 Aug 2011 11:44:47 +0000 (11:44 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 01:37:56 +0000 (09:37 +0800)
This patch makes sure the driver checks all advertisement bits when
checking the current hw advertisements.

(cherry picked from commit b99d2a57b7d9e9e64e9193d70696b77ed035c311)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c

index e1a191047e45900afc46dae8b61994075e91304f..423d73abfc803b8e212331ccc1edc7829032fcb2 100644 (file)
@@ -3333,8 +3333,9 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
        if (tg3_readphy(tp, MII_ADVERTISE, &adv_reg))
                return 0;
 
-       if ((adv_reg & all_mask) != all_mask)
+       if ((adv_reg & ADVERTISE_ALL) != all_mask)
                return 0;
+
        if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
                u32 tg3_ctrl;
 
@@ -3347,7 +3348,8 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
                if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl))
                        return 0;
 
-               if ((tg3_ctrl & all_mask) != all_mask)
+               tg3_ctrl &= (ADVERTISE_1000HALF | ADVERTISE_1000FULL);
+               if (tg3_ctrl != all_mask)
                        return 0;
        }
        return 1;