Date: Sun, 5 Nov 2006 21:54:53 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109303 for review Message-ID: <200611052154.kA5LsrT3091698@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109303 Change 109303 by sam@sam_ebb on 2006/11/05 21:54:11 Fix crash after ifconfig npe1; mii requires that a pointer to the ifnet be the FIRST element in the softc. This is truly gross and horrible; never knew mii required this. Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#3 (text+ko) ==== @@ -82,13 +82,14 @@ }; struct npe_softc { + /* XXX mii requires this be first; do not move! */ + struct ifnet *sc_ifp; /* ifnet pointer */ struct mtx sc_mtx; /* basically a perimeter lock */ device_t sc_dev; bus_space_tag_t sc_iot; bus_space_handle_t sc_ioh; /* MAC register window */ device_t sc_mii; /* child miibus */ bus_space_handle_t sc_miih; /* MII register window */ - struct ifnet *sc_ifp; /* ifnet pointer */ struct ixpnpe_softc *sc_npe; /* NPE support */ int sc_portid; struct callout tick_ch; /* Tick callout */ @@ -243,6 +244,7 @@ npe_getmac(sc, eaddr); + /* NB: must be setup prior to invoking mii code */ sc->sc_ifp = ifp = if_alloc(IFT_ETHER); if (mii_phy_probe(dev, &sc->sc_mii, npe_ifmedia_update, npe_ifmedia_status)) { device_printf(dev, "Cannot find my PHY.\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611052154.kA5LsrT3091698>