1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Grrrrr. That last commit was supposed to be to the head, not to -stable

(even though I want the fixes in -stable anyway). I'm sure I'm going
to get flamed now for committing to -stable and -current too quickly.
*sigh*
This commit is contained in:
Bill Paul 2000-12-12 19:31:14 +00:00
parent 453b556583
commit 34da0ef197
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69925
12 changed files with 27 additions and 3 deletions

View File

@ -161,6 +161,7 @@ static int amphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -165,6 +165,8 @@ static int brgphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
if (sc->mii_flags & MIIF_DOINGAUTO)
untimeout(mii_phy_auto_timeout, sc, sc->mii_auto_ch);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);
@ -399,7 +401,7 @@ brgphy_mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
timeout(mii_phy_auto_timeout, mii, hz >> 1);
mii->mii_auto_ch = timeout(mii_phy_auto_timeout, mii, hz >> 1);
}
return (EJUSTRETURN);
}

View File

@ -214,6 +214,7 @@ static int exphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -106,11 +106,21 @@ mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
timeout(mii_phy_auto_timeout, mii, hz >> 1);
mii->mii_auto_ch = timeout(mii_phy_auto_timeout, mii, hz >> 1);
}
return (EJUSTRETURN);
}
void
mii_phy_auto_stop(sc)
struct mii_softc *sc;
{
if (sc->mii_flags & MIIF_DOINGAUTO) {
sc->mii_flags &= ~MIIF_DOINGAUTO;
untimeout(mii_phy_auto_timeout, sc, sc->mii_auto_ch);
}
}
void
mii_phy_auto_timeout(arg)
void *arg;

View File

@ -120,6 +120,7 @@ struct mii_softc {
mii_downcall_t mii_service; /* our downcall */
struct mii_data *mii_pdata; /* pointer to parent's mii_data */
struct callout_handle mii_auto_ch; /* callout handle for phy autoneg */
int mii_flags; /* misc. flags; see below */
int mii_capabilities; /* capabilities from BMSR */
@ -170,6 +171,7 @@ void mii_add_media __P((struct mii_data *, int, int));
int mii_media_from_bmcr __P((int));
int mii_phy_auto __P((struct mii_softc *, int));
void mii_phy_auto_stop __P((struct mii_softc *));
void mii_phy_reset __P((struct mii_softc *));
void ukphy_status __P((struct mii_softc *));

View File

@ -186,6 +186,7 @@ static int mlphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(&sc->ml_mii);
sc->ml_mii.mii_dev = NULL;
LIST_REMOVE(&sc->ml_mii, mii_list);

View File

@ -207,6 +207,7 @@ static int nsphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -168,6 +168,7 @@ static int pnaphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -174,6 +174,7 @@ static int rlphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_softc(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -168,6 +168,7 @@ static int tdkphy_detach(device_t dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -192,6 +192,7 @@ static int ukphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
mii_phy_auto_stop(sc);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);

View File

@ -166,6 +166,8 @@ static int xmphy_detach(dev)
sc = device_get_softc(dev);
mii = device_get_softc(device_get_parent(dev));
if (sc->mii_flags & MIIF_DOINGAUTO)
untimeout(mii_phy_auto_timeout, sc, sc->mii_auto_ch);
sc->mii_dev = NULL;
LIST_REMOVE(sc, mii_list);
@ -385,7 +387,7 @@ xmphy_mii_phy_auto(mii, waitfor)
*/
if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) {
mii->mii_flags |= MIIF_DOINGAUTO;
timeout(mii_phy_auto_timeout, mii, hz >> 1);
mii->mii_auto_ch = timeout(mii_phy_auto_timeout, mii, hz >> 1);
}
return (EJUSTRETURN);
}