From: John Hodge Date: Sun, 29 May 2011 09:46:56 +0000 (+0800) Subject: Moved to BASE_IOCTLS() macro for keyboard driver X-Git-Tag: rel0.10~97 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1bd380e56add4d1487232b1051ac19ec142f63f1;p=tpg%2Facess2.git Moved to BASE_IOCTLS() macro for keyboard driver --- 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