svn commit: r241215 - head/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Fri Oct 5 03:35:39 UTC 2012


Author: yongari
Date: Fri Oct  5 03:35:38 2012
New Revision: 241215
URL: http://svn.freebsd.org/changeset/base/241215

Log:
  Don't touch EMAC Mode and TX/RX MAC Mode register when driver is
  not running.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Fri Oct  5 00:35:13 2012	(r241214)
+++ head/sys/dev/bge/if_bge.c	Fri Oct  5 03:35:38 2012	(r241215)
@@ -896,7 +896,10 @@ bge_miibus_statchg(device_t dev)
 {
 	struct bge_softc *sc;
 	struct mii_data *mii;
+
 	sc = device_get_softc(dev);
+	if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		return;
 	mii = device_get_softc(sc->bge_miibus);
 
 	if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
@@ -5054,11 +5057,11 @@ bge_init_locked(struct bge_softc *sc)
 	bge_writembx(sc, BGE_MBX_IRQ0_LO, 0);
 	}
 
-	bge_ifmedia_upd_locked(ifp);
-
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
+	bge_ifmedia_upd_locked(ifp);
+
 	callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc);
 }
 


More information about the svn-src-head mailing list