Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/eisa Report which trigger type we're using for our i...



details:   https://anonhg.NetBSD.org/src/rev/241c4f6e001f
branches:  trunk
changeset: 1022540:241c4f6e001f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jul 24 18:50:07 2021 +0000

description:
Report which trigger type we're using for our interrupt.

diffstat:

 sys/dev/eisa/if_tlp_eisa.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r b3c3bccc6758 -r 241c4f6e001f sys/dev/eisa/if_tlp_eisa.c
--- a/sys/dev/eisa/if_tlp_eisa.c        Sat Jul 24 17:07:59 2021 +0000
+++ b/sys/dev/eisa/if_tlp_eisa.c        Sat Jul 24 18:50:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_eisa.c,v 1.28 2021/01/27 04:35:15 thorpej Exp $ */
+/*     $NetBSD: if_tlp_eisa.c,v 1.29 2021/07/24 18:50:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_eisa.c,v 1.28 2021/01/27 04:35:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_eisa.c,v 1.29 2021/07/24 18:50:07 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -150,7 +150,7 @@
        const struct tulip_eisa_product *tep;
        u_int8_t enaddr[ETHER_ADDR_LEN], tmpbuf[sizeof(testpat)];
        u_int32_t val;
-       int irq, i, cnt;
+       int irq, ist, i, cnt;
        char intrbuf[EISA_INTRSTR_LEN];
 
        /*
@@ -244,6 +244,7 @@
         */
        val = bus_space_read_4(iot, ioh, DE425_CFG0);
        irq = tlp_eisa_irqs[(val >> 1) & 0x03];
+       ist = (val & 0x01) ? IST_EDGE : IST_LEVEL;
 
        /*
         * Map and establish our interrupt.
@@ -253,8 +254,7 @@
                return;
        }
        intrstr = eisa_intr_string(ec, ih, intrbuf, sizeof(intrbuf));
-       esc->sc_ih = eisa_intr_establish(ec, ih,
-           (val & 0x01) ? IST_EDGE : IST_LEVEL, IPL_NET, tlp_intr, sc);
+       esc->sc_ih = eisa_intr_establish(ec, ih, ist, IPL_NET, tlp_intr, sc);
        if (esc->sc_ih == NULL) {
                aprint_error_dev(self, "unable to establish interrupt");
                if (intrstr != NULL)
@@ -262,8 +262,10 @@
                aprint_error("\n");
                return;
        }
-       if (intrstr != NULL)
-               aprint_normal_dev(self, "interrupting at %s\n", intrstr);
+       if (intrstr != NULL) {
+               aprint_normal_dev(self, "interrupting at %s (%s trigger)\n",
+                   ist == IST_EDGE ? "edge" : "level", intrstr);
+       }
 
        /*
         * Finish off the attach.



Home | Main Index | Thread Index | Old Index