summaryrefslogtreecommitdiff
path: root/sys/dev/mii/rlphy.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/rlphy.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/rlphy.c')
-rw-r--r--sys/dev/mii/rlphy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c
index f21ca0f5e4a..600bb9becd2 100644
--- a/sys/dev/mii/rlphy.c
+++ b/sys/dev/mii/rlphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlphy.c,v 1.10 2004/09/23 15:32:59 fgsch Exp $ */
+/* $OpenBSD: rlphy.c,v 1.11 2004/09/26 00:59:58 brad Exp $ */
/*
* Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net)
@@ -61,6 +61,10 @@ struct cfdriver rlphy_cd = {
int rlphy_service(struct mii_softc *, struct mii_data *, int);
void rlphy_reset(struct mii_softc *);
+const struct mii_phy_funcs rlphy_funcs = {
+ rlphy_service, ukphy_status, rlphy_reset,
+};
+
int
rlphymatch(parent, match, aux)
struct device *parent;
@@ -106,12 +110,11 @@ rlphyattach(parent, self, aux)
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;
- sc->mii_service = rlphy_service;
- sc->mii_status = ukphy_status;
+ sc->mii_funcs = &rlphy_funcs;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
- rlphy_reset(sc);
+ PHY_RESET(sc);
sc->mii_capabilities =
PHY_READ(sc, MII_BMSR) & ma->mii_capmask;