aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2011-02-23 02:40:31 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2011-02-23 02:40:31 +0000
commit8f382a1fd081e9c1f643b052a39f0587d78a90f9 (patch)
tree725438fad78fbe436e9d3dbe7a3b22d36d24581e
parent0a6cd3ac6d7d0451dcfd431078dc8e137dc247e9 (diff)
downloadsrc-8f382a1fd081e9c1f643b052a39f0587d78a90f9.tar.gz
src-8f382a1fd081e9c1f643b052a39f0587d78a90f9.zip
Remove unnecessary controller reinitialization which resulted in
link flips during alias address insertion or dhclient operation. While I'm here remove dc_reset() in DC_ISR_BUS_ERR case. Device is fully reinitialized again in dc_init_locked().
Notes
Notes: svn path=/head/; revision=218964
-rw-r--r--sys/dev/dc/if_dc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 390b5cf7c7c2..b7635504f5bd 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -2894,6 +2894,7 @@ dc_rxeof(struct dc_softc *sc)
if (rxstat & DC_RXSTAT_CRCERR)
continue;
else {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
return (rx_npkts);
}
@@ -3032,6 +3033,7 @@ dc_txeof(struct dc_softc *sc)
if (txstat & DC_TXSTAT_LATECOLL)
ifp->if_collisions++;
if (!(txstat & DC_TXSTAT_UNDERRUN)) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
return;
}
@@ -3143,8 +3145,10 @@ dc_tx_underrun(struct dc_softc *sc)
uint32_t isr;
int i;
- if (DC_IS_DAVICOM(sc))
+ if (DC_IS_DAVICOM(sc)) {
+ sc->dc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
+ }
if (DC_IS_INTEL(sc)) {
/*
@@ -3164,6 +3168,7 @@ dc_tx_underrun(struct dc_softc *sc)
device_printf(sc->dc_dev,
"%s: failed to force tx to idle state\n",
__func__);
+ sc->dc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
}
}
@@ -3236,7 +3241,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
if (status & DC_ISR_BUS_ERR) {
if_printf(ifp, "%s: bus error\n", __func__);
- dc_reset(sc);
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
}
}
@@ -3319,7 +3324,7 @@ dc_intr(void *arg)
dc_start_locked(ifp);
if (status & DC_ISR_BUS_ERR) {
- dc_reset(sc);
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
DC_UNLOCK(sc);
return;
@@ -3565,6 +3570,9 @@ dc_init_locked(struct dc_softc *sc)
DC_LOCK_ASSERT(sc);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
+
mii = device_get_softc(sc->dc_miibus);
/*
@@ -3818,6 +3826,7 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
dc_setfilt(sc);
} else {
sc->dc_txthresh = 0;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
}
} else {
@@ -3890,8 +3899,7 @@ dc_watchdog(void *xsc)
ifp->if_oerrors++;
device_printf(sc->dc_dev, "watchdog timeout\n");
- dc_stop(sc);
- dc_reset(sc);
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
dc_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))