]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
Patch to remove STATIC modifier. This is on longer recommended by EFI Framework codin...
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitter.c
index 00c809b6aae4d1cc9afef026ec8bd8f2328469be..dacef61d45d59118961e6b160b99150574c15508 100644 (file)
@@ -1,4 +1,4 @@
-/**@file\r
+/** @file\r
   Console Splitter Driver. Any Handle that attatched\r
   EFI_CONSOLE_IDENTIFIER_PROTOCOL can be bound by this driver.\r
 \r
@@ -16,7 +16,7 @@
   The virtual handle are added on driver entry and never removed.\r
   Such design ensures sytem function well during none console device situation.\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
@@ -30,9 +30,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "ConSplitter.h"\r
 \r
 //\r
-// Global Variables\r
+// Template for Text In Splitter\r
 //\r
-STATIC TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {\r
+TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {\r
   TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
   (EFI_HANDLE) NULL,\r
   {\r
@@ -55,8 +55,8 @@ STATIC TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {
   (EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL **) NULL,\r
   0,\r
   {\r
-    (struct _LIST_ENTRY     *) NULL,\r
-    (struct _LIST_ENTRY     *) NULL\r
+    (LIST_ENTRY *) NULL,\r
+    (LIST_ENTRY *) NULL\r
   },\r
 \r
   {\r
@@ -117,20 +117,29 @@ STATIC TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {
   FALSE\r
 };\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL gUgaDrawProtocolTemplate = {\r
+//\r
+// Template for Uga Draw Protocol\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL mUgaDrawProtocolTemplate = {\r
   ConSpliterUgaDrawGetMode,\r
   ConSpliterUgaDrawSetMode,\r
   ConSpliterUgaDrawBlt\r
 };\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_PROTOCOL gGraphicsOutputProtocolTemplate = {\r
+//\r
+// Template for Graphics Output Protocol\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_PROTOCOL mGraphicsOutputProtocolTemplate = {\r
   ConSpliterGraphicsOutputQueryMode,\r
   ConSpliterGraphicsOutputSetMode,\r
   ConSpliterGraphicsOutputBlt,\r
   NULL\r
 };\r
 \r
-STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {\r
+//\r
+// Template for Text Out Splitter\r
+//\r
+TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
   (EFI_HANDLE) NULL,\r
   {\r
@@ -194,7 +203,10 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
   (INT32 *) NULL\r
 };\r
 \r
-STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {\r
+//\r
+// Template for Standard Error Text Out Splitter\r
+//\r
+TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
   (EFI_HANDLE) NULL,\r
   {\r
@@ -258,6 +270,9 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
   (INT32 *) NULL\r
 };\r
 \r
+//\r
+// Driver binding instance for Console Input Device\r
+//\r
 EFI_DRIVER_BINDING_PROTOCOL           gConSplitterConInDriverBinding = {\r
   ConSplitterConInDriverBindingSupported,\r
   ConSplitterConInDriverBindingStart,\r
@@ -267,6 +282,9 @@ EFI_DRIVER_BINDING_PROTOCOL           gConSplitterConInDriverBinding = {
   NULL\r
 };\r
 \r
+//\r
+// Driver binding instance for Simple Pointer protocol\r
+//\r
 EFI_DRIVER_BINDING_PROTOCOL           gConSplitterSimplePointerDriverBinding = {\r
   ConSplitterSimplePointerDriverBindingSupported,\r
   ConSplitterSimplePointerDriverBindingStart,\r
@@ -288,6 +306,9 @@ EFI_DRIVER_BINDING_PROTOCOL           gConSplitterAbsolutePointerDriverBinding =
   NULL\r
 };\r
 \r
+//\r
+// Driver binding instance for Console Out device\r
+//\r
 EFI_DRIVER_BINDING_PROTOCOL           gConSplitterConOutDriverBinding = {\r
   ConSplitterConOutDriverBindingSupported,\r
   ConSplitterConOutDriverBindingStart,\r
@@ -297,6 +318,9 @@ EFI_DRIVER_BINDING_PROTOCOL           gConSplitterConOutDriverBinding = {
   NULL\r
 };\r
 \r
+//\r
+// Driver binding instance for Standard Error device\r
+//\r
 EFI_DRIVER_BINDING_PROTOCOL           gConSplitterStdErrDriverBinding = {\r
   ConSplitterStdErrDriverBindingSupported,\r
   ConSplitterStdErrDriverBindingStart,\r
@@ -309,6 +333,11 @@ EFI_DRIVER_BINDING_PROTOCOL           gConSplitterStdErrDriverBinding = {
 /**\r
   The user Entry Point for module ConSplitter. The user code starts with this function.\r
 \r
+  Installs driver module protocols and. Creates virtual device handles for ConIn,\r
+  ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,\r
+  Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers. \r
+  Installs Graphics Output protocol and/or UGA Draw protocol if needed.\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
@@ -318,7 +347,7 @@ EFI_DRIVER_BINDING_PROTOCOL           gConSplitterStdErrDriverBinding = {
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-InitializeConSplitter(\r
+ConSplitterDriverEntry(\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
@@ -379,37 +408,6 @@ InitializeConSplitter(
   ASSERT_EFI_ERROR (Status);\r
 \r
 \r
-  //\r
-  // Call the original Entry Point\r
-  //\r
-  Status = ConSplitterDriverEntry (ImageHandle, SystemTable);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-ConSplitterDriverEntry (\r
-  IN EFI_HANDLE                       ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                 *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Intialize a virtual console device to act as an agrigator of physical console\r
-  devices.\r
-\r
-Arguments:\r
-  ImageHandle - (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-  SystemTable - (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-Returns:\r
-  EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-\r
   ASSERT (FeaturePcdGet (PcdConOutGopSupport) ||\r
           FeaturePcdGet (PcdConOutUgaSupport));\r
   //\r
@@ -536,26 +534,25 @@ Returns:
         );\r
 \r
   return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-ConSplitterTextInConstructor (\r
-  TEXT_IN_SPLITTER_PRIVATE_DATA       *ConInPrivate\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+}\r
 \r
-  Construct the ConSplitter.\r
 \r
-Arguments:\r
+/**\r
+  Construct console input devices' private data.\r
 \r
-  ConInPrivate    - A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA structure.\r
+  @param  ConInPrivate             A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA\r
+                                   structure.\r
 \r
-Returns:\r
-  EFI_OUT_OF_RESOURCES - Out of resources.\r
+  @retval EFI_OUT_OF_RESOURCES     Out of resources.\r
+  @retval EFI_SUCCESS              Text Input Devcie's private data has been constructed.\r
+  @retval other                    Failed to construct private data.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+ConSplitterTextInConstructor (\r
+  TEXT_IN_SPLITTER_PRIVATE_DATA       *ConInPrivate\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -659,6 +656,16 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Construct console output devices' private data.\r
+\r
+  @param  ConOutPrivate            A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA\r
+                                   structure.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES     Out of resources.\r
+  @retval EFI_SUCCESS              Text Input Devcie's private data has been constructed.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextOutConstructor (\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA      *ConOutPrivate\r
@@ -671,11 +678,11 @@ ConSplitterTextOutConstructor (
   // Copy protocols template\r
   //\r
   if (FeaturePcdGet (PcdConOutUgaSupport)) {\r
-    CopyMem (&ConOutPrivate->UgaDraw, &gUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));\r
+    CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));\r
   }\r
 \r
   if (FeaturePcdGet (PcdConOutGopSupport)) {\r
-    CopyMem (&ConOutPrivate->GraphicsOutput, &gGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));\r
+    CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));\r
   }\r
 \r
   //\r
@@ -749,43 +756,38 @@ ConSplitterTextOutConstructor (
     // Initialize the following items, theset items remain unchanged in GraphicsOutput->SetMode()\r
     // GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize\r
     //\r
-    ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) NULL;\r
+    ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) NULL;\r
     ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize = 0;\r
 \r
     ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;\r
     //\r
-    // Initial current mode to unknow state, and then set to mode 0\r
+    // Initial current mode to unknown state, and then set to mode 0\r
     //\r
     ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;\r
     ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);\r
   }\r
 \r
-  return Status;\r
+  return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Test to see if the specified protocol could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  Guid                The specified protocol guid.\r
+\r
+  @retval EFI_SUCCESS         The specified protocol is supported on this device.\r
+  @retval other               The specified protocol is not supported on this device.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterSupported (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_GUID                        *Guid\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Generic Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller Handle.\r
-  Guid              - Guid.\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - unsupported.\r
-  EFI_SUCCESS     - operation is OK.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   VOID        *Instance;\r
@@ -830,6 +832,18 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Test to see if Console In Device could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConInDriverBindingSupported (\r
@@ -837,21 +851,6 @@ ConSplitterConInDriverBindingSupported (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Console In Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   return ConSplitterSupported (\r
           This,\r
@@ -860,6 +859,18 @@ Returns:
           );\r
 }\r
 \r
+/**\r
+  Test to see if Simple Pointer protocol could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerDriverBindingSupported (\r
@@ -867,21 +878,6 @@ ConSplitterSimplePointerDriverBindingSupported (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Standard Error Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   return ConSplitterSupported (\r
           This,\r
@@ -890,6 +886,19 @@ Returns:
           );\r
 }\r
 \r
+\r
+/**\r
+  Test to see if Absolute Pointer protocol could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterAbsolutePointerDriverBindingSupported (\r
@@ -897,21 +906,6 @@ ConSplitterAbsolutePointerDriverBindingSupported (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Absolute Pointer Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   return ConSplitterSupported (\r
           This,\r
@@ -920,6 +914,19 @@ Returns:
           );\r
 }\r
 \r
+\r
+/**\r
+  Test to see if Console Out Device could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConOutDriverBindingSupported (\r
@@ -927,21 +934,6 @@ ConSplitterConOutDriverBindingSupported (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Console Out Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   return ConSplitterSupported (\r
           This,\r
@@ -950,6 +942,18 @@ Returns:
           );\r
 }\r
 \r
+/**\r
+  Test to see if Standard Error Device could be supported on the ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterStdErrDriverBindingSupported (\r
@@ -957,21 +961,6 @@ ConSplitterStdErrDriverBindingSupported (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Standard Error Supported Check\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   return ConSplitterSupported (\r
           This,\r
@@ -980,36 +969,39 @@ Returns:
           );\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Start ConSplitter on devcie handle by opening Console Device Guid on device handle \r
+  and the console virtual handle. And Get the console interface on controller handle.\r
+  \r
+  @param  This                      Protocol instance pointer.\r
+  @param  ControllerHandle          Handle of device.\r
+  @param  ConSplitterVirtualHandle  Console virtual Handle.\r
+  @param  DeviceGuid                The specified Console Device, such as ConInDev,\r
+                                    ConOutDev.\r
+  @param  InterfaceGuid             The specified protocol to be opened.\r
+  @param  Interface                 Protocol interface returned.\r
+\r
+  @retval EFI_SUCCESS               This driver supports this device.\r
+  @retval other                     Failed to open the specified Console Device Guid\r
+                                    or specified protocol.\r
+\r
+**/\r
 EFI_STATUS\r
