rlphy.c (95667) | rlphy.c (95722) |
---|---|
1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/dev/mii/rlphy.c 95667 2002-04-28 19:25:07Z phk $ | 32 * $FreeBSD: head/sys/dev/mii/rlphy.c 95722 2002-04-29 13:07:38Z phk $ |
33 */ 34 35/* 36 * driver for RealTek 8139 internal PHYs 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> --- 11 unchanged lines hidden (view full) --- 52 53#include <machine/bus.h> 54#include <pci/if_rlreg.h> 55 56#include "miibus_if.h" 57 58#if !defined(lint) 59static const char rcsid[] = | 33 */ 34 35/* 36 * driver for RealTek 8139 internal PHYs 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> --- 11 unchanged lines hidden (view full) --- 52 53#include <machine/bus.h> 54#include <pci/if_rlreg.h> 55 56#include "miibus_if.h" 57 58#if !defined(lint) 59static const char rcsid[] = |
60 "$FreeBSD: head/sys/dev/mii/rlphy.c 95667 2002-04-28 19:25:07Z phk $"; | 60 "$FreeBSD: head/sys/dev/mii/rlphy.c 95722 2002-04-29 13:07:38Z phk $"; |
61#endif 62 63static int rlphy_probe (device_t); 64static int rlphy_attach (device_t); | 61#endif 62 63static int rlphy_probe (device_t); 64static int rlphy_attach (device_t); |
65static int rlphy_detach (device_t); | |
66 67static device_method_t rlphy_methods[] = { 68 /* device interface */ 69 DEVMETHOD(device_probe, rlphy_probe), 70 DEVMETHOD(device_attach, rlphy_attach), | 65 66static device_method_t rlphy_methods[] = { 67 /* device interface */ 68 DEVMETHOD(device_probe, rlphy_probe), 69 DEVMETHOD(device_attach, rlphy_attach), |
71 DEVMETHOD(device_detach, rlphy_detach), | 70 DEVMETHOD(device_detach, mii_phy_detach), |
72 DEVMETHOD(device_shutdown, bus_generic_shutdown), 73 { 0, 0 } 74}; 75 76static devclass_t rlphy_devclass; 77 78static driver_t rlphy_driver = { 79 "rlphy", --- 89 unchanged lines hidden (view full) --- 169 device_printf(dev, " "); 170 mii_add_media(sc); 171 printf("\n"); 172#undef ADD 173 MIIBUS_MEDIAINIT(sc->mii_dev); 174 return(0); 175} 176 | 71 DEVMETHOD(device_shutdown, bus_generic_shutdown), 72 { 0, 0 } 73}; 74 75static devclass_t rlphy_devclass; 76 77static driver_t rlphy_driver = { 78 "rlphy", --- 89 unchanged lines hidden (view full) --- 168 device_printf(dev, " "); 169 mii_add_media(sc); 170 printf("\n"); 171#undef ADD 172 MIIBUS_MEDIAINIT(sc->mii_dev); 173 return(0); 174} 175 |
177static int rlphy_detach(dev) 178 device_t dev; 179{ 180 struct mii_softc *sc; 181 struct mii_data *mii; 182 183 sc = device_get_softc(dev); 184 mii = device_get_softc(device_get_softc(dev)); 185 mii_phy_auto_stop(sc); 186 sc->mii_dev = NULL; 187 LIST_REMOVE(sc, mii_list); 188 189 return(0); 190} 191 | |
192static int 193rlphy_service(sc, mii, cmd) 194 struct mii_softc *sc; 195 struct mii_data *mii; 196 int cmd; 197{ 198 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 199 --- 167 unchanged lines hidden --- | 176static int 177rlphy_service(sc, mii, cmd) 178 struct mii_softc *sc; 179 struct mii_data *mii; 180 int cmd; 181{ 182 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 183 --- 167 unchanged lines hidden --- |