summaryrefslogtreecommitdiff
path: root/sys/dev/mii/nsphyter.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/nsphyter.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/nsphyter.c')
-rw-r--r--sys/dev/mii/nsphyter.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c
index 753c891c6dd..dd833b296b6 100644
--- a/sys/dev/mii/nsphyter.c
+++ b/sys/dev/mii/nsphyter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsphyter.c,v 1.6 2004/09/20 06:05:27 brad Exp $ */
+/* $OpenBSD: nsphyter.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */
/* $NetBSD: nsphyter.c,v 1.5 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -103,6 +103,10 @@ struct cfdriver nsphyter_cd = {
int nsphyter_service(struct mii_softc *, struct mii_data *, int);
void nsphyter_status(struct mii_softc *);
+const struct mii_phy_funcs nsphyter_funcs = {
+ nsphyter_service, nsphyter_status, mii_phy_reset,
+};
+
int
nsphytermatch(parent, match, aux)
struct device *parent;
@@ -139,12 +143,11 @@ nsphyterattach(parent, self, aux)
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;
- sc->mii_service = nsphyter_service;
- sc->mii_status = nsphyter_status;
+ sc->mii_funcs = &nsphyter_funcs;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
- mii_phy_reset(sc);
+ PHY_RESET(sc);
sc->mii_capabilities =
PHY_READ(sc, MII_BMSR) & ma->mii_capmask;