diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-03-28 03:11:07 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-03-28 03:11:07 +0000 |
commit | 61907b238f157016f47f7ed574070015cc7404b0 (patch) | |
tree | 08335f140089c3381c1c2698b5528a52721f6c1a /sys | |
parent | 276aadb41792dc99977011dacd5ef1ef1b0b1e35 (diff) |
Use mii_phy_tick() instead of duplicating code.
tested & ok pvalchev@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mii/ciphy.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index ce1d7660bb3..ac8d19c2261 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciphy.c,v 1.5 2005/03/26 04:40:09 krw Exp $ */ +/* $OpenBSD: ciphy.c,v 1.6 2005/03/28 03:11:06 krw Exp $ */ /* $FreeBSD: ciphy.c,v 1.1 2004/09/10 20:57:45 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -247,36 +247,9 @@ setit: if (IFM_INST(ife->ifm_media) != sc->mii_inst) return (0); - /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if (mii_phy_tick(sc) == EJUSTRETURN) return (0); - - /* - * Only used for autonegotiation. - */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) - break; - - /* - * Check to see if we have link. If we do, we don't - * need to restart the autonegotiation process. Read - * the BMSR twice in case it's latched. - */ - reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); - if (reg & BMSR_LINK) - break; - - /* - * Only retry autonegotiation every mii_anegticks seconds. - */ - if (++sc->mii_ticks <= sc->mii_anegticks) - break; - - sc->mii_ticks = 0; - mii_phy_auto(sc, 0); - return (0); + break; } /* Update the media status. */ |