From: Pekka Enberg <penberg@kernel.org>
To: kvm@vger.kernel.org
Cc: Pekka Enberg <penberg@kernel.org>, Ingo Molnar <mingo@elte.hu>,
Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 3/3] kvm tools, i8042: Use kernel command names
Date: Thu, 2 Jun 2011 13:56:42 +0300 [thread overview]
Message-ID: <1307012202-14875-3-git-send-email-penberg@kernel.org> (raw)
In-Reply-To: <1307012202-14875-1-git-send-email-penberg@kernel.org>
This patch renames the command constants in hw/i8042.c to use similar names as
in <linux/i8042.h>. Note: we cannot use <linux/i8042.h> constants directly
because they include the command and data.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
tools/kvm/hw/i8042.c | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c
index 48a3c9d..934ef4e 100644
--- a/tools/kvm/hw/i8042.c
+++ b/tools/kvm/hw/i8042.c
@@ -22,13 +22,16 @@
#define I8042_DATA_REG 0x60
#define I8042_COMMAND_REG 0x64
-#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
+/*
+ * Commands
+ */
+#define I8042_CMD_CTL_RCTR 0x20
+#define I8042_CMD_CTL_WCTR 0x60
+#define I8042_CMD_AUX_LOOP 0xD3
+#define I8042_CMD_AUX_SEND 0xD4
+#define I8042_CMD_AUX_TEST 0xA9
+#define I8042_CMD_AUX_DISABLE 0xA7
+#define I8042_CMD_AUX_ENABLE 0xA8
#define RESPONSE_ACK 0xFA
@@ -143,22 +146,22 @@ static void kbd_queue(u8 c)
static void kbd_write_command(u32 val)
{
switch (val) {
- case CMD_READ_MODE:
+ case I8042_CMD_CTL_RCTR:
kbd_queue(state.mode);
break;
- case CMD_WRITE_MODE:
- case CMD_WRITE_AUX:
- case CMD_WRITE_AUX_BUF:
+ case I8042_CMD_CTL_WCTR:
+ case I8042_CMD_AUX_SEND:
+ case I8042_CMD_AUX_LOOP:
state.write_cmd = val;
break;
- case CMD_TEST_AUX:
+ case I8042_CMD_AUX_TEST:
/* 0 means we're a normal PS/2 mouse */
mouse_queue(0);
break;
- case CMD_DISABLE_AUX:
+ case I8042_CMD_AUX_DISABLE:
state.mode |= MODE_DISABLE_AUX;
break;
- case CMD_ENABLE_AUX:
+ case I8042_CMD_AUX_ENABLE:
state.mode &= ~MODE_DISABLE_AUX;
break;
default:
@@ -211,15 +214,15 @@ static u32 kbd_read_status(void)
static void kbd_write_data(u32 val)
{
switch (state.write_cmd) {
- case CMD_WRITE_MODE:
+ case I8042_CMD_CTL_WCTR:
state.mode = val;
kbd_update_irq();
break;
- case CMD_WRITE_AUX_BUF:
+ case I8042_CMD_AUX_LOOP:
mouse_queue(val);
mouse_queue(RESPONSE_ACK);
break;
- case CMD_WRITE_AUX:
+ case I8042_CMD_AUX_SEND:
/* The OS wants to send a command to the mouse */
mouse_queue(RESPONSE_ACK);
switch (val) {
--
1.7.0.4
next prev parent reply other threads:[~2011-06-02 10:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 10:56 [PATCH 1/3] kvm tools, i8042: Sort status register bits Pekka Enberg
2011-06-02 10:56 ` [PATCH 2/3] kmv tools, i8042: Use kernel status register bit names Pekka Enberg
2011-06-02 10:56 ` Pekka Enberg [this message]
2011-06-02 11:04 ` [PATCH 3/3] kvm tools, i8042: Use kernel command names Ingo Molnar
2011-06-02 11:19 ` Ingo Molnar
2011-06-02 11:22 ` Pekka Enberg
2011-06-02 12:12 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307012202-14875-3-git-send-email-penberg@kernel.org \
--to=penberg@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.