summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mtdphy.c
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2004-09-26 00:59:58 +0000
committerbrad <brad@openbsd.org>2004-09-26 00:59:58 +0000
commit78a92591e64c0092dc28da85ada02d797b6f6ca3 (patch)
treee7ade289fa64ea870482d849c7bd72dd96f21cce /sys/dev/mii/mtdphy.c
parentmissing word; (diff)
downloadwireguard-openbsd-78a92591e64c0092dc28da85ada02d797b6f6ca3.tar.xz
wireguard-openbsd-78a92591e64c0092dc28da85ada02d797b6f6ca3.zip
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/mtdphy.c')
-rw-r--r--sys/dev/mii/mtdphy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mii/mtdphy.c b/sys/dev/mii/mtdphy.c
index 4adc0a89a0e..a9d64abb6c0 100644
--- a/sys/dev/mii/mtdphy.c
+++ b/sys/dev/mii/mtdphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtdphy.c,v 1.8 2004/09/20 06:05:27 brad Exp $ */
+/* $OpenBSD: mtdphy.c,v 1.9 2004/09/26 00:59:58 brad Exp $ */
/*
* Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net)
@@ -59,6 +59,10 @@ struct cfdriver mtdphy_cd = {
int mtdphy_service(struct mii_softc *, struct mii_data *, int);
+const struct mii_phy_funcs mtdphy_funcs = {
+ mtdphy_service, ukphy_status, mii_phy_reset,
+};
+
int
mtdphymatch(parent, match, aux)
struct device *parent;
@@ -87,12 +91,11 @@ mtdphyattach(parent, self, aux)
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;
- sc->mii_service = mtdphy_service;
- sc->mii_status = ukphy_status;
+ sc->mii_funcs = &mtdphy_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;