diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-02-15 23:42:49 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-02-15 23:42:49 +0000 |
commit | 6434bd21eaa615beaa194cf38016480670e6592f (patch) | |
tree | 41eaaa63aba734737ac75486f635f6596a1de0d8 /sys/dev/hil/hilkbd.c | |
parent | 8a5b523cbdbf5fea0561720803f3f507147688a9 (diff) |
Rework the console management on hppa:
- only attach a keyboard as a console if it matches the PDC keyboard path
- on hil, as there can be multiple keyboards on the loop, attach only the
first hilkbd device configured as console keyboard. Right now this means
the one with the lowest hil code, which was the existing behaviour so far.
- do not try to switch to the wscons consdev structure early at all in
wscons_machdep, but rather wait for the console to be completely
configured (i.e. both wskbd and wsdisplay are attached) to switch.
With feedback and help from mickey@
Diffstat (limited to 'sys/dev/hil/hilkbd.c')
-rw-r--r-- | sys/dev/hil/hilkbd.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/dev/hil/hilkbd.c b/sys/dev/hil/hilkbd.c index 3b125145e36..829bf4dcb41 100644 --- a/sys/dev/hil/hilkbd.c +++ b/sys/dev/hil/hilkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hilkbd.c,v 1.3 2003/02/15 23:38:46 miod Exp $ */ +/* $OpenBSD: hilkbd.c,v 1.4 2003/02/15 23:42:48 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -99,6 +99,7 @@ struct wskbd_mapdata hilkbd_keymapdata = { void hilkbd_bell(struct hil_softc *, u_int, u_int, u_int); void hilkbd_callback(void *, u_int, u_int8_t *); void hilkbd_decode(u_int8_t, u_int8_t, u_int *, int *); +int hilkbd_is_console(int); int hilkbdprobe(struct device *parent, void *match, void *aux) @@ -149,7 +150,7 @@ hilkbdattach(struct device *parent, struct device *self, void *aux) printf("\n"); - a.console = ha->ha_flags; + a.console = hilkbd_is_console(ha->ha_console); a.keymap = &hilkbd_keymapdata; a.accessops = &hilkbd_accessops; a.accesscookie = sc; @@ -292,3 +293,20 @@ hilkbd_decode(u_int8_t stat, u_int8_t data, u_int *type, int *key) *type = (data & 1) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN; *key = data >> 1; } + +int +hilkbd_is_console(int hil_is_console) +{ + static int seen_hilkbd_console = 0; + + /* if not first hil keyboard, then not the console */ + if (seen_hilkbd_console) + return (0); + + /* if PDC console does not match hil bus path, then not the console */ + if (hil_is_console == 0) + return (0); + + seen_hilkbd_console = 1; + return (1); +} |