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/icsphy.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/icsphy.c')
-rw-r--r-- | sys/dev/mii/icsphy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c index 903910ee4c2..9e55557cc74 100644 --- a/sys/dev/mii/icsphy.c +++ b/sys/dev/mii/icsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icsphy.c,v 1.12 2004/09/20 06:05:27 brad Exp $ */ +/* $OpenBSD: icsphy.c,v 1.13 2004/09/26 00:59:58 brad Exp $ */ /* $NetBSD: icsphy.c,v 1.17 2000/02/02 23:34:56 thorpej Exp $ */ /*- @@ -104,6 +104,10 @@ int icsphy_service(struct mii_softc *, struct mii_data *, int); void icsphy_reset(struct mii_softc *); void icsphy_status(struct mii_softc *); +const struct mii_phy_funcs icsphy_funcs = { + icsphy_service, icsphy_status, icsphy_reset, +}; + int icsphymatch(parent, match, aux) struct device *parent; @@ -154,12 +158,11 @@ icsphyattach(parent, self, aux) sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; - sc->mii_service = icsphy_service; - sc->mii_status = icsphy_status; + sc->mii_funcs = &icsphy_funcs; sc->mii_pdata = mii; sc->mii_flags = mii->mii_flags; - icsphy_reset(sc); + PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; |