nsphy.c (95667) | nsphy.c (95722) |
---|---|
1/* $NetBSD: nsphy.c,v 1.18 1999/07/14 23:57:36 thorpej Exp $ */ 2 3/*- 4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 78 unchanged lines hidden (view full) --- 87#include <dev/mii/miidevs.h> 88 89#include <dev/mii/nsphyreg.h> 90 91#include "miibus_if.h" 92 93#if !defined(lint) 94static const char rcsid[] = | 1/* $NetBSD: nsphy.c,v 1.18 1999/07/14 23:57:36 thorpej Exp $ */ 2 3/*- 4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 78 unchanged lines hidden (view full) --- 87#include <dev/mii/miidevs.h> 88 89#include <dev/mii/nsphyreg.h> 90 91#include "miibus_if.h" 92 93#if !defined(lint) 94static const char rcsid[] = |
95 "$FreeBSD: head/sys/dev/mii/nsphy.c 95667 2002-04-28 19:25:07Z phk $"; | 95 "$FreeBSD: head/sys/dev/mii/nsphy.c 95722 2002-04-29 13:07:38Z phk $"; |
96#endif 97 98static int nsphy_probe (device_t); 99static int nsphy_attach (device_t); | 96#endif 97 98static int nsphy_probe (device_t); 99static int nsphy_attach (device_t); |
100static int nsphy_detach (device_t); | |
101 102static device_method_t nsphy_methods[] = { 103 /* device interface */ 104 DEVMETHOD(device_probe, nsphy_probe), 105 DEVMETHOD(device_attach, nsphy_attach), | 100 101static device_method_t nsphy_methods[] = { 102 /* device interface */ 103 DEVMETHOD(device_probe, nsphy_probe), 104 DEVMETHOD(device_attach, nsphy_attach), |
106 DEVMETHOD(device_detach, nsphy_detach), | 105 DEVMETHOD(device_detach, mii_phy_detach), |
107 DEVMETHOD(device_shutdown, bus_generic_shutdown), 108 { 0, 0 } 109}; 110 111static devclass_t nsphy_devclass; 112 113static driver_t nsphy_driver = { 114 "nsphy", --- 69 unchanged lines hidden (view full) --- 184 mii_add_media(sc); 185 printf("\n"); 186#undef ADD 187 188 MIIBUS_MEDIAINIT(sc->mii_dev); 189 return(0); 190} 191 | 106 DEVMETHOD(device_shutdown, bus_generic_shutdown), 107 { 0, 0 } 108}; 109 110static devclass_t nsphy_devclass; 111 112static driver_t nsphy_driver = { 113 "nsphy", --- 69 unchanged lines hidden (view full) --- 183 mii_add_media(sc); 184 printf("\n"); 185#undef ADD 186 187 MIIBUS_MEDIAINIT(sc->mii_dev); 188 return(0); 189} 190 |
192static int nsphy_detach(dev) 193 device_t dev; 194{ 195 struct mii_softc *sc; 196 struct mii_data *mii; 197 198 sc = device_get_softc(dev); 199 mii = device_get_softc(device_get_parent(dev)); 200 mii_phy_auto_stop(sc); 201 sc->mii_dev = NULL; 202 LIST_REMOVE(sc, mii_list); 203 204 return(0); 205} 206 | |
207static int 208nsphy_service(sc, mii, cmd) 209 struct mii_softc *sc; 210 struct mii_data *mii; 211 int cmd; 212{ 213 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 214 int reg; --- 183 unchanged lines hidden --- | 191static int 192nsphy_service(sc, mii, cmd) 193 struct mii_softc *sc; 194 struct mii_data *mii; 195 int cmd; 196{ 197 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 198 int reg; --- 183 unchanged lines hidden --- |