summaryrefslogtreecommitdiffstats
path: root/sys/dev/sis
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-09-01 22:50:11 +0000
committeryongari <yongari@FreeBSD.org>2010-09-01 22:50:11 +0000
commitbbb8b576331e93599eb9120a0444db481e4d6f88 (patch)
treeba888d53214ebebd622ac21270ed0aec3695d7f7 /sys/dev/sis
parent3d51d3dedf3acc91d5cd0fda05cc758d186324f9 (diff)
downloadFreeBSD-src-bbb8b576331e93599eb9120a0444db481e4d6f88.zip
FreeBSD-src-bbb8b576331e93599eb9120a0444db481e4d6f88.tar.gz
Move sis_reset() to sis_initl(). This ensures driver starts with
known good state of controller.
Diffstat (limited to 'sys/dev/sis')
-rw-r--r--sys/dev/sis/if_sis.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c
index 6e9b8db..8886617 100644
--- a/sys/dev/sis/if_sis.c
+++ b/sys/dev/sis/if_sis.c
@@ -1205,7 +1205,6 @@ sis_detach(device_t dev)
/* These should only be active if attach succeeded. */
if (device_is_attached(dev)) {
SIS_LOCK(sc);
- sis_reset(sc);
sis_stop(sc);
SIS_UNLOCK(sc);
callout_drain(&sc->sis_stat_ch);
@@ -1740,7 +1739,6 @@ sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
if (status & SIS_ISR_SYSERR) {
- sis_reset(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sis_initl(sc);
}
@@ -1796,7 +1794,6 @@ sis_intr(void *arg)
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
if (status & SIS_ISR_SYSERR) {
- sis_reset(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sis_initl(sc);
SIS_UNLOCK(sc);
@@ -1980,7 +1977,10 @@ sis_initl(struct sis_softc *sc)
* Cancel pending I/O and free all RX/TX buffers.
*/
sis_stop(sc);
-
+ /*
+ * Reset the chip to a known state.
+ */
+ sis_reset(sc);
#ifdef notyet
if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) {
/*
@@ -2268,8 +2268,7 @@ sis_watchdog(struct sis_softc *sc)
device_printf(sc->sis_dev, "watchdog timeout\n");
sc->sis_ifp->if_oerrors++;
- sis_stop(sc);
- sis_reset(sc);
+ sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sis_initl(sc);
if (!IFQ_DRV_IS_EMPTY(&sc->sis_ifp->if_snd))
@@ -2346,7 +2345,6 @@ sis_shutdown(device_t dev)
sc = device_get_softc(dev);
SIS_LOCK(sc);
- sis_reset(sc);
sis_stop(sc);
SIS_UNLOCK(sc);
return (0);
OpenPOWER on IntegriCloud