Moved to BASE_IOCTLS() macro for keyboard driver
authorJohn Hodge <[email protected]>
Sun, 29 May 2011 09:46:56 +0000 (17:46 +0800)
committerJohn Hodge <[email protected]>
Sun, 29 May 2011 09:46:56 +0000 (17:46 +0800)
Kernel/include/tpl_drv_joystick.h
Modules/Input/PS2KbMouse/kb.c

index 3ba441a..888d4ac 100644 (file)
@@ -63,6 +63,7 @@ enum eTplJoystick_IOCtl {
         * ioctl(..., tJoystickNumValue *)\r
         * \brief Set axis flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         * ioctl(..., tJoystickNumValue *)\r
         * \brief Set axis flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
+        * \todo Define flag values\r
         */\r
        JOY_IOCTL_GETSETAXISFLAGS,\r
 \r
         */\r
        JOY_IOCTL_GETSETAXISFLAGS,\r
 \r
@@ -70,6 +71,7 @@ enum eTplJoystick_IOCtl {
         * ioctl(..., tJoystickNumValue *)\r
         * \brief Set Button Flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
         * ioctl(..., tJoystickNumValue *)\r
         * \brief Set Button Flags\r
         * \note If \a Value is equal to -1 (all bits set), the value is not changed\r
+        * \todo Define flag values\r
         */\r
        JOY_IOCTL_GETSETBUTTONFLAGS,\r
 };\r
         */\r
        JOY_IOCTL_GETSETBUTTONFLAGS,\r
 };\r
index 507d575..07170a2 100644 (file)
@@ -264,6 +264,8 @@ void KB_UpdateLEDs(void)
        outb(0x60, leds);
 }
 
        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
 /**
  * \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)
        {
 {
        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
        // Sets the Keyboard Callback
        case KB_IOCTL_SETCALLBACK:
                // Sanity Check

UCC git Repository :: git.ucc.asn.au