summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2013-07-10 06:46:46 +0000
committeryongari <yongari@FreeBSD.org>2013-07-10 06:46:46 +0000
commite68e98804b6164b86f57f120fefe946fe95b1455 (patch)
treedd876ce4d6dbc4e2e87c9cd82dcb88a6e8266d29
parentaf0e2ca5b5c3c18e7a5aaed93302fd4b2d353560 (diff)
downloadFreeBSD-src-e68e98804b6164b86f57f120fefe946fe95b1455.zip
FreeBSD-src-e68e98804b6164b86f57f120fefe946fe95b1455.tar.gz
Avoid controller reinitialization which could be triggered by
dhclient(8) or alias addresses are added. Tested by: dcx dcy <dcbsdx@hotmail.com>
-rw-r--r--sys/dev/hme/if_hme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c
index 9f310ee..1249dc4 100644
--- a/sys/dev/hme/if_hme.c
+++ b/sys/dev/hme/if_hme.c
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
u_int32_t n, v;
HME_LOCK_ASSERT(sc, MA_OWNED);
+
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
+
/*
* Initialization sequence. The numbered steps below correspond
* to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int status)
/* check for fatal errors that needs reset to unfreeze DMA engine */
if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+ sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
hme_init_locked(sc);
}
}
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
device_printf(sc->sc_dev, "device timeout (no link)\n");
++ifp->if_oerrors;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
hme_init_locked(sc);
hme_start_locked(ifp);
return (EJUSTRETURN);
OpenPOWER on IntegriCloud