--- linux-2.4.3-orig/drivers/char/pc_keyb.c Wed Apr 4 19:46:42 2001 +++ linux/drivers/char/pc_keyb.c Sun Apr 8 21:45:37 2001 @@ -404,6 +404,11 @@ mouse_reply_expected = 0; } else if(scancode == AUX_RECONNECT){ + // Under normal operation most mice don't generate 0xAA. + // But, Other devices might be unusable with this policy. + // (My mouse easily generates 0xAAs on rapid movements, + // when set to 10 samples/sec.) + printk("psaux: reconnect detected(0xaa), sending AUX_ENABLE.\n"); queue->head = queue->tail = 0; /* Flush input queue */ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ return; @@ -420,6 +425,9 @@ kill_fasync(&queue->fasync, SIGIO, POLL_IN); wake_up_interruptible(&queue->proc_list); } + else + // 2K buffer is enough for about 10 sec under normal operations, here. + printk("psaux: buffer overflow, byte dropped.\n"); } #endif } @@ -465,6 +473,11 @@ else handle_keyboard_event(scancode); } + else + // Fixme: Ignoring bytes will de-sync mouse protocol. + printk("pc_keyb: %s error (0x%02x), byte ignored(%02x).\n", + (status & KBD_STAT_MOUSE_OBF)?"mouse":"kbd",status,scancode); + status = kbd_read_status(); }