aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii/exphy.c
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>2001-09-29 19:18:52 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>2001-09-29 19:18:52 +0000
commitd9730b8b5308cdb98f8c628dc0a02c8182eca8af (patch)
treee747bfa7e8d363f3c895759cfbfa10fc7ec0841e /sys/dev/mii/exphy.c
parent105cb0c6a95dc84065de6db49c19441aded99961 (diff)
downloadsrc-d9730b8b5308cdb98f8c628dc0a02c8182eca8af.tar.gz
src-d9730b8b5308cdb98f8c628dc0a02c8182eca8af.zip
Cleanup pass for mii drivers.
. Make internal service routines static. . Use a consistent ordering of checks in MII_TICK. Do the work in the mii_phy_tick() subroutine if appropriate. . Call mii_phy_update() to trigger the callbacks.
Notes
Notes: svn path=/head/; revision=84145
Diffstat (limited to 'sys/dev/mii/exphy.c')
-rw-r--r--sys/dev/mii/exphy.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/dev/mii/exphy.c b/sys/dev/mii/exphy.c
index bbe1cc0c910a..39d07429b194 100644
--- a/sys/dev/mii/exphy.c
+++ b/sys/dev/mii/exphy.c
@@ -114,8 +114,8 @@ static driver_t exphy_driver = {
DRIVER_MODULE(xlphy, miibus, exphy_driver, exphy_devclass, 0, 0);
-int exphy_service __P((struct mii_softc *, struct mii_data *, int));
-void exphy_reset __P((struct mii_softc *));
+static int exphy_service __P((struct mii_softc *, struct mii_data *, int));
+static void exphy_reset __P((struct mii_softc *));
static int exphy_probe(dev)
device_t dev;
@@ -221,7 +221,7 @@ static int exphy_detach(dev)
return(0);
}
-int
+static int
exphy_service(sc, mii, cmd)
struct mii_softc *sc;
struct mii_data *mii;
@@ -272,16 +272,16 @@ exphy_service(sc, mii, cmd)
case MII_TICK:
/*
- * Only used for autonegotiation.
+ * Is the interface even up?
*/
- if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
+ if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
return (0);
/*
- * Is the interface even up?
+ * Only used for autonegotiation.
*/
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return (0);
+ if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
+ break;
/*
* The 3Com PHY's autonegotiation doesn't need to be
@@ -294,14 +294,11 @@ exphy_service(sc, mii, cmd)
ukphy_status(sc);
/* Callback if something changed. */
- if (sc->mii_active != mii->mii_media_active || cmd == MII_MEDIACHG) {
- MIIBUS_STATCHG(sc->mii_dev);
- sc->mii_active = mii->mii_media_active;
- }
+ mii_phy_update(sc, cmd);
return (0);
}
-void
+static void
exphy_reset(sc)
struct mii_softc *sc;
{