Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/dev Search children of the "8042" node to che...



details:   https://anonhg.NetBSD.org/src/rev/beb081d35121
branches:  trunk
changeset: 537620:beb081d35121
user:      uwe <uwe%NetBSD.org@localhost>
date:      Thu Oct 03 16:22:46 2002 +0000

description:
Search children of the "8042" node to check if keyboard is the stdin.

diffstat:

 sys/arch/sparc/dev/pckbc_js.c |  18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 57673f21c3d2 -r beb081d35121 sys/arch/sparc/dev/pckbc_js.c
--- a/sys/arch/sparc/dev/pckbc_js.c     Thu Oct 03 16:13:24 2002 +0000
+++ b/sys/arch/sparc/dev/pckbc_js.c     Thu Oct 03 16:22:46 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pckbc_js.c,v 1.5 2002/10/02 16:02:15 thorpej Exp $ */
+/*     $NetBSD: pckbc_js.c,v 1.6 2002/10/03 16:22:46 uwe Exp $ */
 
 /*
  * Copyright (c) 2002 Valeriy E. Ushakov
@@ -136,14 +136,24 @@
        struct ebus_attach_args *ea = aux;
        bus_space_tag_t iot;
        bus_addr_t ioaddr;
-       int intr, isconsole;
+       int intr;
+       int stdin_node, node;
+       int isconsole;
 
        iot = ea->ea_bustag;
        ioaddr = EBUS_ADDR_FROM_REG(&ea->ea_reg[0]);
        intr = ea->ea_nintr ? ea->ea_intr[0] : /* line */ 0;
 
-       /* TODO: see comment in pckbc_obio_attach above */
-       isconsole = 1;
+       /* search children of "8042" node for stdin (keyboard) */
+       stdin_node = prom_instance_to_package(prom_stdin());
+       isconsole = 0;
+
+       for (node = prom_firstchild(ea->ea_node);
+            node != 0; node = prom_nextsibling(node))
+               if (node == stdin_node) {
+                       isconsole = 1;
+                       break;
+               }
 
        pckbc_js_attach_common(jsc, iot, ioaddr, intr, isconsole);
 }



Home | Main Index | Thread Index | Old Index