]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
Coding style modification.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2Keyboard.h
index 1eb2c5491c6d0edadffef05a0fa769a3a4575411..7953b2bc745998098b126eff7523b5a349cbc19c 100644 (file)
@@ -131,28 +131,22 @@ extern EFI_GUID                      gSimpleTextInExNotifyGuid;
 //\r
 // Driver entry point\r
 //\r
+/**\r
+  The user Entry Point for module Ps2Keyboard. The user code starts with this function.\r
+\r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
+  @param[in] SystemTable    A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+  @retval other             Some error occurs when executing this entry point.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 InstallPs2KeyboardDriver (\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - GC_TODO: add argument description\r
-  SystemTable - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  GC_TODO: add return values\r
-\r
---*/\r
 ;\r
 \r
 #define KEYBOARD_8042_DATA_REGISTER     0x60\r
@@ -191,233 +185,170 @@ Returns:
 //\r
 // Other functions that are used among .c files\r
 //\r
+/**\r
+  Show keyboard status lights according to\r
+  indicators in ConsoleIn.\r
+\r
+  @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
+  \r
+  @return status\r
 \r
+**/\r
 EFI_STATUS\r
 UpdateStatusLights (\r
   IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Show keyboard status light for ScrollLock, NumLock and CapsLock\r
-  according to indicators in ConsoleIn.\r
-\r
-Arguments:\r
-\r
-  ConsoleIn   - driver private structure\r
+;\r
 \r
-Returns:\r
+/**\r
+  write key to keyboard\r
 \r
-  EFI_SUCCESS - Show the status light successfully.\r
-  EFI_TIMEOUT - Timeout when operating read/write on registers.\r
+  @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
+  @param Data      value wanted to be written\r
 \r
---*/  \r
-;\r
+  @retval EFI_TIMEOUT - GC_TODO: Add description for return value\r
+  @retval EFI_SUCCESS - GC_TODO: Add description for return value\r
 \r
+**/\r
 EFI_STATUS\r
 KeyboardRead (\r
   IN KEYBOARD_CONSOLE_IN_DEV  *ConsoleIn,\r
   OUT UINT8                   *Data\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
+;\r
 \r
-  ConsoleIn - GC_TODO: add argument description\r
-  Data      - GC_TODO: add argument description\r
+/**\r
+  Get scancode from scancode buffer\r
+  and translate into EFI-scancode and unicode defined by EFI spec\r
+  The function is always called in TPL_NOTIFY\r
 \r
-Returns:\r
+  @param ConsoleIn KEYBOARD_CONSOLE_IN_DEV instance pointer\r
 \r
-  GC_TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_NOT_READY - Input from console not ready yet.\r
+  @retval EFI_SUCCESS   - Function executed successfully.\r
 \r
+**/\r
 EFI_STATUS\r
 KeyGetchar (\r
   IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ConsoleIn - GC_TODO: add argument description\r
-\r
-Returns:\r
+;\r
 \r
-  GC_TODO: add return values\r
+/**\r
+  Perform 8042 controller and keyboard Initialization\r
+  If ExtendedVerification is TRUE, do additional test for\r
+  the keyboard interface\r
 \r
---*/\r
-;\r
+  @param ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer\r
+  @param ExtendedVerification - indicates a thorough initialization\r
 \r
+  @retval EFI_DEVICE_ERROR Fail to init keyboard\r
+  @retval EFI_SUCCESS      Success to init keyboard\r
+**/\r
 EFI_STATUS\r
 InitKeyboard (\r
   IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r
   IN BOOLEAN                     ExtendedVerification\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ConsoleIn             - GC_TODO: add argument description\r
-  ExtendedVerification  - GC_TODO: add argument description\r
+;\r
 \r
-Returns:\r
+/**\r
+  Disable the keyboard interface of the 8042 controller\r
 \r
-  GC_TODO: add return values\r
+  @param ConsoleIn   - the device instance\r
 \r
---*/\r
-;\r
+  @return status of issuing disable command\r
 \r
+**/\r
 EFI_STATUS\r
 DisableKeyboard (\r
   IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ConsoleIn - GC_TODO: add argument description\r
-\r
-Returns:\r
+;\r
 \r
-  GC_TODO: add return values\r
+/**\r
+  Timer event handler: read a series of scancodes from 8042\r
+  and put them into memory scancode buffer.\r
+  it read as much scancodes to either fill\r
+  the memory buffer or empty the keyboard buffer.\r
+  It is registered as running under TPL_NOTIFY\r
 \r
---*/\r
-;\r
+  @param Event - The timer event\r
+  @param Context - A KEYBOARD_CONSOLE_IN_DEV pointer\r
 \r
+**/\r
 VOID\r
 EFIAPI\r
 KeyboardTimerHandler (\r
   IN EFI_EVENT    Event,\r
   IN VOID         *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Event   - GC_TODO: add argument description\r
-  Context - GC_TODO: add argument description\r
+;\r
 \r
-Returns:\r
+/**\r
+  logic reset keyboard\r
+  Implement SIMPLE_TEXT_IN.Reset()\r
+  Perform 8042 controller and keyboard initialization\r
 \r
-  GC_TODO: add return values\r
-\r
---*/\r
-;\r
+  @param This    Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
+  @param ExtendedVerification Indicate that the driver may perform a more \r
+                              exhaustive verification operation of the device during \r
+                              reset, now this par is ignored in this driver    \r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardEfiReset (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                         ExtendedVerification\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - GC_TODO: add argument description\r
-  ExtendedVerification  - GC_TODO: add argument description\r
-\r
-Returns:\r
+;\r
 \r
-  GC_TODO: add return values\r
+/**\r
+  Implement SIMPLE_TEXT_IN.ReadKeyStroke().\r
+  Retrieve key values for driver user.\r
 \r
---*/\r
-;\r
+  @param This    Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
+  @param Key     The output buffer for key value \r
 \r
+  @retval EFI_SUCCESS success to read key stroke\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardReadKeyStroke (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,\r
   OUT EFI_INPUT_KEY                   *Key\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - GC_TODO: add argument description\r
-  Key   - GC_TODO: add argument description\r
-\r
-Returns:\r
+;\r
 \r
-  GC_TODO: add return values\r
+/**\r
+  Event notification function for SIMPLE_TEXT_IN.WaitForKey event\r
+  Signal the event if there is key available\r
 \r
---*/\r
-;\r
+  @param Event    the event object\r
+  @param Context  waitting context\r
 \r
+**/\r
 VOID\r
 EFIAPI\r
 KeyboardWaitForKey (\r
   IN  EFI_EVENT               Event,\r
   IN  VOID                    *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Event   - GC_TODO: add argument description\r
-  Context - GC_TODO: add argument description\r
+;\r
 \r
-Returns:\r
+/**\r
+  Read status register\r
 \r
-  GC_TODO: add return values\r
+  @param ConsoleIn  Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
 \r
---*/\r
-;\r
+  @return value in status register\r
 \r
+**/\r
 UINT8\r
 KeyReadStatusRegister (\r
   IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ConsoleIn - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  GC_TODO: add return values\r
-\r
---*/\r
 ;\r
 \r
 /**\r
@@ -437,106 +368,106 @@ CheckKeyboardConnect (
   )\r
 ;\r
 \r
+/**\r
+  Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r
+  Signal the event if there is key available\r
+\r
+  @param Event    event object\r
+  @param Context  waiting context\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 KeyboardWaitForKeyEx (\r
   IN  EFI_EVENT               Event,\r
   IN  VOID                    *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r
-  Signal the event if there is key available\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/    \r
 ;  \r
 \r
 //\r
 // Simple Text Input Ex protocol function prototypes\r
 //\r
 \r
+/**\r
+  Reset the input device and optionaly run diagnostics\r
+\r
+  @param This                 - Protocol instance pointer.\r
+  @param ExtendedVerification - Driver may perform diagnostics on reset.\r
+\r
+  @retval EFI_SUCCESS           - The device was reset.\r
+  @retval EFI_DEVICE_ERROR      - The device is not functioning properly and could \r
+                                  not be reset.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardEfiResetEx (\r
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
   IN BOOLEAN                            ExtendedVerification\r
   )\r
-/*++\r
+;\r
 \r
-  Routine Description:\r
-    Reset the input device and optionaly run diagnostics\r
+/**\r
+    Reads the next keystroke from the input device. The WaitForKey Event can \r
+    be used to test for existance of a keystroke via WaitForEvent () call.\r
 \r
-  Arguments:\r
-    This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform diagnostics on reset.\r
 \r
-  Returns:\r
-    EFI_SUCCESS           - The device was reset.\r
-    EFI_DEVICE_ERROR      - The device is not functioning properly and could \r
-                            not be reset.\r
+    @param This       - Protocol instance pointer.\r
+    @param KeyData    - A pointer to a buffer that is filled in with the keystroke \r
+                 state data for the key that was pressed.\r
 \r
---*/\r
-;\r
+    @retval EFI_SUCCESS           - The keystroke information was returned.\r
+    @retval EFI_NOT_READY         - There was no keystroke data availiable.\r
+    @retval EFI_DEVICE_ERROR      - The keystroke information was not returned due to \r
+                            hardware errors.\r
+    @retval EFI_INVALID_PARAMETER - KeyData is NULL.                        \r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardReadKeyStrokeEx (\r
   IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
   OUT EFI_KEY_DATA                      *KeyData\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can \r
-    be used to test for existance of a keystroke via WaitForEvent () call.\r
+;\r
 \r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    KeyData    - A pointer to a buffer that is filled in with the keystroke \r
-                 state data for the key that was pressed.\r
+/**\r
+  Set certain state for the input device.\r
 \r
-  Returns:\r
-    EFI_SUCCESS           - The keystroke information was returned.\r
-    EFI_NOT_READY         - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR      - The keystroke information was not returned due to \r
-                            hardware errors.\r
-    EFI_INVALID_PARAMETER - KeyData is NULL.                        \r
+  @param This              - Protocol instance pointer.\r
+  @param KeyToggleState    - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
+                        state for the input device.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS           - The device state was set successfully.\r
+  @retval EFI_DEVICE_ERROR      - The device is not functioning correctly and could \r
+                            not have the setting adjusted.\r
+  @retval EFI_UNSUPPORTED       - The device does not have the ability to set its state.\r
+  @retval EFI_INVALID_PARAMETER - KeyToggleState is NULL.                       \r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardSetState (\r
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
   IN EFI_KEY_TOGGLE_STATE               *KeyToggleState\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Set certain state for the input device.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    KeyToggleState        - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
-                            state for the input device.\r
-                          \r
-  Returns:                \r
-    EFI_SUCCESS           - The device state was set successfully.\r
-    EFI_DEVICE_ERROR      - The device is not functioning correctly and could \r
-                            not have the setting adjusted.\r
-    EFI_UNSUPPORTED       - The device does not have the ability to set its state.\r
-    EFI_INVALID_PARAMETER - KeyToggleState is NULL.                       \r
-\r
---*/   \r
 ;\r
 \r
+/**\r
+    Register a notification function for a particular keystroke for the input device.\r
+\r
+    @param This                    - Protocol instance pointer.\r
+    @param KeyData                 - A pointer to a buffer that is filled in with the keystroke \r
+                              information data for the key that was pressed.\r
+    @param KeyNotificationFunction - Points to the function to be called when the key \r
+                              sequence is typed specified by KeyData.                        \r
+    @param NotifyHandle            - Points to the unique handle assigned to the registered notification.                          \r
+\r
+    @retval EFI_SUCCESS             - The notification function was registered successfully.\r
+    @retval EFI_OUT_OF_RESOURCES    - Unable to allocate resources for necesssary data structures.\r
+    @retval EFI_INVALID_PARAMETER   - KeyData or NotifyHandle is NULL.                       \r
+                              \r
+**/   \r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardRegisterKeyNotify (\r
@@ -545,48 +476,26 @@ KeyboardRegisterKeyNotify (
   IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,\r
   OUT EFI_HANDLE                        *NotifyHandle\r
   )\r
-/*++\r
+;\r
 \r
-  Routine Description:\r
-    Register a notification function for a particular keystroke for the input device.\r
+/**\r
+    Remove a registered notification function from a particular keystroke.\r
 \r
-  Arguments:\r
-    This                    - Protocol instance pointer.\r
-    KeyData                 - A pointer to a buffer that is filled in with the keystroke \r
-                              information data for the key that was pressed.\r
-    KeyNotificationFunction - Points to the function to be called when the key \r
-                              sequence is typed specified by KeyData.                        \r
-    NotifyHandle            - Points to the unique handle assigned to the registered notification.                          \r
+    @param This                    - Protocol instance pointer.    \r
+    @param NotificationHandle      - The handle of the notification function being unregistered.\r
 \r
-  Returns:\r
-    EFI_SUCCESS             - The notification function was registered successfully.\r
-    EFI_OUT_OF_RESOURCES    - Unable to allocate resources for necesssary data structures.\r
-    EFI_INVALID_PARAMETER   - KeyData or NotifyHandle is NULL.                       \r
+  \r
+    @retval EFI_SUCCESS             - The notification function was unregistered successfully.\r
+    @retval EFI_INVALID_PARAMETER   - The NotificationHandle is invalid.\r
+    @retval EFI_NOT_FOUND           - Can not find the matching entry in database.  \r
                               \r
---*/   \r
-;\r
-\r
+**/ \r
 EFI_STATUS\r
 EFIAPI\r
 KeyboardUnregisterKeyNotify (\r
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
   IN EFI_HANDLE                         NotificationHandle\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Remove a registered notification function from a particular keystroke.\r
-\r
-  Arguments:\r
-    This                    - Protocol instance pointer.    \r
-    NotificationHandle      - The handle of the notification function being unregistered.\r
-\r
-  Returns:\r
-    EFI_SUCCESS             - The notification function was unregistered successfully.\r
-    EFI_INVALID_PARAMETER   - The NotificationHandle is invalid.\r
-    EFI_NOT_FOUND           - Can not find the matching entry in database.  \r
-                              \r
---*/   \r
 ;\r
 \r
 #endif\r