summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2005-05-04 02:35:22 +0000
committeraugustss <augustss@NetBSD.org>2005-05-04 02:35:22 +0000
commit5b6d2a575daf7fc3b5be56d0d035072ac8f5f14c (patch)
tree0aeb74a61820af84b9df3e04787dc222f5c0b4e6 /sys/dev
parent22506e27d1df76c5d4697249d719c451364a59a0 (diff)
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 (limited to 'sys/dev')
-rw-r--r--sys/dev/pckbport/files.pckbport3
-rw-r--r--sys/dev/pckbport/pckbd.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/pckbport/files.pckbport b/sys/dev/pckbport/files.pckbport
index d7068cbb411..bef1993840e 100644
--- a/sys/dev/pckbport/files.pckbport
+++ b/sys/dev/pckbport/files.pckbport
@@ -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 @@ attach pckbd at pckbport
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 --git a/sys/dev/pckbport/pckbd.c b/sys/dev/pckbport/pckbd.c
index bb89fdaea20..5ebd1ef9692 100644
--- a/sys/dev/pckbport/pckbd.c
+++ b/sys/dev/pckbport/pckbd.c
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.6 2005/04/29 10:41:18 yamt Exp $");
#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 @@ pckbd_cnattach(pckbport_tag_t kbctag, int kbcslot)
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 @@ pckbd_cnattach(pckbport_tag_t kbctag, int kbcslot)
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