summaryrefslogtreecommitdiff
path: root/sys/dev/hil/hil.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-12-22 07:09:53 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-12-22 07:09:53 +0000
commitd7694e39cc091d00cf9ee689b99c6b7946b982e4 (patch)
tree35ece5d83f334d701ad0c7e0e31bda930e97b494 /sys/dev/hil/hil.c
parent7658356de5013efb24b967df9a37b87aeaf5cd31 (diff)
Postpone the hil console detection logic to the first detection of a keyboard.
On hp300, hil would claim console against dnkbd if no dnkbd was found at the time the loop is probed, even if the loop is empty. Because of this, plugging dnkbd later would not select it as console keyboard, which is really annoying on kernels without wsmux, such as hp300 RAMDISK. Now the first keyboard plugged will become the console keyboard, whatever its type. No functional change on hppa, since the console path gives a definite console device setting.
Diffstat (limited to 'sys/dev/hil/hil.c')
-rw-r--r--sys/dev/hil/hil.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c
index 272b35b7ea9..f9989d7c44c 100644
--- a/sys/dev/hil/hil.c
+++ b/sys/dev/hil/hil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hil.c,v 1.20 2005/05/13 15:22:37 miod Exp $ */
+/* $OpenBSD: hil.c,v 1.21 2005/12/22 07:09:52 miod Exp $ */
/*
* Copyright (c) 2003, 2004, Miodrag Vallat.
* All rights reserved.
@@ -82,6 +82,8 @@
#include <dev/hil/hildevs.h>
#include <dev/hil/hildevs_data.h>
+#include "hilkbd.h"
+
/*
* splhigh is extremely conservative but insures atomic operation,
* splvm (clock only interrupts) seems to be good enough in practice.
@@ -140,7 +142,7 @@ hildatawait(struct hil_softc *sc)
*/
void
-hil_attach(struct hil_softc *sc, int hil_is_console)
+hil_attach(struct hil_softc *sc, int *hil_is_console)
{
printf("\n");
@@ -500,7 +502,7 @@ hilconfig(struct hil_softc *sc, u_int knowndevs)
if (sc->sc_cmdbuf[0] >= hd->minid &&
sc->sc_cmdbuf[0] <= hd->maxid) {
- ha.ha_console = sc->sc_console;
+ ha.ha_console = *sc->sc_console;
ha.ha_code = id;
ha.ha_type = hd->type;
ha.ha_descr = hd->descr;
@@ -510,6 +512,17 @@ hilconfig(struct hil_softc *sc, u_int knowndevs)
sc->sc_devices[id] = (struct hildev_softc *)
config_found_sm(&sc->sc_dev, &ha, hildevprint,
hilsubmatch);
+
+#if NHILKBD > 0
+ /*
+ * If we just attached a keyboard as console,
+ * console choice is not indeterminate anymore.
+ */
+ if (sc->sc_devices[id] != NULL &&
+ ha.ha_type == HIL_DEVICE_KEYBOARD &&
+ ha.ha_console != 0)
+ *sc->sc_console = 1;
+#endif
}
}