]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciSioSerialDxe / SerialIo.c
index f1870f3a1bed1e17592f9f3accc405b21a4648e2..8377ffa13c7aab5a0ea8869c5feecce6846c590e 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   SerialIo implementation for PCI or SIO UARTs.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
-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
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -92,7 +86,7 @@ VerifyUartParameters (
       ((DataBits >= 6) && (DataBits <= 8) && (StopBits == OneFiveStopBits))\r
       ) {\r
     return FALSE;\r
-  } \r
+  }\r
 \r
   //\r
   // Do not verify the baud rate if clock rate is unknown (0).\r
@@ -169,8 +163,8 @@ VerifyUartParameters (
   }\r
 \r
   //\r
-  // ActualBaudRate is higher than requested baud rate and more than 4% \r
-  // higher than the requested value.  Increment Divisor if it is less \r
+  // ActualBaudRate is higher than requested baud rate and more than 4%\r
+  // higher than the requested value.  Increment Divisor if it is less\r
   // than MAX_UINT16 and computed baud rate with new divisor.\r
   //\r
   if (ComputedDivisor == MAX_UINT16) {\r
@@ -212,7 +206,7 @@ SerialFifoFull (
 \r
 /**\r
   Detect whether specific FIFO is empty or not.\r
\r
+\r
   @param  Fifo    A pointer to the Data Structure SERIAL_DEV_FIFO\r
 \r
   @return whether specific FIFO is empty or not\r
@@ -286,7 +280,7 @@ SerialFifoRemove (
 }\r
 \r
 /**\r
-  Reads and writes all avaliable data.\r
+  Reads and writes all available data.\r
 \r
   @param SerialDevice           The device to transmit.\r
 \r
@@ -363,7 +357,7 @@ SerialReceiveTransmit (
           Data = READ_RBR (SerialDevice);\r
 \r
           SerialFifoAdd (&SerialDevice->Receive, Data);\r
-          \r
+\r
           //\r
           // For full handshake flow control, if receive buffer full\r
           // tell the peer to stop sending data.\r
@@ -442,27 +436,6 @@ SerialReceiveTransmit (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Flush the serial hardware transmit FIFO and shift register.\r
-\r
-  @param SerialDevice  The device to flush.\r
-**/\r
-VOID\r
-SerialFlushTransmitFifo (\r
-  SERIAL_DEV  *SerialDevice\r
-  )\r
-{\r
-  SERIAL_PORT_LSR  Lsr;\r
-\r
-  //\r
-  // Wait for the serial port to be ready, to make sure both the transmit FIFO\r
-  // and shift register empty.\r
-  //\r
-  do {\r
-    Lsr.Data = READ_LSR (SerialDevice);\r
-  } while (Lsr.Bits.Temt == 0);\r
-}\r
-\r
 //\r
 // Interface Functions\r
 //\r
@@ -503,8 +476,6 @@ SerialReset (
 \r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
-  SerialFlushTransmitFifo (SerialDevice);\r
-\r
   //\r
   // Make sure DLAB is 0.\r
   //\r
@@ -683,8 +654,6 @@ SerialSetAttributes (
 \r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
-  SerialFlushTransmitFifo (SerialDevice);\r
-\r
   //\r
   // Put serial port on Divisor Latch Mode\r
   //\r
@@ -1090,7 +1059,7 @@ SerialWrite (
                 NULL\r
                 )\r
               );\r
-  \r
+\r
   for (Index = 0; Index < *BufferSize; Index++) {\r
     SerialFifoAdd (&SerialDevice->Transmit, CharBuffer[Index]);\r
 \r