summaryrefslogtreecommitdiff
path: root/sys/dev/mii/tlphy.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-09-26 00:59:59 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-09-26 00:59:59 +0000
commit8e8d95d27df054585cfa2d500a840a20e3ebf363 (patch)
tree8943a7f0c99b56b78d31cd3c72aa1427b2ebc9db /sys/dev/mii/tlphy.c
parent2d35bc93d317846717f475b07c067c11816dae9d (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/tlphy.c')
-rw-r--r--sys/dev/mii/tlphy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c
index b7318ac12e5..3dadb57e574 100644
--- a/sys/dev/mii/tlphy.c
+++ b/sys/dev/mii/tlphy.c
@@ -118,6 +118,10 @@ int tlphy_auto(struct tlphy_softc *, int);
void tlphy_acomp(struct tlphy_softc *);
void tlphy_status(struct mii_softc *);
+const struct mii_phy_funcs tlphy_funcs = {
+ tlphy_service, tlphy_status, mii_phy_reset,
+};
+
int
tlphymatch(parent, match, aux)
struct device *parent;
@@ -147,13 +151,12 @@ tlphyattach(parent, self, aux)
sc->sc_mii.mii_inst = mii->mii_instance;
sc->sc_mii.mii_phy = ma->mii_phyno;
- sc->sc_mii.mii_service = tlphy_service;
- sc->sc_mii.mii_status = tlphy_status;
+ sc->mii_funcs = &tlphy_funcs;
sc->sc_mii.mii_pdata = mii;
sc->sc_mii.mii_flags = mii->mii_flags;
sc->sc_mii.mii_flags &= ~MIIF_NOISOLATE;
- mii_phy_reset(&sc->sc_mii);
+ PHY_RESET(&sc->sc_mii);
sc->sc_mii.mii_flags |= MIIF_NOISOLATE;
/*