]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Added some functions header.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 4 Jul 2008 07:58:57 +0000 (07:58 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 4 Jul 2008 07:58:57 +0000 (07:58 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5409 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h

index af2d2221fe7e97549eae71012aeb87a25912d413..428b40e40412d599358bfeb1eecebb5668f83935 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-  Console Platfrom DXE Driver, install Console protocols.\r
+  Console Platfrom DXE Driver, install Console Device Guids and update Console\r
+  Environment Variables.\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
@@ -80,6 +81,18 @@ InitializeConPlatform(
 }\r
 \r
 \r
+/**\r
+  Test to see if EFI Text In 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
 ConPlatformTextInDriverBindingSupported (\r
@@ -87,19 +100,6 @@ ConPlatformTextInDriverBindingSupported (
   IN  EFI_HANDLE                   ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Supported\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Supported() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   return ConPlatformDriverBindingSupported (\r
           This,\r
@@ -109,6 +109,19 @@ Returns:
           );\r
 }\r
 \r
+\r
+/**\r
+  Test to see if EFI Text Out 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
 ConPlatformTextOutDriverBindingSupported (\r
@@ -116,19 +129,6 @@ ConPlatformTextOutDriverBindingSupported (
   IN  EFI_HANDLE                   ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Supported\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Supported() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   return ConPlatformDriverBindingSupported (\r
           This,\r
@@ -138,6 +138,20 @@ Returns:
           );\r
 }\r
 \r
+\r
+/**\r
+  Test to see if specific 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
+  @param  ProtocolGuid        The specfic protocol.\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
 ConPlatformDriverBindingSupported (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -145,19 +159,6 @@ ConPlatformDriverBindingSupported (
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath,\r
   IN  EFI_GUID                     *ProtocolGuid\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Supported\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Supported() function)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   VOID        *Interface;\r
@@ -178,7 +179,7 @@ Returns:
     return Status;\r
   }\r
   //\r
-  // Test to see if this device supports the Simple Text Output Protocol\r
+  // Test to see if this device supports the specific Protocol\r
   //\r
   Status = gBS->OpenProtocol (\r
                   ControllerHandle,\r
@@ -202,6 +203,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening Simple Text In protocol,\r
+  reading Device Path, and installing Console Devcice In GUID on ControllerHandle.\r
+\r
+  If this devcie is not one hot-plug devce, append its device path into the \r
+  console environment variables ConInDev.\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          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextInDriverBindingStart (\r
@@ -209,18 +227,6 @@ ConPlatformTextInDriverBindingStart (
   IN  EFI_HANDLE                    ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Start() function)\r
-\r
-Returns:\r
-\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_DEVICE_PATH_PROTOCOL    *DevicePath;\r
@@ -307,6 +313,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening Simple Text Out protocol,\r
+  reading Device Path, and installing Console Devcice Out GUID, Standard Error\r
+  Device GUID on ControllerHandle.\r
+\r
+  If this devcie is not one hot-plug devce, append its device path into the \r
+  console environment variables ConOutDev, StdErrDev.\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          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextOutDriverBindingStart (\r
@@ -314,18 +338,6 @@ ConPlatformTextOutDriverBindingStart (
   IN  EFI_HANDLE                    ControllerHandle,\r
   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-\r
-Arguments:\r
-  (Standard DriverBinding Protocol Start() function)\r
-\r
-Returns:\r
-\r
-\r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
@@ -444,6 +456,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Stop this driver on ControllerHandle by removing Console Devcice In GUID \r
+  and closing the Simple Text In protocol on ControllerHandle.\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
 ConPlatformTextInDriverBindingStop (\r
@@ -452,18 +478,6 @@ ConPlatformTextInDriverBindingStop (
   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_DEVICE_PATH_PROTOCOL  *DevicePath;\r
@@ -517,6 +531,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Stop this driver on ControllerHandle by removing Console Devcice Out GUID \r
+  and closing the Simple Text Out protocol on ControllerHandle.\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
 ConPlatformTextOutDriverBindingStop (\r
@@ -525,18 +554,6 @@ ConPlatformTextOutDriverBindingStop (
   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_DEVICE_PATH_PROTOCOL  *DevicePath;\r
@@ -602,6 +619,16 @@ Returns:
 }\r
 \r
 \r
+/**\r
+  Unstall the specific protocol.\r
+\r
+  @param This            Protocol instance pointer.\r
+  @param Handle          Handle of device to unstall protocol on.\r
+  @param ProtocolGuid    The specific protocol need to be uninstalled.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
 ConPlatformUnInstallProtocol (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -632,26 +659,22 @@ ConPlatformUnInstallProtocol (
   return ;\r
 }\r
 \r
-VOID *\r
-ConPlatformGetVariable (\r
-  IN  CHAR16    *Name\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
   Read the EFI variable (Name) and return a dynamically allocated\r
   buffer, and the size of the buffer. On failure return NULL.\r
 \r
-Arguments:\r
-  Name       - String part of EFI variable name\r
 \r
-Returns:\r
-  Dynamically allocated memory that contains a copy of the EFI variable.\r
-  Caller is repsoncible freeing the buffer.\r
+  @param  Name             String part of EFI variable name\r
 \r
-  NULL - Variable was not read\r
+  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
+          Caller is repsoncible freeing the buffer.\r
+          NULL - Variable was not read\r
 \r
---*/\r
+**/\r
+VOID *\r
+ConPlatformGetVariable (\r
+  IN  CHAR16    *Name\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
   VOID        *Buffer;\r
@@ -698,38 +721,31 @@ Returns:
   return Buffer;\r
 }\r
 \r
-EFI_STATUS\r
-ConPlatformMatchDevicePaths (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  * Multi,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  * Single,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  **NewDevicePath OPTIONAL,\r
-  IN  BOOLEAN                   Delete\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
   Function compares a device path data structure to that of all the nodes of a\r
   second device path instance.\r
 \r
-Arguments:\r
-  Multi        - A pointer to a multi-instance device path data structure.\r
-\r
-  Single       - A pointer to a single-instance device path data structure.\r
-\r
-  NewDevicePath - If Delete is TRUE, this parameter must not be null, and it\r
-                  points to the remaining device path data structure.\r
-                  (remaining device path = Multi - Single.)\r
-\r
-  Delete        - If TRUE, means removing Single from Multi.\r
-                  If FALSE, the routine just check whether Single matches\r
-                  with any instance in Multi.\r
 \r
-Returns:\r
+  @param Multi           A pointer to a multi-instance device path data structure.\r
+  @param Single          A pointer to a single-instance device path data structure.\r
+  @param NewDevicePath   If Delete is TRUE, this parameter must not be null, and it\r
+                         points to the remaining device path data structure.\r
+                         (remaining device path = Multi - Single.)\r
+  @param Delete          If TRUE, means removing Single from Multi.\r
+                         If FALSE, the routine just check whether Single matches\r
+                         with any instance in Multi.\r
 \r
-  The function returns EFI_SUCCESS if the Single is contained within Multi.\r
-  Otherwise, EFI_NOT_FOUND is returned.\r
+  @return The function returns EFI_SUCCESS if the Single is contained within Multi.\r
+          Otherwise, EFI_NOT_FOUND is returned.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+ConPlatformMatchDevicePaths (\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *Multi,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *Single,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  **NewDevicePath OPTIONAL,\r
+  IN  BOOLEAN                   Delete\r
+  )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
@@ -739,7 +755,7 @@ Returns:
   //\r
   // The passed in DevicePath should not be NULL\r
   //\r
-  if ((!Multi) || (!Single)) {\r
+  if ((Multi == NULL) || (Single == NULL)) {\r
     return EFI_NOT_FOUND;\r
   }\r
   //\r
@@ -753,7 +769,7 @@ Returns:
   //\r
   // search for the match of 'Single' in 'Multi'\r
   //\r
-  while (DevicePathInst) {\r
+  while (DevicePathInst != NULL) {\r
     if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
       if (!Delete) {\r
         FreePool (DevicePathInst);\r
@@ -780,24 +796,25 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  Update console devicein console environment variables. \r
+\r
+  @param  VariableName    Console environment variables, ConOutDev, ConInDev\r
+                          StdErrDev, ConIn or ConOut.\r
+  @param  DevicePath      Console devcie's device path.\r
+  @param  Operation       Variable operations, such as APPEND or DELETE.\r
+\r
+  @retval EFI_SUCCESS           Variable operates successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  If variable cannot be appended.\r
+  @retval other                 Variable updating failed.\r
+\r
+**/\r
 EFI_STATUS\r
 ConPlatformUpdateDeviceVariable (\r
   IN  CHAR16                    *VariableName,\r
   IN  EFI_DEVICE_PATH_PROTOCOL  *DevicePath,\r
   IN  CONPLATFORM_VAR_OPERATION Operation\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                Status;\r
   EFI_DEVICE_PATH_PROTOCOL  *VariableDevicePath;\r
@@ -881,6 +898,16 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Check if the device is one hot-plug supported.\r
+\r
+  @param  DriverBindingHandle   Protocol instance pointer.\r
+  @param  ControllerHandle      Handle of device to check.\r
+\r
+  @retval TRUE                  The devcie is a hot-plug device\r
+  @retval FALSE                 The devcie is not a hot-plug device.\r
+\r
+**/\r
 BOOLEAN\r
 IsHotPlugDevice (\r
   EFI_HANDLE    DriverBindingHandle,\r
index c24d80e0b16a020a2840dfd1958526f558f59920..64bc589a9bc71574a4ab21e55b261cd972c536fc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Header file for Console Platfrom DXE Driver.\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
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef CON_MANAGE_H_\r
-#define CON_MANAGE_H_\r
+#ifndef _CON_MANAGE_H_\r
+#define _CON_MANAGE_H_\r
 \r
 #include <Uefi.h>\r
 #include <Protocol/SimpleTextOut.h>\r
@@ -51,6 +51,19 @@ typedef enum {
   DELETE\r
 } CONPLATFORM_VAR_OPERATION;\r
 \r
+/**\r
+  Test to see if specific 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
+  @param  ProtocolGuid        The specfic protocol.\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
 ConPlatformDriverBindingSupported (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -59,6 +72,18 @@ ConPlatformDriverBindingSupported (
   IN  EFI_GUID                     *ProtocolGuid\r
   );\r
 \r
+/**\r
+  Test to see if EFI Text In 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
 ConPlatformTextInDriverBindingSupported (\r
@@ -67,6 +92,18 @@ ConPlatformTextInDriverBindingSupported (
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Test to see if EFI Text Out 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
 ConPlatformTextOutDriverBindingSupported (\r
@@ -75,6 +112,23 @@ ConPlatformTextOutDriverBindingSupported (
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening Simple Text In protocol,\r
+  reading Device Path, and installing Console Devcice In GUID on ControllerHandle.\r
+\r
+  If this devcie is not one hot-plug devce, append its device path into the \r
+  console environment variables ConInDev.\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          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextInDriverBindingStart (\r
@@ -83,6 +137,24 @@ ConPlatformTextInDriverBindingStart (
   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start this driver on ControllerHandle by opening Simple Text Out protocol,\r
+  reading Device Path, and installing Console Devcice Out GUID, Standard Error\r
+  Device GUID on ControllerHandle.\r
+\r
+  If this devcie is not one hot-plug devce, append its device path into the \r
+  console environment variables ConOutDev, StdErrDev.\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          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextOutDriverBindingStart (\r
@@ -91,6 +163,20 @@ ConPlatformTextOutDriverBindingStart (
   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle by removing Console Devcice In GUID \r
+  and closing the Simple Text In protocol on ControllerHandle.\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
 ConPlatformTextInDriverBindingStop (\r
@@ -100,6 +186,20 @@ ConPlatformTextInDriverBindingStop (
   IN  EFI_HANDLE                   *ChildHandleBuffer\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle by removing Console Devcice Out GUID \r
+  and closing the Simple Text Out protocol on ControllerHandle.\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
 ConPlatformTextOutDriverBindingStop (\r
@@ -109,6 +209,16 @@ ConPlatformTextOutDriverBindingStop (
   IN  EFI_HANDLE                   *ChildHandleBuffer\r
   );\r
 \r
+/**\r
+  Unstall the specific protocol.\r
+\r
+  @param This            Protocol instance pointer.\r
+  @param Handle          Handle of device to unstall protocol on.\r
+  @param ProtocolGuid    The specific protocol need to be uninstalled.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
 ConPlatformUnInstallProtocol (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
@@ -116,19 +226,62 @@ ConPlatformUnInstallProtocol (
   IN  EFI_GUID                     *ProtocolGuid\r
   );\r
 \r
+/**\r
+  Read the EFI variable (Name) and return a dynamically allocated\r
+  buffer, and the size of the buffer. On failure return NULL.\r
+\r
+\r
+  @param  Name             String part of EFI variable name\r
+\r
+  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
+          Caller is repsoncible freeing the buffer.\r
+          NULL - Variable was not read\r
+\r
+**/\r
 VOID *\r
 ConPlatformGetVariable (\r
   IN  CHAR16              *Name\r
   );\r
 \r
+/**\r
+  Function compares a device path data structure to that of all the nodes of a\r
+  second device path instance.\r
+\r
+\r
+  @param Multi           A pointer to a multi-instance device path data structure.\r
+  @param Single          A pointer to a single-instance device path data structure.\r
+  @param NewDevicePath   If Delete is TRUE, this parameter must not be null, and it\r
+                         points to the remaining device path data structure.\r
+                         (remaining device path = Multi - Single.)\r
+  @param Delete          If TRUE, means removing Single from Multi.\r
+                         If FALSE, the routine just check whether Single matches\r
+                         with any instance in Multi.\r
+\r
+  @return The function returns EFI_SUCCESS if the Single is contained within Multi.\r
+          Otherwise, EFI_NOT_FOUND is returned.\r
+\r
+**/\r
 EFI_STATUS\r
 ConPlatformMatchDevicePaths (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  * Multi,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  * Single,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *Multi,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *Single,\r
   IN  EFI_DEVICE_PATH_PROTOCOL  **NewDevicePath OPTIONAL,\r
   IN  BOOLEAN                   Delete\r
   );\r
 \r
+/**\r
+  Update console devicein console environment variables. \r
+\r
+  @param  VariableName    Console environment variables, ConOutDev, ConInDev\r
+                          StdErrDev, ConIn or ConOut.\r
+  @param  DevicePath      Console devcie's device path.\r
+  @param  Operation       Variable operations, such as APPEND or DELETE.\r
+\r
+  @retval EFI_SUCCESS           Variable operates successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  If variable cannot be appended.\r
+  @retval other                 Variable updating failed.\r
+\r
+**/\r
 EFI_STATUS\r
 ConPlatformUpdateDeviceVariable (\r
   IN  CHAR16                    *VariableName,\r
@@ -136,6 +289,16 @@ ConPlatformUpdateDeviceVariable (
   IN  CONPLATFORM_VAR_OPERATION Operation\r
   );\r
 \r
+/**\r
+  Check if the device is one hot-plug supported.\r
+\r
+  @param  DriverBindingHandle   Protocol instance pointer.\r
+  @param  ControllerHandle      Handle of device to check.\r
+\r
+  @retval TRUE                  The devcie is a hot-plug device\r
+  @retval FALSE                 The devcie is not a hot-plug device.\r
+\r
+**/\r
 BOOLEAN\r
 IsHotPlugDevice (\r
   EFI_HANDLE    DriverBindingHandle,\r