Reset autonegotation timer if media option is not IFM_AUTO.

Make mii_ticks advance, autonegiation is retried every
mii_anegticks seconds.
This commit is contained in:
Pyun YongHyeon 2007-11-16 10:39:18 +00:00
parent 55da31830a
commit 5f36bdfcc2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173667

View file

@ -397,8 +397,10 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/*
* Only used for autonegotiation.
*/
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
sc->mii_ticks = 0;
break;
}
/*
* check for link.
@ -411,6 +413,8 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
}
/* Announce link loss right after it happens. */
if (sc->mii_ticks++ == 0)
break;
if (sc->mii_ticks <= sc->mii_anegticks)
return (0);