ps2: accept 'Set Key Make and Break' commands

HP-UX sends both the 'Set key make and break (0xfc) and
'Set all key typematic make and break' (0xfa). QEMU response
with 'Resend' as it doesn't handle these commands. HP-UX than
reports an PS/2 max retransmission exceeded error. Add these
commands and just reply with ACK.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Message-Id: <20191220211512.3289-4-svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Sven Schnelle 2019-12-20 22:15:09 +01:00 committed by Richard Henderson
parent 376b851909
commit c56b620918

View File

@ -49,6 +49,8 @@
#define KBD_CMD_RESET_DISABLE 0xF5 /* reset and disable scanning */ #define KBD_CMD_RESET_DISABLE 0xF5 /* reset and disable scanning */
#define KBD_CMD_RESET_ENABLE 0xF6 /* reset and enable scanning */ #define KBD_CMD_RESET_ENABLE 0xF6 /* reset and enable scanning */
#define KBD_CMD_RESET 0xFF /* Reset */ #define KBD_CMD_RESET 0xFF /* Reset */
#define KBD_CMD_SET_MAKE_BREAK 0xFC /* Set Make and Break mode */
#define KBD_CMD_SET_TYPEMATIC 0xFA /* Set Typematic Make and Break mode */
/* Keyboard Replies */ /* Keyboard Replies */
#define KBD_REPLY_POR 0xAA /* Power on reset */ #define KBD_REPLY_POR 0xAA /* Power on reset */
@ -573,6 +575,7 @@ void ps2_write_keyboard(void *opaque, int val)
case KBD_CMD_SCANCODE: case KBD_CMD_SCANCODE:
case KBD_CMD_SET_LEDS: case KBD_CMD_SET_LEDS:
case KBD_CMD_SET_RATE: case KBD_CMD_SET_RATE:
case KBD_CMD_SET_MAKE_BREAK:
s->common.write_cmd = val; s->common.write_cmd = val;
ps2_queue(&s->common, KBD_REPLY_ACK); ps2_queue(&s->common, KBD_REPLY_ACK);
break; break;
@ -592,11 +595,18 @@ void ps2_write_keyboard(void *opaque, int val)
KBD_REPLY_ACK, KBD_REPLY_ACK,
KBD_REPLY_POR); KBD_REPLY_POR);
break; break;
case KBD_CMD_SET_TYPEMATIC:
ps2_queue(&s->common, KBD_REPLY_ACK);
break;
default: default:
ps2_queue(&s->common, KBD_REPLY_RESEND); ps2_queue(&s->common, KBD_REPLY_RESEND);
break; break;
} }
break; break;
case KBD_CMD_SET_MAKE_BREAK:
ps2_queue(&s->common, KBD_REPLY_ACK);
s->common.write_cmd = -1;
break;
case KBD_CMD_SCANCODE: case KBD_CMD_SCANCODE:
if (val == 0) { if (val == 0) {
if (s->common.queue.count <= PS2_QUEUE_SIZE - 2) { if (s->common.queue.count <= PS2_QUEUE_SIZE - 2) {