From 916bbb145fe045ac718655f54ac73c1f93bdce51 Mon Sep 17 00:00:00 2001 From: emax Date: Sat, 25 Feb 2006 22:59:01 +0000 Subject: Put a comment, explaining why kbdmux(4) had to be fixed. While I'm here fix a couple of whitespaces. Requested by: netchild MFC after: 1 day --- sys/dev/kbdmux/kbdmux.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sys/dev/kbdmux') diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 844baa7..3080cf2 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -246,7 +246,16 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) KBDMUX_LOCK(state); - /* read all chars from the keyboard */ + /* + * Read all chars from the keyboard + * + * Turns out that atkbd(4) check_char() method may return + * "true" while read_char() method returns NOKEY. If this + * happens we could stuck in the loop below. Avoid this + * by breaking out of the loop if read_char() method returns + * NOKEY. + */ + while (KBDMUX_CHECK_CHAR(kbd)) { c = KBDMUX_READ_CHAR(kbd, 0); if (c == NOKEY) @@ -1128,8 +1137,8 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) break; case PIO_KEYMAP: /* set keyboard translation table */ - case PIO_KEYMAPENT: /* set keyboard translation table entry */ - case PIO_DEADKEYMAP: /* set accent key translation table */ + case PIO_KEYMAPENT: /* set keyboard translation table entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ KBDMUX_LOCK(state); state->ks_accents = 0; -- cgit v1.1