Add extra code into kbdmux(4)s read_char() method to

poll (i.e. call read_char() method) slave keyboards.

This workaround should fix problem with kbdmux(4) and
atkbd(4) not working in ddb(4) and mid-boot.

MFC after:	1 week
This commit is contained in:
Maksim Yevmenkin 2006-07-27 20:33:48 +00:00
parent ea175645b4
commit 04c1ba9b05
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160768

View File

@ -657,6 +657,27 @@ kbdmux_read_char(keyboard_t *kbd, int wait)
/* see if there is something in the keyboard queue */
scancode = getc(&state->ks_inq);
if (scancode == -1) {
if (state->ks_flags & POLLING) {
kbdmux_kbd_t *k;
SLIST_FOREACH(k, &state->ks_kbds, next) {
while (KBDMUX_CHECK_CHAR(k->kbd)) {
scancode = KBDMUX_READ_CHAR(k->kbd, 0);
if (scancode == NOKEY)
break;
if (scancode == ERRKEY)
continue;
if (!KBD_IS_BUSY(k->kbd))
continue;
putc(scancode, &state->ks_inq);
}
}
if (state->ks_inq.c_cc > 0)
goto next_code;
}
KBDMUX_UNLOCK(state);
return (NOKEY);
}