tlphy.c (95667) | tlphy.c (95722) |
---|---|
1/* $NetBSD: tlphy.c,v 1.18 1999/05/14 11:40:28 drochner 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, --- 80 unchanged lines hidden (view full) --- 89#include <dev/mii/miidevs.h> 90 91#include <dev/mii/tlphyreg.h> 92 93#include "miibus_if.h" 94 95#if !defined(lint) 96static const char rcsid[] = | 1/* $NetBSD: tlphy.c,v 1.18 1999/05/14 11:40:28 drochner 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, --- 80 unchanged lines hidden (view full) --- 89#include <dev/mii/miidevs.h> 90 91#include <dev/mii/tlphyreg.h> 92 93#include "miibus_if.h" 94 95#if !defined(lint) 96static const char rcsid[] = |
97 "$FreeBSD: head/sys/dev/mii/tlphy.c 95667 2002-04-28 19:25:07Z phk $"; | 97 "$FreeBSD: head/sys/dev/mii/tlphy.c 95722 2002-04-29 13:07:38Z phk $"; |
98#endif 99 100struct tlphy_softc { 101 struct mii_softc sc_mii; /* generic PHY */ 102 int sc_need_acomp; 103}; 104 105static int tlphy_probe (device_t); 106static int tlphy_attach (device_t); | 98#endif 99 100struct tlphy_softc { 101 struct mii_softc sc_mii; /* generic PHY */ 102 int sc_need_acomp; 103}; 104 105static int tlphy_probe (device_t); 106static int tlphy_attach (device_t); |
107static int tlphy_detach (device_t); | |
108 109static device_method_t tlphy_methods[] = { 110 /* device interface */ 111 DEVMETHOD(device_probe, tlphy_probe), 112 DEVMETHOD(device_attach, tlphy_attach), | 107 108static device_method_t tlphy_methods[] = { 109 /* device interface */ 110 DEVMETHOD(device_probe, tlphy_probe), 111 DEVMETHOD(device_attach, tlphy_attach), |
113 DEVMETHOD(device_detach, tlphy_detach), | 112 DEVMETHOD(device_detach, mii_phy_detach), |
114 DEVMETHOD(device_shutdown, bus_generic_shutdown), 115 { 0, 0 } 116}; 117 118static devclass_t tlphy_devclass; 119 120static driver_t tlphy_driver = { 121 "tlphy", --- 99 unchanged lines hidden (view full) --- 221 222 printf("\n"); 223#undef ADD 224#undef PRINT 225 MIIBUS_MEDIAINIT(sc->sc_mii.mii_dev); 226 return(0); 227} 228 | 113 DEVMETHOD(device_shutdown, bus_generic_shutdown), 114 { 0, 0 } 115}; 116 117static devclass_t tlphy_devclass; 118 119static driver_t tlphy_driver = { 120 "tlphy", --- 99 unchanged lines hidden (view full) --- 220 221 printf("\n"); 222#undef ADD 223#undef PRINT 224 MIIBUS_MEDIAINIT(sc->sc_mii.mii_dev); 225 return(0); 226} 227 |
229static int tlphy_detach(dev) 230 device_t dev; 231{ 232 struct tlphy_softc *sc; 233 struct mii_data *mii; 234 235 sc = device_get_softc(dev); 236 mii = device_get_softc(device_get_parent(dev)); 237 sc->sc_mii.mii_dev = NULL; 238 LIST_REMOVE(&sc->sc_mii, mii_list); 239 240 return(0); 241} 242 | |
243static int 244tlphy_service(self, mii, cmd) 245 struct mii_softc *self; 246 struct mii_data *mii; 247 int cmd; 248{ 249 struct tlphy_softc *sc = (struct tlphy_softc *)self; 250 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; --- 203 unchanged lines hidden --- | 228static int 229tlphy_service(self, mii, cmd) 230 struct mii_softc *self; 231 struct mii_data *mii; 232 int cmd; 233{ 234 struct tlphy_softc *sc = (struct tlphy_softc *)self; 235 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; --- 203 unchanged lines hidden --- |