From fc3cecb36102f3f431938728f25be7bb1dc381a1 Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Sun, 16 Oct 2011 16:57:06 +0000 Subject: [PATCH] Support of keyboard id reading. Partially fixes #7963. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42866 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/ps2/ps2_keyboard.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp index fd9ce14a78..fcbf6f686d 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp @@ -61,6 +61,7 @@ static bool sIsExtended = false; static int32 sKeyboardRepeatRate; static bigtime_t sKeyboardRepeatDelay; +static uint8 sKeyboardIds[2]; static status_t @@ -306,6 +307,13 @@ probe_keyboard(void) cmdbyte, status); } } + + status = ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB], + PS2_CMD_GET_DEVICE_ID, NULL, 0, sKeyboardIds, sizeof(sKeyboardIds)); + + if (status != B_OK) { + INFO("ps2: cannot read keyboard device id:0x%#08lx\n", status); + } return B_OK; } @@ -384,6 +392,8 @@ keyboard_close(void *_cookie) sHasKeyboardReader = false; if (cookie->is_debugger) sHasDebugReader = false; + + sKeyboardIds[0] = sKeyboardIds[1] = 0; } TRACE("ps2: keyboard_close done\n"); @@ -510,6 +520,11 @@ keyboard_ioctl(void *_cookie, uint32 op, void *buffer, size_t length) } case KB_GET_KEYBOARD_ID: + { + TRACE("ps2: ioctl KB_GET_KEYBOARD_ID\n"); + return user_memcpy(buffer, &sKeyboardIds, sizeof(sKeyboardIds)); + } + case KB_SET_CONTROL_ALT_DEL_TIMEOUT: case KB_CANCEL_CONTROL_ALT_DEL: case KB_DELAY_CONTROL_ALT_DEL: