Remove PHY isolate/power down code in bge_stop(). The isolation

handler in brgphy(4) does not exist and brgphy(4) just resets the
PHY and returns EINVAL as it has no isolation handler. I also agree
on Marius's opinion that stop handler of every NIC driver seems to
be the wrong place for implementing PHY isolate/power down.
If we need PHY isolate/power down it should be implemented in
brgphy(4) and users should administratively down the PHY.

Reviewed by:	marius
This commit is contained in:
Pyun YongHyeon 2009-12-07 19:18:23 +00:00
parent 3005368137
commit 6fe124d275

View File

@ -4588,17 +4588,11 @@ static void
bge_stop(struct bge_softc *sc)
{
struct ifnet *ifp;
struct ifmedia_entry *ifm;
struct mii_data *mii = NULL;
int mtmp, itmp;
BGE_LOCK_ASSERT(sc);
ifp = sc->bge_ifp;
if ((sc->bge_flags & BGE_FLAG_TBI) == 0)
mii = device_get_softc(sc->bge_miibus);
callout_stop(&sc->bge_stat_ch);
/* Disable host interrupts. */
@ -4672,27 +4666,6 @@ bge_stop(struct bge_softc *sc)
/* Free TX buffers. */
bge_free_tx_ring(sc);
/*
* Isolate/power down the PHY, but leave the media selection
* unchanged so that things will be put back to normal when
* we bring the interface back up.
*/
if ((sc->bge_flags & BGE_FLAG_TBI) == 0) {
itmp = ifp->if_flags;
ifp->if_flags |= IFF_UP;
/*
* If we are called from bge_detach(), mii is already NULL.
*/
if (mii != NULL) {
ifm = mii->mii_media.ifm_cur;
mtmp = ifm->ifm_media;
ifm->ifm_media = IFM_ETHER | IFM_NONE;
mii_mediachg(mii);
ifm->ifm_media = mtmp;
}
ifp->if_flags = itmp;
}
sc->bge_tx_saved_considx = BGE_TXCONS_UNSET;
/* Clear MAC's link state (PHY may still have link UP). */