Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't choke when we get lots of AENs all at once.



details:   https://anonhg.NetBSD.org/src/rev/3cd5dab566d4
branches:  trunk
changeset: 504542:3cd5dab566d4
user:      ad <ad%NetBSD.org@localhost>
date:      Sun Mar 04 17:50:51 2001 +0000

description:
Don't choke when we get lots of AENs all at once.

diffstat:

 sys/dev/pci/twe.c    |  20 +++++++++++++-------
 sys/dev/pci/twevar.h |   4 +++-
 2 files changed, 16 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r c7d53f6a1dce -r 3cd5dab566d4 sys/dev/pci/twe.c
--- a/sys/dev/pci/twe.c Sun Mar 04 17:01:15 2001 +0000
+++ b/sys/dev/pci/twe.c Sun Mar 04 17:50:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: twe.c,v 1.11 2001/02/25 17:46:42 ad Exp $      */
+/*     $NetBSD: twe.c,v 1.12 2001/03/04 17:50:51 ad Exp $      */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -461,12 +461,17 @@
         * state change has occured.
         */
        if ((status & TWE_STS_ATTN_INTR) != 0) {
-               rv = twe_param_get(sc, TWE_PARAM_AEN, TWE_PARAM_AEN_UnitCode,
-                   2, twe_aen_handler, NULL);
-               if (rv != 0) {
-                       printf("%s: unable to retrieve AEN (%d)\n",
-                           sc->sc_dv.dv_xname, rv);
-                       TWE_OUTL(sc, TWE_REG_CTL, TWE_CTL_CLEAR_ATTN_INTR);
+               if ((sc->sc_flags & TWEF_AEN) == 0) {
+                       rv = twe_param_get(sc, TWE_PARAM_AEN,
+                           TWE_PARAM_AEN_UnitCode, 2, twe_aen_handler,
+                           NULL);
+                       if (rv != 0) {
+                               printf("%s: unable to retrieve AEN (%d)\n",
+                                   sc->sc_dv.dv_xname, rv);
+                               TWE_OUTL(sc, TWE_REG_CTL,
+                                   TWE_CTL_CLEAR_ATTN_INTR);
+                       } else
+                               sc->sc_flags |= TWEF_AEN;
                }
                caught = 1;
        }
@@ -519,6 +524,7 @@
 
        if (TWE_AEN_CODE(aen) == TWE_AEN_QUEUE_EMPTY) {
                TWE_OUTL(sc, TWE_REG_CTL, TWE_CTL_CLEAR_ATTN_INTR);
+               sc->sc_flags &= ~TWEF_AEN;
                return;
        }
 
diff -r c7d53f6a1dce -r 3cd5dab566d4 sys/dev/pci/twevar.h
--- a/sys/dev/pci/twevar.h      Sun Mar 04 17:01:15 2001 +0000
+++ b/sys/dev/pci/twevar.h      Sun Mar 04 17:50:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: twevar.h,v 1.6 2001/01/23 20:51:01 ad Exp $    */
+/*     $NetBSD: twevar.h,v 1.7 2001/03/04 17:50:52 ad Exp $    */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -65,9 +65,11 @@
        struct twe_ccb          *sc_ccbs;
        SIMPLEQ_HEAD(, twe_ccb) sc_ccb_queue;
        SLIST_HEAD(, twe_ccb)   sc_ccb_freelist;
+       int                     sc_flags;
        int                     sc_nunits;
        u_int                   sc_dsize[TWE_MAX_UNITS];
 };
+#define        TWEF_AEN        0x01    /* retrieving an AEN */
 
 /* Optional per-command context. */
 struct twe_context {



Home | Main Index | Thread Index | Old Index