diff options
author | emax <emax@FreeBSD.org> | 2006-07-27 20:33:48 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2006-07-27 20:33:48 +0000 |
commit | 6e9eacd766ebc1ee97172cd621ef3ead709ebd24 (patch) | |
tree | 441a41bbe6a7393f9f016bc1c1fb3c14d446ad55 /sys/dev | |
parent | 15daf52a2d9bfd76672fc6479cfe82c9744ee475 (diff) | |
download | FreeBSD-src-6e9eacd766ebc1ee97172cd621ef3ead709ebd24.zip FreeBSD-src-6e9eacd766ebc1ee97172cd621ef3ead709ebd24.tar.gz |
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
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index f5dca8d..7fb6708 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -657,6 +657,27 @@ next_code: /* 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); } |