Date: Mon, 7 Dec 2009 19:18:23 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r200227 - head/sys/dev/bge Message-ID: <200912071918.nB7JINn7063263@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Mon Dec 7 19:18:23 2009 New Revision: 200227 URL: http://svn.freebsd.org/changeset/base/200227 Log: 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 Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Dec 7 19:08:10 2009 (r200226) +++ head/sys/dev/bge/if_bge.c Mon Dec 7 19:18:23 2009 (r200227) @@ -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). */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912071918.nB7JINn7063263>