-EFIAPI\r
 ConSplitterStart (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_HANDLE                      ConSplitterVirtualHandle,\r
   IN  EFI_GUID                        *DeviceGuid,\r
   IN  EFI_GUID                        *InterfaceGuid,\r
-  IN  VOID                            **Interface\r
+  OUT VOID                            **Interface\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Start() function)\r
-\r
-Returns:\r
-  EFI_ERROR if a SimpleTextIn protocol is not started.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   VOID        *Instance;\r
 \r
   //\r
-  // Check to see whether the handle has the ConsoleInDevice GUID on it\r
+  // Check to see whether the ControllerHandle has the InterfaceGuid on it.\r
   //\r
   Status = gBS->OpenProtocol (\r
                   ControllerHandle,\r
@@ -1045,6 +1037,19 @@ Returns:
                 );\r
 }\r
 \r
+\r
+/**\r
+  Start Console In Consplitter on device handle. \r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          Console In Consplitter is added to ControllerHandle.\r
+  @retval other                Console In Consplitter does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConInDriverBindingStart (\r
@@ -1052,27 +1057,10 @@ ConSplitterConInDriverBindingStart (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-  EFI_ERROR if a SimpleTextIn protocol is not started.\r
-\r
---*/\r
 {\r
-  EFI_STATUS                     Status;\r
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
-  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx;\r
+  EFI_STATUS                          Status;\r
+  EFI_SIMPLE_TEXT_INPUT_PROTOCOL      *TextIn;\r
+  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL   *TextInEx;\r
 \r
   //\r
   // Start ConSplitter on ControllerHandle, and create the virtual\r
@@ -1090,6 +1078,9 @@ Returns:
     return Status;\r
   }\r
 \r
+  //\r
+  // Add this device into Text In devices list.\r
+  //\r
   Status = ConSplitterTextInAddDevice (&mConIn, TextIn);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -1103,15 +1094,30 @@ Returns:
                   mConIn.VirtualHandle,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // If Simple Text Input Ex protocol exists,\r
+    // add this device into Text In Ex devices list.\r
+    //\r
+    Status = ConSplitterTextInExAddDevice (&mConIn, TextInEx);\r
   }\r
 \r
