]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/UnixSerialIoDxe/UnixSerialIo.c
2nd wave of r11105 checkin.2nd wave of r11105 checkin.
[mirror_edk2.git] / UnixPkg / UnixSerialIoDxe / UnixSerialIo.c
index 436df8ca962b60d69ba943e5bac3693debf02cb5..b197ae624a86d8262913b7eac854e937609a0797 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, 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
@@ -108,7 +108,8 @@ ConvertBaud2Unix (
 {\r
   switch (BaudRate) {\r
   case 0:\r
-    return B0;\r
+    return 0; // Don't use B0 as it is also used in EFI #includes as a name so termios.h #define \r
+              // can break the build.\r
   case 50:\r
     return B50;\r
   case 75:\r
@@ -271,6 +272,7 @@ Returns:
   EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
   UINTN                               EntryCount;\r
   UINTN                               Index;\r
+  BOOLEAN                             RemainingDevicePathContainsFlowControl; \r
 \r
   //\r
   // Check RemainingDevicePath validation\r
@@ -356,6 +358,11 @@ Returns:
       return Status;\r
     }\r
 \r
+    //\r
+    // See if RemainingDevicePath has a Flow Control device path node\r
+    //\r
+    RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath);\r
+\r
     for (Index = 0; Index < EntryCount; Index++) {\r
       if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
         Status = gBS->OpenProtocol (\r
@@ -366,9 +373,10 @@ Returns:
                         Handle,\r
                         EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                         );\r
-        if (!EFI_ERROR (Status) &&\r
-            (ContainsFlowControl (RemainingDevicePath) ^ ContainsFlowControl (DevicePath))) {\r
-          Status = EFI_UNSUPPORTED;\r
+        if (!EFI_ERROR (Status)) {\r
+          if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) {\r
+            Status = EFI_UNSUPPORTED;\r
+          }\r
         }\r
         break;\r
       }\r