diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-09-26 00:59:59 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-09-26 00:59:59 +0000 |
commit | 8e8d95d27df054585cfa2d500a840a20e3ebf363 (patch) | |
tree | 8943a7f0c99b56b78d31cd3c72aa1427b2ebc9db /sys/dev/mii/bmtphy.c | |
parent | 2d35bc93d317846717f475b07c067c11816dae9d (diff) |
Restructure the PHY entry points to use a structure of
entry points instead of descrete function pointers, and
extend this to include a "reset" entry point. Make sure
any PHY-specific reset routine is always used.
From NetBSD
ok mcbride@
Diffstat (limited to 'sys/dev/mii/bmtphy.c')
-rw-r--r-- | sys/dev/mii/bmtphy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c index 452684ce711..0f87f3aac29 100644 --- a/sys/dev/mii/bmtphy.c +++ b/sys/dev/mii/bmtphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bmtphy.c,v 1.6 2004/09/20 06:05:27 brad Exp $ */ +/* $OpenBSD: bmtphy.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ /* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -63,6 +63,10 @@ int bmtphy_service(struct mii_softc *, struct mii_data *, int); void bmtphy_status(struct mii_softc *); void bmtphy_reset(struct mii_softc *); +const struct mii_phy_funcs bmtphy_funcs = { + bmtphy_service, bmtphy_status, bmtphy_reset, +}; + int bmtphymatch(parent, match, aux) struct device *parent; @@ -101,13 +105,12 @@ bmtphyattach(parent, self, aux) sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; - sc->mii_service = bmtphy_service; - sc->mii_status = bmtphy_status; + sc->mii_funcs = &bmtphy_funcs; sc->mii_pdata = mii; sc->mii_flags = mii->mii_flags; sc->mii_anegticks = 5; - bmtphy_reset(sc); + PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; |