]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clean codes per ECC for TerminalDxe module.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Jul 2008 06:34:04 +0000 (06:34 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Jul 2008 06:34:04 +0000 (06:34 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5389 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c

index 76b603c3a3db006f74d7ae44b3ba354a7cf7d120..a1c2d5a63de7d4dad0183ce2bd8625256a39dd1e 100644 (file)
@@ -16,7 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Terminal.h"\r
 \r
-STATIC\r
 EFI_STATUS\r
 TerminalFreeNotifyList (\r
   IN OUT LIST_ENTRY           *ListHead\r
@@ -209,6 +208,19 @@ TerminalDriverBindingSupported (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Start the controller.\r
+\r
+  @param  This                   A pointer to the EFI_DRIVER_BINDING_PROTOCOL\r
+                                 instance.\r
+  @param  Controller             The handle of the controller to start.\r
+  @param  RemainingDevicePath    A pointer to the remaining portion of a devcie\r
+                                 path.\r
+\r
+  @return EFI_SUCCESS.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalDriverBindingStart (\r
@@ -216,23 +228,6 @@ TerminalDriverBindingStart (
   IN EFI_HANDLE                     Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-\r
-    Start the controller.\r
-\r
-  Arguments:\r
-\r
-    This                - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller          - The handle of the controller to start.\r
-    RemainingDevicePath - A pointer to the remaining portion of a devcie path.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS.\r
-\r
---*/\r
 {\r
   EFI_STATUS                          Status;\r
   EFI_SERIAL_IO_PROTOCOL              *SerialIo;\r
@@ -358,8 +353,8 @@ TerminalDriverBindingStart (
     }\r
 \r
     TerminalType = FixedPcdGet8 (PcdDefaultTerminalType);\r
-    // must be between PcAnsiType (0) and VTUTF8Type (3)\r
-    ASSERT (TerminalType <= VTUTF8Type);\r
+    // must be between PCANSITYPE (0) and VTUTF8TYPE (3)\r
+    ASSERT (TerminalType <= VTUTF8TYPE);\r
 \r
     CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID));\r
     RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL*)DefaultNode;\r
@@ -369,13 +364,13 @@ TerminalDriverBindingStart (
     //\r
     Node = (VENDOR_DEVICE_PATH *)RemainingDevicePath;\r
     if (CompareGuid (&Node->Guid, &gEfiPcAnsiGuid)) {\r
-      TerminalType = PcAnsiType;\r
+      TerminalType = PCANSITYPE;\r
     } else if (CompareGuid (&Node->Guid, &gEfiVT100Guid)) {\r
-      TerminalType = VT100Type;\r
+      TerminalType = VT100TYPE;\r
     } else if (CompareGuid (&Node->Guid, &gEfiVT100PlusGuid)) {\r
-      TerminalType = VT100PlusType;\r
+      TerminalType = VT100PLUSTYPE;\r
     } else if (CompareGuid (&Node->Guid, &gEfiVTUTF8Guid)) {\r
-      TerminalType = VTUTF8Type;\r
+      TerminalType = VTUTF8TYPE;\r
     } else {\r
       goto Error;\r
     }\r
@@ -544,7 +539,7 @@ TerminalDriverBindingStart (
   //\r
   TerminalDevice->ControllerNameTable = NULL;\r
   switch (TerminalDevice->TerminalType) {\r
-  case PcAnsiType:\r
+  case PCANSITYPE:\r
     AddUnicodeString2 (\r
       "eng",\r
       gTerminalComponentName.SupportedLanguages,\r
@@ -562,7 +557,7 @@ TerminalDriverBindingStart (
 \r
     break;\r
 \r
-  case VT100Type:\r
+  case VT100TYPE:\r
     AddUnicodeString2 (\r
       "eng",\r
       gTerminalComponentName.SupportedLanguages,\r
@@ -580,7 +575,7 @@ TerminalDriverBindingStart (
 \r
     break;\r
 \r
-  case VT100PlusType:\r
+  case VT100PLUSTYPE:\r
     AddUnicodeString2 (\r
       "eng",\r
       gTerminalComponentName.SupportedLanguages,\r
@@ -598,7 +593,7 @@ TerminalDriverBindingStart (
 \r
     break;\r
 \r
-  case VTUTF8Type:\r
+  case VTUTF8TYPE:\r
     AddUnicodeString2 (\r
       "eng",\r
       gTerminalComponentName.SupportedLanguages,\r
@@ -731,6 +726,21 @@ Error:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Stop a device controller.\r
+\r
+  @param  This                   A pointer to the EFI_DRIVER_BINDING_PROTOCOL\r
+                                 instance.\r
+  @param  Controller             A handle to the device being stopped.\r
+  @param  NumberOfChildren       The number of child device handles in\r
+                                 ChildHandleBuffer.\r
+  @param  ChildHandleBuffer      An array of child handles to be freed.\r
+\r
+  @retval EFI_SUCCESS            Operation successful.\r
+  @retval EFI_DEVICE_ERROR       Devices error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalDriverBindingStop (\r
@@ -739,25 +749,6 @@ TerminalDriverBindingStop (
   IN  UINTN                         NumberOfChildren,\r
   IN  EFI_HANDLE                    *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-\r
-    Stop a device controller.\r
-\r
-  Arguments:\r
-\r
-    This              - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller        - A handle to the device being stopped.\r
-    NumberOfChildren  - The number of child device handles in ChildHandleBuffer.\r
-    ChildHandleBuffer - An array of child handles to be freed.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS      - Operation successful.\r
-    EFI_DEVICE_ERROR - Devices error.\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   UINTN                            Index;\r
@@ -927,25 +918,19 @@ TerminalDriverBindingStop (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-TerminalFreeNotifyList (\r
-  IN OUT LIST_ENTRY           *ListHead\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  ListHead   - The list head\r
+/**\r
 \r
-Returns:\r
+  @param  ListHead               The list head\r
 \r
-  EFI_SUCCESS           - Free the notify list successfully\r
-  EFI_INVALID_PARAMETER - ListHead is invalid.\r
+  @retval EFI_SUCCESS            Free the notify list successfully\r
+  @retval EFI_INVALID_PARAMETER  ListHead is invalid.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+TerminalFreeNotifyList (\r
+  IN OUT LIST_ENTRY           *ListHead\r
+  )\r
 {\r
   TERMINAL_CONSOLE_IN_EX_NOTIFY *NotifyNode;\r
 \r
@@ -994,7 +979,7 @@ TerminalUpdateConsoleDevVariable (
   //\r
   // Append terminal device path onto the variable.\r
   //\r
-  for (TerminalType = PcAnsiType; TerminalType <= VTUTF8Type; TerminalType++) {\r
+  for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) {\r
     SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);\r
     NewVariable = AppendDevicePathInstance (Variable, TempDevicePath);\r
     if (Variable != NULL) {\r
@@ -1023,25 +1008,21 @@ TerminalUpdateConsoleDevVariable (
   return ;\r
 }\r
 \r
+\r
+/**\r
+  Remove console device variable.\r
+\r
+  @param  VariableName           A pointer to the variable name.\r
+  @param  ParentDevicePath       A pointer to the parent device path.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
 TerminalRemoveConsoleDevVariable (\r
   IN CHAR16                    *VariableName,\r
   IN EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-\r
-    Remove console device variable.\r
-\r
-  Arguments:\r
-\r
-    VariableName     - A pointer to the variable name.\r
-    ParentDevicePath - A pointer to the parent device path.\r
-\r
-  Returns:\r
-\r
---*/\r
 {\r
   EFI_STATUS                Status;\r
   BOOLEAN                   FoundOne;\r
@@ -1091,7 +1072,7 @@ TerminalRemoveConsoleDevVariable (
     // Loop through all the terminal types that this driver supports\r
     //\r
     Match = FALSE;\r
-    for (TerminalType = PcAnsiType; TerminalType <= VTUTF8Type; TerminalType++) {\r
+    for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) {\r
 \r
       SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);\r
 \r
@@ -1146,32 +1127,26 @@ TerminalRemoveConsoleDevVariable (
   return ;\r
 }\r
 \r
-VOID *\r
-TerminalGetVariableAndSize (\r
-  IN  CHAR16              *Name,\r
-  IN  EFI_GUID            *VendorGuid,\r
-  OUT UINTN               *VariableSize\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r
   buffer, and the size of the buffer. On failure return NULL.\r
 \r
-Arguments:\r
-  Name       - String part of EFI variable name\r
-\r
-  VendorGuid - GUID part of EFI variable name\r
-\r
-  VariableSize - Returns the size of the EFI variable that was read\r
+  @param  Name                   String part of EFI variable name\r
+  @param  VendorGuid             GUID part of EFI variable name\r
+  @param  VariableSize           Returns the size of the EFI variable that was read\r
 \r
-Returns:\r
-  Dynamically allocated memory that contains a copy of the EFI variable.\r
-  Caller is repsoncible freeing the buffer.\r
+  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
+  @return Caller is repsoncible freeing the buffer.\r
+  @retval NULL                   Variable was not read\r
 \r
-  NULL - Variable was not read\r
-\r
---*/\r
+**/\r
+VOID *\r
+TerminalGetVariableAndSize (\r
+  IN  CHAR16              *Name,\r
+  IN  EFI_GUID            *VendorGuid,\r
+  OUT UINTN               *VariableSize\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       BufferSize;\r
@@ -1245,7 +1220,7 @@ SetTerminalDevicePath (
   //\r
   switch (TerminalType) {\r
 \r
-  case PcAnsiType:\r
+  case PCANSITYPE:\r
     CopyMem (\r
       &Node.Guid,\r
       &gEfiPcAnsiGuid,\r
@@ -1253,7 +1228,7 @@ SetTerminalDevicePath (
       );\r
     break;\r
 \r
-  case VT100Type:\r
+  case VT100TYPE:\r
     CopyMem (\r
       &Node.Guid,\r
       &gEfiVT100Guid,\r
@@ -1261,7 +1236,7 @@ SetTerminalDevicePath (
       );\r
     break;\r
 \r
-  case VT100PlusType:\r
+  case VT100PLUSTYPE:\r
     CopyMem (\r
       &Node.Guid,\r
       &gEfiVT100PlusGuid,\r
@@ -1269,7 +1244,7 @@ SetTerminalDevicePath (
       );\r
     break;\r
 \r
-  case VTUTF8Type:\r
+  case VTUTF8TYPE:\r
     CopyMem (\r
       &Node.Guid,\r
       &gEfiVTUTF8Guid,\r
index 86808bbc56f716eca1ff58e188601a5e6dc0d42f..eaa4a74e27134c2385042784e2f00dc9b2426035 100644 (file)
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _TERMINAL_H\r
-#define _TERMINAL_H\r
+#ifndef _TERMINAL_H_\r
+#define _TERMINAL_H_\r
 \r
 \r
 #include <PiDxe.h>\r
@@ -121,10 +121,10 @@ typedef union {
   UINT8 Utf8_3[3];\r
 } UTF8_CHAR;\r
 \r
-#define PcAnsiType                0\r
-#define VT100Type                 1\r
-#define VT100PlusType             2\r
-#define VTUTF8Type                3\r
+#define PCANSITYPE                0\r
+#define VT100TYPE                 1\r
+#define VT100PLUSTYPE             2\r
+#define VTUTF8TYPE                3\r
 \r
 #define LEFTOPENBRACKET           0x5b  // '['\r
 #define ACAP                      0x41\r
@@ -165,9 +165,17 @@ extern EFI_COMPONENT_NAME_PROTOCOL   gTerminalComponentName;
 extern EFI_COMPONENT_NAME2_PROTOCOL  gTerminalComponentName2;\r
 \r
 extern EFI_GUID                      gSimpleTextInExNotifyGuid;\r
-//\r
-// Prototypes\r
-//\r
+\r
+/**\r
+  The user Entry Point for module Terminal. 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
 InitializeTerminal (\r
@@ -176,6 +184,20 @@ InitializeTerminal (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().\r
+  This driver only perform dependent serial device reset regardless of\r
+  the value of ExtendeVerification\r
+\r
+  @param  This                     Indicates the calling context.\r
+  @param  ExtendedVerification     Skip by this driver.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The reset operation succeeds.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The dependent serial port reset fails.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReset (\r
@@ -184,6 +206,23 @@ TerminalConInReset (
   )\r
 ;\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().\r
+\r
+  @param  This                     Indicates the calling context.\r
+  @param  Key                      A pointer to a buffer that is filled in with the\r
+                                   keystroke information for the key that was sent\r
+                                   from terminal.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The keystroke information is returned successfully.\r
+  @return EFI_NOT_READY\r
+  @return There is no keystroke data available.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The dependent serial device encounters error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReadKeyStroke (\r
@@ -193,29 +232,36 @@ TerminalConInReadKeyStroke (
 ;\r
 \r
 \r
+/**\r
+\r
+  @param  RegsiteredData           A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   registered.\r
+  @param  InputData                A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   pressed.\r
+\r
+  @retval TRUE                     Key be pressed matches a registered key.\r
+  @retval FLASE                    Match failed.\r
+\r
+**/\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
 \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
+  Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r
+  Signal the event if there is key available\r
 \r
-Returns:\r
-  TRUE              - Key be pressed matches a registered key.\r
-  FLASE             - Match failed.\r
+  @param  Event                    Indicates the event that invoke this function.\r
+  @param  Context                  Indicates the calling context.\r
 \r
---*/\r
-;\r
+  @return none.\r
 \r
+**/\r
 VOID\r
 EFIAPI\r
 TerminalConInWaitForKeyEx (\r
@@ -223,86 +269,96 @@ TerminalConInWaitForKeyEx (
   IN  VOID            *Context\r
   )\r
 ;\r
+\r
 //\r
 // Simple Text Input Ex protocol 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
 TerminalConInResetEx (\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
+  @param  This                     Protocol instance pointer.\r
+  @param  KeyData                  A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   pressed.\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
+  @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\r
+                                   to hardware errors.\r
+  @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReadKeyStrokeEx (\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\r
+                                   could not have the setting adjusted.\r
+  @retval EFI_UNSUPPORTED          The device does not have the ability to set its\r
+                                   state.\r
+  @retval EFI_INVALID_PARAMETER    KeyToggleState is NULL.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInSetState (\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\r
+                                   keystroke information data for the key that was\r
+                                   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\r
+                                   registered notification.\r
+\r
+  @retval EFI_SUCCESS              The notification function was registered\r
+                                   successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data\r
+                                   structures.\r
+  @retval EFI_INVALID_PARAMETER    KeyData or NotifyHandle is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInRegisterKeyNotify (\r
@@ -311,50 +367,39 @@ TerminalConInRegisterKeyNotify (
   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
 \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
+  Remove a registered notification function from a particular keystroke.\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
+  @param  This                     Protocol instance pointer.\r
+  @param  NotificationHandle       The handle of the notification function being\r
+                                   unregistered.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS              The notification function was unregistered\r
+                                   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
 TerminalConInUnregisterKeyNotify (\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
 \r
-  Arguments:\r
-    This                    - Protocol instance pointer.\r
-    NotificationHandle      - The handle of the notification function being unregistered.\r
+/**\r
+  Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event\r
+  Signal the event if there is key available\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
+  @param  Event                    Indicates the event that invoke this function.\r
+  @param  Context                  Indicates the calling context.\r
 \r
---*/\r
-;\r
+  @return None\r
 \r
+**/\r
 VOID\r
 EFIAPI\r
 TerminalConInWaitForKey (\r
@@ -363,6 +408,23 @@ TerminalConInWaitForKey (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().\r
+  If ExtendeVerification is TRUE, then perform dependent serial device reset,\r
+  and set display mode to mode 0.\r
+  If ExtendedVerification is FALSE, only set display mode to mode 0.\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  ExtendedVerification  Indicates that the driver may perform a more\r
+                                exhaustive verification operation of the device\r
+                                during reset.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The reset operation succeeds.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The terminal is not functioning correctly or the serial port reset fails.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutReset (\r
@@ -371,6 +433,22 @@ TerminalConOutReset (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().\r
+  The Unicode string will be converted to terminal expressible data stream\r
+  and send to terminal via serial port.\r
+\r
+  @param  This                    Indicates the calling context.\r
+  @param  WString                 The Null-terminated Unicode string to be displayed\r
+                                  on the terminal screen.\r
+\r
+  @return EFI_SUCCESS             The string is output successfully.\r
+  @return EFI_DEVICE_ERROR        The serial port fails to send the string out.\r
+  @return EFI_WARN_UNKNOWN_GLYPH  Indicates that some of the characters in the Unicode string could not\r
+                                  be rendered and are skipped.\r
+  @return EFI_UNSUPPORTED\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutOutputString (\r
@@ -379,6 +457,20 @@ TerminalConOutOutputString (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().\r
+  If one of the characters in the *Wstring is\r
+  neither valid Unicode drawing characters,\r
+  not ASCII code, then this function will return\r
+  EFI_UNSUPPORTED.\r
+\r
+  @param  This              Indicates the calling context.\r
+  @param  WString           The Null-terminated Unicode string to be tested.\r
+\r
+  @return EFI_SUCCESS       The terminal is capable of rendering the output string.\r
+  @return EFI_UNSUPPORTED   Some of the characters in the Unicode string cannot be rendered.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutTestString (\r
@@ -387,6 +479,23 @@ TerminalConOutTestString (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().\r
+  It returns information for an available text mode\r
+  that the terminal supports.\r
+  In this driver, we support text mode 80x25 (mode 0),\r
+  80x50 (mode 1), 100x31 (mode 2).\r
+\r
+  @param This        Indicates the calling context.\r
+  @param ModeNumber  The mode number to return information on.\r
+  @param Columns     The returned columns of the requested mode.\r
+  @param Rows        The returned rows of the requested mode.\r
+\r
+  @return EFI_SUCCESS       The requested mode information is returned.\r
+  @return EFI_UNSUPPORTED   The mode number is not valid.\r
+  @return EFI_DEVICE_ERROR\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutQueryMode (\r
@@ -397,6 +506,20 @@ TerminalConOutQueryMode (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUT.SetMode().\r
+  Set the terminal to a specified display mode.\r
+  In this driver, we only support mode 0.\r
+\r
+  @param This          Indicates the calling context.\r
+  @param ModeNumber    The text mode to set.\r
+\r
+  @return EFI_SUCCESS       The requested text mode is set.\r
+  @return EFI_DEVICE_ERROR  The requested text mode cannot be set \r
+                            because of serial device error.\r
+  @return EFI_UNSUPPORTED   The text mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetMode (\r
@@ -405,6 +528,18 @@ TerminalConOutSetMode (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().\r
+\r
+  @param This        Indicates the calling context.\r
+  @param Attribute   The attribute to set. Only bit0..6 are valid, all other bits\r
+                     are undefined and must be zero.\r
+\r
+  @return EFI_SUCCESS        The requested attribute is set.\r
+  @return EFI_DEVICE_ERROR   The requested attribute cannot be set due to serial port error.\r
+  @return EFI_UNSUPPORTED    The attribute requested is not defined by EFI spec.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetAttribute (\r
@@ -413,6 +548,18 @@ TerminalConOutSetAttribute (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().\r
+  It clears the ANSI terminal's display to the\r
+  currently selected background color.\r
+\r
+  @param This     Indicates the calling context.\r
+\r
+  @return EFI_SUCCESS       The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR  The terminal screen cannot be cleared due to serial port error.\r
+  @return EFI_UNSUPPORTED   The terminal is not in a valid display mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutClearScreen (\r
@@ -420,6 +567,19 @@ TerminalConOutClearScreen (
   )\r
 ;\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().\r
+\r
+  @param This      Indicates the calling context.\r
+  @param Column    The row to set cursor to.\r
+  @param Row       The column to set cursor to.\r
+\r
+  @return EFI_SUCCESS       The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR  The request fails due to serial port error.\r
+  @return EFI_UNSUPPORTED   The terminal is not in a valid text mode, or the cursor position\r
+                            is invalid for current mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetCursorPosition (\r
@@ -429,6 +589,18 @@ TerminalConOutSetCursorPosition (
   )\r
 ;\r
 \r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
+  In this driver, the cursor cannot be hidden.\r
+\r
+  @param This      Indicates the calling context.\r
+  @param Visible   If TRUE, the cursor is set to be visible,\r
+                   If FALSE, the cursor is set to be invisible.\r
+\r
+  @return EFI_SUCCESS      The request is valid.\r
+  @return EFI_UNSUPPORTED  The terminal does not support cursor hidden.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutEnableCursor (\r
@@ -592,6 +764,19 @@ TerminalComponentNameGetControllerName (
 //\r
 // internal functions\r
 //\r
+\r
+/**\r
+  Check for a pending key in the Efi Key FIFO or Serial device buffer.\r
+\r
+  @param  This                     Indicates the calling context.\r
+\r
+  @return EFI_SUCCESS\r
+  @return There is key pending.\r
+  @return EFI_NOT_READY\r
+  @return There is no key pending.\r
+  @return EFI_DEVICE_ERROR\r
+\r
+**/\r
 EFI_STATUS\r
 TerminalConInCheckForKey (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This\r
@@ -605,6 +790,15 @@ TerminalUpdateConsoleDevVariable (
   )\r
 ;\r
 \r
+/**\r
+  Remove console device variable.\r
+\r
+  @param  VariableName           A pointer to the variable name.\r
+  @param  ParentDevicePath       A pointer to the parent device path.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
 TerminalRemoveConsoleDevVariable (\r
   IN CHAR16                    *VariableName,\r
@@ -612,6 +806,19 @@ TerminalRemoveConsoleDevVariable (
   )\r
 ;\r
 \r
+/**\r
+  Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r
+  buffer, and the size of the buffer. On failure return NULL.\r
+\r
+  @param  Name                   String part of EFI variable name\r
+  @param  VendorGuid             GUID part of EFI variable name\r
+  @param  VariableSize           Returns the size of the EFI variable that was read\r
+\r
+  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
+  @return Caller is repsoncible freeing the buffer.\r
+  @retval NULL                   Variable was not read\r
+\r
+**/\r
 VOID                                *\r
 TerminalGetVariableAndSize (\r
   IN  CHAR16              *Name,\r
@@ -646,6 +853,18 @@ InitializeEfiKeyFiFo (
   )\r
 ;\r
 \r
+/**\r
+  Get one key out of serial buffer.\r
+\r
+  @param  SerialIo           Serial I/O protocl attached to the serial device.\r
+  @param  Input              The fetched key.\r
+\r
+  @return EFI_NOT_READY      If serial buffer is empty.\r
+  @return EFI_DEVICE_ERROR   If reading serial buffer encounter error.\r
+  @return EFI_SUCCESS        If reading serial buffer successfully, put\r
+                             the fetched key to the parameter output.\r
+\r
+**/\r
 EFI_STATUS\r
 GetOneKeyFromSerial (\r
   EFI_SERIAL_IO_PROTOCOL  *SerialIo,\r
@@ -653,6 +872,17 @@ GetOneKeyFromSerial (
   )\r
 ;\r
 \r
+/**\r
+  Insert one byte raw data into the Raw Data FIFO.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Input                The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Raw Data buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 RawFiFoInsertOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
@@ -660,6 +890,16 @@ RawFiFoInsertOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Remove one pre-fetched key out of the Raw Data FIFO.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Raw Data FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 RawFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
@@ -667,18 +907,47 @@ RawFiFoRemoveOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether Raw Data FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Raw Data FIFO buffer is empty.\r
+  @return FLASE                If Raw Data FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsRawFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether Raw Data FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Raw Data FIFO buffer is full.\r
+  @return FLASE                If Raw Data FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsRawFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
 ;\r
 \r
+/**\r
+  Insert one pre-fetched key into the FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Key                  The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If FIFO buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 EfiKeyFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
@@ -686,6 +955,16 @@ EfiKeyFiFoInsertOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Remove one pre-fetched key out of the FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 EfiKeyFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
@@ -693,18 +972,47 @@ EfiKeyFiFoRemoveOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If FIFO buffer is empty.\r
+  @return FLASE                If FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsEfiKeyFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If FIFO buffer is full.\r
+  @return FLASE                If FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsEfiKeyFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
 ;\r
 \r
+/**\r
+  Insert one pre-fetched key into the Unicode FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Input                The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Unicode FIFO buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 UnicodeFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
@@ -712,6 +1020,16 @@ UnicodeFiFoInsertOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Remove one pre-fetched key out of the Unicode FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Unicode FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 UnicodeFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
@@ -719,12 +1037,30 @@ UnicodeFiFoRemoveOneKey (
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether Unicode FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Unicode FIFO buffer is empty.\r
+  @return FLASE                If Unicode FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsUnicodeFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
 ;\r
 \r
+/**\r
+  Clarify whether Unicode FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Unicode FIFO buffer is full.\r
+  @return FLASE                If Unicode FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsUnicodeFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
@@ -765,26 +1101,6 @@ AnsiTestString (
   )\r
 ;\r
 \r
-//\r
-// internal functions for VT100\r
-//\r
-EFI_STATUS\r
-VT100TestString (\r
-  IN  TERMINAL_DEV    *VT100Device,\r
-  IN  CHAR16          *WString\r
-  )\r
-;\r
-\r
-//\r
-// internal functions for VT100Plus\r
-//\r
-EFI_STATUS\r
-VT100PlusTestString (\r
-  IN  TERMINAL_DEV    *TerminalDevice,\r
-  IN  CHAR16          *WString\r
-  )\r
-;\r
-\r
 //\r
 // internal functions for VTUTF8\r
 //\r
index 404e46e0e73d38a07372cfeb46c114df2244a7e0..62abf9076262fe2a94ca44563a004422b2749e7b 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
+/** @file\r
   Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -15,31 +15,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Terminal.h"\r
 \r
 \r
-STATIC\r
+\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
+  @param  TerminalDevice           Terminal driver private structure\r
+  @param  KeyData                  A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   pressed.\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\r
+                                   to hardware errors.\r
+  @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 ReadKeyStrokeWorker (\r
   IN  TERMINAL_DEV *TerminalDevice,\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
-    TerminalDevice        - Terminal driver 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
   LIST_ENTRY                      *Link;\r
@@ -86,35 +83,26 @@ ReadKeyStrokeWorker (
 \r
 }\r
 \r
+/**\r
+  Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().\r
+  This driver only perform dependent serial device reset regardless of\r
+  the value of ExtendeVerification\r
 \r
+  @param  This                     Indicates the calling context.\r
+  @param  ExtendedVerification     Skip by this driver.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The reset operation succeeds.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The dependent serial port reset fails.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReset (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                         ExtendedVerification\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().\r
-    This driver only perform dependent serial device reset regardless of\r
-    the value of ExtendeVerification\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    ExtendedVerification - Skip by this driver.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The reset operation succeeds.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The dependent serial port reset fails.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   TERMINAL_DEV  *TerminalDevice;\r
@@ -150,36 +138,29 @@ TerminalConInReset (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().\r
+\r
+  @param  This                     Indicates the calling context.\r
+  @param  Key                      A pointer to a buffer that is filled in with the\r
+                                   keystroke information for the key that was sent\r
+                                   from terminal.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The keystroke information is returned successfully.\r
+  @return EFI_NOT_READY\r
+  @return There is no keystroke data available.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The dependent serial device encounters error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReadKeyStroke (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,\r
   OUT EFI_INPUT_KEY                   *Key\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    Key  - A pointer to a buffer that is filled in with the keystroke\r
-        information for the key that was sent from terminal.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The keystroke information is returned successfully.\r
-\r
-    EFI_NOT_READY\r
-      There is no keystroke data available.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The dependent serial device encounters error.\r
-\r
---*/\r
 {\r
   TERMINAL_DEV  *TerminalDevice;\r
   EFI_STATUS    Status;\r
@@ -202,27 +183,25 @@ TerminalConInReadKeyStroke (
 }\r
 \r
 \r
+\r
+/**\r
+\r
+  @param  RegsiteredData           A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   registered.\r
+  @param  InputData                A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   pressed.\r
+\r
+  @retval TRUE                     Key be pressed matches a registered key.\r
+  @retval FLASE                    Match failed.\r
+\r
+**/\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
@@ -235,29 +214,23 @@ Returns:
 }\r
 \r
 \r
+\r
+/**\r
+  Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r
+  Signal the event if there is key available\r
+\r
+  @param  Event                    Indicates the event that invoke this function.\r
+  @param  Context                  Indicates the calling context.\r
+\r
+  @return none.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 TerminalConInWaitForKeyEx (\r
   IN  EFI_EVENT       Event,\r
   IN  VOID            *Context\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r
-    Signal the event if there is key available\r
-\r
-  Arguments:\r
-\r
-    Event - Indicates the event that invoke this function.\r
-\r
-    Context - Indicates the calling context.\r
-\r
-  Returns:\r
-\r
-    N/A\r
-\r
---*/\r
 {\r
   TERMINAL_DEV            *TerminalDevice;\r
 \r
@@ -271,27 +244,24 @@ TerminalConInWaitForKeyEx (
 // Simple Text Input Ex protocol functions\r
 //\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
 TerminalConInResetEx (\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
   TERMINAL_DEV            *TerminalDevice;\r
@@ -307,31 +277,29 @@ TerminalConInResetEx (
 \r
 }\r
 \r
+\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
+  @param  This                     Protocol instance pointer.\r
+  @param  KeyData                  A pointer to a buffer that is filled in with the\r
+                                   keystroke state data for the key that was\r
+                                   pressed.\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\r
+                                   to hardware errors.\r
+  @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInReadKeyStrokeEx (\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
-  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
-  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
   TERMINAL_DEV                    *TerminalDevice;\r
 \r
@@ -345,30 +313,28 @@ TerminalConInReadKeyStrokeEx (
 \r
 }\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\r
+                                   could not have the setting adjusted.\r
+  @retval EFI_UNSUPPORTED          The device does not have the ability to set its\r
+                                   state.\r
+  @retval EFI_INVALID_PARAMETER    KeyToggleState is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInSetState (\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
   if (KeyToggleState == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -377,6 +343,26 @@ TerminalConInSetState (
   return EFI_SUCCESS;\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\r
+                                   keystroke information data for the key that was\r
+                                   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\r
+                                   registered notification.\r
+\r
+  @retval EFI_SUCCESS              The notification function was registered\r
+                                   successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data\r
+                                   structures.\r
+  @retval EFI_INVALID_PARAMETER    KeyData or NotifyHandle is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConInRegisterKeyNotify (\r
@@ -385,25 +371,6 @@ TerminalConInRegisterKeyNotify (
   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
   TERMINAL_DEV                    *TerminalDevice;\r
@@ -462,27 +429,26 @@ TerminalConInRegisterKeyNotify (
   return EFI_SUCCESS;\r
 }\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\r
+                                   unregistered.\r
+\r
+  @retval EFI_SUCCESS              The notification function was unregistered\r
+                                   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
 TerminalConInUnregisterKeyNotify (\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
   TERMINAL_DEV                    *TerminalDevice;\r
@@ -534,27 +500,30 @@ TerminalConInUnregisterKeyNotify (
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  Turn raw data into Unicode (according to different encode), and \r
+  translate Unicode into key information. (according to different standard). \r
 \r
+  @param  TerminalDevice       Terminal driver private structure.\r
+\r
+  @return none.\r
+\r
+**/\r
 VOID\r
 TranslateRawDataToEfiKey (\r
   IN  TERMINAL_DEV      *TerminalDevice\r
   )\r
-/*++\r
-    Step1: Turn raw data into Unicode (according to different encode).\r
-    Step2: Translate Unicode into key information.\r
-    (according to different terminal standard).\r
---*/\r
 {\r
   switch (TerminalDevice->TerminalType) {\r
 \r
-  case PcAnsiType:\r
-  case VT100Type:\r
-  case VT100PlusType:\r
+  case PCANSITYPE:\r
+  case VT100TYPE:\r
+  case VT100PLUSTYPE:\r
     AnsiRawDataToUnicode (TerminalDevice);\r
     UnicodeToEfiKey (TerminalDevice);\r
     break;\r
 \r
-  case VTUTF8Type:\r
+  case VTUTF8TYPE:\r
     //\r
     // Process all the raw data in the RawFIFO,\r
     // put the processed key into UnicodeFIFO.\r
@@ -571,29 +540,22 @@ TranslateRawDataToEfiKey (
   }\r
 }\r
 \r
+/**\r
+  Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event\r
+  Signal the event if there is key available\r
+\r
+  @param  Event                    Indicates the event that invoke this function.\r
+  @param  Context                  Indicates the calling context.\r
+\r
+  @return None\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 TerminalConInWaitForKey (\r
   IN  EFI_EVENT       Event,\r
   IN  VOID            *Context\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event\r
-    Signal the event if there is key available\r
-\r
-  Arguments:\r
-\r
-    Event - Indicates the event that invoke this function.\r
-\r
-    Context - Indicates the calling context.\r
-\r
-  Returns:\r
-\r
-    N/A\r
-\r
---*/\r
 {\r
   //\r
   // Someone is waiting on the keystroke event, if there's\r
@@ -607,30 +569,23 @@ TerminalConInWaitForKey (
   }\r
 }\r
 \r
-EFI_STATUS\r
-TerminalConInCheckForKey (\r
-  IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This\r
-  )\r
-/*++\r
-  Routine Description:\r
-\r
-    Check for a pending key in the Efi Key FIFO or Serial device buffer.\r
-\r
-  Arguments:\r
 \r
-    This - Indicates the calling context.\r
+/**\r
+  Check for a pending key in the Efi Key FIFO or Serial device buffer.\r
 \r
-  Returns:\r
+  @param  This                     Indicates the calling context.\r
 \r
-    EFI_SUCCESS\r
-       There is key pending.\r
+  @return EFI_SUCCESS\r
+  @return There is key pending.\r
+  @return EFI_NOT_READY\r
+  @return There is no key pending.\r
+  @return EFI_DEVICE_ERROR\r
 \r
-    EFI_NOT_READY\r
-      There is no key pending.\r
-\r
-    EFI_DEVICE_ERROR\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+TerminalConInCheckForKey (\r
+  IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This\r
+  )\r
 {\r
   EFI_STATUS              Status;\r
   TERMINAL_DEV            *TerminalDevice;\r
@@ -680,7 +635,7 @@ TerminalConInCheckForKey (
   //\r
   Status = SerialIo->GetControl (SerialIo, &Control);\r
 \r
-  if (Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) {\r
+  if (0 != (Control & EFI_SERIAL_INPUT_BUFFER_EMPTY)) {\r
     //\r
     // Translate all the raw data in RawFIFO into EFI Key,\r
     // according to different terminal type supported.\r
@@ -732,26 +687,31 @@ TerminalConInCheckForKey (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Get one key out of serial buffer.\r
+\r
+  @param  SerialIo           Serial I/O protocl attached to the serial device.\r
+  @param  Output             The fetched key.\r
+\r
+  @return EFI_NOT_READY      If serial buffer is empty.\r
+  @return EFI_DEVICE_ERROR   If reading serial buffer encounter error.\r
+  @return EFI_SUCCESS        If reading serial buffer successfully, put\r
+                             the fetched key to the parameter output.\r
+\r
+**/\r
 EFI_STATUS\r
 GetOneKeyFromSerial (\r
   EFI_SERIAL_IO_PROTOCOL  *SerialIo,\r
-  UINT8                   *Input\r
+  UINT8                   *Output\r
   )\r
-/*++\r
-    Get one key out of serial buffer.\r
-    If serial buffer is empty, return EFI_NOT_READY;\r
-    if reading serial buffer encounter error, returns EFI_DEVICE_ERROR;\r
-    if reading serial buffer successfully, put the fetched key to\r
-    the parameter "Input", and return EFI_SUCCESS.\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       Size;\r
 \r
   Size    = 1;\r
-  *Input  = 0;\r
+  *Output = 0;\r
 \r
-  Status  = SerialIo->Read (SerialIo, &Size, Input);\r
+  Status  = SerialIo->Read (SerialIo, &Size, Output);\r
 \r
   if (EFI_ERROR (Status)) {\r
 \r
@@ -763,23 +723,29 @@ GetOneKeyFromSerial (
 \r
   }\r
 \r
-  if (*Input == 0) {\r
+  if (*Output == 0) {\r
     return EFI_NOT_READY;\r
   }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Insert one byte raw data into the Raw Data FIFO.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Input                The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Raw Data buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 RawFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
   UINT8             Input\r
   )\r
-/*++\r
-    Insert one byte raw data into the Raw Data FIFO.\r
-    If FIFO is FULL before data insertion,\r
-    return FALSE, and the key is lost.\r
---*/\r
 {\r
   UINT8 Tail;\r
 \r
@@ -799,16 +765,21 @@ RawFiFoInsertOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Remove one pre-fetched key out of the Raw Data FIFO.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Raw Data FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 RawFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
   UINT8         *Output\r
   )\r
-/*++\r
-    Remove one byte raw data out of the Raw Data FIFO.\r
-    If FIFO buffer is empty before remove operation,\r
-    return FALSE.\r
---*/\r
 {\r
   UINT8 Head;\r
 \r
@@ -829,13 +800,19 @@ RawFiFoRemoveOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Clarify whether Raw Data FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Raw Data FIFO buffer is empty.\r
+  @return FLASE                If Raw Data FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsRawFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is empty.\r
---*/\r
 {\r
   if (TerminalDevice->RawFiFo.Head == TerminalDevice->RawFiFo.Tail) {\r
     return TRUE;\r
@@ -844,13 +821,19 @@ IsRawFiFoEmpty (
   }\r
 }\r
 \r
+/**\r
+  Clarify whether Raw Data FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Raw Data FIFO buffer is full.\r
+  @return FLASE                If Raw Data FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsRawFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is full.\r
---*/\r
 {\r
   UINT8 Tail;\r
   UINT8 Head;\r
@@ -866,16 +849,22 @@ IsRawFiFoFull (
   return FALSE;\r
 }\r
 \r
+/**\r
+  Insert one pre-fetched key into the FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Key                  The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If FIFO buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 EfiKeyFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
   EFI_INPUT_KEY     Key\r
   )\r
-/*++\r
-    Insert one pre-fetched key into the FIFO buffer.\r
-    If FIFO buffer is FULL before key insertion,\r
-    return FALSE, and the key is lost.\r
---*/\r
 {\r
   UINT8 Tail;\r
 \r
@@ -895,16 +884,21 @@ EfiKeyFiFoInsertOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Remove one pre-fetched key out of the FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 EfiKeyFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
   EFI_INPUT_KEY *Output\r
   )\r
-/*++\r
-    Remove one pre-fetched key out of the FIFO buffer.\r
-    If FIFO buffer is empty before remove operation,\r
-    return FALSE.\r
---*/\r
 {\r
   UINT8 Head;\r
 \r
@@ -926,13 +920,19 @@ EfiKeyFiFoRemoveOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Clarify whether FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If FIFO buffer is empty.\r
+  @return FLASE                If FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsEfiKeyFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is empty.\r
---*/\r
 {\r
   if (TerminalDevice->EfiKeyFiFo.Head == TerminalDevice->EfiKeyFiFo.Tail) {\r
     return TRUE;\r
@@ -941,13 +941,19 @@ IsEfiKeyFiFoEmpty (
   }\r
 }\r
 \r
+/**\r
+  Clarify whether FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If FIFO buffer is full.\r
+  @return FLASE                If FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsEfiKeyFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is full.\r
---*/\r
 {\r
   UINT8 Tail;\r
   UINT8 Head;\r
@@ -963,16 +969,22 @@ IsEfiKeyFiFoFull (
   return FALSE;\r
 }\r
 \r
+/**\r
+  Insert one pre-fetched key into the Unicode FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Input                The key will be input.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Unicode FIFO buffer is full before key insertion,\r
+                               and the key is lost.\r
+\r
+**/\r
 BOOLEAN\r
 UnicodeFiFoInsertOneKey (\r
   TERMINAL_DEV      *TerminalDevice,\r
   UINT16            Input\r
   )\r
-/*++\r
-    Insert one pre-fetched key into the FIFO buffer.\r
-    If FIFO buffer is FULL before key insertion,\r
-    return FALSE, and the key is lost.\r
---*/\r
 {\r
   UINT8 Tail;\r
 \r
@@ -992,16 +1004,21 @@ UnicodeFiFoInsertOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Remove one pre-fetched key out of the Unicode FIFO buffer.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure.\r
+  @param  Output               The key will be removed.\r
+\r
+  @return TRUE                 If insert successfully.\r
+  @return FLASE                If Unicode FIFO buffer is empty before remove operation.\r
+\r
+**/\r
 BOOLEAN\r
 UnicodeFiFoRemoveOneKey (\r
   TERMINAL_DEV  *TerminalDevice,\r
   UINT16        *Output\r
   )\r
-/*++\r
-    Remove one pre-fetched key out of the FIFO buffer.\r
-    If FIFO buffer is empty before remove operation,\r
-    return FALSE.\r
---*/\r
 {\r
   UINT8 Head;\r
 \r
@@ -1022,13 +1039,19 @@ UnicodeFiFoRemoveOneKey (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Clarify whether Unicode FIFO buffer is empty.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Unicode FIFO buffer is empty.\r
+  @return FLASE                If Unicode FIFO buffer is not empty.\r
+\r
+**/\r
 BOOLEAN\r
 IsUnicodeFiFoEmpty (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is empty.\r
---*/\r
 {\r
   if (TerminalDevice->UnicodeFiFo.Head == TerminalDevice->UnicodeFiFo.Tail) {\r
     return TRUE;\r
@@ -1037,13 +1060,19 @@ IsUnicodeFiFoEmpty (
   }\r
 }\r
 \r
+/**\r
+  Clarify whether Unicode FIFO buffer is full.\r
+\r
+  @param  TerminalDevice       Terminal driver private structure\r
+\r
+  @return TRUE                 If Unicode FIFO buffer is full.\r
+  @return FLASE                If Unicode FIFO buffer is not full.\r
+\r
+**/\r
 BOOLEAN\r
 IsUnicodeFiFoFull (\r
   TERMINAL_DEV  *TerminalDevice\r
   )\r
-/*++\r
-    Clarify whether FIFO buffer is full.\r
---*/\r
 {\r
   UINT8 Tail;\r
   UINT8 Head;\r
@@ -1077,7 +1106,6 @@ UnicodeFiFoGetKeyCount (
   }\r
 }\r
 \r
-STATIC\r
 VOID\r
 UnicodeToEfiKeyFlushState (\r
   IN  TERMINAL_DEV    *TerminalDevice\r
@@ -1085,31 +1113,31 @@ UnicodeToEfiKeyFlushState (
 {\r
   EFI_INPUT_KEY Key;\r
 \r
-  if (TerminalDevice->InputState & INPUT_STATE_ESC) {\r
+  if (0 != (TerminalDevice->InputState & INPUT_STATE_ESC)) {\r
     Key.ScanCode    = SCAN_ESC;\r
     Key.UnicodeChar = 0;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if (TerminalDevice->InputState & INPUT_STATE_CSI) {\r
+  if (0 != (TerminalDevice->InputState & INPUT_STATE_CSI)) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = CSI;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if (TerminalDevice->InputState & INPUT_STATE_LEFTOPENBRACKET) {\r
+  if (0 != (TerminalDevice->InputState & INPUT_STATE_LEFTOPENBRACKET)) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = LEFTOPENBRACKET;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if (TerminalDevice->InputState & INPUT_STATE_O) {\r
+  if (0 != (TerminalDevice->InputState & INPUT_STATE_O)) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = 'O';\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if (TerminalDevice->InputState & INPUT_STATE_2) {\r
+  if (0 != (TerminalDevice->InputState & INPUT_STATE_2)) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = '2';\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
@@ -1124,80 +1152,74 @@ UnicodeToEfiKeyFlushState (
   TerminalDevice->InputState = INPUT_STATE_DEFAULT;\r
 }\r
 \r
+\r
+/**\r
+  Converts a stream of Unicode characters from a terminal input device into EFI Keys that\r
+  can be read through the Simple Input Protocol.  The table below shows the keyboard\r
+  input mappings that this function supports.  If the ESC sequence listed in one of the\r
+  columns is presented, then it is translated into the coorespoding EFI Scan Code.  If a\r
+  matching sequence is not found, then the raw key strokes are converted into EFI Keys.\r
+  2 seconds are allowed for an ESC sequence to be completed.  If the ESC sequence is not\r
+  completed in 2 seconds, then the raw key strokes of the partial ESC sequence are\r
+  converted into EFI Keys.\r
+  There is one special input sequence that will force the system to reset.\r
+  This is ESC R ESC r ESC R.\r
+\r
+  Symbols used in table below\r
+  ===========================\r
+    ESC = 0x1B\r
+    CSI = 0x9B\r
+    DEL = 0x7f\r
+    ^   = CTRL\r
+  \r
+  +=========+======+===========+==========+==========+\r
+  |         | EFI  | UEFI 2.0  |          |          |\r
+  |         | Scan |           |  VT100+  |          |\r
+  |   KEY   | Code |  PC ANSI  |  VTUTF8  |   VT100  |\r
+  +=========+======+===========+==========+==========+\r
+  | NULL    | 0x00 |           |          |          |\r
+  | UP      | 0x01 | ESC [ A   | ESC [ A  | ESC [ A  |\r
+  | DOWN    | 0x02 | ESC [ B   | ESC [ B  | ESC [ B  |\r
+  | RIGHT   | 0x03 | ESC [ C   | ESC [ C  | ESC [ C  |\r
+  | LEFT    | 0x04 | ESC [ D   | ESC [ D  | ESC [ D  |\r
+  | HOME    | 0x05 | ESC [ H   | ESC h    | ESC [ H  |\r
+  | END     | 0x06 | ESC [ F   | ESC k    | ESC [ K  |\r
+  | INSERT  | 0x07 | ESC [ @   | ESC +    | ESC [ @  |\r
+  |         |      | ESC [ L   |          | ESC [ L  |\r
+  | DELETE  | 0x08 | ESC [ X   | ESC -    | ESC [ P  |\r
+  | PG UP   | 0x09 | ESC [ I   | ESC ?    | ESC [ V  |\r
+  |         |      |           |          | ESC [ ?  |\r
+  | PG DOWN | 0x0A | ESC [ G   | ESC /    | ESC [ U  |\r
+  |         |      |           |          | ESC [ /  |\r
+  | F1      | 0x0B | ESC [ M   | ESC 1    | ESC O P  |\r
+  | F2      | 0x0C | ESC [ N   | ESC 2    | ESC O Q  |\r
+  | F3      | 0x0D | ESC [ O   | ESC 3    | ESC O w  |\r
+  | F4      | 0x0E | ESC [ P   | ESC 4    | ESC O x  |\r
+  | F5      | 0x0F | ESC [ Q   | ESC 5    | ESC O t  |\r
+  | F6      | 0x10 | ESC [ R   | ESC 6    | ESC O u  |\r
+  | F7      | 0x11 | ESC [ S   | ESC 7    | ESC O q  |\r
+  | F8      | 0x12 | ESC [ T   | ESC 8    | ESC O r  |\r
+  | F9      | 0x13 | ESC [ U   | ESC 9    | ESC O p  |\r
+  | F10     | 0x14 | ESC [ V   | ESC 0    | ESC O M  |\r
+  | Escape  | 0x17 | ESC       | ESC      | ESC      |\r
+  | F11     | 0x15 |           | ESC !    |          |\r
+  | F12     | 0x16 |           | ESC @    |          |\r
+  +=========+======+===========+==========+==========+\r
+  \r
+  Special Mappings\r
+  ================\r
+  ESC R ESC r ESC R = Reset System\r
+\r
+\r
+  @param TerminalDevice   The terminal device to use to translate raw input into EFI Keys\r
+\r
+  @return None\r
+\r
+**/\r
 VOID\r
 UnicodeToEfiKey (\r
   IN  TERMINAL_DEV    *TerminalDevice\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Converts a stream of Unicode characters from a terminal input device into EFI Keys that\r
-    can be read through the Simple Input Protocol.  The table below shows the keyboard\r
-    input mappings that this function supports.  If the ESC sequence listed in one of the\r
-    columns is presented, then it is translated into the coorespoding EFI Scan Code.  If a\r
-    matching sequence is not found, then the raw key strokes are converted into EFI Keys.\r
-\r
-    2 seconds are allowed for an ESC sequence to be completed.  If the ESC sequence is not\r
-    completed in 2 seconds, then the raw key strokes of the partial ESC sequence are\r
-    converted into EFI Keys.\r
-\r
-    There is one special input sequence that will force the system to reset.\r
-    This is ESC R ESC r ESC R.\r
-\r
-  Arguments:\r
-\r
-    TerminaDevice : The terminal device to use to translate raw input into EFI Keys\r
-\r
-  Returns:\r
-\r
-    None\r
-\r
-Symbols used in table below\r
-===========================\r
-  ESC = 0x1B\r
-  CSI = 0x9B\r
-  DEL = 0x7f\r
-  ^   = CTRL\r
-\r
-+=========+======+===========+==========+==========+\r
-|         | EFI  | UEFI 2.0  |          |          |\r
-|         | Scan |           |  VT100+  |          |\r
-|   KEY   | Code |  PC ANSI  |  VTUTF8  |   VT100  |\r
-+=========+======+===========+==========+==========+\r
-| NULL    | 0x00 |           |          |          |\r
-| UP      | 0x01 | ESC [ A   | ESC [ A  | ESC [ A  |\r
-| DOWN    | 0x02 | ESC [ B   | ESC [ B  | ESC [ B  |\r
-| RIGHT   | 0x03 | ESC [ C   | ESC [ C  | ESC [ C  |\r
-| LEFT    | 0x04 | ESC [ D   | ESC [ D  | ESC [ D  |\r
-| HOME    | 0x05 | ESC [ H   | ESC h    | ESC [ H  |\r
-| END     | 0x06 | ESC [ F   | ESC k    | ESC [ K  |\r
-| INSERT  | 0x07 | ESC [ @   | ESC +    | ESC [ @  |\r
-|         |      | ESC [ L   |          | ESC [ L  |\r
-| DELETE  | 0x08 | ESC [ X   | ESC -    | ESC [ P  |\r
-| PG UP   | 0x09 | ESC [ I   | ESC ?    | ESC [ V  |\r
-|         |      |           |          | ESC [ ?  |\r
-| PG DOWN | 0x0A | ESC [ G   | ESC /    | ESC [ U  |\r
-|         |      |           |          | ESC [ /  |\r
-| F1      | 0x0B | ESC [ M   | ESC 1    | ESC O P  |\r
-| F2      | 0x0C | ESC [ N   | ESC 2    | ESC O Q  |\r
-| F3      | 0x0D | ESC [ O   | ESC 3    | ESC O w  |\r
-| F4      | 0x0E | ESC [ P   | ESC 4    | ESC O x  |\r
-| F5      | 0x0F | ESC [ Q   | ESC 5    | ESC O t  |\r
-| F6      | 0x10 | ESC [ R   | ESC 6    | ESC O u  |\r
-| F7      | 0x11 | ESC [ S   | ESC 7    | ESC O q  |\r
-| F8      | 0x12 | ESC [ T   | ESC 8    | ESC O r  |\r
-| F9      | 0x13 | ESC [ U   | ESC 9    | ESC O p  |\r
-| F10     | 0x14 | ESC [ V   | ESC 0    | ESC O M  |\r
-| Escape  | 0x17 | ESC       | ESC      | ESC      |\r
-| F11     | 0x15 |           | ESC !    |          |\r
-| F12     | 0x16 |           | ESC @    |          |\r
-+=========+======+===========+==========+==========+\r
-\r
-Special Mappings\r
-================\r
-ESC R ESC r ESC R = Reset System\r
-\r
---*/\r
 {\r
   EFI_STATUS          Status;\r
   EFI_STATUS          TimerStatus;\r
@@ -1245,7 +1267,7 @@ ESC R ESC r ESC R = Reset System
         continue;\r
       }\r
 \r
-      if (UnicodeChar == 'O' && TerminalDevice->TerminalType == VT100Type) {\r
+      if (UnicodeChar == 'O' && TerminalDevice->TerminalType == VT100TYPE) {\r
         TerminalDevice->InputState |= INPUT_STATE_O;\r
         TerminalDevice->ResetState = RESET_STATE_DEFAULT;\r
         continue;\r
@@ -1253,8 +1275,8 @@ ESC R ESC r ESC R = Reset System
 \r
       Key.ScanCode = SCAN_NULL;\r
 \r
-      if (TerminalDevice->TerminalType == VT100PlusType ||\r
-          TerminalDevice->TerminalType == VTUTF8Type) {\r
+      if (TerminalDevice->TerminalType == VT100PLUSTYPE ||\r
+          TerminalDevice->TerminalType == VTUTF8TYPE) {\r
         switch (UnicodeChar) {\r
         case '1':\r
           Key.ScanCode = SCAN_F1;\r
@@ -1358,7 +1380,7 @@ ESC R ESC r ESC R = Reset System
 \r
       Key.ScanCode = SCAN_NULL;\r
 \r
-      if (TerminalDevice->TerminalType == VT100Type) {\r
+      if (TerminalDevice->TerminalType == VT100TYPE) {\r
         switch (UnicodeChar) {\r
         case 'P':\r
           Key.ScanCode = SCAN_F1;\r
@@ -1413,10 +1435,10 @@ ESC R ESC r ESC R = Reset System
 \r
       Key.ScanCode = SCAN_NULL;\r
 \r
-      if (TerminalDevice->TerminalType == PcAnsiType    ||\r
-          TerminalDevice->TerminalType == VT100Type     ||\r
-          TerminalDevice->TerminalType == VT100PlusType ||\r
-          TerminalDevice->TerminalType == VTUTF8Type) {\r
+      if (TerminalDevice->TerminalType == PCANSITYPE    ||\r
+          TerminalDevice->TerminalType == VT100TYPE     ||\r
+          TerminalDevice->TerminalType == VT100PLUSTYPE ||\r
+          TerminalDevice->TerminalType == VTUTF8TYPE) {\r
         switch (UnicodeChar) {\r
         case 'A':\r
           Key.ScanCode = SCAN_UP;\r
@@ -1431,100 +1453,100 @@ ESC R ESC r ESC R = Reset System
           Key.ScanCode = SCAN_LEFT;\r
           break;\r
         case 'H':\r
-          if (TerminalDevice->TerminalType == PcAnsiType ||\r
-              TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE ||\r
+              TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_HOME;\r
           }\r
           break;\r
         case 'F':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_END;\r
           }\r
           break;\r
         case 'K':\r
-          if (TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_END;\r
           }\r
           break;\r
         case 'L':\r
         case '@':\r
-          if (TerminalDevice->TerminalType == PcAnsiType ||\r
-              TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE ||\r
+              TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_INSERT;\r
           }\r
           break;\r
         case 'X':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_DELETE;\r
           }\r
           break;\r
         case 'P':\r
-          if (TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_DELETE;\r
-          } else if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          } else if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F4;\r
           }\r
           break;\r
         case 'I':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_PAGE_UP;\r
           }\r
           break;\r
         case 'V':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F10;\r
           }\r
         case '?':\r
-          if (TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_PAGE_UP;\r
           }\r
           break;\r
         case 'G':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_PAGE_DOWN;\r
           }\r
           break;\r
         case 'U':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F9;\r
           }\r
         case '/':\r
-          if (TerminalDevice->TerminalType == VT100Type) {\r
+          if (TerminalDevice->TerminalType == VT100TYPE) {\r
             Key.ScanCode = SCAN_PAGE_DOWN;\r
           }\r
           break;\r
         case 'M':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F1;\r
           }\r
           break;\r
         case 'N':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F2;\r
           }\r
           break;\r
         case 'O':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F3;\r
           }\r
           break;\r
         case 'Q':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F5;\r
           }\r
           break;\r
         case 'R':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F6;\r
           }\r
           break;\r
         case 'S':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F7;\r
           }\r
           break;\r
         case 'T':\r
-          if (TerminalDevice->TerminalType == PcAnsiType) {\r
+          if (TerminalDevice->TerminalType == PCANSITYPE) {\r
             Key.ScanCode = SCAN_F8;\r
           }\r
           break;\r
index 06fda61274fa15885136aab4ac28f0adae46f981..f6f78b6b88950888e2b4187bd5e0714b8e7ff536 100644 (file)
@@ -86,36 +86,30 @@ CHAR16 mSetCursorPositionString[]  = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0
 //\r
 // Body of the ConOut functions\r
 //\r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().\r
+  If ExtendeVerification is TRUE, then perform dependent serial device reset,\r
+  and set display mode to mode 0.\r
+  If ExtendedVerification is FALSE, only set display mode to mode 0.\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  ExtendedVerification  Indicates that the driver may perform a more\r
+                                exhaustive verification operation of the device\r
+                                during reset.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The reset operation succeeds.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The terminal is not functioning correctly or the serial port reset fails.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutReset (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                          ExtendedVerification\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().\r
-    If ExtendeVerification is TRUE, then perform dependent serial device reset,\r
-    and set display mode to mode 0.\r
-    If ExtendedVerification is FALSE, only set display mode to mode 0.\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    ExtendedVerification - Indicates that the driver may perform a more exhaustive\r
-                           verification operation of the device during reset.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The reset operation succeeds.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The terminal is not functioning correctly or the serial port reset fails.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   TERMINAL_DEV  *TerminalDevice;\r
@@ -157,42 +151,29 @@ TerminalConOutReset (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().\r
+  The Unicode string will be converted to terminal expressible data stream\r
+  and send to terminal via serial port.\r
+\r
+  @param  This                    Indicates the calling context.\r
+  @param  WString                 The Null-terminated Unicode string to be displayed\r
+                                  on the terminal screen.\r
+\r
+  @return EFI_SUCCESS             The string is output successfully.\r
+  @return EFI_DEVICE_ERROR        The serial port fails to send the string out.\r
+  @return EFI_WARN_UNKNOWN_GLYPH  Indicates that some of the characters in the Unicode string could not\r
+                                  be rendered and are skipped.\r
+  @return EFI_UNSUPPORTED\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutOutputString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  CHAR16                           *WString\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().\r
-    The Unicode string will be converted to terminal expressible data stream\r
-    and send to terminal via serial port.\r
-\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    WString - The Null-terminated Unicode string to be displayed on\r
-              the terminal screen.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The string is output successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The serial port fails to send the string out.\r
-\r
-    EFI_WARN_UNKNOWN_GLYPH\r
-      Indicates that some of the characters in the Unicode string could not\r
-      be rendered and are skipped.\r
-\r
-    EFI_UNSUPPORTED\r
-\r
---*/\r
 {\r
   TERMINAL_DEV                *TerminalDevice;\r
   EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
@@ -238,9 +219,9 @@ TerminalConOutOutputString (
 \r
     switch (TerminalDevice->TerminalType) {\r
 \r
-    case PcAnsiType:\r
-    case VT100Type:\r
-    case VT100PlusType:\r
+    case PCANSITYPE:\r
+    case VT100TYPE:\r
+    case VT100PLUSTYPE:\r
 \r
       if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar)) {\r
         //\r
@@ -266,7 +247,7 @@ TerminalConOutOutputString (
 \r
       }\r
 \r
-      if (TerminalDevice->TerminalType != PcAnsiType) {\r
+      if (TerminalDevice->TerminalType != PCANSITYPE) {\r
         GraphicChar = AsciiChar;\r
       }\r
 \r
@@ -284,7 +265,7 @@ TerminalConOutOutputString (
 \r
       break;\r
 \r
-    case VTUTF8Type:\r
+    case VTUTF8TYPE:\r
       UnicodeToUtf8 (*WString, &Utf8Char, &ValidBytes);\r
       Length = ValidBytes;\r
       Status = TerminalDevice->SerialIo->Write (\r
@@ -353,37 +334,27 @@ OutputError:
   return EFI_DEVICE_ERROR;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().\r
+  If one of the characters in the *Wstring is\r
+  neither valid Unicode drawing characters,\r
+  not ASCII code, then this function will return\r
+  EFI_UNSUPPORTED.\r
+\r
+  @param  This              Indicates the calling context.\r
+  @param  WString           The Null-terminated Unicode string to be tested.\r
+\r
+  @return EFI_SUCCESS       The terminal is capable of rendering the output string.\r
+  @return EFI_UNSUPPORTED   Some of the characters in the Unicode string cannot be rendered.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutTestString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  CHAR16                           *WString\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().\r
-    If one of the characters in the *Wstring is\r
-    neither valid Unicode drawing characters,\r
-    not ASCII code, then this function will return\r
-    EFI_UNSUPPORTED.\r
-\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    WString - The Null-terminated Unicode string to be tested.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The terminal is capable of rendering the output string.\r
-\r
-    EFI_UNSUPPORTED\r
-      Some of the characters in the Unicode string cannot be rendered.\r
-\r
---*/\r
 {\r
   TERMINAL_DEV  *TerminalDevice;\r
   EFI_STATUS    Status;\r
@@ -395,13 +366,13 @@ TerminalConOutTestString (
 \r
   switch (TerminalDevice->TerminalType) {\r
 \r
-  case PcAnsiType:\r
-  case VT100Type:\r
-  case VT100PlusType:\r
+  case PCANSITYPE:\r
+  case VT100TYPE:\r
+  case VT100PLUSTYPE:\r
     Status = AnsiTestString (TerminalDevice, WString);\r
     break;\r
 \r
-  case VTUTF8Type:\r
+  case VTUTF8TYPE:\r
     Status = VTUTF8TestString (TerminalDevice, WString);\r
     break;\r
 \r
@@ -413,6 +384,24 @@ TerminalConOutTestString (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().\r
+  It returns information for an available text mode\r
+  that the terminal supports.\r
+  In this driver, we support text mode 80x25 (mode 0),\r
+  80x50 (mode 1), 100x31 (mode 2).\r
+\r
+  @param This        Indicates the calling context.\r
+  @param ModeNumber  The mode number to return information on.\r
+  @param Columns     The returned columns of the requested mode.\r
+  @param Rows        The returned rows of the requested mode.\r
+\r
+  @return EFI_SUCCESS       The requested mode information is returned.\r
+  @return EFI_UNSUPPORTED   The mode number is not valid.\r
+  @return EFI_DEVICE_ERROR\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutQueryMode (\r
@@ -421,41 +410,6 @@ TerminalConOutQueryMode (
   OUT UINTN                            *Columns,\r
   OUT UINTN                            *Rows\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUT_PROTOCOL.QueryMode().\r
-    It returns information for an available text mode\r
-    that the terminal supports.\r
-    In this driver, we support text mode 80x25 (mode 0),\r
-    80x50 (mode 1), 100x31 (mode 2).\r
-\r
-\r
-  Arguments:\r
-\r
-    *This\r
-        Indicates the calling context.\r
-\r
-    ModeNumber\r
-        The mode number to return information on.\r
-\r
-    Columns\r
-        The returned columns of the requested mode.\r
-\r
-    Rows\r
-        The returned rows of the requested mode.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The requested mode information is returned.\r
-\r
-    EFI_UNSUPPORTED\r
-      The mode number is not valid.\r
-\r
-    EFI_DEVICE_ERROR\r
-\r
---*/\r
 {\r
   if (This->Mode->MaxMode > 3) {\r
     return EFI_DEVICE_ERROR;\r
@@ -478,39 +432,27 @@ TerminalConOutQueryMode (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUT.SetMode().\r
+  Set the terminal to a specified display mode.\r
+  In this driver, we only support mode 0.\r
+\r
+  @param This          Indicates the calling context.\r
+  @param ModeNumber    The text mode to set.\r
+\r
+  @return EFI_SUCCESS       The requested text mode is set.\r
+  @return EFI_DEVICE_ERROR  The requested text mode cannot be set \r
+                            because of serial device error.\r
+  @return EFI_UNSUPPORTED   The text mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetMode (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  UINTN                            ModeNumber\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUT.SetMode().\r
-    Set the terminal to a specified display mode.\r
-    In this driver, we only support mode 0.\r
-\r
-  Arguments:\r
-\r
-    This\r
-        Indicates the calling context.\r
-\r
-    ModeNumber\r
-        The text mode to set.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The requested text mode is set.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The requested text mode cannot be set because of serial device error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The text mode number is not valid.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   TERMINAL_DEV  *TerminalDevice;\r
@@ -550,38 +492,25 @@ TerminalConOutSetMode (
 \r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().\r
+\r
+  @param This        Indicates the calling context.\r
+  @param Attribute   The attribute to set. Only bit0..6 are valid, all other bits\r
+                     are undefined and must be zero.\r
+\r
+  @return EFI_SUCCESS        The requested attribute is set.\r
+  @return EFI_DEVICE_ERROR   The requested attribute cannot be set due to serial port error.\r
+  @return EFI_UNSUPPORTED    The attribute requested is not defined by EFI spec.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetAttribute (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  UINTN                            Attribute\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().\r
-\r
-  Arguments:\r
-\r
-    This\r
-        Indicates the calling context.\r
-\r
-    Attribute\r
-        The attribute to set. Only bit0..6 are valid, all other bits\r
-        are undefined and must be zero.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The requested attribute is set.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The requested attribute cannot be set due to serial port error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The attribute requested is not defined by EFI spec.\r
-\r
---*/\r
 {\r
   UINT8         ForegroundControl;\r
   UINT8         BackgroundControl;\r
@@ -736,36 +665,24 @@ TerminalConOutSetAttribute (
 \r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().\r
+  It clears the ANSI terminal's display to the\r
+  currently selected background color.\r
+\r
+  @param This     Indicates the calling context.\r
+\r
+  @return EFI_SUCCESS       The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR  The terminal screen cannot be cleared due to serial port error.\r
+  @return EFI_UNSUPPORTED   The terminal is not in a valid display mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutClearScreen (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().\r
-    It clears the ANSI terminal's display to the\r
-    currently selected background color.\r
-\r
-\r
-  Arguments:\r
-\r
-    This\r
-        Indicates the calling context.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The operation completed successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The terminal screen cannot be cleared due to serial port error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The terminal is not in a valid display mode.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   TERMINAL_DEV  *TerminalDevice;\r
@@ -788,6 +705,20 @@ TerminalConOutClearScreen (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().\r
+\r
+  @param This      Indicates the calling context.\r
+  @param Column    The row to set cursor to.\r
+  @param Row       The column to set cursor to.\r
+\r
+  @return EFI_SUCCESS       The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR  The request fails due to serial port error.\r
+  @return EFI_UNSUPPORTED   The terminal is not in a valid text mode, or the cursor position\r
+                            is invalid for current mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutSetCursorPosition (\r
@@ -795,35 +726,6 @@ TerminalConOutSetCursorPosition (
   IN  UINTN                            Column,\r
   IN  UINTN                            Row\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().\r
-\r
-  Arguments:\r
-\r
-    This\r
-        Indicates the calling context.\r
-\r
-    Column\r
-        The row to set cursor to.\r
-\r
-    Row\r
-        The column to set cursor to.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The operation completed successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The request fails due to serial port error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The terminal is not in a valid text mode, or the cursor position\r
-      is invalid for current mode.\r
-\r
---*/\r
 {\r
   EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
   UINTN                       MaxColumn;\r
@@ -879,36 +781,25 @@ TerminalConOutSetCursorPosition (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
+  In this driver, the cursor cannot be hidden.\r
+\r
+  @param This      Indicates the calling context.\r
+  @param Visible   If TRUE, the cursor is set to be visible,\r
+                   If FALSE, the cursor is set to be invisible.\r
+\r
+  @return EFI_SUCCESS      The request is valid.\r
+  @return EFI_UNSUPPORTED  The terminal does not support cursor hidden.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 TerminalConOutEnableCursor (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                          Visible\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
-    In this driver, the cursor cannot be hidden.\r
-\r
-  Arguments:\r
-\r
-    This\r
-        Indicates the calling context.\r
-\r
-    Visible\r
-        If TRUE, the cursor is set to be visible,\r
-        If FALSE, the cursor is set to be invisible.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The request is valid.\r
-\r
-    EFI_UNSUPPORTED\r
-      The terminal does not support cursor hidden.\r
-\r
---*/\r
 {\r
   if (!Visible) {\r
     return EFI_UNSUPPORTED;\r
@@ -917,31 +808,25 @@ TerminalConOutEnableCursor (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Detects if a Unicode char is for Box Drawing text graphics.\r
+\r
+  @param  Graphic      Unicode char to test.\r
+  @param  PcAnsi       Optional pointer to return PCANSI equivalent of\r
+                       Graphic.\r
+  @param  Ascii        Optional pointer to return ASCII equivalent of\r
+                       Graphic.\r
+\r
+  @return TRUE         If Graphic is a supported Unicode Box Drawing character.\r
+\r
+**/\r
 BOOLEAN\r
 TerminalIsValidTextGraphics (\r
   IN  CHAR16  Graphic,\r
   OUT CHAR8   *PcAnsi, OPTIONAL\r
   OUT CHAR8   *Ascii OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-    Detects if a Unicode char is for Box Drawing text graphics.\r
-\r
-Arguments:\r
-\r
-    Graphic  - Unicode char to test.\r
-\r
-    PcAnsi  - Optional pointer to return PCANSI equivalent of Graphic.\r
-\r
-    Ascii   - Optional pointer to return ASCII equivalent of Graphic.\r
-\r
-Returns:\r
-\r
-    TRUE if Graphic is a supported Unicode Box Drawing character.\r
-\r
---*/\r
 {\r
   UNICODE_TO_CHAR *Table;\r
 \r
index 286c937d42bd7f372722fb19da9bcbf90c411e1f..260ae848990c29942c848ccff228ae64ba23de28 100644 (file)
@@ -1,4 +1,4 @@
-/**@file\r
+/** @file\r
   Implementation translation among different code tyies.\r
 \r
 Copyright (c) 2006, Intel Corporation. <BR>\r