PERFORCE change 109303 for review
Sam Leffler
sam at FreeBSD.org
Sun Nov 5 21:55:01 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=109303
Change 109303 by sam at 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");
More information about the p4-projects
mailing list