-  Status = ConSplitterTextInExAddDevice (&mConIn, TextInEx);\r
-\r
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Start Simple Pointer Consplitter on device handle. \r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          Simple Pointer Consplitter is added to ControllerHandle.\r
+  @retval other                Simple Pointer Consplitter does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerDriverBindingStart (\r
@@ -1119,26 +1125,14 @@ ConSplitterSimplePointerDriverBindingStart (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_ERROR if a SimpleTextIn protocol is not started.\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;\r
 \r
+  //\r
+  // Start ConSplitter on ControllerHandle, and create the virtual\r
+  // agrogated console device on first call Start for a SimplePointer handle.\r
+  //\r
   Status = ConSplitterStart (\r
             This,\r
             ControllerHandle,\r
@@ -1151,9 +1145,25 @@ Returns:
     return Status;\r
   }\r
 \r
+  //\r
+  // Add this devcie into Simple Pointer devices list.\r
+  //\r
   return ConSplitterSimplePointerAddDevice (&mConIn, SimplePointer);\r
 }\r
 \r
+\r
+/**\r
+  Start Absolute Pointer Consplitter on device handle. \r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          Absolute Pointer Consplitter is added to ControllerHandle.\r
+  @retval other                Absolute Pointer Consplitter does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterAbsolutePointerDriverBindingStart (\r
@@ -1161,26 +1171,14 @@ ConSplitterAbsolutePointerDriverBindingStart (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a ConIn handle.\r
-\r
-Arguments:\r
-  This                 - Pointer to protocol.\r
-  ControllerHandle     - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-\r
-  EFI_ERROR if a AbsolutePointer protocol is not started.\r
-\r
---*/\r
 {\r
   EFI_STATUS                        Status;\r
   EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer;\r
 \r
+  //\r
+  // Start ConSplitter on ControllerHandle, and create the virtual\r
+  // agrogated console device on first call Start for a AbsolutePointer handle.\r
+  //\r
   Status = ConSplitterStart (\r
              This,\r
              ControllerHandle,\r
@@ -1194,9 +1192,25 @@ Returns:
     return Status;\r
   }\r
 \r
+  //\r
+  // Add this devcie into Absolute Pointer devices list.\r
+  //\r
   return ConSplitterAbsolutePointerAddDevice (&mConIn, AbsolutePointer);\r
 }\r
 \r
+\r
+/**\r
+  Start Console Out Consplitter on device handle. \r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          Console Out Consplitter is added to ControllerHandle.\r
+  @retval other                Console Out Consplitter does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConOutDriverBindingStart (\r
@@ -1204,27 +1218,16 @@ ConSplitterConOutDriverBindingStart (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-  EFI_ERROR if a SimpleTextIn protocol is not started.\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;\r
   EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput;\r
   EFI_UGA_DRAW_PROTOCOL            *UgaDraw;\r
 \r
+  //\r
+  // Start ConSplitter on ControllerHandle, and create the virtual\r
+  // agrogated console device on first call Start for a ConsoleOut handle.\r
+  //\r
   Status = ConSplitterStart (\r
             This,\r
             ControllerHandle,\r
@@ -1253,7 +1256,7 @@ Returns:
 \r
   if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
     //\r
-    // Open UGA_DRAW protocol\r
+    // Open UGA DRAW protocol\r
     //\r
     Status = gBS->OpenProtocol (\r
                     ControllerHandle,\r
@@ -1295,6 +1298,19 @@ Returns:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Start Standard Error Consplitter on device handle. \r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          Standard Error Consplitter is added to ControllerHandle.\r
+  @retval other                Standard Error Consplitter does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterStdErrDriverBindingStart (\r
@@ -1302,25 +1318,14 @@ ConSplitterStdErrDriverBindingStart (
   IN  EFI_HANDLE                      ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual\r
-  agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
-Arguments:\r
-  This              - Pointer to protocol.\r
-  ControllerHandle  - Controller handle.\r
-  RemainingDevicePath  - Remaining device path.\r
-\r
-Returns:\r
-  EFI_ERROR if a SimpleTextIn protocol is not started.\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;\r
 \r
+  //\r
+  // Start ConSplitter on ControllerHandle, and create the virtual\r
+  // agrogated console device on first call Start for a StandardError handle.\r
+  //\r
   Status = ConSplitterStart (\r
             This,\r
             ControllerHandle,\r
@@ -1366,9 +1371,24 @@ Returns:
   return Status;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Stop ConSplitter on device handle by closing Console Device Guid on device handle \r
+  and the console virtual handle.\r
+  \r
+  @param  This                      Protocol instance pointer.\r
+  @param  ControllerHandle          Handle of device.\r
+  @param  ConSplitterVirtualHandle  Console virtual Handle.\r
+  @param  DeviceGuid                The specified Console Device, such as ConInDev,\r
+                                    ConOutDev.\r
+  @param  InterfaceGuid             The specified protocol to be opened.\r
+  @param  Interface                 Protocol interface returned.\r
+\r
+  @retval EFI_SUCCESS               Stop ConSplitter on ControllerHandle successfully.\r
+  @retval other                     Failed to Stop ConSplitter on ControllerHandle.\r
+\r
+**/\r
 EFI_STATUS\r
-EFIAPI\r
 ConSplitterStop (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
   IN  EFI_HANDLE                      ControllerHandle,\r
@@ -1377,18 +1397,6 @@ ConSplitterStop (
   IN  EFI_GUID                        *InterfaceGuid,\r
   IN  VOID                            **Interface\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -1412,6 +1420,7 @@ Returns:
         This->DriverBindingHandle,\r
         ConSplitterVirtualHandle\r
         );\r
+\r
   gBS->CloseProtocol (\r
         ControllerHandle,\r
         DeviceGuid,\r
@@ -1422,6 +1431,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Stop Console In ConSplitter on ControllerHandle by closing Console In Devcice GUID.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConInDriverBindingStop (\r
@@ -1430,23 +1453,11 @@ ConSplitterConInDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
-  EFI_STATUS                     Status;\r
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
-\r
+  EFI_STATUS                        Status;\r
+  EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *TextIn;\r
   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx;\r
+\r
   if (NumberOfChildren == 0) {\r
     return EFI_SUCCESS;\r
   }\r
@@ -1459,16 +1470,20 @@ Returns:
                   ControllerHandle,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = ConSplitterTextInExDeleteDevice (&mConIn, TextInEx);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // If Simple Text Input Ex protocol exists,\r
+    // remove device from Text Input Ex devices list.\r
+    //  \r
+    Status = ConSplitterTextInExDeleteDevice (&mConIn, TextInEx);\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
   }\r
 \r
-\r
+  //\r
+  // Close Simple Text In protocol on controller handle and virtual handle.\r
+  //\r
   Status = ConSplitterStop (\r
             This,\r
             ControllerHandle,\r
@@ -1480,12 +1495,28 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+\r
   //\r
-  // Delete this console input device's data structures.\r
-  //\r
+  // Remove device from Text Input devices list.\r
+  // \r
   return ConSplitterTextInDeleteDevice (&mConIn, TextIn);\r
 }\r
 \r
+\r
+/**\r
+  Stop Simple Pointer protocol ConSplitter on ControllerHandle by closing\r
+  Simple Pointer protocol.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerDriverBindingStop (\r
@@ -1494,18 +1525,6 @@ ConSplitterSimplePointerDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;\r
@@ -1514,6 +1533,9 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
+  //\r
+  // Close Simple Pointer protocol on controller handle and virtual handle.\r
+  //\r
   Status = ConSplitterStop (\r
             This,\r
             ControllerHandle,\r
@@ -1525,12 +1547,28 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+\r
   //\r
-  // Delete this console input device's data structures.\r
+  // Remove this device from Simple Pointer device list.\r
   //\r
   return ConSplitterSimplePointerDeleteDevice (&mConIn, SimplePointer);\r
 }\r
 \r
+\r
+/**\r
+  Stop Absolute Pointer protocol ConSplitter on ControllerHandle by closing\r
+  Absolute Pointer protocol.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterAbsolutePointerDriverBindingStop (\r
@@ -1539,18 +1577,6 @@ ConSplitterAbsolutePointerDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                        Status;\r
   EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer;\r
@@ -1559,6 +1585,9 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
+  //\r
+  // Close Absolute Pointer protocol on controller handle and virtual handle.\r
+  //\r
   Status = ConSplitterStop (\r
              This,\r
              ControllerHandle,\r
@@ -1570,12 +1599,27 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+\r
   //\r
-  // Delete this console input device's data structures.\r
+  // Remove this device from Absolute Pointer device list.\r
   //\r
   return ConSplitterAbsolutePointerDeleteDevice (&mConIn, AbsolutePointer);\r
 }\r
 \r
+\r
+/**\r
+  Stop Console Out ConSplitter on device handle by closing Console Out Devcice GUID.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterConOutDriverBindingStop (\r
@@ -1584,18 +1628,6 @@ ConSplitterConOutDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;\r
@@ -1604,6 +1636,9 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
+  //\r
+  // Close Absolute Pointer protocol on controller handle and virtual handle.\r
+  //\r
   Status = ConSplitterStop (\r
             This,\r
             ControllerHandle,\r
@@ -1617,11 +1652,25 @@ Returns:
   }\r
 \r
   //\r
-  // Delete this console output device's data structures.\r
+  // Remove this device from Text Out device list.\r
   //\r
   return ConSplitterTextOutDeleteDevice (&mConOut, TextOut);\r
 }\r
 \r
+\r
+/**\r
+  Stop Standard Error ConSplitter on ControllerHandle by closing Standard Error GUID.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterStdErrDriverBindingStop (\r
@@ -1630,18 +1679,6 @@ ConSplitterStdErrDriverBindingStop (
   IN  UINTN                           NumberOfChildren,\r
   IN  EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Stop() function)\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - Complete successfully.\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;\r
@@ -1650,6 +1687,9 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
+  //\r
+  // Close Standard Error Device on controller handle and virtual handle.\r
+  //\r
   Status = ConSplitterStop (\r
             This,\r
             ControllerHandle,\r
@@ -1686,33 +1726,28 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-ConSplitterGrowBuffer (\r
-  IN  UINTN                           SizeOfCount,\r
-  IN  UINTN                           *Count,\r
-  IN OUT  VOID                        **Buffer\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Take the passed in Buffer of size SizeOfCount and grow the buffer\r
   by MAX (CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT, MaxGrow) * SizeOfCount\r
   bytes. Copy the current data in Buffer to the new version of Buffer\r
   and free the old version of buffer.\r
 \r
+  @param  SizeOfCount              Size of element in array\r
+  @param  Count                    Current number of elements in array\r
+  @param  Buffer                   Bigger version of passed in Buffer with all the\r
+                                   data\r
 \r
-Arguments:\r
-  SizeOfCount - Size of element in array\r
-  Count       - Current number of elements in array\r
-  Buffer      - Bigger version of passed in Buffer with all the data\r
-\r
-Returns:\r
-  EFI_SUCCESS - Buffer size has grown\r
-  EFI_OUT_OF_RESOURCES - Could not grow the buffer size\r
-\r
-  None\r
+  @retval EFI_SUCCESS              Buffer size has grown\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+ConSplitterGrowBuffer (\r
+  IN  UINTN                           SizeOfCount,\r
+  IN  UINTN                           *Count,\r
+  IN OUT  VOID                        **Buffer\r
+  )\r
 {\r
   UINTN NewSize;\r
   UINTN OldSize;\r
@@ -1743,23 +1778,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Add Text Input Device in Consplitter Text Input list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  TextIn                   Simple Text Input protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Text Input Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextInAddDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *TextIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-  EFI_OUT_OF_RESOURCES\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -1790,23 +1824,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Remove Simple Text Device in Consplitter Absolute Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  TextIn                   Simple Text protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Simple Text Device removed successfully.\r
+  @retval EFI_NOT_FOUND            No Simple Text Device found.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextInDeleteDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *TextIn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-  EFI_NOT_FOUND\r
-\r
---*/\r
 {\r
   UINTN Index;\r
   //\r
@@ -1827,6 +1860,16 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  Add Text Input Ex Device in Consplitter Text Input Ex list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  TextInEx                 Simple Text Ex Input protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Text Input Ex Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextInExAddDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA         *Private,\r
@@ -1862,6 +1905,16 @@ ConSplitterTextInExAddDevice (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Remove Simple Text Ex Device in Consplitter Absolute Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  TextInEx                 Simple Text Ex protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Simple Text Ex Device removed successfully.\r
+  @retval EFI_NOT_FOUND            No Simple Text Ex Device found.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextInExDeleteDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA         *Private,\r
@@ -1887,23 +1940,22 @@ ConSplitterTextInExDeleteDevice (
   return EFI_NOT_FOUND;\r
 }\r
 \r
+\r
+/**\r
+  Add Simple Pointer Device in Consplitter Simple Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  SimplePointer            Simple Pointer protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Simple Pointer Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterSimplePointerAddDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   IN  EFI_SIMPLE_POINTER_PROTOCOL     *SimplePointer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES\r
-  EFI_SUCCESS\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -1928,22 +1980,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Remove Simple Pointer Device in Consplitter Absolute Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  SimplePointer            Simple Pointer protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Simple Pointer Device removed successfully.\r
+  @retval EFI_NOT_FOUND            No Simple Pointer Device found.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterSimplePointerDeleteDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   IN  EFI_SIMPLE_POINTER_PROTOCOL     *SimplePointer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   UINTN Index;\r
   //\r
@@ -1964,23 +2016,22 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+\r
+/**\r
+  Add Absolute Pointer Device in Consplitter Absolute Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  AbsolutePointer          Absolute Pointer protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Absolute Pointer Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterAbsolutePointerAddDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA     *Private,\r
   IN  EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES\r
-  EFI_SUCCESS\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -2005,22 +2056,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Remove Absolute Pointer Device in Consplitter Absolute Pointer list.\r
+\r
+  @param  Private                  Text In Splitter pointer.\r
+  @param  AbsolutePointer          Absolute Pointer protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Absolute Pointer Device removed successfully.\r
+  @retval EFI_NOT_FOUND            No Absolute Pointer Device found.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterAbsolutePointerDeleteDevice (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA     *Private,\r
   IN  EFI_ABSOLUTE_POINTER_PROTOCOL     *AbsolutePointer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   UINTN Index;\r
   //\r
@@ -2041,22 +2092,19 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
-STATIC\r
+/**\r
+  Reallocate Text Out mode map.\r
+\r
+  @param  Private                  Consplitter Text Out pointer.\r
+\r
+  @retval EFI_SUCCESS              Buffer size has grown\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterGrowMapTable (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   UINTN Size;\r
   UINTN NewSize;\r
@@ -2118,23 +2166,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Add the device's output mode to console splitter's mode list.\r
+\r
+  @param  Private               Text Out Splitter pointer\r
+  @param  TextOut               Simple Text Output protocol pointer.\r
+  \r
+  @retval EFI_SUCCESS           Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterAddOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   INT32       MaxMode;\r
@@ -2202,17 +2249,16 @@ Returns:
   mode 0 is 80x25, mode 1 is 80x50, this routine will not check the\r
   intersection for mode 0 and mode 1.\r
 \r
-  @parm TextOutModeMap  Current text out mode map, begin with the mode 80x25\r
-  @parm NewlyAddedMap   New text out mode map, begin with the mode 80x25\r
-  @parm MapStepSize     Mode step size for one console device\r
-  @parm NewMapStepSize  Mode step size for one console device\r
-  @parm MaxMode         Current max text mode\r
-  @parm CurrentMode     Current text mode\r
+  @param TextOutModeMap  Current text out mode map, begin with the mode 80x25\r
+  @param NewlyAddedMap   New text out mode map, begin with the mode 80x25\r
+  @param MapStepSize     Mode step size for one console device\r
+  @param NewMapStepSize  Mode step size for one console device\r
+  @param MaxMode         Current max text mode\r
+  @param CurrentMode     Current text mode\r
 \r
   @retval None\r
 \r
 **/\r
-STATIC\r
 VOID\r
 ConSplitterGetIntersection (\r
   IN  INT32                           *TextOutModeMap,\r
@@ -2272,24 +2318,21 @@ ConSplitterGetIntersection (
   return ;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Add the device's output mode to console splitter's mode list.\r
+\r
+  @param  Private               Text Out Splitter pointer.\r
+  @param  TextOut               Simple Text Output protocol pointer.\r
+  \r
+  @return None\r
+\r
+**/\r
 VOID\r
 ConSplitterSyncOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-  Private - Private data structure.\r
-  TextOut - Text Out Protocol.\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   INT32                         CurrentMaxMode;\r
   INT32                         Mode;\r
@@ -2359,23 +2402,18 @@ Returns:
   return ;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Sync output device between ConOut and StdErr output.\r
+\r
+  @retval EFI_SUCCESS              Sync implemented successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterGetIntersectionBetweenConOutAndStrErr (\r
   VOID\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-  EFI_OUT_OF_RESOURCES\r
-\r
---*/\r
 {\r
   UINTN                         ConOutNumOfConsoles;\r
   UINTN                         StdErrNumOfConsoles;\r
@@ -2525,24 +2563,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Add GOP or UGA output mode into Consplitter Text Out list.\r
+\r
+  @param  Private               Text Out Splitter pointer.\r
+  @param  GraphicsOutput        Graphics Output protocol pointer.\r
+  @param  UgaDraw               UGA Draw protocol pointer.\r
+\r
+  @retval EFI_SUCCESS           Output mode added successfully.\r
+  @retval other                 Failed to add output mode.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterAddGraphicsOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput,\r
   IN  EFI_UGA_DRAW_PROTOCOL           *UgaDraw\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                           Status;\r
   UINTN                                Index;\r
@@ -2683,7 +2721,7 @@ Returns:
       CurrentGraphicsOutputMode->Info->PixelFormat = PixelBltOnly;\r
       ZeroMem (&CurrentGraphicsOutputMode->Info->PixelInformation, sizeof (EFI_PIXEL_BITMASK));\r
       CurrentGraphicsOutputMode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
-      CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) NULL;\r
+      CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) NULL;\r
       CurrentGraphicsOutputMode->FrameBufferSize = 0;\r
     }\r
 \r
@@ -2732,7 +2770,7 @@ Returns:
     Info->PixelFormat = PixelBltOnly;\r
     Info->PixelsPerScanLine = UgaHorizontalResolution;\r
     CurrentGraphicsOutputMode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
-    CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) NULL;\r
+    CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) NULL;\r
     CurrentGraphicsOutputMode->FrameBufferSize = 0;\r
 \r
     //\r
@@ -2781,27 +2819,21 @@ Done:
   return Status;\r
 }\r
 \r
-VOID\r
-ConsplitterSetConsoleOutMode (\r
-  IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   This routine will get the current console mode information (column, row)\r
   from ConsoleOutMode variable and set it; if the variable does not exist,\r
   set to user defined console mode.\r
 \r
-Arguments:\r
-\r
-  None\r
+  @param  Private            Consplitter Text Out pointer.\r
 \r
-Returns:\r
+  @return None\r
 \r
-  None\r
-\r
---*/\r
+**/\r
+VOID\r
+ConsplitterSetConsoleOutMode (\r
+  IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private\r
+  )\r
 {\r
   UINTN                         Col;\r
   UINTN                         Row;\r
@@ -2824,7 +2856,7 @@ Returns:
   ASSERT(ModeInfo != NULL);\r
 \r
   Status = gRT->GetVariable (\r
-                   VarConOutMode,\r
+                   VARCONOUTMODE,\r
                    &gEfiGenericPlatformVariableGuid,\r
                    NULL,\r
                    &ModeInfoSize,\r
@@ -2839,7 +2871,7 @@ Returns:
     ModeInfo->Column = 80;\r
     ModeInfo->Row    = 25;\r
     Status = gRT->SetVariable (\r
-                    VarConOutMode,\r
+                    VARCONOUTMODE,\r
                     &gEfiGenericPlatformVariableGuid,\r
                     EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                     sizeof (CONSOLE_OUT_MODE),\r
@@ -2875,7 +2907,7 @@ Returns:
     // Update ConOutMode variable\r
     //\r
     Status = gRT->SetVariable (\r
-                    VarConOutMode,\r
+                    VARCONOUTMODE,\r
                     &gEfiGenericPlatformVariableGuid,\r
                     EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                     sizeof (CONSOLE_OUT_MODE),\r
@@ -2887,6 +2919,18 @@ Returns:
 }\r
 \r
 \r
+/**\r
+  Add Text Output Device in Consplitter Text Output list.\r
+\r
+  @param  Private                  Text Out Splitter pointer.\r
+  @param  TextOut                  Simple Text Output protocol pointer.\r
+  @param  GraphicsOutput           Graphics Output protocol pointer.\r
+  @param  UgaDraw                  UGA Draw protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Text Output Device added successfully.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextOutAddDevice (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,\r
@@ -2894,17 +2938,6 @@ ConSplitterTextOutAddDevice (
   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL       *GraphicsOutput,\r
   IN  EFI_UGA_DRAW_PROTOCOL              *UgaDraw\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   UINTN                 CurrentNumOfConsoles;\r
@@ -3051,22 +3084,22 @@ Returns:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Remove Text Out Device in Consplitter Text Out list.\r
+\r
+  @param  Private                  Text Out Splitter pointer.\r
+  @param  TextOut                  Simple Text Output Pointer protocol pointer.\r
+\r
+  @retval EFI_SUCCESS              Text Out Device removed successfully.\r
+  @retval EFI_NOT_FOUND            No Text Out Device found.\r
+\r
+**/\r
 EFI_STATUS\r
 ConSplitterTextOutDeleteDevice (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA     *Private,\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   INT32                 Index;\r
   UINTN                 CurrentNumOfConsoles;\r
@@ -3151,30 +3184,25 @@ Returns:
 \r
   return Status;\r
 }\r
-//\r
-// ConSplitter TextIn member 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
 ConSplitterTextInReset (\r
   IN  EFI_SIMPLE_TEXT_INPUT_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
   EFI_STATUS                    ReturnStatus;\r
@@ -3201,29 +3229,26 @@ ConSplitterTextInReset (
   return ReturnStatus;\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  Private                  Protocol instance pointer.\r
+  @param  Key                      Driver may perform diagnostics on reset.\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 keydtroke information was not returned due\r
+                                   to hardware errors.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextInPrivateReadKeyStroke (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   OUT EFI_INPUT_KEY                   *Key\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
-    Key    - Driver may perform diagnostics on reset.\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 keydtroke information was not returned due to\r
-                        hardware errors.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   UINTN         Index;\r
@@ -3251,49 +3276,45 @@ ConSplitterTextInPrivateReadKeyStroke (
   return EFI_NOT_READY;\r
 }\r
 \r
-BOOLEAN\r
-ConSpliterConssoleControlStdInLocked (\r
-  VOID\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Return TRUE if StdIn is locked. The ConIn device on the virtual handle is\r
   the only device locked.\r
 \r
-Arguments:\r
   NONE\r
 \r
-Returns:\r
-  TRUE  - StdIn locked\r
-  FALSE - StdIn working normally\r
+  @retval TRUE                     StdIn locked\r
+  @retval FALSE                    StdIn working normally\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+ConSpliterConssoleControlStdInLocked (\r
+  VOID\r
+  )\r
 {\r
   return mConIn.PasswordEnabled;\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-ConSpliterConsoleControlLockStdInEvent (\r
-  IN  EFI_EVENT                       Event,\r
-  IN  VOID                            *Context\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This timer event will fire when StdIn is locked. It will check the key\r
   sequence on StdIn to see if it matches the password. Any error in the\r
   password will cause the check to reset. As long a mConIn.PasswordEnabled is\r
   TRUE the StdIn splitter will not report any input.\r
 \r
-Arguments:\r
-  (Standard EFI_EVENT_NOTIFY)\r
+  @param  Event                  The Event this notify function registered to.\r
+  @param  Context                Pointer to the context data registerd to the\r
+                                 Event.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+ConSpliterConsoleControlLockStdInEvent (\r
+  IN  EFI_EVENT                       Event,\r
+  IN  VOID                            *Context\r
+  )\r
 {\r
   EFI_STATUS    Status;\r
   EFI_INPUT_KEY Key;\r
@@ -3330,7 +3351,7 @@ Returns:
           BackSpaceString[0]  = CHAR_BACKSPACE;\r
           BackSpaceString[1]  = 0;\r
 \r
-          SpaceString[0]      = ' ';\r
+          SpaceString[0]      = L' ';\r
           SpaceString[1]      = 0;\r
 \r
           ConSplitterTextOutOutputString (&mConOut.TextOut, BackSpaceString);\r
@@ -3357,27 +3378,26 @@ Returns:
   } while (!EFI_ERROR (Status));\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-ConSpliterConsoleControlLockStdIn (\r
-  IN  EFI_CONSOLE_CONTROL_PROTOCOL    *This,\r
-  IN  CHAR16                          *Password\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   If Password is NULL unlock the password state variable and set the event\r
   timer. If the Password is too big return an error. If the Password is valid\r
   Copy the Password and enable state variable and then arm the periodic timer\r
 \r
-Arguments:\r
+  @param  This                     Console Control protocol pointer.\r
+  @param  Password                 The password input.\r
 \r
-Returns:\r
-  EFI_SUCCESS           - Lock the StdIn device\r
-  EFI_INVALID_PARAMETER - Password is NULL\r
-  EFI_OUT_OF_RESOURCES  - Buffer allocation to store the password fails\r
+  @retval EFI_SUCCESS              Lock the StdIn device\r
+  @retval EFI_INVALID_PARAMETER    Password is NULL\r
+  @retval EFI_OUT_OF_RESOURCES     Buffer allocation to store the password fails\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ConSpliterConsoleControlLockStdIn (\r
+  IN  EFI_CONSOLE_CONTROL_PROTOCOL    *This,\r
+  IN  CHAR16                          *Password\r
+  )\r
 {\r
   if (Password == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -3400,30 +3420,27 @@ Returns:
   return EFI_SUCCESS;\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
+  If the ConIn is password locked make it look like no keystroke is availible\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  Key                      Driver may perform diagnostics on reset.\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 keydtroke information was not returned due\r
+                                   to hardware errors.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextInReadKeyStroke (\r
   IN  EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *This,\r
   OUT EFI_INPUT_KEY                   *Key\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
-    If the ConIn is password locked make it look like no keystroke is availible\r
-\r
-  Arguments:\r
-    This   - Protocol instance pointer.\r
-    Key    - Driver may perform diagnostics on reset.\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 keydtroke information was not returned due to\r
-                        hardware errors.\r
-\r
---*/\r
 {\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
 \r
@@ -3440,29 +3457,26 @@ ConSplitterTextInReadKeyStroke (
   return ConSplitterTextInPrivateReadKeyStroke (Private, Key);\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-ConSplitterTextInWaitForKey (\r
-  IN  EFI_EVENT                       Event,\r
-  IN  VOID                            *Context\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This event agregates all the events of the ConIn devices in the spliter.\r
   If the ConIn is password locked then return.\r
   If any events of physical ConIn devices are signaled, signal the ConIn\r
   spliter event. This will cause the calling code to call\r
   ConSplitterTextInReadKeyStroke ().\r
 \r
-Arguments:\r
-  Event   - The Event assoicated with callback.\r
-  Context - Context registered when Event was created.\r
+  @param  Event                    The Event assoicated with callback.\r
+  @param  Context                  Context registered when Event was created.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+ConSplitterTextInWaitForKey (\r
+  IN  EFI_EVENT                       Event,\r
+  IN  VOID                            *Context\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
@@ -3496,28 +3510,26 @@ Returns:
 }\r
 \r
 \r
-STATIC\r
+\r
+/**\r
+  Test if the key has been registered on input device.\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
@@ -3542,31 +3554,24 @@ Returns:
 \r
 }\r
 \r
-//\r
-// Simple Text Input Ex protocol functions\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
 ConSplitterTextInResetEx (\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
   EFI_STATUS                    ReturnStatus;\r
@@ -3594,31 +3599,29 @@ ConSplitterTextInResetEx (
 \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
 ConSplitterTextInReadKeyStrokeEx (\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
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
   EFI_STATUS                    Status;\r
@@ -3662,30 +3665,28 @@ ConSplitterTextInReadKeyStrokeEx (
   return EFI_NOT_READY;\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
 ConSplitterTextInSetState (\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
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
   EFI_STATUS                    Status;\r
@@ -3715,6 +3716,26 @@ ConSplitterTextInSetState (
 \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
 ConSplitterTextInRegisterKeyNotify (\r
@@ -3723,25 +3744,6 @@ ConSplitterTextInRegisterKeyNotify (
   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
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
   EFI_STATUS                    Status;\r
@@ -3836,27 +3838,26 @@ ConSplitterTextInRegisterKeyNotify (
 \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
 ConSplitterTextInUnregisterKeyNotify (\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
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
   EFI_STATUS                    Status;\r
@@ -3920,27 +3921,24 @@ ConSplitterTextInUnregisterKeyNotify (
 \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
 ConSplitterSimplePointerReset (\r
   IN  EFI_SIMPLE_POINTER_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
   EFI_STATUS                    ReturnStatus;\r
@@ -3970,30 +3968,26 @@ ConSplitterSimplePointerReset (
   return ReturnStatus;\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  Private                  Protocol instance pointer.\r
+  @param  State                    The state information of simple pointer device.\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 keydtroke information was not returned due\r
+                                   to hardware errors.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerPrivateGetState (\r
   IN  TEXT_IN_SPLITTER_PRIVATE_DATA   *Private,\r
   IN OUT EFI_SIMPLE_POINTER_STATE     *State\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
-    State  -\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 keydtroke information was not returned due to\r
-                        hardware errors.\r
-\r
---*/\r
 {\r
   EFI_STATUS                Status;\r
   EFI_STATUS                ReturnStatus;\r
@@ -4050,30 +4044,27 @@ ConSplitterSimplePointerPrivateGetState (
   return ReturnStatus;\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
+  If the ConIn is password locked make it look like no keystroke is availible\r
+\r
+  @param  This                     A pointer to protocol instance.\r
+  @param  State                    A pointer to state information on the pointer device\r
+\r
+  @retval EFI_SUCCESS              The keystroke information was returned in State.\r
+  @retval EFI_NOT_READY            There was no keystroke data availiable.\r
+  @retval EFI_DEVICE_ERROR         The keydtroke information was not returned due\r
+                                   to hardware errors.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerGetState (\r
   IN  EFI_SIMPLE_POINTER_PROTOCOL     *This,\r
   IN OUT EFI_SIMPLE_POINTER_STATE     *State\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
-    If the ConIn is password locked make it look like no keystroke is availible\r
-\r
-  Arguments:\r
-    This   - Protocol instance pointer.\r
-    State  -\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 keydtroke information was not returned due to\r
-                        hardware errors.\r
-\r
---*/\r
 {\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
 \r
@@ -4090,29 +4081,26 @@ ConSplitterSimplePointerGetState (
   return ConSplitterSimplePointerPrivateGetState (Private, State);\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-ConSplitterSimplePointerWaitForInput (\r
-  IN  EFI_EVENT                       Event,\r
-  IN  VOID                            *Context\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This event agregates all the events of the ConIn devices in the spliter.\r
   If the ConIn is password locked then return.\r
   If any events of physical ConIn devices are signaled, signal the ConIn\r
   spliter event. This will cause the calling code to call\r
   ConSplitterTextInReadKeyStroke ().\r
 \r
-Arguments:\r
-  Event   - The Event assoicated with callback.\r
-  Context - Context registered when Event was created.\r
+  @param  Event                    The Event assoicated with callback.\r
+  @param  Context                  Context registered when Event was created.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+ConSplitterSimplePointerWaitForInput (\r
+  IN  EFI_EVENT                       Event,\r
+  IN  VOID                            *Context\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
@@ -4145,31 +4133,23 @@ Returns:
   }\r
 }\r
 \r
-//\r
-// Absolute Pointer Protocol functions\r
-//\r
+/**\r
+  Resets the pointer device hardware.\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 correctly and\r
+                                   could not be reset.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterAbsolutePointerReset (\r
   IN EFI_ABSOLUTE_POINTER_PROTOCOL   *This,\r
   IN BOOLEAN                         ExtendedVerification\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Resets the pointer device hardware.\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 correctly and could\r
-                            not be reset.\r
-\r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_STATUS                    ReturnStatus;\r
@@ -4199,28 +4179,28 @@ ConSplitterAbsolutePointerReset (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Retrieves the current state of a pointer device.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  State                    A pointer to the state information on the\r
+                                   pointer device.\r
+\r
+  @retval EFI_SUCCESS              The state of the pointer device was returned in\r
+                                   State..\r
+  @retval EFI_NOT_READY            The state of the pointer device has not changed\r
+                                   since the last call to GetState().\r
+  @retval EFI_DEVICE_ERROR         A device error occurred while attempting to\r
+                                   retrieve the pointer device's current state.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterAbsolutePointerGetState (\r
   IN EFI_ABSOLUTE_POINTER_PROTOCOL   *This,\r
   IN OUT EFI_ABSOLUTE_POINTER_STATE  *State\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves the current state of a pointer device.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    State                 - A pointer to the state information on the pointer device.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The state of the pointer device was returned in State..\r
-    EFI_NOT_READY         - The state of the pointer device has not changed since the last call to\r
-                            GetState().\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempting to retrieve the pointer\r
-                            device's current state.\r
---*/\r
 {\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
   EFI_STATUS                    Status;\r
@@ -4281,29 +4261,26 @@ ConSplitterAbsolutePointerGetState (
   return ReturnStatus;\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-ConSplitterAbsolutePointerWaitForInput (\r
-  IN  EFI_EVENT                       Event,\r
-  IN  VOID                            *Context\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This event agregates all the events of the pointer devices in the splitter.\r
   If the ConIn is password locked then return.\r
   If any events of physical pointer devices are signaled, signal the pointer\r
   splitter event. This will cause the calling code to call\r
   ConSplitterAbsolutePointerGetState ().\r
 \r
-Arguments:\r
-  Event   - The Event assoicated with callback.\r
-  Context - Context registered when Event was created.\r
+  @param  Event                    The Event assoicated with callback.\r
+  @param  Context                  Context registered when Event was created.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+ConSplitterAbsolutePointerWaitForInput (\r
+  IN  EFI_EVENT                       Event,\r
+  IN  VOID                            *Context\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   TEXT_IN_SPLITTER_PRIVATE_DATA *Private;\r
@@ -4337,28 +4314,25 @@ Returns:
   }\r
 }\r
 \r
+\r
+/**\r
+  Reset the text output device hardware and optionaly run diagnostics\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  ExtendedVerification     Driver may perform more exhaustive verfication\r
+                                   operation of the device during reset.\r
+\r
+  @retval EFI_SUCCESS              The text output device was reset.\r
+  @retval EFI_DEVICE_ERROR         The text output device is not functioning\r
+                                   correctly and could not be reset.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutReset (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  BOOLEAN                            ExtendedVerification\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reset the text output device hardware and optionaly run diagnostics\r
-\r
-  Arguments:\r
-    This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform more exhaustive verfication\r
-                           operation of the device during reset.\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - The text output device was reset.\r
-    EFI_DEVICE_ERROR  - The text output device is not functioning correctly and\r
-                        could not be reset.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4384,7 +4358,7 @@ ConSplitterTextOutReset (
     }\r
   }\r
 \r
-  This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
+  This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BLACK));\r
 \r
   Status = DevNullTextOutSetMode (Private, 0);\r
   if (EFI_ERROR (Status)) {\r
@@ -4394,34 +4368,32 @@ ConSplitterTextOutReset (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Write a Unicode string to the output device.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  WString                  The NULL-terminated Unicode string to be\r
+                                   displayed on the output device(s). All output\r
+                                   devices must also support the Unicode drawing\r
+                                   defined in this file.\r
+\r
+  @retval EFI_SUCCESS              The string was output to the device.\r
+  @retval EFI_DEVICE_ERROR         The device reported an error while attempting to\r
+                                   output the text.\r
+  @retval EFI_UNSUPPORTED          The output device's mode is not currently in a\r
+                                   defined text mode.\r
+  @retval EFI_WARN_UNKNOWN_GLYPH   This warning code indicates that some of the\r
+                                   characters in the Unicode string could not be\r
+                                   rendered and were skipped.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutOutputString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  CHAR16                             *WString\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Write a Unicode string to the output device.\r
-\r
-  Arguments:\r
-    This    - Protocol instance pointer.\r
-    String  - The NULL-terminated Unicode string to be displayed on the output\r
-              device(s). All output devices must also support the Unicode\r
-              drawing defined in this file.\r
-\r
-  Returns:\r
-    EFI_SUCCESS       - The string was output to the device.\r
-    EFI_DEVICE_ERROR  - The device reported an error while attempting to output\r
-                         the text.\r
-    EFI_UNSUPPORTED        - The output device's mode is not currently in a\r
-                              defined text mode.\r
-    EFI_WARN_UNKNOWN_GLYPH - This warning code indicates that some of the\r
-                              characters in the Unicode string could not be\r
-                              rendered and were skipped.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4435,7 +4407,7 @@ ConSplitterTextOutOutputString (
   Private         = TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   BackSpaceCount  = 0;\r
-  for (TargetString = WString; *TargetString; TargetString++) {\r
+  for (TargetString = WString; *TargetString != L'\0'; TargetString++) {\r
     if (*TargetString == CHAR_BACKSPACE) {\r
       BackSpaceCount++;\r
     }\r
@@ -4469,37 +4441,35 @@ ConSplitterTextOutOutputString (
     }\r
   }\r
 \r
-  if (BackSpaceCount) {\r
+  if (BackSpaceCount > 0) {\r
     FreePool (TargetString);\r
   }\r
 \r
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Verifies that all characters in a Unicode string can be output to the\r
+  target device.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  WString                  The NULL-terminated Unicode string to be\r
+                                   examined for the output device(s).\r
+\r
+  @retval EFI_SUCCESS              The device(s) are capable of rendering the\r
+                                   output string.\r
+  @retval EFI_UNSUPPORTED          Some of the characters in the Unicode string\r
+                                   cannot be rendered by one or more of the output\r
+                                   devices mapped by the EFI handle.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutTestString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  CHAR16                             *WString\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Verifies that all characters in a Unicode string can be output to the\r
-    target device.\r
-\r
-  Arguments:\r
-    This    - Protocol instance pointer.\r
-    String  - The NULL-terminated Unicode string to be examined for the output\r
-               device(s).\r
-\r
-  Returns:\r
-    EFI_SUCCESS     - The device(s) are capable of rendering the output string.\r
-    EFI_UNSUPPORTED - Some of the characters in the Unicode string cannot be\r
-                       rendered by one or more of the output devices mapped\r
-                       by the EFI handle.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4530,6 +4500,24 @@ ConSplitterTextOutTestString (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Returns information for an available text mode that the output device(s)\r
+  supports.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  ModeNumber               The mode number to return information on.\r
+  @param  Columns                  Returns the columns of the text output device\r
+                                   for the requested ModeNumber.\r
+  @param  Rows                     Returns the rows of the text output device\r
+                                   for the requested ModeNumber.\r
+\r
+  @retval EFI_SUCCESS              The requested mode information was returned.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request.\r
+  @retval EFI_UNSUPPORTED          The mode number was not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutQueryMode (\r
@@ -4538,25 +4526,6 @@ ConSplitterTextOutQueryMode (
   OUT UINTN                              *Columns,\r
   OUT UINTN                              *Rows\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Returns information for an available text mode that the output device(s)\r
-    supports.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    ModeNumber - The mode number to return information on.\r
-    Columns, Rows - Returns the geometry of the text output device for the\r
-                    requested ModeNumber.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The requested mode information was returned.\r
-    EFI_DEVICE_ERROR - The device had an error and could not\r
-                       complete the request.\r
-    EFI_UNSUPPORTED - The mode number was not valid.\r
-\r
---*/\r
 {\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
   UINTN                           CurrentMode;\r
@@ -4597,28 +4566,25 @@ ConSplitterTextOutQueryMode (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Sets the output device(s) to a specified mode.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  ModeNumber               The mode number to set.\r
+\r
+  @retval EFI_SUCCESS              The requested text mode was set.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request.\r
+  @retval EFI_UNSUPPORTED          The mode number was not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutSetMode (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  UINTN                              ModeNumber\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Sets the output device(s) to a specified mode.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    ModeNumber - The mode number to set.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The requested text mode was set.\r
-    EFI_DEVICE_ERROR - The device had an error and\r
-                       could not complete the request.\r
-    EFI_UNSUPPORTED - The mode number was not valid.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4680,31 +4646,30 @@ ConSplitterTextOutSetMode (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Sets the background and foreground colors for the OutputString () and\r
+  ClearScreen () functions.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  Attribute                The attribute to set. Bits 0..3 are the\r
+                                   foreground color, and bits 4..6 are the\r
+                                   background color. All other bits are undefined\r
+                                   and must be zero. The valid Attributes are\r
+                                   defined in this file.\r
+\r
+  @retval EFI_SUCCESS              The attribute was set.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request.\r
+  @retval EFI_UNSUPPORTED          The attribute requested is not defined.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutSetAttribute (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  UINTN                              Attribute\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Sets the background and foreground colors for the OutputString () and\r
-    ClearScreen () functions.\r
-\r
-  Arguments:\r
-    This      - Protocol instance pointer.\r
-    Attribute - The attribute to set. Bits 0..3 are the foreground color, and\r
-                bits 4..6 are the background color. All other bits are undefined\r
-                and must be zero. The valid Attributes are defined in this file.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The attribute was set.\r
-    EFI_DEVICE_ERROR - The device had an error and\r
-                       could not complete the request.\r
-    EFI_UNSUPPORTED - The attribute requested is not defined.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4741,27 +4706,24 @@ ConSplitterTextOutSetAttribute (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Clears the output device(s) display to the currently selected background\r
+  color.\r
+\r
+  @param  This                     Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS              The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request.\r
+  @retval EFI_UNSUPPORTED          The output device is not in a valid text mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutClearScreen (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Clears the output device(s) display to the currently selected background\r
-    color.\r
-\r
-  Arguments:\r
-    This      - Protocol instance pointer.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and\r
-                       could not complete the request.\r
-    EFI_UNSUPPORTED - The output device is not in a valid text mode.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4791,6 +4753,26 @@ ConSplitterTextOutClearScreen (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Sets the current coordinates of the cursor position\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  Column                   The column position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of columns by QueryMode ().\r
+  @param  Row                      The row position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of rows by QueryMode ().\r
+\r
+  @retval EFI_SUCCESS              The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request.\r
+  @retval EFI_UNSUPPORTED          The output device is not in a valid text mode,\r
+                                   or the cursor position is invalid for the\r
+                                   current mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutSetCursorPosition (\r
@@ -4798,25 +4780,6 @@ ConSplitterTextOutSetCursorPosition (
   IN  UINTN                              Column,\r
   IN  UINTN                              Row\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Sets the current coordinates of the cursor position\r
-\r
-  Arguments:\r
-    This        - Protocol instance pointer.\r
-    Column, Row - the position to set the cursor to. Must be greater than or\r
-                  equal to zero and less than the number of columns and rows\r
-                  by QueryMode ().\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and\r
-                       could not complete the request.\r
-    EFI_UNSUPPORTED - The output device is not in a valid text mode, or the\r
-                       cursor position is invalid for the current mode.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r
@@ -4870,30 +4833,27 @@ ConSplitterTextOutSetCursorPosition (
   return ReturnStatus;\r
 }\r
 \r
+\r
+/**\r
+  Makes the cursor visible or invisible\r
+\r
+  @param  This                     Protocol instance pointer.\r
+  @param  Visible                  If TRUE, the cursor is set to be visible. If\r
+                                   FALSE, the cursor is set to be invisible.\r
+\r
+  @retval EFI_SUCCESS              The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR         The device had an error and could not complete\r
+                                   the request, or the device does not support\r
+                                   changing the cursor mode.\r
+  @retval EFI_UNSUPPORTED          The output device is not in a valid text mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterTextOutEnableCursor (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *This,\r
   IN  BOOLEAN                            Visible\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Makes the cursor visible or invisible\r
-\r
-  Arguments:\r
-    This    - Protocol instance pointer.\r
-    Visible - If TRUE, the cursor is set to be visible. If FALSE, the cursor is\r
-              set to be invisible.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and could not complete the\r
-                        request, or the device does not support changing\r
-                        the cursor mode.\r
-    EFI_UNSUPPORTED - The output device is not in a valid text mode.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;\r