summaryrefslogtreecommitdiffstats
path: root/sys/dev/re/if_re.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2008-12-11 00:46:07 +0000
committeryongari <yongari@FreeBSD.org>2008-12-11 00:46:07 +0000
commitb23743de45e3817f1560837b416d9c697cf618f2 (patch)
treea2db4e2a120c580f909b522c8fc848160aa9d1ad /sys/dev/re/if_re.c
parentf630de1b0f17ce16ea7a6d05faa555019082bc4a (diff)
downloadFreeBSD-src-b23743de45e3817f1560837b416d9c697cf618f2.zip
FreeBSD-src-b23743de45e3817f1560837b416d9c697cf618f2.tar.gz
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.
Diffstat (limited to 'sys/dev/re/if_re.c')
-rw-r--r--sys/dev/re/if_re.c12
1 files changed, 5 insertions, 7 deletions
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
OpenPOWER on IntegriCloud