Don't report current link status if interface is not UP.

If interface is not UP, the current link status wouldn't
reflect the negotiated status.
This commit is contained in:
Pyun YongHyeon 2009-12-14 22:30:07 +00:00
parent 871d21ce2d
commit 5f26dcd859
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200555

View File

@ -2177,6 +2177,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
mii = device_get_softc(sc->vge_miibus);
VGE_LOCK(sc);
if ((ifp->if_flags & IFF_UP) == 0) {
VGE_UNLOCK(sc);
return;
}
mii_pollstat(mii);
VGE_UNLOCK(sc);
ifmr->ifm_active = mii->mii_media_active;