brgphy.c (95673) | brgphy.c (95722) |
---|---|
1/* 2 * Copyright (c) 2000 3 * Bill Paul <wpaul@ee.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) 2000 3 * Bill Paul <wpaul@ee.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/brgphy.c 95673 2002-04-28 20:34:20Z phk $ | 32 * $FreeBSD: head/sys/dev/mii/brgphy.c 95722 2002-04-29 13:07:38Z phk $ |
33 */ 34 35/* 36 * Driver for the Broadcom BCR5400 1000baseTX PHY. Speed is always 37 * 1000mbps; all we need to negotiate here is full or half duplex. 38 */ 39 40#include <sys/param.h> --- 13 unchanged lines hidden (view full) --- 54#include <dev/mii/miidevs.h> 55 56#include <dev/mii/brgphyreg.h> 57 58#include "miibus_if.h" 59 60#if !defined(lint) 61static const char rcsid[] = | 33 */ 34 35/* 36 * Driver for the Broadcom BCR5400 1000baseTX PHY. Speed is always 37 * 1000mbps; all we need to negotiate here is full or half duplex. 38 */ 39 40#include <sys/param.h> --- 13 unchanged lines hidden (view full) --- 54#include <dev/mii/miidevs.h> 55 56#include <dev/mii/brgphyreg.h> 57 58#include "miibus_if.h" 59 60#if !defined(lint) 61static const char rcsid[] = |
62 "$FreeBSD: head/sys/dev/mii/brgphy.c 95673 2002-04-28 20:34:20Z phk $"; | 62 "$FreeBSD: head/sys/dev/mii/brgphy.c 95722 2002-04-29 13:07:38Z phk $"; |
63#endif 64 65static int brgphy_probe (device_t); 66static int brgphy_attach (device_t); | 63#endif 64 65static int brgphy_probe (device_t); 66static int brgphy_attach (device_t); |
67static int brgphy_detach (device_t); | |
68 69static device_method_t brgphy_methods[] = { 70 /* device interface */ 71 DEVMETHOD(device_probe, brgphy_probe), 72 DEVMETHOD(device_attach, brgphy_attach), | 67 68static device_method_t brgphy_methods[] = { 69 /* device interface */ 70 DEVMETHOD(device_probe, brgphy_probe), 71 DEVMETHOD(device_attach, brgphy_attach), |
73 DEVMETHOD(device_detach, brgphy_detach), | 72 DEVMETHOD(device_detach, mii_phy_detach), |
74 DEVMETHOD(device_shutdown, bus_generic_shutdown), 75 { 0, 0 } 76}; 77 78static devclass_t brgphy_devclass; 79 80static driver_t brgphy_driver = { 81 "brgphy", --- 92 unchanged lines hidden (view full) --- 174 printf("\n"); 175#undef ADD 176#undef PRINT 177 178 MIIBUS_MEDIAINIT(sc->mii_dev); 179 return(0); 180} 181 | 73 DEVMETHOD(device_shutdown, bus_generic_shutdown), 74 { 0, 0 } 75}; 76 77static devclass_t brgphy_devclass; 78 79static driver_t brgphy_driver = { 80 "brgphy", --- 92 unchanged lines hidden (view full) --- 173 printf("\n"); 174#undef ADD 175#undef PRINT 176 177 MIIBUS_MEDIAINIT(sc->mii_dev); 178 return(0); 179} 180 |
182static int brgphy_detach(dev) 183 device_t dev; 184{ 185 struct mii_softc *sc; 186 struct mii_data *mii; 187 188 sc = device_get_softc(dev); 189 mii = device_get_softc(device_get_parent(dev)); 190 if (sc->mii_flags & MIIF_DOINGAUTO) 191 untimeout(mii_phy_auto_timeout, sc, sc->mii_auto_ch); 192 193 sc->mii_dev = NULL; 194 LIST_REMOVE(sc, mii_list); 195 196 return(0); 197} 198 | |
199static int 200brgphy_service(sc, mii, cmd) 201 struct mii_softc *sc; 202 struct mii_data *mii; 203 int cmd; 204{ 205 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 206 int reg, speed; --- 260 unchanged lines hidden --- | 181static int 182brgphy_service(sc, mii, cmd) 183 struct mii_softc *sc; 184 struct mii_data *mii; 185 int cmd; 186{ 187 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 188 int reg, speed; --- 260 unchanged lines hidden --- |