xmphy.c (67164) | xmphy.c (69925) |
---|---|
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/xmphy.c 67164 2000-10-15 14:19:01Z phk $ | 32 * $FreeBSD: head/sys/dev/mii/xmphy.c 69925 2000-12-12 19:31:14Z wpaul $ |
33 */ 34 35/* 36 * driver for the XaQti XMAC II's internal PHY. This is sort of 37 * like a 10/100 PHY, except the only thing we're really autoselecting 38 * here is full/half duplex. Speed is always 1000mbps. 39 */ 40 --- 13 unchanged lines hidden (view full) --- 54#include <dev/mii/miidevs.h> 55 56#include <dev/mii/xmphyreg.h> 57 58#include "miibus_if.h" 59 60#if !defined(lint) 61static const char rcsid[] = | 33 */ 34 35/* 36 * driver for the XaQti XMAC II's internal PHY. This is sort of 37 * like a 10/100 PHY, except the only thing we're really autoselecting 38 * here is full/half duplex. Speed is always 1000mbps. 39 */ 40 --- 13 unchanged lines hidden (view full) --- 54#include <dev/mii/miidevs.h> 55 56#include <dev/mii/xmphyreg.h> 57 58#include "miibus_if.h" 59 60#if !defined(lint) 61static const char rcsid[] = |
62 "$FreeBSD: head/sys/dev/mii/xmphy.c 67164 2000-10-15 14:19:01Z phk $"; | 62 "$FreeBSD: head/sys/dev/mii/xmphy.c 69925 2000-12-12 19:31:14Z wpaul $"; |
63#endif 64 65static int xmphy_probe __P((device_t)); 66static int xmphy_attach __P((device_t)); 67static int xmphy_detach __P((device_t)); 68 69static device_method_t xmphy_methods[] = { 70 /* device interface */ --- 90 unchanged lines hidden (view full) --- 161static int xmphy_detach(dev) 162 device_t dev; 163{ 164 struct mii_softc *sc; 165 struct mii_data *mii; 166 167 sc = device_get_softc(dev); 168 mii = device_get_softc(device_get_parent(dev)); | 63#endif 64 65static int xmphy_probe __P((device_t)); 66static int xmphy_attach __P((device_t)); 67static int xmphy_detach __P((device_t)); 68 69static device_method_t xmphy_methods[] = { 70 /* device interface */ --- 90 unchanged lines hidden (view full) --- 161static int xmphy_detach(dev) 162 device_t dev; 163{ 164 struct mii_softc *sc; 165 struct mii_data *mii; 166 167 sc = device_get_softc(dev); 168 mii = device_get_softc(device_get_parent(dev)); |
169 if (sc->mii_flags & MIIF_DOINGAUTO) 170 untimeout(mii_phy_auto_timeout, sc, sc->mii_auto_ch); |
|
169 sc->mii_dev = NULL; 170 LIST_REMOVE(sc, mii_list); 171 172 return(0); 173} 174int 175xmphy_service(sc, mii, cmd) 176 struct mii_softc *sc; --- 203 unchanged lines hidden (view full) --- 380 381 /* 382 * Just let it finish asynchronously. This is for the benefit of 383 * the tick handler driving autonegotiation. Don't want 500ms 384 * delays all the time while the system is running! 385 */ 386 if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { 387 mii->mii_flags |= MIIF_DOINGAUTO; | 171 sc->mii_dev = NULL; 172 LIST_REMOVE(sc, mii_list); 173 174 return(0); 175} 176int 177xmphy_service(sc, mii, cmd) 178 struct mii_softc *sc; --- 203 unchanged lines hidden (view full) --- 382 383 /* 384 * Just let it finish asynchronously. This is for the benefit of 385 * the tick handler driving autonegotiation. Don't want 500ms 386 * delays all the time while the system is running! 387 */ 388 if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { 389 mii->mii_flags |= MIIF_DOINGAUTO; |
388 timeout(mii_phy_auto_timeout, mii, hz >> 1); | 390 mii->mii_auto_ch = timeout(mii_phy_auto_timeout, mii, hz >> 1); |
389 } 390 return (EJUSTRETURN); 391} | 391 } 392 return (EJUSTRETURN); 393} |