diff options
author | Jason Wright <jason@cvs.openbsd.org> | 1998-10-20 00:57:53 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 1998-10-20 00:57:53 +0000 |
commit | 2f4bc1b0a2ed762a6a71d37d8fb9eba7b745f336 (patch) | |
tree | dc91d885ecd0ae26c9e5947a5c6e0a440c209e1c | |
parent | ac6d9214fccc9759d3f1dacb92c5c86403731a3b (diff) |
o Only read the per-channel status reg if the global int mask says something
interesting happened.
o Base all interrupt decisions on per-channel status reg.
-rw-r--r-- | sys/arch/sparc/dev/qe.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc/dev/qereg.h | 15 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c index 91a8bb3730a..85285b8ab61 100644 --- a/sys/arch/sparc/dev/qe.c +++ b/sys/arch/sparc/dev/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.2 1998/10/19 19:55:54 jason Exp $ */ +/* $OpenBSD: qe.c,v 1.3 1998/10/20 00:57:52 jason Exp $ */ /* * Copyright (c) 1998 Jason L. Wright. @@ -297,20 +297,21 @@ qeintr(v) int r = 0; qecstat = sc->sc_qr->stat >> (4 * sc->sc_channel); - qestat = sc->sc_cr->stat; if ((qecstat & 0xf) == 0) return r; - if (qecstat & QEC_STAT_ER || qecstat & QEC_STAT_BM) { + qestat = sc->sc_cr->stat; + + if (qestat & QE_CR_STAT_ALLERRORS) { r |= qe_eint(sc, qestat); if (r == -1) return 1; } - if (qecstat & QEC_STAT_TX && qestat & QE_CR_STAT_TXIRQ) + if (qestat & QE_CR_STAT_TXIRQ) r |= qe_tint(sc); - if (qecstat & QEC_STAT_RX && qestat & QE_CR_STAT_RXIRQ) + if (qestat & QE_CR_STAT_RXIRQ) r |= qe_rint(sc); return r; diff --git a/sys/arch/sparc/dev/qereg.h b/sys/arch/sparc/dev/qereg.h index 15d440f6b1c..0450ba507ee 100644 --- a/sys/arch/sparc/dev/qereg.h +++ b/sys/arch/sparc/dev/qereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qereg.h,v 1.2 1998/10/19 19:55:55 jason Exp $ */ +/* $OpenBSD: qereg.h,v 1.3 1998/10/20 00:57:52 jason Exp $ */ /* * Copyright (c) 1998 Jason L. Wright. @@ -80,6 +80,19 @@ struct qe_cregs { #define QE_CR_STAT_RXPERR 0x00000002 /* rx parity error */ #define QE_CR_STAT_RXSERR 0x00000001 /* rx sbus error ack */ +/* + * Errors: all status bits except for TX/RX IRQ + */ +#define QE_CR_STAT_ALLERRORS \ + ( QE_CR_STAT_EDEFER | QE_CR_STAT_CLOSS | QE_CR_STAT_ERETRIES \ + | QE_CR_STAT_LCOLL | QE_CR_STAT_FUFLOW | QE_CR_STAT_JERROR \ + | QE_CR_STAT_BERROR | QE_CR_STAT_TCCOFLOW | QE_CR_STAT_TXDERROR \ + | QE_CR_STAT_TXLERR | QE_CR_STAT_TXPERR | QE_CR_STAT_TXSERR \ + | QE_CR_STAT_RCCOFLOW | QE_CR_STAT_RUOFLOW | QE_CR_STAT_MCOFLOW \ + | QE_CR_STAT_RXFOFLOW | QE_CR_STAT_RLCOLL | QE_CR_STAT_FCOFLOW \ + | QE_CR_STAT_CECOFLOW | QE_CR_STAT_RXDROP | QE_CR_STAT_RXSMALL \ + | QE_CR_STAT_RXLERR | QE_CR_STAT_RXPERR | QE_CR_STAT_RXSERR) + /* qe_cregs.qmask: qec error interrupt mask. */ #define QE_CR_QMASK_COFLOW 0x00100000 /* collision cntr overflow */ #define QE_CR_QMASK_TXDERROR 0x00080000 /* tx descriptor error */ |