From f53227a1e62ba02f3aeb584db60639063ba647af Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Mon, 29 May 2000 17:08:52 +0000 Subject: preparing for AX88190 support; from NetBSD. --- sys/dev/ic/dp8390.c | 11 +++++++++-- sys/dev/ic/dp8390reg.h | 9 +++++++-- sys/dev/ic/dp8390var.h | 9 ++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) (limited to 'sys/dev') 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 */ @@ -116,6 +117,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 */ -- cgit v1.2.3