diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2014-12-08 10:58:46 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2014-12-08 10:58:46 +0000 |
commit | 295fd73b0e245ca137ce0b5f2c881b0e5eabaca5 (patch) | |
tree | 55a658ba34de6ce1710a9220673b7c47e303e4fe /sys/dev/ic/rtl81x9.c | |
parent | 289b5d92df74fa66f52fd6e6c1007523f9e1f37c (diff) |
Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().
Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.
Diffstat (limited to 'sys/dev/ic/rtl81x9.c')
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index fe4e2654c4f..7c138dc5dc4 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.84 2014/11/24 02:03:37 brad Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.85 2014/12/08 10:58:45 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -739,7 +739,6 @@ rl_txeof(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ - rl_reset(sc); rl_init(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -779,10 +778,8 @@ rl_intr(void *arg) rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init(sc); - } claimed = 1; } @@ -926,6 +923,9 @@ rl_init(void *xsc) */ rl_stop(sc); + /* Put controller into known state. */ + rl_reset(sc); + /* * Init our MAC address. Even though the chipset * documentation doesn't mention it, we need to enter "Config |