summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mii.c
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-06-11 00:20:38 +0000
committerbrooks <brooks@FreeBSD.org>2005-06-11 00:20:38 +0000
commit56b665cc88be843c01f6af8c88def1faa3cc9e11 (patch)
tree309c3062f0a7521de5c1216e25221b33657a0085 /sys/dev/mii/mii.c
parent79ca8ce4826a3a923d1cd391bd2400cb70887243 (diff)
downloadFreeBSD-src-56b665cc88be843c01f6af8c88def1faa3cc9e11.zip
FreeBSD-src-56b665cc88be843c01f6af8c88def1faa3cc9e11.tar.gz
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.
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r--sys/dev/mii/mii.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index 51e2ffc..c640e13 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -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
OpenPOWER on IntegriCloud