Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev Take all of the OpenFirmware "stdin" gro...



details:   https://anonhg.NetBSD.org/src/rev/2598ff64afa9
branches:  trunk
changeset: 472773:2598ff64afa9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu May 06 19:20:59 1999 +0000

description:
Take all of the OpenFirmware "stdin" grovelling out of the ADB keyboard
driver, as the smarts for this all live somewhere else now.

diffstat:

 sys/arch/macppc/dev/akbd.c |  42 ++++--------------------------------------
 1 files changed, 4 insertions(+), 38 deletions(-)

diffs (79 lines):

diff -r 9844cc814f0e -r 2598ff64afa9 sys/arch/macppc/dev/akbd.c
--- a/sys/arch/macppc/dev/akbd.c        Thu May 06 19:16:44 1999 +0000
+++ b/sys/arch/macppc/dev/akbd.c        Thu May 06 19:20:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: akbd.c,v 1.6 1999/02/17 14:56:56 tsubai Exp $  */
+/*     $NetBSD: akbd.c,v 1.7 1999/05/06 19:20:59 thorpej Exp $ */
 
 /*
  * Copyright (C) 1998  Colin Wood
@@ -104,7 +104,7 @@
        KB_US,
 };
 
-static int akbd_is_console __P((void));
+static int akbd_is_console;
 
 static int
 akbdmatch(parent, cf, aux)
@@ -237,7 +237,7 @@
                printf("kbd: returned %d from SetADBInfo\n", error);
 #endif
 
-       a.console = akbd_is_console();
+       a.console = akbd_is_console;
        a.keymap = &akbd_keymapdata;
        a.accessops = &akbd_accessops;
        a.accesscookie = sc;
@@ -436,24 +436,6 @@
 #endif
 
 int
-akbd_is_console()
-{
-       int chosen, stdin, pkg;
-       char name[16];
-       int kbd;
-
-       chosen = OF_finddevice("/chosen");
-       OF_getprop(chosen, "stdin", &stdin, 4);
-       pkg = OF_instance_to_package(stdin);
-       OF_getprop(pkg, "name", name, sizeof(name));
-
-       if (strcmp(name, "keyboard") == 0)
-               return 1;
-       else
-               return 0;
-}
-
-int
 akbd_enable(v, on)
        void *v;
        int on;
@@ -527,25 +509,9 @@
 int
 akbd_cnattach()
 {
-       int chosen, stdin, node;
-       char name[16];
 
-       chosen = OF_finddevice("/chosen");
-       if (chosen == -1)
-               return -1;
-
-       if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1)
-               return -1;
-
-       node = OF_parent(OF_instance_to_package(stdin));
-       bzero(name, sizeof(name));
-       OF_getprop(node, "name", name, sizeof(name));
-
-       if (strcmp(name, "adb") != 0)
-               return -1;
-
+       akbd_is_console = 1;
        wskbd_cnattach(&akbd_consops, NULL, &akbd_keymapdata);
-
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index