summaryrefslogtreecommitdiffstats
path: root/drivers/char/pc_keyb.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
commit99a7e12f34b3661a0d1354eef83a0eef4df5e34c (patch)
tree3560aca9ca86792f9ab7bd87861ea143a1b3c7a3 /drivers/char/pc_keyb.c
parente73a04659c0b8cdee4dd40e58630e2cf63afb316 (diff)
Merge with Linux 2.3.38.
Diffstat (limited to 'drivers/char/pc_keyb.c')
-rw-r--r--drivers/char/pc_keyb.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c
index 0841df811..5287ec93d 100644
--- a/drivers/char/pc_keyb.c
+++ b/drivers/char/pc_keyb.c
@@ -412,6 +412,15 @@ static inline void handle_mouse_event(unsigned char scancode)
#endif
}
+static inline void handle_keyboard_event(unsigned char scancode)
+{
+#ifdef CONFIG_VT
+ if (do_acknowledge(scancode))
+ handle_scancode(scancode, !(scancode & 0x80));
+#endif
+ mark_bh(KEYBOARD_BH);
+}
+
/*
* This reads the keyboard status port, and does the
* appropriate action.
@@ -428,20 +437,18 @@ static unsigned char handle_kbd_event(void)
unsigned char scancode;
scancode = kbd_read_input();
- if (status & KBD_STAT_MOUSE_OBF) {
- handle_mouse_event(scancode);
- } else {
-#ifdef CONFIG_VT
- if (do_acknowledge(scancode))
- handle_scancode(scancode, !(scancode & 0x80));
-#endif
- mark_bh(KEYBOARD_BH);
+
+ /* Ignore error bytes */
+ if (!(status & (KBD_STAT_GTO | KBD_STAT_PERR))) {
+ if (status & KBD_STAT_MOUSE_OBF)
+ handle_mouse_event(scancode);
+ else
+ handle_keyboard_event(scancode);
}
status = kbd_read_status();
- if(!work--)
- {
+ if (!--work) {
printk(KERN_ERR "pc_keyb: controller jammed (0x%02X).\n",
status);
break;
@@ -739,6 +746,10 @@ static int __init detect_auxiliary_port(void)
int loops = 10;
int retval = 0;
+ /* Check if the BIOS detected a device on the auxiliary port. */
+ if (aux_device_present == 0xaa)
+ return 1;
+
spin_lock_irqsave(&kbd_controller_lock, flags);
/* Put the value 0x5A in the output buffer using the "Write