summaryrefslogtreecommitdiff
path: root/src/kbd.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-05-01 19:59:34 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-05-01 19:59:34 -0400
commitdd5a8a6b0d3c2d8320cb26ea8ac6798091070f9a (patch)
tree4984d73debd8856a39c408a182e839a86766965b /src/kbd.c
parent5718d5662d33355403e7aa62227acecac1755a4f (diff)
downloadqemu-seabios-dd5a8a6b0d3c2d8320cb26ea8ac6798091070f9a.tar.gz
When USB keyboard active, don't send keyboard commands to ps2 port.
Route keyboard commands to a USB handler when USB keyboard is active. Add a GETID handler for USB keyboards.
Diffstat (limited to 'src/kbd.c')
-rw-r--r--src/kbd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kbd.c b/src/kbd.c
index 36c89fc..1977c5d 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -9,7 +9,8 @@
#include "util.h" // debug_enter
#include "config.h" // CONFIG_*
#include "bregs.h" // struct bregs
-#include "ps2port.h" // kbd_command
+#include "ps2port.h" // ps2_kbd_command
+#include "usb-hid.h" // usb_kbd_command
// Bit definitions for BDA kbd_flag[012]
#define KF0_RSHIFT (1<<0)
@@ -109,6 +110,14 @@ dequeue_key(struct bregs *regs, int incr, int extended)
SET_BDA(kbd_buf_head, buffer_head);
}
+static inline int
+kbd_command(int command, u8 *param)
+{
+ if (usb_kbd_active())
+ return usb_kbd_command(command, param);
+ return ps2_kbd_command(command, param);
+}
+
// read keyboard input
static void
handle_1600(struct bregs *regs)