diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-02-14 12:10:03 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-02-14 12:10:03 +0000 |
commit | efd19b8fd01ab0d5b10c78c8eddbd9bed512b11f (patch) | |
tree | 9ba2b71cf1d58835c6cc2982582bfcdbba49433c /sys/dev/mii/mii.c | |
parent | 4bb97cfa93ab447ba8945e6498acc4415449e354 (diff) |
- 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]
Notes
Notes:
svn path=/head/; revision=155669
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r-- | sys/dev/mii/mii.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index c640e1358eba..25110687b6c2 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; } |