diff options
author | imp <imp@FreeBSD.org> | 2010-03-17 22:45:53 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2010-03-17 22:45:53 +0000 |
commit | b55593dee5f64317be6472d0338098432211dbe4 (patch) | |
tree | ded4956d12c68bd9c5d60163bf41d402245d5ac5 | |
parent | 0c9a31ed99969559c9216a0483e3889f0754a214 (diff) | |
download | FreeBSD-src-b55593dee5f64317be6472d0338098432211dbe4.zip FreeBSD-src-b55593dee5f64317be6472d0338098432211dbe4.tar.gz |
Remove two instances of the evil hack to get the ifnet. mii_ifp is
set early enough that we don't need to do these hacks anymore.
-rw-r--r-- | sys/dev/mii/mii.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 63b6254..352ff97 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -259,13 +259,7 @@ miibus_statchg(device_t dev) MIIBUS_STATCHG(parent); mii = device_get_softc(dev); - - /* - * Note that each NIC's softc must start with an ifnet pointer. - * XXX: EVIL HACK! - */ - ifp = *(struct ifnet **)device_get_softc(parent); - ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active); + mii->mii_ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active); return; } @@ -288,11 +282,7 @@ miibus_linkchg(device_t dev) link_state = LINK_STATE_DOWN; } else link_state = LINK_STATE_UNKNOWN; - /* - * Note that each NIC's softc must start with an ifnet pointer. - * XXX: EVIL HACK! - */ - if_link_state_change(*(struct ifnet**)device_get_softc(parent), link_state); + if_link_state_change(mii->mii_ifp, link_state); } static void |