From dc49a382550eac9e87062e092f18ba3b5acfae2f Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 29 Feb 2004 05:40:40 -0800 Subject: [PATCH] [TIGON3]: tg3_phy_copper_begin() tweaks. - Zap wait_for_link arg, never set. - Decrease delay loop when forcing link down. --- drivers/net/tg3.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 1dbe2b359b4ba..8a2c97fed8da6 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -1051,7 +1051,7 @@ static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8 }; } -static int tg3_phy_copper_begin(struct tg3 *tp, int wait_for_link) +static int tg3_phy_copper_begin(struct tg3 *tp) { u32 new_adv; int i; @@ -1169,7 +1169,7 @@ static int tg3_phy_copper_begin(struct tg3 *tp, int wait_for_link) tg3_readphy(tp, MII_BMCR, &orig_bmcr); if (bmcr != orig_bmcr) { tg3_writephy(tp, MII_BMCR, BMCR_LOOPBACK); - for (i = 0; i < 15000; i++) { + for (i = 0; i < 1500; i++) { u32 tmp; udelay(10); @@ -1188,27 +1188,6 @@ static int tg3_phy_copper_begin(struct tg3 *tp, int wait_for_link) BMCR_ANENABLE | BMCR_ANRESTART); } - if (wait_for_link) { - tp->link_config.active_speed = SPEED_INVALID; - tp->link_config.active_duplex = DUPLEX_INVALID; - for (i = 0; i < 300000; i++) { - u32 tmp; - - udelay(10); - tg3_readphy(tp, MII_BMSR, &tmp); - tg3_readphy(tp, MII_BMSR, &tmp); - if (!(tmp & BMSR_LSTATUS)) - continue; - - tg3_readphy(tp, MII_TG3_AUX_STAT, &tmp); - tg3_aux_stat_to_speed_duplex(tp, tmp, - &tp->link_config.active_speed, - &tp->link_config.active_duplex); - } - if (tp->link_config.active_speed == SPEED_INVALID) - return -EINVAL; - } - return 0; } @@ -1411,7 +1390,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp) if (current_link_up == 0) { u32 tmp; - tg3_phy_copper_begin(tp, 0); + tg3_phy_copper_begin(tp); tg3_readphy(tp, MII_BMSR, &tmp); tg3_readphy(tp, MII_BMSR, &tmp); -- 2.53.0