summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2000-05-29 17:08:52 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2000-05-29 17:08:52 +0000
commitf53227a1e62ba02f3aeb584db60639063ba647af (patch)
tree2f4b01a0f39d58ddc2eb5bbd6dfbdbff7b22368e
parent288e815d9076bdde9976f3119a35b9ac205ec0b1 (diff)
preparing for AX88190 support; from NetBSD.
-rw-r--r--sys/dev/ic/dp8390.c11
-rw-r--r--sys/dev/ic/dp8390reg.h9
-rw-r--r--sys/dev/ic/dp8390var.h9
3 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 62c58b19280..f3e717fb121 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.7 2000/04/19 21:40:45 fgsch Exp $ */
+/* $OpenBSD: dp8390.c,v 1.8 2000/05/29 17:08:51 fgsch Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -349,7 +349,7 @@ dp8390_init(sc)
sc->cr_proto | ED_CR_PAGE_0 | ED_CR_STP);
/* Accept broadcast and multicast packets by default. */
- i = ED_RCR_AB | ED_RCR_AM;
+ i = ED_RCR_AB | ED_RCR_AM | sc->rcr_proto;
if (ifp->if_flags & IFF_PROMISC) {
/*
* Set promiscuous mode. Multicast filter was set earlier so
@@ -640,6 +640,13 @@ dp8390_intr(arg)
*/
NIC_PUT(regt, regh, ED_P0_ISR, isr);
+ /* Work around for AX88190 bug */
+ if ((sc->sc_flags & DP8390_DO_AX88190_WORKAROUND) != 0)
+ while ((NIC_GET(regt, regh, ED_P0_ISR) & isr) != 0) {
+ NIC_PUT(regt, regh, ED_P0_ISR, 0);
+ NIC_PUT(regt, regh, ED_P0_ISR, isr);
+ }
+
/*
* Handle transmitter interrupts. Handle these first because
* the receiver will reset the board under some conditions.
diff --git a/sys/dev/ic/dp8390reg.h b/sys/dev/ic/dp8390reg.h
index 3917d88297a..daaeccb7aeb 100644
--- a/sys/dev/ic/dp8390reg.h
+++ b/sys/dev/ic/dp8390reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390reg.h,v 1.7 1998/11/06 06:32:14 fgsch Exp $ */
+/* $OpenBSD: dp8390reg.h,v 1.8 2000/05/29 17:08:51 fgsch Exp $ */
/* $NetBSD: dp8390reg.h,v 1.3 1997/04/29 04:32:08 scottr Exp $ */
/*
@@ -461,7 +461,12 @@
#define ED_RCR_MON 0x20
/*
- * Bits 6 and 7 are unused/reserved.
+ * INTT: Interrupt Trigger Mode. Must be set if AX88190.
+ */
+#define ED_RCR_INTT 0x40
+
+/*
+ * Bit 7 is unused/reserved.
*/
/*
diff --git a/sys/dev/ic/dp8390var.h b/sys/dev/ic/dp8390var.h
index a5c895b10e7..00792026afa 100644
--- a/sys/dev/ic/dp8390var.h
+++ b/sys/dev/ic/dp8390var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390var.h,v 1.2 2000/04/19 21:52:38 fgsch Exp $ */
+/* $OpenBSD: dp8390var.h,v 1.3 2000/05/29 17:08:51 fgsch Exp $ */
/* $NetBSD: dp8390var.h,v 1.8 1998/08/12 07:19:09 scottr Exp $ */
/*
@@ -37,6 +37,7 @@ struct dp8390_softc {
int is790; /* NIC is a 790 */
u_int8_t cr_proto; /* values always set in CR */
+ u_int8_t rcr_proto; /* values always set in RCR */
u_int8_t dcr_reg; /* override DCR iff LS is set */
int mem_start; /* offset of NIC memory */
@@ -117,6 +118,12 @@ struct dp8390_softc {
#define DP8390_FORCE_PIO 0x0010
/*
+ * The chip is ASIX AX88190 and needs work around.
+ */
+#define DP8390_DO_AX88190_WORKAROUND 0x0020
+
+
+/*
* NIC register access macros
*/
#define NIC_GET(t, h, reg) bus_space_read_1(t, h, \