summaryrefslogtreecommitdiffstats
path: root/sys/dev/kbd
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2006-02-28 23:46:23 +0000
committeremax <emax@FreeBSD.org>2006-02-28 23:46:23 +0000
commit1fe6de0cf418e43c04586dd954ccfcc43563cff3 (patch)
tree1dfe4b5e62c72a4a8be5ecf2979324cfc038d50e /sys/dev/kbd
parent8bb537fa797e0a20081f3e20ee8696b83d766291 (diff)
downloadFreeBSD-src-1fe6de0cf418e43c04586dd954ccfcc43563cff3.zip
FreeBSD-src-1fe6de0cf418e43c04586dd954ccfcc43563cff3.tar.gz
Integrate kbdmux(4) into syscons(4) and kbd code.
By default syscons(4) will look for the kbdmux(4) keyboard first, and then, if not found, look for any keyboard. Current kbd code is modified so if kbdmux(4) is the current keyboard, all new keyboards are automatically added to the kbdmux(4). Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at the loader prompt, or at runtime, by kldload'ing the kbdmux module and releasing current active keyboard. If, for whatever reason, kbdmux(4) is not required/desired then just do not load it and everything should work as before. It is also possible to kldunload kbdmux at runtime and syscons(4) will automatically switch to the first available keyboard. No response from: freebsd-current@ MFC after: 1 day
Diffstat (limited to 'sys/dev/kbd')
-rw-r--r--sys/dev/kbd/kbd.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c
index 9786441..1c004c3 100644
--- a/sys/dev/kbd/kbd.c
+++ b/sys/dev/kbd/kbd.c
@@ -185,8 +185,12 @@ kbd_register(keyboard_t *kbd)
{
const keyboard_driver_t **list;
const keyboard_driver_t *p;
+ keyboard_t *mux;
+ keyboard_info_t ki;
int index;
+ mux = kbd_get_keyboard(kbd_find_keyboard("kbdmux", -1));
+
for (index = 0; index < keyboards; ++index) {
if (keyboard[index] == NULL)
break;
@@ -208,6 +212,16 @@ kbd_register(keyboard_t *kbd)
if (strcmp(p->name, kbd->kb_name) == 0) {
keyboard[index] = kbd;
kbdsw[index] = p->kbdsw;
+
+ if (mux != NULL) {
+ bzero(&ki, sizeof(ki));
+ strcpy(ki.kb_name, kbd->kb_name);
+ ki.kb_unit = kbd->kb_unit;
+
+ (*kbdsw[mux->kb_index]->ioctl)
+ (mux, KBADDKBD, (caddr_t) &ki);
+ }
+
return (index);
}
}
@@ -216,6 +230,16 @@ kbd_register(keyboard_t *kbd)
if (strcmp(p->name, kbd->kb_name) == 0) {
keyboard[index] = kbd;
kbdsw[index] = p->kbdsw;
+
+ if (mux != NULL) {
+ bzero(&ki, sizeof(ki));
+ strcpy(ki.kb_name, kbd->kb_name);
+ ki.kb_unit = kbd->kb_unit;
+
+ (*kbdsw[mux->kb_index]->ioctl)
+ (mux, KBADDKBD, (caddr_t) &ki);
+ }
+
return (index);
}
}
OpenPOWER on IntegriCloud