]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
code scrub.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Terminal.c
index 21ae6ae8601c58e3c50e3acf8b7bb6079656929a..d02306fda8f2daa5d298718a315d0186c47547f1 100644 (file)
@@ -119,16 +119,16 @@ TERMINAL_DEV  gTerminalDevTemplate = {
 \r
 \r
 /**\r
-  Test to see if this driver supports ControllerHandle\r
+  Test to see if this driver supports Controller. \r
 \r
   @param  This                Protocol instance pointer.\r
-  @param  ControllerHandle    Handle of device to test\r
+  @param  Controller          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 EFI_ALREADY_STARTED This driver is already running on this device\r
-  @retval other               This driver does not support this device\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
+  @retval other               This driver does not support this device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -230,19 +230,19 @@ TerminalDriverBindingSupported (
 }\r
 \r
 /**\r
-  Start this driver on ControllerHandle by opening a Serial IO protocol,\r
+  Start this driver on Controller by opening a Serial IO protocol,\r
   reading Device Path, and creating a child handle with a Simple Text In,\r
   Simple Text In Ex and Simple Text Out protocol, and device path protocol.\r
   And store Console Device Environment Variables.\r
 \r
   @param  This                 Protocol instance pointer.\r
-  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  Controller           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
+  @retval EFI_SUCCESS          This driver is added to Controller.\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on Controller.\r
+  @retval other                This driver does not support this device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -383,7 +383,7 @@ TerminalDriverBindingStart (
     ASSERT (TerminalType <= VTUTF8TYPE);\r
 \r
     CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID));\r
-    RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL*)DefaultNode;\r
+    RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DefaultNode;\r
   } else {\r
     //\r
     // Use the RemainingDevicePath to determine the terminal type\r
@@ -753,17 +753,17 @@ Error:
 }\r
 \r
 /**\r
-  Stop this driver on ControllerHandle by closing Simple Text In, Simple Text\r
+  Stop this driver on Controller by closing Simple Text In, Simple Text\r
   In Ex, Simple Text Out protocol, and removing parent device path from\r
   Console Device Environment Variables.    \r
 \r
   @param  This              Protocol instance pointer.\r
-  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  Controller        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 EFI_SUCCESS       This driver is removed Controller.\r
   @retval other             This driver could not be removed from this device.\r
 \r
 **/\r
@@ -972,7 +972,7 @@ TerminalFreeNotifyList (
                    TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE\r
                    );\r
     RemoveEntryList (ListHead->ForwardLink);\r
-    gBS->FreePool (NotifyNode);\r
+    FreePool (NotifyNode);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -1172,8 +1172,8 @@ TerminalRemoveConsoleDevVariable (
   @param  VariableSize           Returns the size of the EFI variable that was read\r
 \r
   @return Dynamically allocated memory that contains a copy of the EFI variable.\r
-  @return Caller is repsoncible freeing the buffer.\r
-  @retval NULL                   Variable was not read\r
+          Caller is repsoncible freeing the buffer. If variable was not read, \r
+          NULL regturned.\r
 \r
 **/\r
 VOID *\r
@@ -1263,53 +1263,40 @@ SetTerminalDevicePath (
   Node.Header.SubType = MSG_VENDOR_DP;\r
 \r
   //\r
-  // generate terminal device path node according to terminal type.\r
+  // Generate terminal device path node according to terminal type.\r
   //\r
   switch (TerminalType) {\r
 \r
   case PCANSITYPE:\r
-    CopyMem (\r
-      &Node.Guid,\r
-      &gEfiPcAnsiGuid,\r
-      sizeof (EFI_GUID)\r
-      );\r
+    CopyGuid (&Node.Guid, &gEfiPcAnsiGuid);\r
     break;\r
 \r
   case VT100TYPE:\r
-    CopyMem (\r
-      &Node.Guid,\r
-      &gEfiVT100Guid,\r
-      sizeof (EFI_GUID)\r
-      );\r
+    CopyGuid (&Node.Guid, &gEfiVT100Guid);\r
     break;\r
 \r
   case VT100PLUSTYPE:\r
-    CopyMem (\r
-      &Node.Guid,\r
-      &gEfiVT100PlusGuid,\r
-      sizeof (EFI_GUID)\r
-      );\r
+    CopyGuid (&Node.Guid, &gEfiVT100PlusGuid);\r
     break;\r
 \r
   case VTUTF8TYPE:\r
-    CopyMem (\r
-      &Node.Guid,\r
-      &gEfiVTUTF8Guid,\r
-      sizeof (EFI_GUID)\r
-      );\r
+    CopyGuid (&Node.Guid, &gEfiVTUTF8Guid);\r
     break;\r
 \r
   default:\r
     return EFI_UNSUPPORTED;\r
-    break;\r
   }\r
 \r
+  //\r
+  // Get VENDOR_DEVCIE_PATH size and put into Node.Header\r
+  //\r
   SetDevicePathNodeLength (\r
     &Node.Header,\r
     sizeof (VENDOR_DEVICE_PATH)\r
     );\r
+\r
   //\r
-  // append the terminal node onto parent device path\r
+  // Append the terminal node onto parent device path\r
   // to generate a complete terminal device path.\r
   //\r
   *TerminalDevicePath = AppendDevicePathNode (\r
@@ -1384,8 +1371,8 @@ InitializeEfiKeyFiFo (
 /**\r
   The user Entry Point for module Terminal. The user code starts with this function.\r
 \r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param  SystemTable    A pointer to the EFI System Table.\r
 \r
   @retval EFI_SUCCESS       The entry point is executed successfully.\r
   @retval other             Some error occurs when executing this entry point.\r