From: Ingo Molnar Subject: Re: [PATCH] kvm tools: Add support for PS/2 keyboard system Date: Thu, 2 Jun 2011 11:42:37 +0200 Message-ID: <20110602094237.GB10741@elte.hu> References: <1306940036-15540-1-git-send-email-levinsasha928@gmail.com> <1307005827.2785.26.camel@lappy> <1307007251.2785.29.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, John Floren To: Sasha Levin Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:50918 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933203Ab1FBJml (ORCPT ); Thu, 2 Jun 2011 05:42:41 -0400 Content-Disposition: inline In-Reply-To: <1307007251.2785.29.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: btw., i tried to match up the kernel's i8042.c with kvm's and it was pretty hard due to arbitrary differences. The kernel knows about: -------------------> /* * Status register bits. */ #define I8042_STR_PARITY 0x80 #define I8042_STR_TIMEOUT 0x40 #define I8042_STR_AUXDATA 0x20 #define I8042_STR_KEYLOCK 0x10 #define I8042_STR_CMDDAT 0x08 #define I8042_STR_MUXERR 0x04 #define I8042_STR_IBF 0x02 #define I8042_STR_OBF 0x01 /* * Control register bits. */ #define I8042_CTR_KBDINT 0x01 #define I8042_CTR_AUXINT 0x02 #define I8042_CTR_IGNKEYLOCK 0x08 #define I8042_CTR_KBDDIS 0x10 #define I8042_CTR_AUXDIS 0x20 #define I8042_CTR_XLATE 0x40 /* * Return codes. */ #define I8042_RET_CTL_TEST 0x55 <------------------- While hw/i8042.c knows about similar things, just under different names: -------------------> #define CMD_READ_MODE 0x20 #define CMD_WRITE_MODE 0x60 #define CMD_WRITE_AUX_BUF 0xD3 #define CMD_WRITE_AUX 0xD4 #define CMD_TEST_AUX 0xA9 #define CMD_DISABLE_AUX 0xA7 #define CMD_ENABLE_AUX 0xA8 #define RESPONSE_ACK 0xFA #define MODE_DISABLE_AUX 0x20 #define AUX_ENABLE_REPORTING 0x20 #define AUX_SCALING_FLAG 0x10 #define AUX_DEFAULT_RESOLUTION 0x2 #define AUX_DEFAULT_SAMPLE 100 #define KBD_STATUS_SYS 0x4 #define KBD_STATUS_A2 0x8 #define KBD_STATUS_INH 0x10 #define KBD_STATUS_OBF 0x01 #define KBD_STATUS_AUX_OBF 0x20 #define KBD_MODE_KBD_INT 0x01 #define KBD_MODE_SYS 0x02 <------------------- Would it be possible for hw/i8042.c to use the kernel names, to make it easier to review and debug this code? (also, 0x2 should be 0x02 to make it easier to review as well.) Thanks, Ingo