]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update code style.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Jun 2009 08:39:21 +0000 (08:39 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Jun 2009 08:39:21 +0000 (08:39 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8669 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.c
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.h [deleted file]
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c

index 58781e55ef358fe6743f8cf57bcbbc7c9ffa20cd..0824ad6c5044f2536bb0d39859561d2ee8c33aa5 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
+/** @file\r
+  UEFI Component Name and Name2 protocol for Isa serial driver.\r
 \r
-  \r
-Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, 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
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Serial.h"\r
 \r
+#define SERIAL_PORT_NAME  "ISA Serial Port # "\r
 //\r
 // EFI Component Name Protocol\r
 //\r
@@ -227,27 +228,19 @@ IsaSerialComponentNameGetControllerName (
            );\r
 }\r
 \r
-VOID\r
-AddName (\r
-  IN  SERIAL_DEV                               *SerialDevice,\r
-  IN  EFI_ISA_IO_PROTOCOL                      *IsaIo\r
-  )\r
 /**\r
+  Add the ISO639-2 and RFC4646 component name both for the Serial IO device\r
 \r
-  Routine Description:\r
-  \r
-    Add the component name for the serial io device\r
+  @param SerialDevice     A pointer to the SERIAL_DEV instance.\r
 \r
-  Arguments:\r
-  \r
-    SerialDevice              - A pointer to the SERIAL_DEV instance.\r
-    IsaIo                     - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-    \r
-  Returns:\r
+  @param IsaIo            A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
 \r
-    None\r
-    \r
 **/\r
+VOID\r
+AddName (\r
+  IN  SERIAL_DEV                               *SerialDevice,\r
+  IN  EFI_ISA_IO_PROTOCOL                      *IsaIo\r
+  )\r
 {\r
   CHAR16  SerialPortName[sizeof (SERIAL_PORT_NAME)];\r
 \r
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.h b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/ComponentName.h
deleted file mode 100644 (file)
index 6f404b1..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/**@file\r
-\r
-  \r
-Copyright (c) 2006 - 2007, 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _SERIAL_COMPONENT_NAME_H\r
-#define _SERIAL_COMPONENT_NAME_H\r
-\r
-#define SERIAL_PORT_NAME  "ISA Serial Port # "\r
-#define ADD_SERIAL_NAME(x, y)    AddName ((x), (y))\r
-\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gIsaSerialComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gIsaSerialComponentName2;\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-IsaSerialComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-IsaSerialComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-VOID\r
-AddName (\r
-  IN  SERIAL_DEV                                   *SerialDevice,\r
-  IN  EFI_ISA_IO_PROTOCOL                          *IsaIo\r
-  )\r
-/**\r
-\r
-  Routine Description:\r
-\r
-    Add the component name for the serial io device\r
-\r
-  Arguments:\r
-\r
-    SerialDevice              - A pointer to the SERIAL_DEV instance.\r
-    IsaIo                     - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-\r
-  Returns:\r
-\r
-    None\r
-\r
-**/\r
-;\r
-\r
-#endif\r
index 1118e0b8307b392ecd51f47254b4e64c947b5e02..aa7c315e1d8584927dfec82ee95d23d66d509c14 100644 (file)
@@ -1,7 +1,6 @@
 #/** @file\r
-# Component description file for IsaSerial module.\r
-#\r
 # Serial driver for standard UARTS on an ISA bus.\r
+#\r
 # Copyright (c) 2007 - 2009, Intel Corporation\r
 #\r
 # All rights reserved. This program and the accompanying materials\r
@@ -35,7 +34,6 @@
 \r
 [Sources.common]\r
   ComponentName.c\r
-  ComponentName.h\r
   Serial.h\r
   Serial.c\r
 \r
   DebugLib\r
 \r
 [Protocols]\r
-  gEfiIsaIoProtocolGuid                         # PROTOCOL TO_START\r
-  gEfiSerialIoProtocolGuid                      # PROTOCOL BY_START\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
+  gEfiIsaIoProtocolGuid                         ## TO_START\r
+  gEfiDevicePathProtocolGuid                    ## TO_START\r
+  gEfiSerialIoProtocolGuid                      ## BY_START\r
 \r
 [FixedPcd.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1\r
-\r
-\r
index 6a7713cdaf5f16b3a24d85d0bc2ec59ac0fa04d4..f9d08ce3a0cc6831973b14408b13102d21c9471b 100644 (file)
@@ -1,14 +1,14 @@
-/**@file\r
+/** @file\r
   Serial driver for standard UARTS on an ISA bus.\r
 \r
-  Copyright (c) 2006 - 2007, 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
-  http://opensource.org/licenses/bsd-license.php\r
+Copyright (c) 2006 - 2009, 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
+http://opensource.org/licenses/bsd-license.php\r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -82,7 +82,7 @@ SERIAL_DEV  gSerialDevTempate = {
   },\r
   FALSE,\r
   FALSE,\r
-  UART16550A,\r
+  Uart16550A,\r
   NULL\r
 };\r
 \r
@@ -125,11 +125,11 @@ InitializeIsaSerial (
 /**\r
   Check to see if this driver supports the given controller\r
 \r
-  @param  This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param  Controller - The handle of the controller to test.\r
-  @param  RemainingDevicePath - A pointer to the remaining portion of a device path.\r
+  @param  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller           The handle of the controller to test.\r
+  @param  RemainingDevicePath  A pointer to the remaining portion of a device path.\r
 \r
-  @return EFI_SUCCESS - This driver can support the given controller\r
+  @return EFI_SUCCESS          This driver can support the given controller\r
 \r
 **/\r
 EFI_STATUS\r
@@ -261,11 +261,11 @@ Error:
 /**\r
   Start to management the controller passed in\r
 \r
-  @param  This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param  Controller - The handle of the controller to test.\r
-  @param  RemainingDevicePath - A pointer to the remaining portion of a device path.\r
+  @param  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller           The handle of the controller to test.\r
+  @param  RemainingDevicePath  A pointer to the remaining portion of a device path.\r
 \r
-  @return EFI_SUCCESS - Driver is started successfully\r
+  @return EFI_SUCCESS   Driver is started successfully\r
 \r
 **/\r
 EFI_STATUS\r
@@ -388,7 +388,7 @@ SerialControllerDriverStart (
   SerialDevice->IsaIo               = IsaIo;\r
   SerialDevice->ParentDevicePath    = ParentDevicePath;\r
 \r
-  ADD_SERIAL_NAME (SerialDevice, IsaIo);\r
+  AddName (SerialDevice, IsaIo);\r
 \r
   for (Index = 0; SerialDevice->IsaIo->ResourceList->ResourceItem[Index].Type != EfiIsaAcpiResourceEndOfList; Index++) {\r
     if (SerialDevice->IsaIo->ResourceList->ResourceItem[Index].Type == EfiIsaAcpiResourceIo) {\r
@@ -501,8 +501,8 @@ Error:
            This->DriverBindingHandle,\r
            Controller\r
            );\r
-    if (SerialDevice) {\r
-      if (SerialDevice->DevicePath) {\r
+    if (SerialDevice != NULL) {\r
+      if (SerialDevice->DevicePath != NULL) {\r
         gBS->FreePool (SerialDevice->DevicePath);\r
       }\r
 \r
@@ -517,13 +517,13 @@ Error:
 /**\r
   Disconnect this driver with the controller, uninstall related protocol instance\r
 \r
-  @param  This                - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param  Controller          - The handle of the controller to test.\r
-  @param  NumberOfChildren    - Number of child device.\r
-  @param  ChildHandleBuffer   - A pointer to the remaining portion of a device path.\r
+  @param  This                  A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller            The handle of the controller to test.\r
+  @param  NumberOfChildren      Number of child device.\r
+  @param  ChildHandleBuffer     A pointer to the remaining portion of a device path.\r
 \r
-  @retval EFI_SUCCESS         - Operation successfully\r
-  @retval EFI_DEVICE_ERROR    - Cannot stop the driver successfully\r
+  @retval EFI_SUCCESS           Operation successfully\r
+  @retval EFI_DEVICE_ERROR      Cannot stop the driver successfully\r
 \r
 **/\r
 EFI_STATUS\r
@@ -624,7 +624,7 @@ SerialControllerDriverStop (
                EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
                );\r
       } else {\r
-        if (SerialDevice->DevicePath) {\r
+        if (SerialDevice->DevicePath != NULL) {\r
           gBS->FreePool (SerialDevice->DevicePath);\r
         }\r
 \r
@@ -646,9 +646,9 @@ SerialControllerDriverStop (
 }\r
 \r
 /**\r
-  Detect whether specific FIFO is full or not\r
+  Detect whether specific FIFO is full or not.\r
 \r
-  @param Fifo  - A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param Fifo    A pointer to the Data Structure SERIAL_DEV_FIFO\r
 \r
   @return whether specific FIFO is full or not\r
 \r
@@ -667,10 +667,9 @@ IsaSerialFifoFull (
 }\r
 \r
 /**\r
-  Detect whether specific FIFO is empty or not\r
-\r
+  Detect whether specific FIFO is empty or not.\r
  \r
-  @param  Fifo  - A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param  Fifo    A pointer to the Data Structure SERIAL_DEV_FIFO\r
 \r
   @return whether specific FIFO is empty or not\r
 \r
@@ -689,13 +688,13 @@ IsaSerialFifoEmpty (
 }\r
 \r
 /**\r
-  Add data to specific FIFO\r
+  Add data to specific FIFO.\r
 \r
-  @param Fifo                - A pointer to the Data Structure SERIAL_DEV_FIFO\r
-  @param Data                - the data added to FIFO\r
+  @param Fifo                  A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param Data                  the data added to FIFO\r
 \r
-  @retval EFI_SUCCESS         - Add data to specific FIFO successfully\r
-  @retval EFI_OUT_OF_RESOURCE - Failed to add data because FIFO is already full\r
+  @retval EFI_SUCCESS           Add data to specific FIFO successfully\r
+  @retval EFI_OUT_OF_RESOURCE   Failed to add data because FIFO is already full\r
 \r
 **/\r
 EFI_STATUS\r
@@ -725,13 +724,13 @@ IsaSerialFifoAdd (
 }\r
 \r
 /**\r
-  Remove data from specific FIFO\r
+  Remove data from specific FIFO.\r
 \r
-  @param Fifo                - A pointer to the Data Structure SERIAL_DEV_FIFO\r
-  @param Data                - the data removed from FIFO\r
+  @param Fifo                  A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param Data                  the data removed from FIFO\r
 \r
-  @retval EFI_SUCCESS         - Remove data from specific FIFO successfully\r
-  @retval EFI_OUT_OF_RESOURCE - Failed to remove data because FIFO is empty\r
+  @retval EFI_SUCCESS           Remove data from specific FIFO successfully\r
+  @retval EFI_OUT_OF_RESOURCE   Failed to remove data because FIFO is empty\r
 \r
 **/\r
 EFI_STATUS\r
@@ -763,10 +762,10 @@ IsaSerialFifoRemove (
 /**\r
   Reads and writes all avaliable data.\r
 \r
-  @param SerialDevice         - The device to flush\r
+  @param SerialDevice           The device to flush\r
 \r
-  @retval EFI_SUCCESS         - Data was read/written successfully.\r
-  @retval EFI_OUT_OF_RESOURCE - Failed because software receive FIFO is full.  Note, when\r
+  @retval EFI_SUCCESS           Data was read/written successfully.\r
+  @retval EFI_OUT_OF_RESOURCE   Failed because software receive FIFO is full.  Note, when\r
                                 this happens, pending writes are not done.\r
 \r
 **/\r
@@ -808,16 +807,16 @@ IsaSerialReceiveTransmit (
       //\r
       // Flush incomming data to prevent a an overrun during a long write\r
       //\r
-      if (Lsr.Bits.DR && !ReceiveFifoFull) {\r
+      if ((Lsr.Bits.Dr == 1) && !ReceiveFifoFull) {\r
         ReceiveFifoFull = IsaSerialFifoFull (&SerialDevice->Receive);\r
         if (!ReceiveFifoFull) {\r
-          if (Lsr.Bits.FIFOE || Lsr.Bits.OE || Lsr.Bits.PE || Lsr.Bits.FE || Lsr.Bits.BI) {\r
+          if (Lsr.Bits.FIFOe == 1 || Lsr.Bits.Oe == 1 || Lsr.Bits.Pe == 1 || Lsr.Bits.Fe == 1 || Lsr.Bits.Bi == 1) {\r
             REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
               EFI_ERROR_CODE,\r
               EFI_P_EC_INPUT_ERROR | EFI_PERIPHERAL_SERIAL_PORT,\r
               SerialDevice->DevicePath\r
               );\r
-            if (Lsr.Bits.FIFOE || Lsr.Bits.PE || Lsr.Bits.FE || Lsr.Bits.BI) {\r
+            if (Lsr.Bits.FIFOe == 1 || Lsr.Bits.Pe == 1|| Lsr.Bits.Fe == 1 || Lsr.Bits.Bi == 1) {\r
               Data = READ_RBR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
               continue;\r
             }\r
@@ -827,7 +826,7 @@ IsaSerialReceiveTransmit (
           //\r
           if (SerialDevice->HardwareFlowControl) {\r
             Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-            Mcr.Bits.DTRC &= 0;\r
+            Mcr.Bits.DtrC &= 0;\r
             WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
           }\r
 \r
@@ -838,7 +837,7 @@ IsaSerialReceiveTransmit (
           //\r
           if (SerialDevice->HardwareFlowControl) {\r
             Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-            Mcr.Bits.DTRC |= 1;\r
+            Mcr.Bits.DtrC |= 1;\r
             WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
           }\r
 \r
@@ -856,7 +855,7 @@ IsaSerialReceiveTransmit (
       //\r
       // Do the write\r
       //\r
-      if (Lsr.Bits.THRE && !IsaSerialFifoEmpty (&SerialDevice->Transmit)) {\r
+      if (Lsr.Bits.Thre == 1 && !IsaSerialFifoEmpty (&SerialDevice->Transmit)) {\r
         //\r
         // Make sure the transmit data will not be missed\r
         //\r
@@ -865,14 +864,14 @@ IsaSerialReceiveTransmit (
           // Send RTS\r
           //\r
           Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-          Mcr.Bits.RTS |= 1;\r
+          Mcr.Bits.Rts |= 1;\r
           WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
           //\r
           // Wait for CTS\r
           //\r
           TimeOut   = 0;\r
           Msr.Data  = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-          while (!Msr.Bits.CTS) {\r
+          while (Msr.Bits.Cts == 0) {\r
             gBS->Stall (TIMEOUT_STALL_INTERVAL);\r
             TimeOut++;\r
             if (TimeOut > 5) {\r
@@ -882,7 +881,7 @@ IsaSerialReceiveTransmit (
             Msr.Data = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
           }\r
 \r
-          if (Msr.Bits.CTS) {\r
+          if (Msr.Bits.Cts == 1) {\r
             IsaSerialFifoRemove (&SerialDevice->Transmit, &Data);\r
             WRITE_THR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Data);\r
           }\r
@@ -902,11 +901,11 @@ IsaSerialReceiveTransmit (
           // Assert RTS\r
           //\r
           Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-          Mcr.Bits.RTS &= 0;\r
+          Mcr.Bits.Rts &= 0;\r
           WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
         }\r
       }\r
-    } while (Lsr.Bits.THRE && !IsaSerialFifoEmpty (&SerialDevice->Transmit));\r
+    } while (Lsr.Bits.Thre == 1 && !IsaSerialFifoEmpty (&SerialDevice->Transmit));\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -916,12 +915,12 @@ IsaSerialReceiveTransmit (
 // Interface Functions\r
 //\r
 /**\r
-  Reset serial device\r
+  Reset serial device.\r
 \r
-  @param This             - Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param This               Pointer to EFI_SERIAL_IO_PROTOCOL\r
 \r
-  @retval EFI_SUCCESS      - Reset successfully\r
-  @retval EFI_DEVICE_ERROR - Failed to reset\r
+  @retval EFI_SUCCESS        Reset successfully\r
+  @retval EFI_DEVICE_ERROR   Failed to reset\r
 \r
 **/\r
 EFI_STATUS\r
@@ -955,32 +954,32 @@ IsaSerialReset (
   // Make sure DLAB is 0.\r
   //\r
   Lcr.Data      = READ_LCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-  Lcr.Bits.DLAB = 0;\r
+  Lcr.Bits.DLab = 0;\r
   WRITE_LCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Lcr.Data);\r
 \r
   //\r
   // Turn off all interrupts\r
   //\r
   Ier.Data        = READ_IER (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-  Ier.Bits.RAVIE  = 0;\r
-  Ier.Bits.THEIE  = 0;\r
-  Ier.Bits.RIE    = 0;\r
-  Ier.Bits.MIE    = 0;\r
+  Ier.Bits.Ravie  = 0;\r
+  Ier.Bits.Theie  = 0;\r
+  Ier.Bits.Rie    = 0;\r
+  Ier.Bits.Mie    = 0;\r
   WRITE_IER (SerialDevice->IsaIo, SerialDevice->BaseAddress, Ier.Data);\r
 \r
   //\r
   // Disable the FIFO.\r
   //\r
-  Fcr.Bits.TRFIFOE = 0;\r
+  Fcr.Bits.TrFIFOE = 0;\r
   WRITE_FCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Fcr.Data);\r
 \r
   //\r
   // Turn off loopback and disable device interrupt.\r
   //\r
   Mcr.Data      = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-  Mcr.Bits.OUT1 = 0;\r
-  Mcr.Bits.OUT2 = 0;\r
-  Mcr.Bits.LME  = 0;\r
+  Mcr.Bits.Out1 = 0;\r
+  Mcr.Bits.Out2 = 0;\r
+  Mcr.Bits.Lme  = 0;\r
   WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
 \r
   //\r
@@ -1020,9 +1019,9 @@ IsaSerialReset (
   //\r
   // for 16550A enable FIFO, 16550 disable FIFO\r
   //\r
-  Fcr.Bits.TRFIFOE  = 1;\r
-  Fcr.Bits.RESETRF  = 1;\r
-  Fcr.Bits.RESETTF  = 1;\r
+  Fcr.Bits.TrFIFOE  = 1;\r
+  Fcr.Bits.ResetRF  = 1;\r
+  Fcr.Bits.ResetTF  = 1;\r
   WRITE_FCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Fcr.Data);\r
 \r
   //\r
@@ -1044,20 +1043,20 @@ IsaSerialReset (
 }\r
 \r
 /**\r
-  Set new attributes to a serial device\r
+  Set new attributes to a serial device.\r
 \r
-  @param This                   - Pointer to EFI_SERIAL_IO_PROTOCOL\r
-  @param  BaudRate               - The baudrate of the serial device\r
-  @param  ReceiveFifoDepth       - The depth of receive FIFO buffer\r
-  @param  Timeout                - The request timeout for a single char\r
-  @param  Parity                 - The type of parity used in serial device\r
-  @param  DataBits               - Number of databits used in serial device\r
-  @param  StopBits               - Number of stopbits used in serial device\r
+  @param This                     Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param  BaudRate                 The baudrate of the serial device\r
+  @param  ReceiveFifoDepth         The depth of receive FIFO buffer\r
+  @param  Timeout                  The request timeout for a single char\r
+  @param  Parity                   The type of parity used in serial device\r
+  @param  DataBits                 Number of databits used in serial device\r
+  @param  StopBits                 Number of stopbits used in serial device\r
 \r
-  @retval  EFI_SUCCESS            - The new attributes were set\r
-  @retval  EFI_INVALID_PARAMETERS - One or more attributes have an unsupported value\r
-  @retval  EFI_UNSUPPORTED        - Data Bits can not set to 5 or 6\r
-  @retval  EFI_DEVICE_ERROR       - The serial device is not functioning correctly (no return)\r
+  @retval  EFI_SUCCESS              The new attributes were set\r
+  @retval  EFI_INVALID_PARAMETERS   One or more attributes have an unsupported value\r
+  @retval  EFI_UNSUPPORTED          Data Bits can not set to 5 or 6\r
+  @retval  EFI_DEVICE_ERROR         The serial device is not functioning correctly (no return)\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1205,11 +1204,11 @@ IsaSerialSetAttributes (
                        ((UINT32) BaudRate * 16),\r
                        &Remained\r
                        );\r
-  if (Remained) {\r
+  if (Remained != 0) {\r
     Divisor += 1;\r
   }\r
 \r
-  if ((Divisor == 0) || (Divisor & 0xffff0000)) {\r
+  if ((Divisor == 0) || ((Divisor & 0xffff0000) != 0)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1224,7 +1223,7 @@ IsaSerialSetAttributes (
   // Put serial port on Divisor Latch Mode\r
   //\r
   Lcr.Data      = READ_LCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-  Lcr.Bits.DLAB = 1;\r
+  Lcr.Bits.DLab = 1;\r
   WRITE_LCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Lcr.Data);\r
 \r
   //\r
@@ -1236,37 +1235,37 @@ IsaSerialSetAttributes (
   //\r
   // Put serial port back in normal mode and set remaining attributes.\r
   //\r
-  Lcr.Bits.DLAB = 0;\r
+  Lcr.Bits.DLab = 0;\r
 \r
   switch (Parity) {\r
   case NoParity:\r
-    Lcr.Bits.PAREN    = 0;\r
-    Lcr.Bits.EVENPAR  = 0;\r
-    Lcr.Bits.STICPAR  = 0;\r
+    Lcr.Bits.ParEn    = 0;\r
+    Lcr.Bits.EvenPar  = 0;\r
+    Lcr.Bits.SticPar  = 0;\r
     break;\r
 \r
   case EvenParity:\r
-    Lcr.Bits.PAREN    = 1;\r
-    Lcr.Bits.EVENPAR  = 1;\r
-    Lcr.Bits.STICPAR  = 0;\r
+    Lcr.Bits.ParEn    = 1;\r
+    Lcr.Bits.EvenPar  = 1;\r
+    Lcr.Bits.SticPar  = 0;\r
     break;\r
 \r
   case OddParity:\r
-    Lcr.Bits.PAREN    = 1;\r
-    Lcr.Bits.EVENPAR  = 0;\r
-    Lcr.Bits.STICPAR  = 0;\r
+    Lcr.Bits.ParEn    = 1;\r
+    Lcr.Bits.EvenPar  = 0;\r
+    Lcr.Bits.SticPar  = 0;\r
     break;\r
 \r
   case SpaceParity:\r
-    Lcr.Bits.PAREN    = 1;\r
-    Lcr.Bits.EVENPAR  = 1;\r
-    Lcr.Bits.STICPAR  = 1;\r
+    Lcr.Bits.ParEn    = 1;\r
+    Lcr.Bits.EvenPar  = 1;\r
+    Lcr.Bits.SticPar  = 1;\r
     break;\r
 \r
   case MarkParity:\r
-    Lcr.Bits.PAREN    = 1;\r
-    Lcr.Bits.EVENPAR  = 0;\r
-    Lcr.Bits.STICPAR  = 1;\r
+    Lcr.Bits.ParEn    = 1;\r
+    Lcr.Bits.EvenPar  = 0;\r
+    Lcr.Bits.SticPar  = 1;\r
     break;\r
 \r
   default:\r
@@ -1275,12 +1274,12 @@ IsaSerialSetAttributes (
 \r
   switch (StopBits) {\r
   case OneStopBit:\r
-    Lcr.Bits.STOPB = 0;\r
+    Lcr.Bits.StopB = 0;\r
     break;\r
 \r
   case OneFiveStopBits:\r
   case TwoStopBits:\r
-    Lcr.Bits.STOPB = 1;\r
+    Lcr.Bits.StopB = 1;\r
     break;\r
 \r
   default:\r
@@ -1289,7 +1288,7 @@ IsaSerialSetAttributes (
   //\r
   // DataBits\r
   //\r
-  Lcr.Bits.SERIALDB = (UINT8) ((DataBits - 5) & 0x03);\r
+  Lcr.Bits.SerialDB = (UINT8) ((DataBits - 5) & 0x03);\r
   WRITE_LCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Lcr.Data);\r
 \r
   //\r
@@ -1343,7 +1342,7 @@ IsaSerialSetAttributes (
     }\r
   }\r
 \r
-  if (SerialDevice->DevicePath) {\r
+  if (SerialDevice->DevicePath != NULL) {\r
     gBS->FreePool (SerialDevice->DevicePath);\r
   }\r
 \r
@@ -1355,13 +1354,13 @@ IsaSerialSetAttributes (
 }\r
 \r
 /**\r
-  Set Control Bits\r
+  Set Control Bits.\r
 \r
-  @param This            - Pointer to EFI_SERIAL_IO_PROTOCOL\r
-  @param Control         - Control bits that can be settable\r
+  @param This              Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param Control           Control bits that can be settable\r
 \r
-  @retval EFI_SUCCESS     - New Control bits were set successfully\r
-  @retval EFI_UNSUPPORTED - The Control bits wanted to set are not supported\r
+  @retval EFI_SUCCESS       New Control bits were set successfully\r
+  @retval EFI_UNSUPPORTED   The Control bits wanted to set are not supported\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1387,38 +1386,38 @@ IsaSerialSetControl (
   //\r
   // first determine the parameter is invalid\r
   //\r
-  if (Control & 0xffff8ffc) {\r
+  if ((Control & 0xffff8ffc) != 0) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
   Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-  Mcr.Bits.DTRC = 0;\r
-  Mcr.Bits.RTS = 0;\r
-  Mcr.Bits.LME = 0;\r
+  Mcr.Bits.DtrC = 0;\r
+  Mcr.Bits.Rts = 0;\r
+  Mcr.Bits.Lme = 0;\r
   SerialDevice->SoftwareLoopbackEnable = FALSE;\r
   SerialDevice->HardwareFlowControl = FALSE;\r
 \r
-  if (Control & EFI_SERIAL_DATA_TERMINAL_READY) {\r
-    Mcr.Bits.DTRC = 1;\r
+  if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) == EFI_SERIAL_DATA_TERMINAL_READY) {\r
+    Mcr.Bits.DtrC = 1;\r
   }\r
 \r
-  if (Control & EFI_SERIAL_REQUEST_TO_SEND) {\r
-    Mcr.Bits.RTS = 1;\r
+  if ((Control & EFI_SERIAL_REQUEST_TO_SEND) == EFI_SERIAL_REQUEST_TO_SEND) {\r
+    Mcr.Bits.Rts = 1;\r
   }\r
 \r
-  if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) {\r
-    Mcr.Bits.LME = 1;\r
+  if ((Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) == EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) {\r
+    Mcr.Bits.Lme = 1;\r
   }\r
 \r
-  if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) {\r
+  if ((Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) == EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) {\r
     SerialDevice->HardwareFlowControl = TRUE;\r
   }\r
 \r
   WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);\r
 \r
-  if (Control & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) {\r
+  if ((Control & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) == EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) {\r
     SerialDevice->SoftwareLoopbackEnable = TRUE;\r
   }\r
 \r
@@ -1428,12 +1427,12 @@ IsaSerialSetControl (
 }\r
 \r
 /**\r
-  Get ControlBits\r
+  Get ControlBits.\r
 \r
-  @param This        - Pointer to EFI_SERIAL_IO_PROTOCOL\r
-  @param Control     - Control signals of the serial device\r
+  @param This          Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param Control       Control signals of the serial device\r
 \r
-  @retval EFI_SUCCESS - Get Control signals successfully\r
+  @retval EFI_SUCCESS   Get Control signals successfully\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1459,19 +1458,19 @@ IsaSerialGetControl (
   //\r
   Msr.Data = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
 \r
-  if (Msr.Bits.CTS) {\r
+  if (Msr.Bits.Cts == 1) {\r
     *Control |= EFI_SERIAL_CLEAR_TO_SEND;\r
   }\r
 \r
-  if (Msr.Bits.DSR) {\r
+  if (Msr.Bits.Dsr == 1) {\r
     *Control |= EFI_SERIAL_DATA_SET_READY;\r
   }\r
 \r
-  if (Msr.Bits.RI) {\r
+  if (Msr.Bits.Ri == 1) {\r
     *Control |= EFI_SERIAL_RING_INDICATE;\r
   }\r
 \r
-  if (Msr.Bits.DCD) {\r
+  if (Msr.Bits.Dcd == 1) {\r
     *Control |= EFI_SERIAL_CARRIER_DETECT;\r
   }\r
   //\r
@@ -1479,15 +1478,15 @@ IsaSerialGetControl (
   //\r
   Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
 \r
-  if (Mcr.Bits.DTRC) {\r
+  if (Mcr.Bits.DtrC == 1) {\r
     *Control |= EFI_SERIAL_DATA_TERMINAL_READY;\r
   }\r
 \r
-  if (Mcr.Bits.RTS) {\r
+  if (Mcr.Bits.Rts == 1) {\r
     *Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
   }\r
 \r
-  if (Mcr.Bits.LME) {\r
+  if (Mcr.Bits.Lme == 1) {\r
     *Control |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
   }\r
 \r
@@ -1521,16 +1520,16 @@ IsaSerialGetControl (
 }\r
 \r
 /**\r
-  Write the specified number of bytes to serial device\r
+  Write the specified number of bytes to serial device.\r
 \r
-  @param This             - Pointer to EFI_SERIAL_IO_PROTOCOL\r
-  @param  BufferSize       - On input the size of Buffer, on output the amount of\r
+  @param This               Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param  BufferSize         On input the size of Buffer, on output the amount of\r
                        data actually written\r
-  @param  Buffer           - The buffer of data to write\r
+  @param  Buffer             The buffer of data to write\r
 \r
-  @retval EFI_SUCCESS      - The data were written successfully\r
-  @retval EFI_DEVICE_ERROR - The device reported an error\r
-  @retval EFI_TIMEOUT      - The write operation was stopped due to timeout\r
+  @retval EFI_SUCCESS        The data were written successfully\r
+  @retval EFI_DEVICE_ERROR   The device reported an error\r
+  @retval EFI_TIMEOUT        The write operation was stopped due to timeout\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1556,7 +1555,7 @@ IsaSerialWrite (
     return EFI_SUCCESS;\r
   }\r
 \r
-  if (!Buffer) {\r
+  if (Buffer == NULL) {\r
     REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
       EFI_ERROR_CODE,\r
       EFI_P_EC_OUTPUT_ERROR | EFI_PERIPHERAL_SERIAL_PORT,\r
@@ -1602,16 +1601,16 @@ IsaSerialWrite (
 }\r
 \r
 /**\r
-  Read the specified number of bytes from serial device\r
+  Read the specified number of bytes from serial device.\r
 \r
-  @param This             - Pointer to EFI_SERIAL_IO_PROTOCOL\r
-  @param BufferSize       - On input the size of Buffer, on output the amount of\r
-                       data returned in buffer\r
-  @param Buffer           -  The buffer to return the data into\r
+  @param This               Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param BufferSize         On input the size of Buffer, on output the amount of\r
+                            data returned in buffer\r
+  @param Buffer             The buffer to return the data into\r
 \r
-  @retval EFI_SUCCESS      - The data were read successfully\r
-  @retval EFI_DEVICE_ERROR - The device reported an error\r
-  @retval EFI_TIMEOUT      - The read operation was stopped due to timeout\r
+  @retval EFI_SUCCESS        The data were read successfully\r
+  @retval EFI_DEVICE_ERROR   The device reported an error\r
+  @retval EFI_TIMEOUT        The read operation was stopped due to timeout\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1636,7 +1635,7 @@ IsaSerialRead (
     return EFI_SUCCESS;\r
   }\r
 \r
-  if (!Buffer) {\r
+  if (Buffer == NULL) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
@@ -1696,9 +1695,9 @@ IsaSerialRead (
 }\r
 \r
 /**\r
-  Use scratchpad register to test if this serial port is present\r
+  Use scratchpad register to test if this serial port is present.\r
 \r
-  @param SerialDevice - Pointer to serial device structure\r
+  @param SerialDevice   Pointer to serial device structure\r
 \r
   @return if this serial port is present\r
 **/\r
@@ -1736,11 +1735,11 @@ IsaSerialPortPresent (
 }\r
 \r
 /**\r
-  Use IsaIo protocol to read serial port\r
+  Use IsaIo protocol to read serial port.\r
 \r
-  @param IsaIo       - Pointer to EFI_ISA_IO_PROTOCOL instance\r
-  @param BaseAddress - Serial port register group base address\r
-  @param Offset      - Offset in register group\r
+  @param IsaIo         Pointer to EFI_ISA_IO_PROTOCOL instance\r
+  @param BaseAddress   Serial port register group base address\r
+  @param Offset        Offset in register group\r
 \r
   @return Data read from serial port\r
 \r
@@ -1768,12 +1767,12 @@ IsaSerialReadPort (
 }\r
 \r
 /**\r
-  Use IsaIo protocol to write serial port\r
+  Use IsaIo protocol to write serial port.\r
 \r
-  @param  IsaIo       - Pointer to EFI_ISA_IO_PROTOCOL instance\r
-  @param  BaseAddress - Serial port register group base address\r
-  @param  Offset      - Offset in register group\r
-  @param  Data        - data which is to be written to some serial port register\r
+  @param  IsaIo         Pointer to EFI_ISA_IO_PROTOCOL instance\r
+  @param  BaseAddress   Serial port register group base address\r
+  @param  Offset        Offset in register group\r
+  @param  Data          data which is to be written to some serial port register\r
 \r
 **/\r
 VOID\r
index af4428a99622cea3625e271102bd4b4ea19b082a..c7f2105f6264095f5f45cd08f2574ab82c99e2aa 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
+/** @file\r
   Include for Serial Driver\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, 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 _SERIAL_H\r
-#define _SERIAL_H\r
+#ifndef _SERIAL_H_\r
+#define _SERIAL_H_\r
 \r
 \r
 #include <PiDxe.h>\r
@@ -33,6 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/PcdLib.h>\r
+\r
 //\r
 // Driver Binding Externs\r
 //\r
@@ -65,10 +66,10 @@ typedef struct {
 } SERIAL_DEV_FIFO;\r
 \r
 typedef enum {\r
-  UART8250  = 0,\r
-  UART16450 = 1,\r
-  UART16550 = 2,\r
-  UART16550A= 3\r
+  Uart8250  = 0,\r
+  Uart16450 = 1,\r
+  Uart16550 = 2,\r
+  Uart16550A= 3\r
 } EFI_UART_TYPE;\r
 \r
 //\r
@@ -110,23 +111,13 @@ typedef struct {
   EFI_UNICODE_STRING_TABLE               *ControllerNameTable;\r
 } SERIAL_DEV;\r
 \r
-#include "ComponentName.h"\r
-\r
 #define SERIAL_DEV_FROM_THIS(a) CR (a, SERIAL_DEV, SerialIo, SERIAL_DEV_SIGNATURE)\r
 \r
-\r
 //\r
 // Serial Driver Defaults\r
 //\r
 #define SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH  1\r
 #define SERIAL_PORT_DEFAULT_TIMEOUT             1000000\r
-\r
-/*\r
-#define SERIAL_PORT_DEFAULT_BAUD_RATE           115200\r
-#define SERIAL_PORT_DEFAULT_PARITY              NoParity\r
-#define SERIAL_PORT_DEFAULT_DATA_BITS           8\r
-#define SERIAL_PORT_DEFAULT_STOP_BITS           1\r
-*/\r
 #define SERIAL_PORT_DEFAULT_CONTROL_MASK        0\r
 \r
 \r
@@ -165,17 +156,17 @@ typedef struct {
 //  Purpose:  Define each bit in Interrupt Enable Register\r
 //  Context:\r
 //  Fields:\r
-//     RAVIE  Bit0: Receiver Data Available Interrupt Enable\r
-//     THEIE  Bit1: Transmistter Holding Register Empty Interrupt Enable\r
-//     RIE      Bit2: Receiver Interrupt Enable\r
-//     MIE      Bit3: Modem Interrupt Enable\r
+//     Ravie  Bit0: Receiver Data Available Interrupt Enable\r
+//     Theie  Bit1: Transmistter Holding Register Empty Interrupt Enable\r
+//     Rie      Bit2: Receiver Interrupt Enable\r
+//     Mie      Bit3: Modem Interrupt Enable\r
 //     Reserved Bit4-Bit7: Reserved\r
 //\r
 typedef struct {\r
-  UINT8 RAVIE : 1;\r
-  UINT8 THEIE : 1;\r
-  UINT8 RIE : 1;\r
-  UINT8 MIE : 1;\r
+  UINT8 Ravie : 1;\r
+  UINT8 Theie : 1;\r
+  UINT8 Rie : 1;\r
+  UINT8 Mie : 1;\r
   UINT8 Reserved : 4;\r
 } SERIAL_PORT_IER_BITS;\r
 \r
@@ -192,55 +183,25 @@ typedef union {
   UINT8                 Data;\r
 } SERIAL_PORT_IER;\r
 \r
-//\r
-//  Name:   SERIAL_PORT_IIR_BITS\r
-//  Purpose:  Define each bit in Interrupt Identification Register\r
-//  Context:\r
-//  Fields:\r
-//      IPS    Bit0: Interrupt Pending Status\r
-//      IIB    Bit1-Bit3: Interrupt ID Bits\r
-//      Reserved Bit4-Bit5: Reserved\r
-//      FIFOES   Bit6-Bit7: FIFO Mode Enable Status\r
-//\r
-typedef struct {\r
-  UINT8 IPS : 1;\r
-  UINT8 IIB : 3;\r
-  UINT8 Reserved : 2;\r
-  UINT8 FIFOES : 2;\r
-} SERIAL_PORT_IIR_BITS;\r
-\r
-//\r
-//  Name:   SERIAL_PORT_IIR\r
-//  Purpose:\r
-//  Context:\r
-//  Fields:\r
-//      Bits    SERIAL_PORT_IIR_BITS:  Bits of the IIR\r
-//      Data    UINT8: the value of the IIR\r
-//\r
-typedef union {\r
-  SERIAL_PORT_IIR_BITS  Bits;\r
-  UINT8                 Data;\r
-} SERIAL_PORT_IIR;\r
-\r
 //\r
 //  Name:   SERIAL_PORT_FCR_BITS\r
 //  Purpose:  Define each bit in FIFO Control Register\r
 //  Context:\r
 //  Fields:\r
-//      TRFIFOE    Bit0: Transmit and Receive FIFO Enable\r
-//      RESETRF    Bit1: Reset Reciever FIFO\r
-//      RESETTF    Bit2: Reset Transmistter FIFO\r
-//      DMS        Bit3: DMA Mode Select\r
+//      TrFIFOE    Bit0: Transmit and Receive FIFO Enable\r
+//      ResetRF    Bit1: Reset Reciever FIFO\r
+//      ResetTF    Bit2: Reset Transmistter FIFO\r
+//      Dms        Bit3: DMA Mode Select\r
 //      Reserved   Bit4-Bit5: Reserved\r
-//      RTB        Bit6-Bit7: Receive Trigger Bits\r
+//      Rtb        Bit6-Bit7: Receive Trigger Bits\r
 //\r
 typedef struct {\r
-  UINT8 TRFIFOE : 1;\r
-  UINT8 RESETRF : 1;\r
-  UINT8 RESETTF : 1;\r
-  UINT8 DMS : 1;\r
+  UINT8 TrFIFOE : 1;\r
+  UINT8 ResetRF : 1;\r
+  UINT8 ResetTF : 1;\r
+  UINT8 Dms : 1;\r
   UINT8 Reserved : 2;\r
-  UINT8 RTB : 2;\r
+  UINT8 Rtb : 2;\r
 } SERIAL_PORT_FCR_BITS;\r
 \r
 //\r
@@ -261,22 +222,22 @@ typedef union {
 //  Purpose:  Define each bit in Line Control Register\r
 //  Context:\r
 //  Fields:\r
-//      SERIALDB  Bit0-Bit1: Number of Serial Data Bits\r
-//      STOPB   Bit2: Number of Stop Bits\r
-//      PAREN   Bit3: Parity Enable\r
-//      EVENPAR   Bit4: Even Parity Select\r
-//      STICPAR   Bit5: Sticky Parity\r
-//      BRCON   Bit6: Break Control\r
-//      DLAB    Bit7: Divisor Latch Access Bit\r
+//      SerialDB  Bit0-Bit1: Number of Serial Data Bits\r
+//      StopB     Bit2: Number of Stop Bits\r
+//      ParEn     Bit3: Parity Enable\r
+//      EvenPar   Bit4: Even Parity Select\r
+//      SticPar   Bit5: Sticky Parity\r
+//      BrCon     Bit6: Break Control\r
+//      DLab      Bit7: Divisor Latch Access Bit\r
 //\r
 typedef struct {\r
-  UINT8 SERIALDB : 2;\r
-  UINT8 STOPB : 1;\r
-  UINT8 PAREN : 1;\r
-  UINT8 EVENPAR : 1;\r
-  UINT8 STICPAR : 1;\r
-  UINT8 BRCON : 1;\r
-  UINT8 DLAB : 1;\r
+  UINT8 SerialDB : 2;\r
+  UINT8 StopB : 1;\r
+  UINT8 ParEn : 1;\r
+  UINT8 EvenPar : 1;\r
+  UINT8 SticPar : 1;\r
+  UINT8 BrCon : 1;\r
+  UINT8 DLab : 1;\r
 } SERIAL_PORT_LCR_BITS;\r
 \r
 //\r
@@ -297,19 +258,19 @@ typedef union {
 //  Purpose:  Define each bit in Modem Control Register\r
 //  Context:\r
 //  Fields:\r
-//      DTRC     Bit0: Data Terminal Ready Control\r
-//      RTS      Bit1: Request To Send Control\r
-//      OUT1     Bit2: Output1\r
-//      OUT2     Bit3: Output2, used to disable interrupt\r
-//      LME;     Bit4: Loopback Mode Enable\r
+//      DtrC     Bit0: Data Terminal Ready Control\r
+//      Rts      Bit1: Request To Send Control\r
+//      Out1     Bit2: Output1\r
+//      Out2     Bit3: Output2, used to disable interrupt\r
+//      Lme;     Bit4: Loopback Mode Enable\r
 //      Reserved Bit5-Bit7: Reserved\r
 //\r
 typedef struct {\r
-  UINT8 DTRC : 1;\r
-  UINT8 RTS : 1;\r
-  UINT8 OUT1 : 1;\r
-  UINT8 OUT2 : 1;\r
-  UINT8 LME : 1;\r
+  UINT8 DtrC : 1;\r
+  UINT8 Rts : 1;\r
+  UINT8 Out1 : 1;\r
+  UINT8 Out2 : 1;\r
+  UINT8 Lme : 1;\r
   UINT8 Reserved : 3;\r
 } SERIAL_PORT_MCR_BITS;\r
 \r
@@ -331,24 +292,24 @@ typedef union {
 //  Purpose:  Define each bit in Line Status Register\r
 //  Context:\r
 //  Fields:\r
-//      DR    Bit0: Receiver Data Ready Status\r
-//      OE    Bit1: Overrun Error Status\r
-//      PE    Bit2: Parity Error Status\r
-//      FE    Bit3: Framing Error Status\r
-//      BI    Bit4: Break Interrupt Status\r
-//      THRE  Bit5: Transmistter Holding Register Status\r
-//      TEMT  Bit6: Transmitter Empty Status\r
-//      FIFOE Bit7: FIFO Error Status\r
+//      Dr    Bit0: Receiver Data Ready Status\r
+//      Oe    Bit1: Overrun Error Status\r
+//      Pe    Bit2: Parity Error Status\r
+//      Fe    Bit3: Framing Error Status\r
+//      Bi    Bit4: Break Interrupt Status\r
+//      Thre  Bit5: Transmistter Holding Register Status\r
+//      Temt  Bit6: Transmitter Empty Status\r
+//      FIFOe Bit7: FIFO Error Status\r
 //\r
 typedef struct {\r
-  UINT8 DR : 1;\r
-  UINT8 OE : 1;\r
-  UINT8 PE : 1;\r
-  UINT8 FE : 1;\r
-  UINT8 BI : 1;\r
-  UINT8 THRE : 1;\r
-  UINT8 TEMT : 1;\r
-  UINT8 FIFOE : 1;\r
+  UINT8 Dr : 1;\r
+  UINT8 Oe : 1;\r
+  UINT8 Pe : 1;\r
+  UINT8 Fe : 1;\r
+  UINT8 Bi : 1;\r
+  UINT8 Thre : 1;\r
+  UINT8 Temt : 1;\r
+  UINT8 FIFOe : 1;\r
 } SERIAL_PORT_LSR_BITS;\r
 \r
 //\r
@@ -373,20 +334,20 @@ typedef union {
 //      DeltaDSR        Bit1: Delta Data Set Ready Status\r
 //      TrailingEdgeRI  Bit2: Trailing Edge of Ring Indicator Status\r
 //      DeltaDCD        Bit3: Delta Data Carrier Detect Status\r
-//      CTS             Bit4: Clear To Send Status\r
-//      DSR             Bit5: Data Set Ready Status\r
-//      RI              Bit6: Ring Indicator Status\r
-//      DCD             Bit7: Data Carrier Detect Status\r
+//      Cts             Bit4: Clear To Send Status\r
+//      Dsr             Bit5: Data Set Ready Status\r
+//      Ri              Bit6: Ring Indicator Status\r
+//      Dcd             Bit7: Data Carrier Detect Status\r
 //\r
 typedef struct {\r
   UINT8 DeltaCTS : 1;\r
   UINT8 DeltaDSR : 1;\r
   UINT8 TrailingEdgeRI : 1;\r
   UINT8 DeltaDCD : 1;\r
-  UINT8 CTS : 1;\r
-  UINT8 DSR : 1;\r
-  UINT8 RI : 1;\r
-  UINT8 DCD : 1;\r
+  UINT8 Cts : 1;\r
+  UINT8 Dsr : 1;\r
+  UINT8 Ri : 1;\r
+  UINT8 Dcd : 1;\r
 } SERIAL_PORT_MSR_BITS;\r
 \r
 //\r
@@ -432,7 +393,16 @@ typedef union {
 // Prototypes\r
 // Driver model protocol interface\r
 //\r
+/**\r
+  Check to see if this driver supports the given controller\r
 \r
+  @param  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller           The handle of the controller to test.\r
+  @param  RemainingDevicePath  A pointer to the remaining portion of a device path.\r
+\r
+  @return EFI_SUCCESS          This driver can support the given controller\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SerialControllerDriverSupported (\r
@@ -441,6 +411,15 @@ SerialControllerDriverSupported (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start to management the controller passed in\r
+\r
+  @param  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller           The handle of the controller to test.\r
+  @param  RemainingDevicePath  A pointer to the remaining portion of a device path.\r
+\r
+  @return EFI_SUCCESS          Driver is started successfully\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SerialControllerDriverStart (\r
@@ -449,6 +428,18 @@ SerialControllerDriverStart (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Disconnect this driver with the controller, uninstall related protocol instance\r
+\r
+  @param  This                  A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param  Controller            The handle of the controller to test.\r
+  @param  NumberOfChildren      Number of child device.\r
+  @param  ChildHandleBuffer     A pointer to the remaining portion of a device path.\r
+\r
+  @retval EFI_SUCCESS           Operation successfully\r
+  @retval EFI_DEVICE_ERROR      Cannot stop the driver successfully\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SerialControllerDriverStop (\r
@@ -461,12 +452,38 @@ SerialControllerDriverStop (
 //\r
 // Serial I/O Protocol Interface\r
 //\r
+/**\r
+  Reset serial device.\r
+\r
+  @param This               Pointer to EFI_SERIAL_IO_PROTOCOL\r
+\r
+  @retval EFI_SUCCESS        Reset successfully\r
+  @retval EFI_DEVICE_ERROR   Failed to reset\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialReset (\r
   IN EFI_SERIAL_IO_PROTOCOL         *This\r
   );\r
 \r
+/**\r
+  Set new attributes to a serial device.\r
+\r
+  @param This                     Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param  BaudRate                 The baudrate of the serial device\r
+  @param  ReceiveFifoDepth         The depth of receive FIFO buffer\r
+  @param  Timeout                  The request timeout for a single char\r
+  @param  Parity                   The type of parity used in serial device\r
+  @param  DataBits                 Number of databits used in serial device\r
+  @param  StopBits                 Number of stopbits used in serial device\r
+\r
+  @retval  EFI_SUCCESS              The new attributes were set\r
+  @retval  EFI_INVALID_PARAMETERS   One or more attributes have an unsupported value\r
+  @retval  EFI_UNSUPPORTED          Data Bits can not set to 5 or 6\r
+  @retval  EFI_DEVICE_ERROR         The serial device is not functioning correctly (no return)\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialSetAttributes (\r
@@ -479,6 +496,16 @@ IsaSerialSetAttributes (
   IN EFI_STOP_BITS_TYPE             StopBits\r
   );\r
 \r
+/**\r
+  Set Control Bits.\r
+\r
+  @param This              Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param Control           Control bits that can be settable\r
+\r
+  @retval EFI_SUCCESS       New Control bits were set successfully\r
+  @retval EFI_UNSUPPORTED   The Control bits wanted to set are not supported\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialSetControl (\r
@@ -486,6 +513,15 @@ IsaSerialSetControl (
   IN UINT32                         Control\r
   );\r
 \r
+/**\r
+  Get ControlBits.\r
+\r
+  @param This          Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param Control       Control signals of the serial device\r
+\r
+  @retval EFI_SUCCESS   Get Control signals successfully\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialGetControl (\r
@@ -493,6 +529,19 @@ IsaSerialGetControl (
   OUT UINT32                        *Control\r
   );\r
 \r
+/**\r
+  Write the specified number of bytes to serial device.\r
+\r
+  @param This                Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param  BufferSize         On input the size of Buffer, on output the amount of\r
+                             data actually written\r
+  @param  Buffer             The buffer of data to write\r
+\r
+  @retval EFI_SUCCESS        The data were written successfully\r
+  @retval EFI_DEVICE_ERROR   The device reported an error\r
+  @retval EFI_TIMEOUT        The write operation was stopped due to timeout\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialWrite (\r
@@ -501,6 +550,19 @@ IsaSerialWrite (
   IN VOID                           *Buffer\r
   );\r
 \r
+/**\r
+  Read the specified number of bytes from serial device.\r
+\r
+  @param This               Pointer to EFI_SERIAL_IO_PROTOCOL\r
+  @param BufferSize         On input the size of Buffer, on output the amount of\r
+                            data returned in buffer\r
+  @param Buffer             The buffer to return the data into\r
+\r
+  @retval EFI_SUCCESS        The data were read successfully\r
+  @retval EFI_DEVICE_ERROR   The device reported an error\r
+  @retval EFI_TIMEOUT        The read operation was stopped due to timeout\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IsaSerialRead (\r
@@ -512,38 +574,101 @@ IsaSerialRead (
 //\r
 // Internal Functions\r
 //\r
+/**\r
+  Use scratchpad register to test if this serial port is present.\r
+\r
+  @param SerialDevice   Pointer to serial device structure\r
+\r
+  @return if this serial port is present\r
+**/\r
 BOOLEAN\r
 IsaSerialPortPresent (\r
   IN SERIAL_DEV                     *SerialDevice\r
   );\r
 \r
+/**\r
+  Detect whether specific FIFO is full or not.\r
+\r
+  @param Fifo    A pointer to the Data Structure SERIAL_DEV_FIFO\r
+\r
+  @return whether specific FIFO is full or not\r
+\r
+**/\r
 BOOLEAN\r
 IsaSerialFifoFull (\r
   IN SERIAL_DEV_FIFO                *Fifo\r
   );\r
 \r
+/**\r
+  Detect whether specific FIFO is empty or not.\r
\r
+  @param  Fifo    A pointer to the Data Structure SERIAL_DEV_FIFO\r
+\r
+  @return whether specific FIFO is empty or not\r
+\r
+**/\r
 BOOLEAN\r
 IsaSerialFifoEmpty (\r
   IN SERIAL_DEV_FIFO                *Fifo\r
   );\r
 \r
+/**\r
+  Add data to specific FIFO.\r
+\r
+  @param Fifo                  A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param Data                  the data added to FIFO\r
+\r
+  @retval EFI_SUCCESS           Add data to specific FIFO successfully\r
+  @retval EFI_OUT_OF_RESOURCE   Failed to add data because FIFO is already full\r
+\r
+**/\r
 EFI_STATUS\r
 IsaSerialFifoAdd (\r
   IN SERIAL_DEV_FIFO                *Fifo,\r
   IN UINT8                          Data\r
   );\r
 \r
+/**\r
+  Remove data from specific FIFO.\r
+\r
+  @param Fifo                  A pointer to the Data Structure SERIAL_DEV_FIFO\r
+  @param Data                  the data removed from FIFO\r
+\r
+  @retval EFI_SUCCESS           Remove data from specific FIFO successfully\r
+  @retval EFI_OUT_OF_RESOURCE   Failed to remove data because FIFO is empty\r
+\r
+**/\r
 EFI_STATUS\r
 IsaSerialFifoRemove (\r
   IN  SERIAL_DEV_FIFO               *Fifo,\r
   OUT UINT8                         *Data\r
   );\r
 \r
+/**\r
+  Reads and writes all avaliable data.\r
+\r
+  @param SerialDevice           The device to flush\r
+\r
+  @retval EFI_SUCCESS           Data was read/written successfully.\r
+  @retval EFI_OUT_OF_RESOURCE   Failed because software receive FIFO is full.  Note, when\r
+                                this happens, pending writes are not done.\r
+\r
+**/\r
 EFI_STATUS\r
 IsaSerialReceiveTransmit (\r
   IN SERIAL_DEV                     *SerialDevice\r
   );\r
 \r
+/**\r
+  Use IsaIo protocol to read serial port.\r
+\r
+  @param IsaIo         Pointer to EFI_ISA_IO_PROTOCOL instance\r
+  @param BaseAddress   Serial port register group base address\r
+  @param Offset        Offset in register group\r
+\r
+  @return Data read from serial port\r
+\r
+**/\r
 UINT8\r
 IsaSerialReadPort (\r
   IN EFI_ISA_IO_PROTOCOL                    *IsaIo,\r
@@ -551,6 +676,15 @@ IsaSerialReadPort (
   IN UINT32                                 Offset\r
   );\r
 \r
+/**\r
+  Use IsaIo protocol to write serial port.\r
+\r
+  @param  IsaIo         Pointer to EFI_ISA_IO_PROTOCOL instance\r
+  @param  BaseAddress   Serial port register group base address\r
+  @param  Offset        Offset in register group\r
+  @param  Data          data which is to be written to some serial port register\r
+\r
+**/\r
 VOID\r
 IsaSerialWritePort (\r
   IN EFI_ISA_IO_PROTOCOL                    *IsaIo,\r
@@ -559,4 +693,148 @@ IsaSerialWritePort (
   IN UINT8                                  Data\r
   );\r
 \r
+\r
+//\r
+// EFI Component Name Functions\r
+//\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IsaSerialComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IsaSerialComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  );\r
+\r
+/**\r
+  Add the component name for the serial io device\r
+\r
+  @param SerialDevice     A pointer to the SERIAL_DEV instance.\r
+\r
+  @param IsaIo            A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+\r
+**/\r
+VOID\r
+AddName (\r
+  IN  SERIAL_DEV                                   *SerialDevice,\r
+  IN  EFI_ISA_IO_PROTOCOL                          *IsaIo\r
+  );\r
+\r
 #endif\r
index b143ba3282d1058a522dcd83a77050b875ad2246..dbac719aeaf79c9f4b15399c6e11ab85206076d1 100644 (file)
@@ -835,7 +835,7 @@ EFIAPI
 UefiDecompress (\r
   IN CONST VOID  *Source,\r
   IN OUT VOID    *Destination,\r
-  IN OUT VOID    *Scratch\r
+  IN OUT VOID    *Scratch  OPTIONAL\r
   )\r
 {\r
   return UefiTianoDecompress (Source, Destination, Scratch, 1);\r
index f08577cf280d5820c80d513a7d352cfbdc859a73..10a992a801c86604a7a7d053c2e6e2415eb700e3 100644 (file)
@@ -808,7 +808,7 @@ CreateChildNode (
         // Make sure we initialize the new stream with the correct \r
         // authentication status for both aggregate and local status fields.\r
         //\r
-        if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) != 0) {\r
+        if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) == EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {\r
           //\r
           // OR in the parent stream's aggregate status.\r
           //\r
@@ -837,7 +837,7 @@ CreateChildNode (
         //\r
         // There's no GUIDed section extraction protocol available.\r
         //\r
-        if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {\r
+        if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) == EFI_GUIDED_SECTION_PROCESSING_REQUIRED) {\r
           //\r
           // If the section REQUIRES an extraction protocol, then we're toast\r
           //\r
@@ -849,7 +849,7 @@ CreateChildNode (
         // Figure out the proper authentication status\r
         //\r
         AuthenticationStatus = Stream->AuthenticationStatus;\r
-        if (GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {\r
+        if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) == EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {\r
           //\r
           //  The local status of the new stream is contained in \r
           //  AuthenticaionStatus.  This value needs to be ORed into the\r