Add an evil hack to work around a cast from the softc to the ifnet that

I missed.  Since I did no rearrange any softcs, casting the result of
device_get_softc() to (struct ifnet **) and derefrencing it yeilds a
pointer to the ifp.  This makes at least vr(4) nics work.
This commit is contained in:
Brooks Davis 2005-06-11 00:20:38 +00:00
parent faefda0be0
commit f32e678d0c

View File

@ -172,9 +172,10 @@ miibus_attach(device_t dev)
mii = device_get_softc(dev);
/*
* Note that each NIC's softc must start with an ifnet structure.
* Note that each NIC's softc must start with an ifnet pointer.
* XXX: EVIL HACK!
*/
mii->mii_ifp = device_get_softc(device_get_parent(dev));
mii->mii_ifp = *(struct ifnet**)device_get_softc(device_get_parent(dev));
v = device_get_ivars(dev);
ifmedia_upd = v[0];
ifmedia_sts = v[1];
@ -265,9 +266,10 @@ miibus_linkchg(device_t dev)
} else
link_state = LINK_STATE_UNKNOWN;
/*
* Note that each NIC's softc must start with an ifnet structure.
* Note that each NIC's softc must start with an ifnet pointer.
* XXX: EVIL HACK!
*/
if_link_state_change(device_get_softc(parent), link_state);
if_link_state_change(*(struct ifnet**)device_get_softc(parent), link_state);
}
static void