summaryrefslogtreecommitdiff
path: root/sys/dev/ic/re.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-09-29 17:35:46 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-09-29 17:35:46 +0000
commita19a6adb6abf9c582a9300efec679ed1e56644de (patch)
tree391dde10401e84950b742bf08fe1c7929a1487ef /sys/dev/ic/re.c
parenteae0669870b6625afd165a410856d70407e215ca (diff)
Only run the hardware diagnostic function re_diag() on adapters with
the 8169 chipset, it is disabled by default anyway. Reset the TX interrupt mitigation counter in re_start() if no packets were queued and there are still TX descriptors in use. Write to the ISR and clear the link state in re_init(). From wpaul@FreeBSD
Diffstat (limited to 'sys/dev/ic/re.c')
-rw-r--r--sys/dev/ic/re.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index f781b37cdaf..c6fd2a46b66 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.46 2006/09/18 21:33:32 dim Exp $ */
+/* $OpenBSD: re.c,v 1.47 2006/09/29 17:35:45 brad Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -987,12 +987,14 @@ re_attach(struct rl_softc *sc)
* Some 32-bit cards were incorrectly wired and would
* malfunction if plugged into a 64-bit slot.
*/
- error = re_diag(sc);
- if (error) {
- printf("%s: attach aborted due to hardware diag failure\n",
- sc->sc_dev.dv_xname);
- ether_ifdetach(ifp);
- goto fail_8;
+ if (sc->rl_type == RL_8169) {
+ error = re_diag(sc);
+ if (error) {
+ printf("%s: attach aborted due to hardware diag failure\n",
+ sc->sc_dev.dv_xname);
+ ether_ifdetach(ifp);
+ goto fail_8;
+ }
}
#endif
@@ -1715,8 +1717,11 @@ re_start(struct ifnet *ifp)
#endif
}
- if (queued == 0)
+ if (queued == 0) {
+ if (sc->rl_ldata.rl_tx_free != RL_TX_DESC_CNT(sc))
+ CSR_WRITE_4(sc, RL_TIMERCNT, 1);
return;
+ }
sc->rl_ldata.rl_txq_prodidx = idx;
@@ -1838,6 +1843,7 @@ re_init(struct ifnet *ifp)
CSR_WRITE_2(sc, RL_IMR, 0);
else
CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS);
+ CSR_WRITE_2(sc, RL_ISR, RL_INTRS_CPLUS);
/* Start RX/TX process. */
CSR_WRITE_4(sc, RL_MISSEDPKT, 0);
@@ -1892,6 +1898,8 @@ re_init(struct ifnet *ifp)
splx(s);
+ sc->rl_link = 0;
+
timeout_add(&sc->timer_handle, hz);
return (0);