From 1bd380e56add4d1487232b1051ac19ec142f63f1 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 May 2011 17:46:56 +0800 Subject: [PATCH] Moved to BASE_IOCTLS() macro for keyboard driver --- Kernel/include/tpl_drv_joystick.h | 2 ++ Modules/Input/PS2KbMouse/kb.c | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Kernel/include/tpl_drv_joystick.h b/Kernel/include/tpl_drv_joystick.h index 3ba441ac..888d4ac1 100644 --- a/Kernel/include/tpl_drv_joystick.h +++ b/Kernel/include/tpl_drv_joystick.h @@ -63,6 +63,7 @@ enum eTplJoystick_IOCtl { * ioctl(..., tJoystickNumValue *) * \brief Set axis flags * \note If \a Value is equal to -1 (all bits set), the value is not changed + * \todo Define flag values */ JOY_IOCTL_GETSETAXISFLAGS, @@ -70,6 +71,7 @@ enum eTplJoystick_IOCtl { * ioctl(..., tJoystickNumValue *) * \brief Set Button Flags * \note If \a Value is equal to -1 (all bits set), the value is not changed + * \todo Define flag values */ JOY_IOCTL_GETSETBUTTONFLAGS, }; diff --git a/Modules/Input/PS2KbMouse/kb.c b/Modules/Input/PS2KbMouse/kb.c index 507d5757..07170a26 100644 --- a/Modules/Input/PS2KbMouse/kb.c +++ b/Modules/Input/PS2KbMouse/kb.c @@ -264,6 +264,8 @@ void KB_UpdateLEDs(void) outb(0x60, leds); } +static const char *csaIOCTL_NAMES[] = {DRV_IOCTLNAMES, DRV_KEYBAORD_IOCTLNAMES, NULL}; + /** * \fn int KB_IOCtl(tVFS_Node *Node, int Id, void *Data) * \brief Calls an IOCtl Command @@ -272,11 +274,8 @@ int KB_IOCtl(tVFS_Node *Node, int Id, void *Data) { switch(Id) { - case DRV_IOCTL_TYPE: return DRV_TYPE_KEYBOARD; - case DRV_IOCTL_IDENT: memcpy(Data, "KB\0\0", 4); return 1; - case DRV_IOCTL_VERSION: return 0x100; - case DRV_IOCTL_LOOKUP: return 0; - + BASE_IOCTLS(DRV_TYPE_KEYBOARD, "KB", 0x100, csaIOCTL_NAMES); + // Sets the Keyboard Callback case KB_IOCTL_SETCALLBACK: // Sanity Check -- 2.20.1