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/amphy.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/amphy.c')
-rw-r--r-- | sys/dev/mii/amphy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/amphy.c b/sys/dev/mii/amphy.c index a3eda893ad4..fdf8eb28e34 100644 --- a/sys/dev/mii/amphy.c +++ b/sys/dev/mii/amphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amphy.c,v 1.6 2004/09/20 06:05:27 brad Exp $ */ +/* $OpenBSD: amphy.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -70,6 +70,10 @@ struct cfdriver amphy_cd = { int amphy_service(struct mii_softc *, struct mii_data *, int); void amphy_status(struct mii_softc *); +const struct mii_phy_funcs amphy_funcs = { + amphy_service, amphy_status, mii_phy_reset, +}; + int amphymatch(parent, match, aux) struct device *parent; @@ -113,14 +117,13 @@ amphyattach(parent, self, aux) sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; - sc->mii_service = amphy_service; - sc->mii_status = amphy_status; + sc->mii_funcs = &hy_funcs; sc->mii_pdata = mii; sc->mii_flags = mii->mii_flags; sc->mii_flags |= MIIF_NOISOLATE; - mii_phy_reset(sc); + PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; |