summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-01-15 18:48:13 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-01-15 18:48:13 +0000
commita29dca0301bba1300400a3c151ac75f22d70bf1b (patch)
tree3e1e2141f2cc7e670bdbe1ec12b152654dd90747
parentca0686869ba0439ae8d5c41c50b226158e522b3e (diff)
rev 1.85
Newer chips do not need the receiver lock-up workaround; detect when it is required. From NetBSD
-rw-r--r--sys/dev/ic/fxp.c11
-rw-r--r--sys/dev/ic/fxpvar.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 70378d7557c..faaa8a746b5 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.65 2005/01/15 05:24:11 brad Exp $ */
+/* $OpenBSD: fxp.c,v 1.66 2005/01/15 18:48:12 brad Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -490,6 +490,12 @@ fxp_attach_common(sc, intrstr)
}
}
+ /* Receiver lock-up workaround detection. */
+ fxp_read_eeprom(sc, &data, 3, 1);
+ if ((data & 0x03) != 0x03) {
+ sc->sc_flags |= FXPF_RECV_WORKAROUND;
+ }
+
/*
* Initialize our media structures and probe the MII.
*/
@@ -1026,8 +1032,9 @@ fxp_stats_update(arg)
if (sp->rx_good) {
ifp->if_ipackets += letoh32(sp->rx_good);
sc->rx_idle_secs = 0;
- } else
+ } else if (sc->sc_flags & FXPF_RECV_WORKAROUND) {
sc->rx_idle_secs++;
+ }
ifp->if_ierrors +=
letoh32(sp->rx_crc_errors) +
letoh32(sp->rx_alignment_errors) +
diff --git a/sys/dev/ic/fxpvar.h b/sys/dev/ic/fxpvar.h
index 6e274a417c0..935660a5a7e 100644
--- a/sys/dev/ic/fxpvar.h
+++ b/sys/dev/ic/fxpvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxpvar.h,v 1.21 2005/01/14 18:14:12 deraadt Exp $ */
+/* $OpenBSD: fxpvar.h,v 1.22 2005/01/15 18:48:12 brad Exp $ */
/* $NetBSD: if_fxpvar.h,v 1.1 1997/06/05 02:01:58 thorpej Exp $ */
/*
@@ -107,6 +107,7 @@ struct fxp_softc {
#define FXPF_MWI_ENABLE 0x10 /* enable use of PCI MWI command */
#define FXPF_DISABLE_STANDBY 0x20 /* currently need to work-around */
#define FXPF_UCODE 0x40 /* ucode load already attempted */
+#define FXPF_RECV_WORKAROUND 0x80 /* receiver lock-up workaround */
struct timeout stats_update_to; /* Pointer to timeout structure */
int rx_idle_secs; /* # of seconds RX has been idle */
struct fxp_cb_tx *cbl_base; /* base of TxCB list */