]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / DevicePath.c
index bdb69b4b6fa13afdb37be245c238893ce7be6cae..9d46b1cfb0239f677d7b199051a4f23903249022 100644 (file)
@@ -2,8 +2,8 @@
   BDS internal function define the default device path string, it can be\r
   replaced by platform device path.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2009, 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
@@ -487,8 +487,8 @@ DevPathAtapi (
   CatPrint (\r
     Str,\r
     L"Ata(%s,%s)",\r
-    Atapi->PrimarySecondary ? L"Secondary" : L"Primary",\r
-    Atapi->SlaveMaster ? L"Slave" : L"Master"\r
+    (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",\r
+    (Atapi->SlaveMaster != 0)? L"Slave" : L"Master"\r
     );\r
 }\r
 \r
@@ -679,7 +679,7 @@ DevPathSata (
   SATA_DEVICE_PATH *Sata;\r
 \r
   Sata = DevPath;\r
-  if (Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) {\r
+  if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
     CatPrint (\r
       Str,\r
       L"Sata(%x,%x)",\r
@@ -964,7 +964,7 @@ DevPathiSCSI (
   CatPrint (\r
     Str,\r
     L"iSCSI(%a,%x,%lx,",\r
-    IScsi->iSCSITargetName,\r
+    IScsi->TargetName,\r
     (UINTN) IScsi->TargetPortalGroupTag,\r
     IScsi->Lun\r
     );\r
@@ -984,6 +984,28 @@ DevPathiSCSI (
   CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved");\r
 }\r
 \r
+/**\r
+  Convert Device Path to a Unicode string for printing.\r
+\r
+  @param Str             The buffer holding the output string.\r
+                         This buffer contains the length of the\r
+                         string and the maixmum length reserved\r
+                         for the string buffer.\r
+  @param DevPath         The device path.\r
+\r
+**/\r
+VOID\r
+DevPathVlan (\r
+  IN OUT POOL_PRINT       *Str,\r
+  IN VOID                 *DevPath\r
+  )\r
+{\r
+  VLAN_DEVICE_PATH  *Vlan;\r
+\r
+  Vlan = DevPath;\r
+  CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);\r
+}\r
+\r
 /**\r
   Convert Device Path to a Unicode string for printing.\r
 \r
@@ -1390,6 +1412,11 @@ DEVICE_PATH_STRING_TABLE  DevPathTable[] = {
     MSG_ISCSI_DP,\r
     DevPathiSCSI\r
   },\r
+  {\r
+    MESSAGING_DEVICE_PATH,\r
+    MSG_VLAN_DP,\r
+    DevPathVlan\r
+  },\r
   {\r
     MEDIA_DEVICE_PATH,\r
     MEDIA_HARDDRIVE_DP,\r
@@ -1503,7 +1530,7 @@ DevicePathToStr (
     // Find the handler to dump this device path node\r
     //\r
     DumpNode = NULL;\r
-    for (Index = 0; DevPathTable[Index].Function; Index += 1) {\r
+    for (Index = 0; DevPathTable[Index].Function != NULL; Index += 1) {\r
 \r
       if (DevicePathType (DevPathNode) == DevPathTable[Index].Type &&\r
           DevicePathSubType (DevPathNode) == DevPathTable[Index].SubType\r
@@ -1521,7 +1548,7 @@ DevicePathToStr (
     //\r
     //  Put a path seperator in if needed\r
     //\r
-    if (Str.Len && DumpNode != DevPathEndInstance) {\r
+    if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {\r
       CatPrint (&Str, L"/");\r
     }\r
     //\r