summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mii.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-02-14 12:10:03 +0000
committerglebius <glebius@FreeBSD.org>2006-02-14 12:10:03 +0000
commit2e5f3296e55949ce8b624df724e7356f71d04ec0 (patch)
tree9ba2b71cf1d58835c6cc2982582bfcdbba49433c /sys/dev/mii/mii.c
parentfce3a7325a8849b58c71b811b5c38d1680f881c7 (diff)
downloadFreeBSD-src-2e5f3296e55949ce8b624df724e7356f71d04ec0.zip
FreeBSD-src-2e5f3296e55949ce8b624df724e7356f71d04ec0.tar.gz
- Introduce ifmedia_baudrate(), which returns correct baudrate of the
given media status. [1] - Utilize ifmedia_baudrate() in miibus_statchg() to update ifp->if_baudrate. Obtained from: NetBSD [1]
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r--sys/dev/mii/mii.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index c640e13..2511068 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -240,9 +240,20 @@ static void
miibus_statchg(device_t dev)
{
device_t parent;
+ struct mii_data *mii;
+ struct ifnet *ifp;
parent = device_get_parent(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);
return;
}
OpenPOWER on IntegriCloud