diff options
author | andre <andre@FreeBSD.org> | 2004-05-03 13:01:34 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-05-03 13:01:34 +0000 |
commit | f8ee348f1d1b903d0b117c893b5f73aed4e5bce8 (patch) | |
tree | ff1bd46cb26c67e03c65388e1a1f300a9c5b60d7 | |
parent | 0e0892f300c42840e39885a17d59d5cff2ed6c15 (diff) | |
download | FreeBSD-src-f8ee348f1d1b903d0b117c893b5f73aed4e5bce8.zip FreeBSD-src-f8ee348f1d1b903d0b117c893b5f73aed4e5bce8.tar.gz |
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
-rw-r--r-- | sys/dev/dc/dcphy.c | 2 | ||||
-rw-r--r-- | sys/dev/mii/brgphy.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/dcphy.c | 2 | ||||
-rw-r--r-- | sys/dev/mii/e1000phy.c | 4 | ||||
-rw-r--r-- | sys/dev/mii/mii_physubr.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/mlphy.c | 4 | ||||
-rw-r--r-- | sys/dev/mii/rgephy.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/ruephy.c | 4 | ||||
-rw-r--r-- | sys/dev/mii/tlphy.c | 4 | ||||
-rw-r--r-- | sys/dev/mii/xmphy.c | 4 |
10 files changed, 22 insertions, 20 deletions
diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index 4c930e5..5b4b8f5 100644 --- a/sys/dev/dc/dcphy.c +++ b/sys/dev/dc/dcphy.c @@ -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; diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 6b4d38f..15ae23d 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -362,8 +362,8 @@ setit: /* * 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 @@ setit: 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 @@ setit: break; } } + mii_phy_update(sc, cmd); return (0); } diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c index 4c930e5..5b4b8f5 100644 --- a/sys/dev/mii/dcphy.c +++ b/sys/dev/mii/dcphy.c @@ -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; diff --git a/sys/dev/mii/e1000phy.c b/sys/dev/mii/e1000phy.c index 6f9f458..ab1ece3 100644 --- a/sys/dev/mii/e1000phy.c +++ b/sys/dev/mii/e1000phy.c @@ -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); diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 96e481c..d458817 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -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; diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c index 744d3c3..ecb84f7 100644 --- a/sys/dev/mii/mlphy.c +++ b/sys/dev/mii/mlphy.c @@ -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; diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index 5c0f13d..84681ed 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -298,8 +298,8 @@ setit: /* * 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 @@ setit: 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); } diff --git a/sys/dev/mii/ruephy.c b/sys/dev/mii/ruephy.c index f2dbc16..494bd74 100644 --- a/sys/dev/mii/ruephy.c +++ b/sys/dev/mii/ruephy.c @@ -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); diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index ca9f854..cf3ce2e 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -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); diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 2a1ee80..22ecd73 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -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; |