diff options
author | 2005-03-28 03:11:06 +0000 | |
---|---|---|
committer | 2005-03-28 03:11:06 +0000 | |
commit | f6cfec8ed46fde7acaf9fdcfc2c6570af245d634 (patch) | |
tree | 8d3ad2e333a5182666323961be45db4a0143d8f3 | |
parent | shorten dmesg (diff) | |
download | wireguard-openbsd-f6cfec8ed46fde7acaf9fdcfc2c6570af245d634.tar.xz wireguard-openbsd-f6cfec8ed46fde7acaf9fdcfc2c6570af245d634.zip |
Use mii_phy_tick() instead of duplicating code.
tested & ok pvalchev@
-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. */ |