diff options
author | Sriram <srk@ti.com> | 2009-09-24 16:32:53 +0530 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2009-10-21 16:46:36 -0400 |
commit | b57d400a5778b7b5c2176f2d1edd0aa6246f8a10 (patch) | |
tree | 0015985b4a99d235edc8d475dbf43dc5c0978290 | |
parent | 9cca25aade51736579d8684ca8ecf73fbe922a1b (diff) |
EMAC driver: check for auto-negotiation status periodically.
Instead of choosing a conservative timeout interval for auto-
negotiation, check for completion status periodically in a loop.
This should reduce the timeout interval significantly if the
negotiation is completed early.
-rw-r--r-- | drivers/net/ticpgmac.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ticpgmac.c b/drivers/net/ticpgmac.c index 94bd8f9004..6d7f64c8f7 100644 --- a/drivers/net/ticpgmac.c +++ b/drivers/net/ticpgmac.c @@ -332,7 +332,12 @@ static int gen_auto_negotiate(int phy_addr) do{ udelay(40000); cntr++; - }while(cntr < 150 ); + + if (cpgmac_eth_phy_read(phy_addr, PHY_BMSR, &tmp)){ + if(tmp & PHY_BMSR_AUTN_COMP) + break; + } + }while(cntr < 150 ); if (!cpgmac_eth_phy_read(phy_addr, PHY_BMSR, &tmp)) return(0); |