]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c
Coding style modification.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2KbdTextIn.c
index 71cf8eed03bb8c27225d238a4c7a5b8a48efd935..17bbcc3136f6bb2d347be13c0bd235a34bc6f828 100644 (file)
@@ -45,54 +45,48 @@ KeyboardCheckForKey (
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This\r
   );\r
 \r
+/**\r
+  @param RegsiteredData    - A pointer to a buffer that is filled in with the keystroke \r
+                      state data for the key that was registered.\r
+  @param InputData         - A pointer to a buffer that is filled in with the keystroke \r
+                      state data for the key that was pressed.\r
+\r
+  @retval TRUE              - Key be pressed matches a registered key.\r
+  @retval FALSE             - Match failed. \r
+  \r
+**/\r
 STATIC\r
 BOOLEAN\r
 IsKeyRegistered (\r
   IN EFI_KEY_DATA  *RegsiteredData,\r
   IN EFI_KEY_DATA  *InputData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+;\r
 \r
-Arguments:\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
-  RegsiteredData    - A pointer to a buffer that is filled in with the keystroke \r
-                      state data for the key that was registered.\r
-  InputData         - A pointer to a buffer that is filled in with the keystroke \r
-                      state data for the key that was pressed.\r
+  \r
+    @param ConsoleInDev          - Ps2 Keyboard private structure\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
-Returns:\r
-  TRUE              - Key be pressed matches a registered key.\r
-  FLASE             - Match failed. \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
 STATIC\r
 EFI_STATUS\r
 KeyboardReadKeyStrokeWorker (\r
   IN  KEYBOARD_CONSOLE_IN_DEV           *ConsoleInDev,\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
-  Arguments:\r
-    ConsoleInDev          - Ps2 Keyboard private structure\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
-  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
 \r
---*/\r
 {\r
   EFI_STATUS                            Status;\r
   EFI_TPL                               OldTpl;\r
@@ -161,29 +155,23 @@ KeyboardReadKeyStrokeWorker (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  logic reset keyboard\r
+  Implement SIMPLE_TEXT_IN.Reset()\r
+  Perform 8042 controller and keyboard initialization\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
-  Implement SIMPLE_TEXT_IN.Reset()\r
-  Perform 8042 controller and keyboard initialization\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-// GC_TODO:    This - add argument and description to function comment\r
-// GC_TODO:    ExtendedVerification - add argument and description to function comment\r
-// GC_TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// GC_TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// GC_TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   EFI_STATUS              Status;\r
   KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;\r
@@ -251,29 +239,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Implement SIMPLE_TEXT_IN.ReadKeyStroke().\r
+  Retrieve key values for driver user.\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
-  Implement SIMPLE_TEXT_IN.ReadKeyStroke().\r
-  Retrieve key values for driver user.\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-// GC_TODO:    This - add argument and description to function comment\r
-// GC_TODO:    Key - add argument and description to function comment\r
-// GC_TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// GC_TODO:    EFI_NOT_READY - add return value to function comment\r
-// GC_TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   EFI_STATUS              Status;\r
   KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;\r
@@ -290,26 +270,20 @@ Returns:
   \r
 }\r
 \r
+/**\r
+  Event notification function for SIMPLE_TEXT_IN.WaitForKey event\r
+  Signal the event if there is key available\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
-  Event notification function for SIMPLE_TEXT_IN.WaitForKey event\r
-  Signal the event if there is key available\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-// GC_TODO:    Event - add argument and description to function comment\r
-// GC_TODO:    Context - add argument and description to function comment\r
 {\r
   EFI_TPL                 OldTpl;\r
   KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;\r
@@ -343,25 +317,17 @@ Returns:
   return ;\r
 }\r
 \r
+/**\r
+  Check keyboard for given key value\r
+  \r
+  @param  This  Point to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
+  \r
+  @retval EFI_SUCCESS success check keyboard value\r
+**/\r
 EFI_STATUS\r
 KeyboardCheckForKey (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This\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
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
 {\r
   KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;\r
 \r
@@ -377,28 +343,25 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Judge whether is a registed key\r
+\r
+  @param RegsiteredData    - A pointer to a buffer that is filled in with the keystroke \r
+                      state data for the key that was registered.\r
+  @param InputData         - A pointer to a buffer that is filled in with the keystroke \r
+                      state data for the key that was pressed.\r
+\r
+  @retval TRUE              - Key be pressed matches a registered key.\r
+  @retval FLASE             - Match failed. \r
+  \r
+**/\r
 STATIC\r
 BOOLEAN\r
 IsKeyRegistered (\r
   IN EFI_KEY_DATA  *RegsiteredData,\r
   IN EFI_KEY_DATA  *InputData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  RegsiteredData    - A pointer to a buffer that is filled in with the keystroke \r
-                      state data for the key that was registered.\r
-  InputData         - A pointer to a buffer that is filled in with the keystroke \r
-                      state data for the key that was pressed.\r
 \r
-Returns:\r
-  TRUE              - Key be pressed matches a registered key.\r
-  FLASE             - Match failed. \r
-  \r
---*/\r
 {\r
   ASSERT (RegsiteredData != NULL && InputData != NULL);\r
   \r
@@ -423,24 +386,21 @@ Returns:
 \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
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r
 \r
@@ -449,27 +409,24 @@ Returns:
   \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
-  Routine Description:\r
-    Reset the input device and optionaly run diagnostics\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
-\r
---*/\r
 {\r
   EFI_STATUS                            Status;\r
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r
@@ -498,31 +455,29 @@ KeyboardEfiResetEx (
   return EFI_SUCCESS;\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
+/**\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
-    KeyData    - A pointer to a buffer that is filled in with the keystroke \r
+\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
-  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
+    @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
-    EFI_INVALID_PARAMETER - KeyData is NULL.                        \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
 {\r
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r
 \r
@@ -535,30 +490,27 @@ KeyboardReadKeyStrokeEx (
   \r
 }\r
 \r
+/**\r
+  Set certain state for the input device.\r
+\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
+  @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
   EFI_STATUS                            Status;\r
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r
@@ -619,6 +571,22 @@ Exit:
   return Status;\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
@@ -627,25 +595,6 @@ KeyboardRegisterKeyNotify (
   IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,\r
   OUT EFI_HANDLE                        *NotifyHandle\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Register a notification function for a particular keystroke for the input device.\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
-\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
---*/   \r
 {\r
   EFI_STATUS                            Status;\r
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r
@@ -720,27 +669,24 @@ Exit:
 \r
 }\r
 \r
+/**\r
+    Remove a registered notification function from a particular keystroke.\r
+\r
+    @param This                    - Protocol instance pointer.    \r
+    @param NotificationHandle      - The handle of the notification function being unregistered.\r
+\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
 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
   EFI_STATUS                            Status;\r
   KEYBOARD_CONSOLE_IN_DEV               *ConsoleInDev;\r