From 279fe8d15669ab601a2b4d94cce9e607d8012b0b Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 29 Apr 2002 13:07:38 +0000 Subject: Make one generic mii_phy_detach() to replace 19 slightly different ones. Rename mii_phy_auto_stop() mii_phy_down(). Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did. --- sys/dev/dc/dcphy.c | 17 +---------------- sys/dev/dc/pnphy.c | 17 +---------------- 2 files changed, 2 insertions(+), 32 deletions(-) (limited to 'sys/dev/dc') diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index 4138b3cb27c0..3426b11e935a 100644 --- a/sys/dev/dc/dcphy.c +++ b/sys/dev/dc/dcphy.c @@ -95,13 +95,12 @@ static const char rcsid[] = static int dcphy_probe (device_t); static int dcphy_attach (device_t); -static int dcphy_detach (device_t); static device_method_t dcphy_methods[] = { /* device interface */ DEVMETHOD(device_probe, dcphy_probe), DEVMETHOD(device_attach, dcphy_attach), - DEVMETHOD(device_detach, dcphy_detach), + DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), { 0, 0 } }; @@ -204,20 +203,6 @@ static int dcphy_attach(dev) return(0); } -static int dcphy_detach(dev) - device_t dev; -{ - struct mii_softc *sc; - struct mii_data *mii; - - sc = device_get_softc(dev); - mii = device_get_softc(device_get_parent(dev)); - sc->mii_dev = NULL; - LIST_REMOVE(sc, mii_list); - - return(0); -} - static int dcphy_service(sc, mii, cmd) struct mii_softc *sc; diff --git a/sys/dev/dc/pnphy.c b/sys/dev/dc/pnphy.c index b3ff92306996..9b1ec55d2e09 100644 --- a/sys/dev/dc/pnphy.c +++ b/sys/dev/dc/pnphy.c @@ -82,13 +82,12 @@ static const char rcsid[] = static int pnphy_probe (device_t); static int pnphy_attach (device_t); -static int pnphy_detach (device_t); static device_method_t pnphy_methods[] = { /* device interface */ DEVMETHOD(device_probe, pnphy_probe), DEVMETHOD(device_attach, pnphy_attach), - DEVMETHOD(device_detach, pnphy_detach), + DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), { 0, 0 } }; @@ -167,20 +166,6 @@ static int pnphy_attach(dev) return(0); } -static int pnphy_detach(dev) - device_t dev; -{ - struct mii_softc *sc; - struct mii_data *mii; - - sc = device_get_softc(dev); - mii = device_get_softc(device_get_parent(dev)); - sc->mii_dev = NULL; - LIST_REMOVE(sc, mii_list); - - return(0); -} - static int pnphy_service(sc, mii, cmd) struct mii_softc *sc; -- cgit v1.3