From 0c5eb28b6b85b05e4867ccba4b2ff116ea77d010 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Sat, 23 Aug 2003 18:09:25 +0000 Subject: [PATCH] Report media status for bitrate PHYs. --- sys/pci/if_xl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 93db5b8a5b3a..5d83acab0dfb 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -3020,17 +3020,25 @@ xl_ifmedia_sts(ifp, ifmr) { struct xl_softc *sc; u_int32_t icfg; + u_int16_t status = 0; struct mii_data *mii = NULL; sc = ifp->if_softc; if (sc->xl_miibus != NULL) mii = device_get_softc(sc->xl_miibus); + XL_SEL_WIN(4); + status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS); + XL_SEL_WIN(3); icfg = CSR_READ_4(sc, XL_W3_INTERNAL_CFG) & XL_ICFG_CONNECTOR_MASK; icfg >>= XL_ICFG_CONNECTOR_BITS; ifmr->ifm_active = IFM_ETHER; + ifmr->ifm_status = IFM_AVALID; + + if ((status & XL_MEDIASTAT_CARRIER) == 0) + ifmr->ifm_status |= IFM_ACTIVE; switch(icfg) { case XL_XCVR_10BT: