Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pckbport Make an new option PCKBD_CNATTACH_MAY_FAIL....



details:   https://anonhg.NetBSD.org/src/rev/c99b85da315f
branches:  trunk
changeset: 580688:c99b85da315f
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed May 04 02:35:22 2005 +0000

description:
Make an new option PCKBD_CNATTACH_MAY_FAIL.  When this option is set and no
keyboard is detected the pckbd keyboard is not used as the console.

Previously the pckbd keyboard was used as the console as soon as the
kernel had it configured into the kernel.  This is far from ideal on a
machine that has no PS/2 keyboard, but a USB keyboard attached since the
(non-existant) PS/2 keyboard becomes the console instead of the USB keyboard.

For now this option will be off by default to be backwards compatible.

diffstat:

 sys/dev/pckbport/files.pckbport |   3 ++-
 sys/dev/pckbport/pckbd.c        |  10 ++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diffs (62 lines):

diff -r 448b2d5d209b -r c99b85da315f sys/dev/pckbport/files.pckbport
--- a/sys/dev/pckbport/files.pckbport   Wed May 04 01:57:23 2005 +0000
+++ b/sys/dev/pckbport/files.pckbport   Wed May 04 02:35:22 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.pckbport,v 1.3 2005/01/18 10:22:51 scw Exp $
+# $NetBSD: files.pckbport,v 1.4 2005/05/04 02:35:22 augustss Exp $
 # devices attached at pckbport, for use with wscons
 
 file   dev/pckbport/pckbport.c         pckbport | pckbport_machdep_cnattach
@@ -9,6 +9,7 @@
 file   dev/pckbport/pckbd.c            pckbd                   needs-flag
 file   dev/pckbport/wskbdmap_mfii.c    pckbd
 defparam PCKBD_LAYOUT
+defflag        PCKBD_CNATTACH_MAY_FAIL
 
 defflag        opt_pms.h                       PMS_DISABLE_POWERHOOK
 defflag        opt_pms.h                       PMS_SYNAPTICS_TOUCHPAD
diff -r 448b2d5d209b -r c99b85da315f sys/dev/pckbport/pckbd.c
--- a/sys/dev/pckbport/pckbd.c  Wed May 04 01:57:23 2005 +0000
+++ b/sys/dev/pckbport/pckbd.c  Wed May 04 02:35:22 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbd.c,v 1.6 2005/04/29 10:41:18 yamt Exp $ */
+/* $NetBSD: pckbd.c,v 1.7 2005/05/04 02:35:22 augustss Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.6 2005/04/29 10:41:18 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.7 2005/05/04 02:35:22 augustss Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -99,6 +99,7 @@
 #include "locators.h"
 
 #include "opt_pckbd_layout.h"
+#include "opt_pckbd_cnattach_may_fail.h"
 #include "opt_wsdisplay_compat.h"
 
 struct pckbd_internal {
@@ -602,7 +603,8 @@
        u_char cmd[1];
 
        res = pckbd_init(&pckbd_consdata, kbctag, kbcslot, 1);
-#if 0 /* we allow the console to be attached if no keyboard is present */
+       /* We may allow the console to be attached if no keyboard is present */
+#if defined(PCKBD_CNATTACH_MAY_FAIL)
        if (res)
                return res;
 #endif
@@ -611,7 +613,7 @@
        cmd[0] = KBC_ENABLE;
        res = pckbport_poll_cmd(kbctag, kbcslot, cmd, 1, 0, 0, 0);
 
-#if 0
+#if defined(PCKBD_CNATTACH_MAY_FAIL)
        if (res)
                return res;
 #endif



Home | Main Index | Thread Index | Old Index