]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Fix advertisement handling
authorJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 03:19:28 +0000 (11:19 +0800)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 03:19:28 +0000 (11:19 +0800)
Commit 28011cf19b (net: Add ethtool to mii advertisment conversion
helpers) added a helper function ethtool_adv_to_mii_100bt() and
tg3_copper_is_advertising_all(), tg3_phy_autoneg_cfg() were
modified to use this.
Before that commit, ethtool to mii advertisement conversion was
done wrt speed, but now pause operation is also taken account.
So, in tg3_copper_is_advertising_all(), below condition becomes
true and this makes link up fails.

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

To fix this add ADVERTISE_ALL bit and operation to cap speed,
and change default advertisement not including ADVERTISED_Pause.

(backported from commit 202ff1c26c768efeead20b388556eda265dc8352)
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c

index e317c3cef354b768b4c0ba9695486e032166125a..4de2fb2278c089c75c11b2615a7e2c9921841d98 100644 (file)
@@ -3586,7 +3586,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
        u32 val, new_adv;
 
        new_adv = ADVERTISE_CSMA;
-       new_adv |= ethtool_adv_to_mii_adv_t(advertise);
+       new_adv |= ethtool_adv_to_mii_adv_t(advertise) & ADVERTISE_ALL;
        new_adv |= tg3_advert_flowctrl_1000T(flowctrl);
 
        err = tg3_writephy(tp, MII_ADVERTISE, new_adv);
@@ -13228,8 +13228,7 @@ static u32 __devinit tg3_read_otp_phycfg(struct tg3 *tp)
 
 static void __devinit tg3_phy_init_link_config(struct tg3 *tp)
 {
-       u32 adv = ADVERTISED_Autoneg |
-                 ADVERTISED_Pause;
+       u32 adv = ADVERTISED_Autoneg;
 
        if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
                adv |= ADVERTISED_1000baseT_Half |