From b23743de45e3817f1560837b416d9c697cf618f2 Mon Sep 17 00:00:00 2001 From: yongari Date: Thu, 11 Dec 2008 00:46:07 +0000 Subject: Always put controller into known state before device intialization. While here remove re_reset calls invoked in system error case as controller reset is always done in device initialization. --- sys/dev/re/if_re.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/dev/re/if_re.c') diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 6c88352..687849f 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -756,7 +756,6 @@ re_diag(struct rl_softc *sc) ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; - re_reset(sc); re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -2091,10 +2090,8 @@ re_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count) * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -2158,10 +2155,8 @@ re_int_task(void *arg, int npending) RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2482,6 +2477,9 @@ re_init_locked(struct rl_softc *sc) */ re_stop(sc); + /* Put controller into known state. */ + re_reset(sc); + /* * Enable C+ RX and TX mode, as well as VLAN stripping and * RX checksum offload. We must configure the C+ register -- cgit v1.1