From: Jack Lange Date: Tue, 24 Apr 2012 22:25:09 +0000 (-0400) Subject: added "SET_DEFAULTS" command to keyboard emulation X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a0e4eedc63421f847d6639af4795667a094d76f;p=palacios.releases.git added "SET_DEFAULTS" command to keyboard emulation --- diff --git a/palacios/src/devices/keyboard.c b/palacios/src/devices/keyboard.c index 794e8b3..ea57b32 100644 --- a/palacios/src/devices/keyboard.c +++ b/palacios/src/devices/keyboard.c @@ -188,6 +188,9 @@ struct keyboard_internal { // after having a f0 sent to 60 // we wait for a new output byte on 60 GETSET_SCANCODES, + // first send ACK (0xfa) + // then wait for reception, and reset kb state + SET_DEFAULTS, } state; @@ -223,6 +226,9 @@ struct keyboard_internal { }; +static int keyboard_reset_device(struct keyboard_internal * kbd); + + static int update_kb_irq(struct keyboard_internal * state) { int irq_num = 0; @@ -898,6 +904,11 @@ static int keyboard_write_output(struct guest_info * core, ushort_t port, void * kbd->state = NORMAL; break; + case SET_DEFAULTS: + keyboard_reset_device(kbd); + kbd->state = NORMAL; + break; + default: case NORMAL: { // command is being sent to keyboard controller @@ -942,6 +953,15 @@ static int keyboard_write_output(struct guest_info * core, ushort_t port, void * kbd->state = GETSET_SCANCODES; break; + + case 0xf6: // set defaults + // ACK command + // clear output buffer + // reset to init state + push_to_output_queue(kbd, 0xfa, COMMAND, KEYBOARD); + kbd->state = SET_DEFAULTS; + break; + case 0xfe: // resend case 0xfd: // set key type make case 0xfc: // set key typ make/break @@ -950,7 +970,7 @@ static int keyboard_write_output(struct guest_info * core, ushort_t port, void * case 0xf9: // set all make case 0xf8: // set all make/break case 0xf7: // set all typemaktic - case 0xf6: // set defaults + PrintError("keyboard: unhandled known command 0x%x on output buffer (60h)\n", data); ret = -1; break;