Correct the phy_service() routine case MII_TICK to correctly track

the falling edge of a media state change.

This is in preparation for media state change notification to the
routing socket.

No objections by:	sam, wpaul, ru, bms
Brucification by:	bde
This commit is contained in:
andre 2004-05-03 13:01:34 +00:00
parent 0e0892f300
commit f8ee348f1d
10 changed files with 22 additions and 20 deletions

View File

@ -324,7 +324,7 @@ dcphy_service(sc, mii, cmd)
* successful autonegotation is never recognised on
* these chips.
*/
if (++sc->mii_ticks != 50)
if (++sc->mii_ticks <= 50)
break;
sc->mii_ticks = 0;

View File

@ -362,8 +362,8 @@ brgphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5)
return (0);
if (++sc->mii_ticks <= 5)
break;
sc->mii_ticks = 0;
brgphy_mii_phy_auto(sc);
@ -381,7 +381,6 @@ brgphy_service(sc, mii, cmd)
if (sc->mii_media_active != mii->mii_media_active ||
sc->mii_media_status != mii->mii_media_status ||
cmd == MII_MEDIACHG) {
mii_phy_update(sc, cmd);
switch (brgphy_mii_model) {
case MII_MODEL_xxBROADCOM_BCM5401:
bcm5401_load_dspcode(sc);
@ -391,6 +390,7 @@ brgphy_service(sc, mii, cmd)
break;
}
}
mii_phy_update(sc, cmd);
return (0);
}

View File

@ -324,7 +324,7 @@ dcphy_service(sc, mii, cmd)
* successful autonegotation is never recognised on
* these chips.
*/
if (++sc->mii_ticks != 50)
if (++sc->mii_ticks <= 50)
break;
sc->mii_ticks = 0;

View File

@ -333,8 +333,8 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5)
return (0);
if (++sc->mii_ticks <= 5)
break;
sc->mii_ticks = 0;
e1000phy_reset(sc);

View File

@ -231,9 +231,11 @@ mii_phy_tick(struct mii_softc *sc)
/*
* Only retry autonegotiation every N seconds.
*/
if (sc->mii_anegticks == 0)
if (sc->mii_anegticks == 0) {
sc->mii_anegticks = 17;
if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
}
if (++sc->mii_ticks <= sc->mii_anegticks)
return (EJUSTRETURN);
sc->mii_ticks = 0;

View File

@ -337,8 +337,8 @@ mlphy_service(xsc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5)
return (0);
if (++sc->mii_ticks <= 5)
break;
sc->mii_ticks = 0;
msc->ml_linked = 0;

View File

@ -298,8 +298,8 @@ rgephy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5/*10*/)
return (0);
if (++sc->mii_ticks <= 5/*10*/)
break;
sc->mii_ticks = 0;
rgephy_mii_phy_auto(sc);
@ -317,9 +317,9 @@ rgephy_service(sc, mii, cmd)
if (sc->mii_media_active != mii->mii_media_active ||
sc->mii_media_status != mii->mii_media_status ||
cmd == MII_MEDIACHG) {
mii_phy_update(sc, cmd);
rgephy_load_dspcode(sc);
}
mii_phy_update(sc, cmd);
return (0);
}

View File

@ -226,8 +226,8 @@ ruephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5)
return (0);
if (++sc->mii_ticks <= 5)
break;
sc->mii_ticks = 0;
ruephy_reset(sc);

View File

@ -325,8 +325,8 @@ tlphy_service(self, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->sc_mii.mii_ticks != 5)
return (0);
if (++sc->sc_mii.mii_ticks <= 5)
break;
sc->sc_mii.mii_ticks = 0;
mii_phy_reset(&sc->sc_mii);

View File

@ -255,8 +255,8 @@ xmphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
if (++sc->mii_ticks != 5)
return (0);
if (++sc->mii_ticks <= 5)
break;
sc->mii_ticks = 0;