]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
Libraries and utilities for instrumenting regions of code and measuring their perform...
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePathToText.c
index 5de21b1f9d9b954bf2eebac25c0d986d88fcbfe7..44689504df22a369510dd40aa7391e0108d36002 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DevicePathToText protocol as defined in the UEFI 2.0 specification.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, 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
@@ -55,10 +55,10 @@ CatPrint (
     Size = StrSize (AppendStr) - sizeof (UINT16);\r
     Size = Size + StrSize (Str->Str);\r
     Str->Str = ReallocatePool (\r
-                StrSize (Str->Str),\r
-                Size,\r
-                Str->Str\r
-                );\r
+                 StrSize (Str->Str),\r
+                 Size,\r
+                 Str->Str\r
+                 );\r
     ASSERT (Str->Str != NULL);\r
   }\r
 \r
@@ -73,9 +73,9 @@ CatPrint (
 }\r
 \r
 /**\r
-  Converts a PCI device path structure to its string representive.\r
+  Converts a PCI device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -96,13 +96,13 @@ DevPathToTextPci (
   PCI_DEVICE_PATH *Pci;\r
 \r
   Pci = DevPath;\r
-  CatPrint (Str, L"Pci(0x%x,0x%x)", Pci->Device, Pci->Function);\r
+  CatPrint (Str, L"Pci(0x%x,0x%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);\r
 }\r
 \r
 /**\r
-  Converts a PC Card device path structure to its string representive.\r
+  Converts a PC Card device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -123,13 +123,13 @@ DevPathToTextPccard (
   PCCARD_DEVICE_PATH  *Pccard;\r
 \r
   Pccard = DevPath;\r
-  CatPrint (Str, L"PcCard(0x%x)", Pccard->FunctionNumber);\r
+  CatPrint (Str, L"PcCard(0x%x)", (UINTN) Pccard->FunctionNumber);\r
 }\r
 \r
 /**\r
-  Converts a Memory Map device path structure to its string representive.\r
+  Converts a Memory Map device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -153,16 +153,16 @@ DevPathToTextMemMap (
   CatPrint (\r
     Str,\r
     L"MemoryMapped(0x%x,0x%lx,0x%lx)",\r
-    MemMap->MemoryType,\r
+    (UINTN) MemMap->MemoryType,\r
     MemMap->StartingAddress,\r
     MemMap->EndingAddress\r
     );\r
 }\r
 \r
 /**\r
-  Converts a Vendor device path structure to its string representive.\r
+  Converts a Vendor device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -208,7 +208,7 @@ DevPathToTextVendor (
       } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
         CatPrint (Str, L"VenUft8()");\r
         return ;\r
-      } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {\r
+      } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {\r
         FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
         switch (FlowControlMap & 0x00000003) {\r
         case 0:\r
@@ -228,13 +228,13 @@ DevPathToTextVendor (
         }\r
 \r
         return ;\r
-      } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {\r
+      } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
         CatPrint (\r
           Str,\r
           L"SAS(0x%lx,0x%lx,0x%x,",\r
           ((SAS_DEVICE_PATH *) Vendor)->SasAddress,\r
           ((SAS_DEVICE_PATH *) Vendor)->Lun,\r
-          ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
+          (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
           );\r
         Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);\r
         if ((Info & 0x0f) == 0) {\r
@@ -250,13 +250,13 @@ DevPathToTextVendor (
           if ((Info & 0x0f) == 1) {\r
             CatPrint (Str, L"0,");\r
           } else {\r
-            CatPrint (Str, L"0x%x,", (Info >> 8) & 0xff);\r
+            CatPrint (Str, L"0x%x,",(UINTN) (Info >> 8) & 0xff);\r
           }\r
         } else {\r
           CatPrint (Str, L"0,0,0,0,");\r
         }\r
 \r
-        CatPrint (Str, L"0x%x)", ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
+        CatPrint (Str, L"0x%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
         return ;\r
       } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {\r
         CatPrint (Str, L"DebugPort()");\r
@@ -279,7 +279,7 @@ DevPathToTextVendor (
   if (DataLength != 0) {\r
     CatPrint (Str, L",");\r
     for (Index = 0; Index < DataLength; Index++) {\r
-      CatPrint (Str, L"%02x", ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);\r
+      CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);\r
     }\r
   }\r
 \r
@@ -287,9 +287,9 @@ DevPathToTextVendor (
 }\r
 \r
 /**\r
-  Converts a Controller device path structure to its string representive.\r
+  Converts a Controller device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -313,14 +313,14 @@ DevPathToTextController (
   CatPrint (\r
     Str,\r
     L"Ctrl(0x%x)",\r
-    Controller->ControllerNumber\r
+    (UINTN) Controller->ControllerNumber\r
     );\r
 }\r
 \r
 /**\r
-  Converts a ACPI device path structure to its string representive.\r
+  Converts a ACPI device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -344,31 +344,31 @@ DevPathToTextAcpi (
   if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
     switch (EISA_ID_TO_NUM (Acpi->HID)) {\r
     case 0x0a03:\r
-      CatPrint (Str, L"PciRoot(0x%x)", Acpi->UID);\r
+      CatPrint (Str, L"PciRoot(0x%x)", (UINTN) Acpi->UID);\r
       break;\r
 \r
     case 0x0604:\r
-      CatPrint (Str, L"Floppy(0x%x)", Acpi->UID);\r
+      CatPrint (Str, L"Floppy(0x%x)", (UINTN) Acpi->UID);\r
       break;\r
 \r
     case 0x0301:\r
-      CatPrint (Str, L"Keyboard(0x%x)", Acpi->UID);\r
+      CatPrint (Str, L"Keyboard(0x%x)", (UINTN) Acpi->UID);\r
       break;\r
 \r
     case 0x0501:\r
-      CatPrint (Str, L"Serial(0x%x)", Acpi->UID);\r
+      CatPrint (Str, L"Serial(0x%x)", (UINTN) Acpi->UID);\r
       break;\r
 \r
     case 0x0401:\r
-      CatPrint (Str, L"ParallelPort(0x%x)", Acpi->UID);\r
+      CatPrint (Str, L"ParallelPort(0x%x)", (UINTN) Acpi->UID);\r
       break;\r
 \r
     default:\r
-      CatPrint (Str, L"Acpi(PNP%04x,0x%x)", EISA_ID_TO_NUM (Acpi->HID), Acpi->UID);\r
+      CatPrint (Str, L"Acpi(PNP%04x,0x%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);\r
       break;\r
     }\r
   } else {\r
-    CatPrint (Str, L"Acpi(0x%08x,0x%x)", Acpi->HID, Acpi->UID);\r
+    CatPrint (Str, L"Acpi(0x%08x,0x%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);\r
   }\r
 }\r
 \r
@@ -404,9 +404,9 @@ EisaIdToText (
 }\r
 \r
 /**\r
-  Converts a ACPI extended HID device path structure to its string representive.\r
+  Converts a ACPI extended HID device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -464,7 +464,7 @@ DevPathToTextAcpiEx (
       if (AcpiEx->UID == 0) {\r
         CatPrint (Str, L"%a,", UIDStr);\r
       } else {\r
-        CatPrint (Str, L"0x%x,", AcpiEx->UID);\r
+        CatPrint (Str, L"0x%x,", (UINTN) AcpiEx->UID);\r
       }\r
 \r
       if (AcpiEx->CID == 0) {\r
@@ -478,7 +478,7 @@ DevPathToTextAcpiEx (
         L"AcpiEx(%s,%s,0x%x,%a,%a,%a)",\r
         HIDText,\r
         CIDText,\r
-        AcpiEx->UID,\r
+        (UINTN) AcpiEx->UID,\r
         HIDStr,\r
         CIDStr,\r
         UIDStr\r
@@ -488,9 +488,9 @@ DevPathToTextAcpiEx (
 }\r
 \r
 /**\r
-  Converts a ACPI address device path structure to its string representive.\r
+  Converts a ACPI address device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -517,17 +517,17 @@ DevPathToTextAcpiAdr (
   Length             = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);\r
   AdditionalAdrCount = (UINT16) ((Length - 8) / 4);\r
 \r
-  CatPrint (Str, L"AcpiAdr(0x%x", AcpiAdr->ADR);\r
+  CatPrint (Str, L"AcpiAdr(0x%x", (UINTN) AcpiAdr->ADR);\r
   for (Index = 0; Index < AdditionalAdrCount; Index++) {\r
-    CatPrint (Str, L",0x%x", *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));\r
+    CatPrint (Str, L",0x%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));\r
   }\r
   CatPrint (Str, L")");\r
 }\r
 \r
 /**\r
-  Converts a ATAPI device path structure to its string representive.\r
+  Converts a ATAPI device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -550,22 +550,22 @@ DevPathToTextAtapi (
   Atapi = DevPath;\r
 \r
   if (DisplayOnly) {\r
-    CatPrint (Str, L"Ata(0x%x)", Atapi->Lun);\r
+    CatPrint (Str, L"Ata(0x%x)", (UINTN) Atapi->Lun);\r
   } else {\r
     CatPrint (\r
       Str,\r
       L"Ata(%s,%s,0x%x)",\r
-      Atapi->PrimarySecondary ? L"Secondary" : L"Primary",\r
-      Atapi->SlaveMaster ? L"Slave" : L"Master",\r
-      Atapi->Lun\r
+      (Atapi->PrimarySecondary == 1) ? L"Secondary" : L"Primary",\r
+      (Atapi->SlaveMaster == 1) ? L"Slave" : L"Master",\r
+      (UINTN) Atapi->Lun\r
       );\r
   }\r
 }\r
 \r
 /**\r
-  Converts a SCSI device path structure to its string representive.\r
+  Converts a SCSI device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -586,13 +586,13 @@ DevPathToTextScsi (
   SCSI_DEVICE_PATH  *Scsi;\r
 \r
   Scsi = DevPath;\r
-  CatPrint (Str, L"Scsi(0x%x,0x%x)", Scsi->Pun, Scsi->Lun);\r
+  CatPrint (Str, L"Scsi(0x%x,0x%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);\r
 }\r
 \r
 /**\r
-  Converts a Fibre device path structure to its string representive.\r
+  Converts a Fibre device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -617,9 +617,9 @@ DevPathToTextFibre (
 }\r
 \r
 /**\r
-  Converts a 1394 device path structure to its string representive.\r
+  Converts a 1394 device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -647,9 +647,9 @@ DevPathToText1394 (
 }\r
 \r
 /**\r
-  Converts a USB device path structure to its string representive.\r
+  Converts a USB device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -674,9 +674,9 @@ DevPathToTextUsb (
 }\r
 \r
 /**\r
-  Converts a USB WWID device path structure to its string representive.\r
+  Converts a USB WWID device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -708,6 +708,7 @@ DevPathToTextUsbWWID (
     // In case no NULL terminator in SerialNumber, create a new one with NULL terminator\r
     //\r
     NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr);\r
+    ASSERT (NewStr != NULL);\r
     NewStr [Length] = 0;\r
     SerialNumberStr = NewStr;\r
   }\r
@@ -715,17 +716,17 @@ DevPathToTextUsbWWID (
   CatPrint (\r
     Str,\r
     L"UsbWwid(0x%x,0x%x,0x%x,\"%s\")",\r
-    UsbWWId->VendorId,\r
-    UsbWWId->ProductId,\r
-    UsbWWId->InterfaceNumber,\r
+    (UINTN) UsbWWId->VendorId,\r
+    (UINTN) UsbWWId->ProductId,\r
+    (UINTN) UsbWWId->InterfaceNumber,\r
     SerialNumberStr\r
     );\r
 }\r
 \r
 /**\r
-  Converts a Logic Unit device path structure to its string representive.\r
+  Converts a Logic Unit device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -746,13 +747,13 @@ DevPathToTextLogicalUnit (
   DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;\r
 \r
   LogicalUnit = DevPath;\r
-  CatPrint (Str, L"Unit(0x%x)", LogicalUnit->Lun);\r
+  CatPrint (Str, L"Unit(0x%x)", (UINTN) LogicalUnit->Lun);\r
 }\r
 \r
 /**\r
-  Converts a USB class device path structure to its string representive.\r
+  Converts a USB class device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -835,10 +836,10 @@ DevPathToTextUsbClass (
     CatPrint (\r
       Str,\r
       L"(0x%x,0x%x,0x%x,0x%x)",\r
-      UsbClass->VendorId,\r
-      UsbClass->ProductId,\r
-      UsbClass->DeviceSubClass,\r
-      UsbClass->DeviceProtocol\r
+      (UINTN) UsbClass->VendorId,\r
+      (UINTN) UsbClass->ProductId,\r
+      (UINTN) UsbClass->DeviceSubClass,\r
+      (UINTN) UsbClass->DeviceProtocol\r
       );\r
     return;\r
   }\r
@@ -848,27 +849,27 @@ DevPathToTextUsbClass (
       CatPrint (\r
         Str,\r
         L"UsbDeviceFirmwareUpdate(0x%x,0x%x,0x%x)",\r
-        UsbClass->VendorId,\r
-        UsbClass->ProductId,\r
-        UsbClass->DeviceProtocol\r
+        (UINTN) UsbClass->VendorId,\r
+        (UINTN) UsbClass->ProductId,\r
+        (UINTN) UsbClass->DeviceProtocol\r
         );\r
       return;\r
     } else if (UsbClass->DeviceSubClass == USB_SUBCLASS_IRDA_BRIDGE) {\r
       CatPrint (\r
         Str,\r
         L"UsbIrdaBridge(0x%x,0x%x,0x%x)",\r
-        UsbClass->VendorId,\r
-        UsbClass->ProductId,\r
-        UsbClass->DeviceProtocol\r
+        (UINTN) UsbClass->VendorId,\r
+        (UINTN) UsbClass->ProductId,\r
+        (UINTN) UsbClass->DeviceProtocol\r
         );\r
       return;\r
     } else if (UsbClass->DeviceSubClass == USB_SUBCLASS_TEST) {\r
       CatPrint (\r
         Str,\r
         L"UsbTestAndMeasurement(0x%x,0x%x,0x%x)",\r
-        UsbClass->VendorId,\r
-        UsbClass->ProductId,\r
-        UsbClass->DeviceProtocol\r
+        (UINTN) UsbClass->VendorId,\r
+        (UINTN) UsbClass->ProductId,\r
+        (UINTN) UsbClass->DeviceProtocol\r
         );\r
       return;\r
     }\r
@@ -877,18 +878,18 @@ DevPathToTextUsbClass (
   CatPrint (\r
     Str,\r
     L"UsbClass(0x%x,0x%x,0x%x,0x%x,0x%x)",\r
-    UsbClass->VendorId,\r
-    UsbClass->ProductId,\r
-    UsbClass->DeviceClass,\r
-    UsbClass->DeviceSubClass,\r
-    UsbClass->DeviceProtocol\r
+    (UINTN) UsbClass->VendorId,\r
+    (UINTN) UsbClass->ProductId,\r
+    (UINTN) UsbClass->DeviceClass,\r
+    (UINTN) UsbClass->DeviceSubClass,\r
+    (UINTN) UsbClass->DeviceProtocol\r
     );\r
 }\r
 \r
 /**\r
-  Converts a SATA device path structure to its string representive.\r
+  Converts a SATA device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -909,19 +910,28 @@ DevPathToTextSata (
   SATA_DEVICE_PATH *Sata;\r
 \r
   Sata = DevPath;\r
-  CatPrint (\r
-    Str,\r
-    L"Sata(0x%x,0x%x,0x%x)",\r
-    (UINTN) Sata->HBAPortNumber,\r
-    (UINTN) Sata->PortMultiplierPortNumber,\r
-    (UINTN) Sata->Lun\r
-    );\r
+  if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
+    CatPrint (\r
+      Str,\r
+      L"Sata(0x%x,0x%x)",\r
+      (UINTN) Sata->HBAPortNumber,\r
+      (UINTN) Sata->Lun\r
+      );\r
+  } else {\r
+    CatPrint (\r
+      Str,\r
+      L"Sata(0x%x,0x%x,0x%x)",\r
+      (UINTN) Sata->HBAPortNumber,\r
+      (UINTN) Sata->PortMultiplierPortNumber,\r
+      (UINTN) Sata->Lun\r
+      );\r
+  }\r
 }\r
 \r
 /**\r
-  Converts a I20 device path structure to its string representive.\r
+  Converts a I20 device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -942,13 +952,13 @@ DevPathToTextI2O (
   I2O_DEVICE_PATH *I2ODevPath;\r
 \r
   I2ODevPath = DevPath;\r
-  CatPrint (Str, L"I2O(0x%x)", I2ODevPath->Tid);\r
+  CatPrint (Str, L"I2O(0x%x)", (UINTN) I2ODevPath->Tid);\r
 }\r
 \r
 /**\r
-  Converts a MAC address device path structure to its string representive.\r
+  Converts a MAC address device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -980,16 +990,38 @@ DevPathToTextMacAddr (
   CatPrint (Str, L"MAC(");\r
 \r
   for (Index = 0; Index < HwAddressSize; Index++) {\r
-    CatPrint (Str, L"%02x", MacDevPath->MacAddress.Addr[Index]);\r
+    CatPrint (Str, L"%02x", (UINTN) MacDevPath->MacAddress.Addr[Index]);\r
   }\r
 \r
-  CatPrint (Str, L",0x%x)", MacDevPath->IfType);\r
+  CatPrint (Str, L",0x%x)", (UINTN) MacDevPath->IfType);\r
+}\r
+\r
+/**\r
+  Converts network protocol string to its text representation.\r
+\r
+  @param Str             The string representative of input device.\r
+  @param Protocol        The network protocol ID.\r
+\r
+**/\r
+VOID\r
+CatNetworkProtocol (\r
+  IN OUT POOL_PRINT  *Str,\r
+  IN UINT16          Protocol\r
+  )\r
+{\r
+  if (Protocol == RFC_1700_TCP_PROTOCOL) {\r
+    CatPrint (Str, L"TCP");\r
+  } else if (Protocol == RFC_1700_UDP_PROTOCOL) {\r
+    CatPrint (Str, L"UDP");\r
+  } else {\r
+    CatPrint (Str, L"0x%x", Protocol);\r
+  }\r
 }\r
 \r
 /**\r
-  Converts a IPv4 device path structure to its string representive.\r
+  Converts a IPv4 device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1014,34 +1046,43 @@ DevPathToTextIPv4 (
     CatPrint (\r
       Str,\r
       L"IPv4(%d.%d.%d.%d)",\r
-      IPDevPath->RemoteIpAddress.Addr[0],\r
-      IPDevPath->RemoteIpAddress.Addr[1],\r
-      IPDevPath->RemoteIpAddress.Addr[2],\r
-      IPDevPath->RemoteIpAddress.Addr[3]\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[3]\r
       );\r
     return ;\r
   }\r
 \r
   CatPrint (\r
     Str,\r
-    L"IPv4(%d.%d.%d.%d,%s,%s,%d.%d.%d.%d)",\r
-    IPDevPath->RemoteIpAddress.Addr[0],\r
-    IPDevPath->RemoteIpAddress.Addr[1],\r
-    IPDevPath->RemoteIpAddress.Addr[2],\r
-    IPDevPath->RemoteIpAddress.Addr[3],\r
-    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
-    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IPDevPath->LocalIpAddress.Addr[0],\r
-    IPDevPath->LocalIpAddress.Addr[1],\r
-    IPDevPath->LocalIpAddress.Addr[2],\r
-    IPDevPath->LocalIpAddress.Addr[3]\r
+    L"IPv4(%d.%d.%d.%d,",\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[3]\r
+    );\r
+\r
+  CatNetworkProtocol (\r
+    Str,\r
+    IPDevPath->Protocol\r
+    );\r
+\r
+  CatPrint (\r
+    Str,\r
+    L",%s,%d.%d.%d.%d)",\r
+    IPDevPath->StaticIpAddress ? L"Static" : L"DHCP",\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[0],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[1],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[2],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[3]\r
     );\r
 }\r
 \r
 /**\r
-  Converts a IPv6 device path structure to its string representive.\r
+  Converts a IPv6 device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1066,70 +1107,79 @@ DevPathToTextIPv6 (
     CatPrint (\r
       Str,\r
       L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-      IPDevPath->RemoteIpAddress.Addr[0],\r
-      IPDevPath->RemoteIpAddress.Addr[1],\r
-      IPDevPath->RemoteIpAddress.Addr[2],\r
-      IPDevPath->RemoteIpAddress.Addr[3],\r
-      IPDevPath->RemoteIpAddress.Addr[4],\r
-      IPDevPath->RemoteIpAddress.Addr[5],\r
-      IPDevPath->RemoteIpAddress.Addr[6],\r
-      IPDevPath->RemoteIpAddress.Addr[7],\r
-      IPDevPath->RemoteIpAddress.Addr[8],\r
-      IPDevPath->RemoteIpAddress.Addr[9],\r
-      IPDevPath->RemoteIpAddress.Addr[10],\r
-      IPDevPath->RemoteIpAddress.Addr[11],\r
-      IPDevPath->RemoteIpAddress.Addr[12],\r
-      IPDevPath->RemoteIpAddress.Addr[13],\r
-      IPDevPath->RemoteIpAddress.Addr[14],\r
-      IPDevPath->RemoteIpAddress.Addr[15]\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[3],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[4],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[5],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[6],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[7],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[8],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[9],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[10],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[11],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[12],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[13],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[14],\r
+      (UINTN) IPDevPath->RemoteIpAddress.Addr[15]\r
       );\r
     return ;\r
   }\r
 \r
   CatPrint (\r
     Str,\r
-    L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,%s,%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
-    IPDevPath->RemoteIpAddress.Addr[0],\r
-    IPDevPath->RemoteIpAddress.Addr[1],\r
-    IPDevPath->RemoteIpAddress.Addr[2],\r
-    IPDevPath->RemoteIpAddress.Addr[3],\r
-    IPDevPath->RemoteIpAddress.Addr[4],\r
-    IPDevPath->RemoteIpAddress.Addr[5],\r
-    IPDevPath->RemoteIpAddress.Addr[6],\r
-    IPDevPath->RemoteIpAddress.Addr[7],\r
-    IPDevPath->RemoteIpAddress.Addr[8],\r
-    IPDevPath->RemoteIpAddress.Addr[9],\r
-    IPDevPath->RemoteIpAddress.Addr[10],\r
-    IPDevPath->RemoteIpAddress.Addr[11],\r
-    IPDevPath->RemoteIpAddress.Addr[12],\r
-    IPDevPath->RemoteIpAddress.Addr[13],\r
-    IPDevPath->RemoteIpAddress.Addr[14],\r
-    IPDevPath->RemoteIpAddress.Addr[15],\r
-    IPDevPath->Protocol ? L"TCP" : L"UDP",\r
-    (IPDevPath->StaticIpAddress == TRUE) ? L"Static" : L"DHCP",\r
-    IPDevPath->LocalIpAddress.Addr[0],\r
-    IPDevPath->LocalIpAddress.Addr[1],\r
-    IPDevPath->LocalIpAddress.Addr[2],\r
-    IPDevPath->LocalIpAddress.Addr[3],\r
-    IPDevPath->LocalIpAddress.Addr[4],\r
-    IPDevPath->LocalIpAddress.Addr[5],\r
-    IPDevPath->LocalIpAddress.Addr[6],\r
-    IPDevPath->LocalIpAddress.Addr[7],\r
-    IPDevPath->LocalIpAddress.Addr[8],\r
-    IPDevPath->LocalIpAddress.Addr[9],\r
-    IPDevPath->LocalIpAddress.Addr[10],\r
-    IPDevPath->LocalIpAddress.Addr[11],\r
-    IPDevPath->LocalIpAddress.Addr[12],\r
-    IPDevPath->LocalIpAddress.Addr[13],\r
-    IPDevPath->LocalIpAddress.Addr[14],\r
-    IPDevPath->LocalIpAddress.Addr[15]\r
+    L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,",\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[3],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[4],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[5],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[6],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[7],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[8],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[9],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[10],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[11],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[12],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[13],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[14],\r
+    (UINTN) IPDevPath->RemoteIpAddress.Addr[15]\r
+    );\r
+    \r
+  CatNetworkProtocol (\r
+    Str,\r
+    IPDevPath->Protocol\r
+    );\r
+\r
+  CatPrint (\r
+    Str,\r
+    L"%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
+    IPDevPath->StaticIpAddress ? L"Static" : L"DHCP",\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[0],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[1],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[2],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[3],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[4],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[5],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[6],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[7],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[8],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[9],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[10],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[11],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[12],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[13],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[14],\r
+    (UINTN) IPDevPath->LocalIpAddress.Addr[15]\r
     );\r
 }\r
 \r
 /**\r
-  Converts an Infini Band device path structure to its string representive.\r
+  Converts an Infini Band device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1153,7 +1203,7 @@ DevPathToTextInfiniBand (
   CatPrint (\r
     Str,\r
     L"Infiniband(0x%x,%g,0x%lx,0x%lx,0x%lx)",\r
-    InfiniBand->ResourceFlags,\r
+    (UINTN) InfiniBand->ResourceFlags,\r
     InfiniBand->PortGid,\r
     InfiniBand->ServiceId,\r
     InfiniBand->TargetPortId,\r
@@ -1162,9 +1212,9 @@ DevPathToTextInfiniBand (
 }\r
 \r
 /**\r
-  Converts a UART device path structure to its string representive.\r
+  Converts a UART device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1225,7 +1275,7 @@ DevPathToTextUart (
   if (Uart->DataBits == 0) {\r
     CatPrint (Str, L"DEFAULT,");\r
   } else {\r
-    CatPrint (Str, L"%d,", Uart->DataBits);\r
+    CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);\r
   }\r
 \r
   CatPrint (Str, L"%c,", Parity);\r
@@ -1254,9 +1304,9 @@ DevPathToTextUart (
 }\r
 \r
 /**\r
-  Converts an iSCSI device path structure to its string representive.\r
+  Converts an iSCSI device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1281,8 +1331,8 @@ DevPathToTextiSCSI (
   CatPrint (\r
     Str,\r
     L"iSCSI(%a,0x%x,0x%lx,",\r
-    ISCSIDevPath->iSCSITargetName,\r
-    ISCSIDevPath->TargetPortalGroupTag,\r
+    ISCSIDevPath->TargetName,\r
+    (UINTN) ISCSIDevPath->TargetPortalGroupTag,\r
     ISCSIDevPath->Lun\r
     );\r
 \r
@@ -1302,9 +1352,36 @@ DevPathToTextiSCSI (
 }\r
 \r
 /**\r
-  Converts a Hard drive device path structure to its string representive.\r
+  Converts a VLAN device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
+VOID\r
+DevPathToTextVlan (\r
+  IN OUT POOL_PRINT  *Str,\r
+  IN VOID            *DevPath,\r
+  IN BOOLEAN         DisplayOnly,\r
+  IN BOOLEAN         AllowShortcuts\r
+  )\r
+{\r
+  VLAN_DEVICE_PATH  *Vlan;\r
+\r
+  Vlan = DevPath;\r
+  CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId);\r
+}\r
+\r
+/**\r
+  Converts a Hard drive device path structure to its string representative.\r
+\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1330,9 +1407,9 @@ DevPathToTextHardDrive (
     CatPrint (\r
       Str,\r
       L"HD(%d,%s,0x%08x,",\r
-      Hd->PartitionNumber,\r
+      (UINTN) Hd->PartitionNumber,\r
       L"MBR",\r
-      *((UINT32 *) (&(Hd->Signature[0])))\r
+      (UINTN) *((UINT32 *) (&(Hd->Signature[0])))\r
       );\r
     break;\r
 \r
@@ -1340,7 +1417,7 @@ DevPathToTextHardDrive (
     CatPrint (\r
       Str,\r
       L"HD(%d,%s,%g,",\r
-      Hd->PartitionNumber,\r
+      (UINTN) Hd->PartitionNumber,\r
       L"GPT",\r
       (EFI_GUID *) &(Hd->Signature[0])\r
       );\r
@@ -1350,8 +1427,8 @@ DevPathToTextHardDrive (
     CatPrint (\r
       Str,\r
       L"HD(%d,%d,0,",\r
-      Hd->PartitionNumber,\r
-      Hd->SignatureType\r
+      (UINTN) Hd->PartitionNumber,\r
+      (UINTN) Hd->SignatureType\r
       );\r
     break;\r
   }\r
@@ -1360,9 +1437,9 @@ DevPathToTextHardDrive (
 }\r
 \r
 /**\r
-  Converts a CDROM device path structure to its string representive.\r
+  Converts a CDROM device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1384,17 +1461,17 @@ DevPathToTextCDROM (
 \r
   Cd = DevPath;\r
   if (DisplayOnly) {\r
-    CatPrint (Str, L"CDROM(0x%x)", Cd->BootEntry);\r
+    CatPrint (Str, L"CDROM(0x%x)", (UINTN) Cd->BootEntry);\r
     return ;\r
   }\r
 \r
-  CatPrint (Str, L"CDROM(0x%x,0x%lx,0x%lx)", Cd->BootEntry, Cd->PartitionStart, Cd->PartitionSize);\r
+  CatPrint (Str, L"CDROM(0x%x,0x%lx,0x%lx)", (UINTN) Cd->BootEntry, Cd->PartitionStart, Cd->PartitionSize);\r
 }\r
 \r
 /**\r
-  Converts a File device path structure to its string representive.\r
+  Converts a File device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1419,9 +1496,9 @@ DevPathToTextFilePath (
 }\r
 \r
 /**\r
-  Converts a Media protocol device path structure to its string representive.\r
+  Converts a Media protocol device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1446,9 +1523,9 @@ DevPathToTextMediaProtocol (
 }\r
 \r
 /**\r
-  Converts a Firmware Volume device path structure to its string representive.\r
+  Converts a Firmware Volume device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1473,9 +1550,9 @@ DevPathToTextFv (
 }\r
 \r
 /**\r
-  Converts a Firmware Volume File device path structure to its string representive.\r
+  Converts a Firmware Volume File device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1500,9 +1577,41 @@ DevPathToTextFvFile (
 }\r
 \r
 /**\r
-  Converts a BIOS Boot Specification device path structure to its string representive.\r
+  Converts a Relative Offset device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
+VOID\r
+DevPathRelativeOffsetRange (\r
+  IN OUT POOL_PRINT       *Str,\r
+  IN VOID                 *DevPath,\r
+  IN BOOLEAN              DisplayOnly,\r
+  IN BOOLEAN              AllowShortcuts\r
+  )\r
+{\r
+  MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
+\r
+  Offset = DevPath;\r
+  CatPrint (\r
+    Str,\r
+    L"Offset(0x%lx,0x%lx)",\r
+    Offset->StartingOffset,\r
+    Offset->EndingOffset\r
+    );\r
+}\r
+\r
+/**\r
+  Converts a BIOS Boot Specification device path structure to its string representative.\r
+\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1557,7 +1666,7 @@ DevPathToTextBBS (
   if (Type != NULL) {\r
     CatPrint (Str, L"BBS(%s,%a", Type, Bbs->String);\r
   } else {\r
-    CatPrint (Str, L"BBS(0x%x,%a", Bbs->DeviceType, Bbs->String);\r
+    CatPrint (Str, L"BBS(0x%x,%a", (UINTN) Bbs->DeviceType, Bbs->String);\r
   }\r
 \r
   if (DisplayOnly) {\r
@@ -1565,13 +1674,13 @@ DevPathToTextBBS (
     return ;\r
   }\r
 \r
-  CatPrint (Str, L",0x%x)", Bbs->StatusFlag);\r
+  CatPrint (Str, L",0x%x)", (UINTN) Bbs->StatusFlag);\r
 }\r
 \r
 /**\r
-  Converts an End-of-Device-Path structure to its string representive.\r
+  Converts an End-of-Device-Path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1593,9 +1702,9 @@ DevPathToTextEndInstance (
 }\r
 \r
 /**\r
-  Converts an unknown device path structure to its string representive.\r
+  Converts an unknown device path structure to its string representative.\r
 \r
-  @param Str             The string representive of input device.\r
+  @param Str             The string representative of input device.\r
   @param DevPath         The input device path structure.\r
   @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
                          of the display node is used, where applicable. If DisplayOnly\r
@@ -1642,14 +1751,15 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable
   {MESSAGING_DEVICE_PATH, MSG_UART_DP, DevPathToTextUart},\r
   {MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, DevPathToTextVendor},\r
   {MESSAGING_DEVICE_PATH, MSG_ISCSI_DP, DevPathToTextiSCSI},\r
+  {MESSAGING_DEVICE_PATH, MSG_VLAN_DP, DevPathToTextVlan},\r
   {MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextHardDrive},\r
   {MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextCDROM},\r
   {MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextVendor},\r
-  {MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, DevPathToTextFilePath},\r
   {MEDIA_DEVICE_PATH, MEDIA_PROTOCOL_DP, DevPathToTextMediaProtocol},\r
   {MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, DevPathToTextFilePath},\r
   {MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_VOL_DP, DevPathToTextFv},\r
   {MEDIA_DEVICE_PATH, MEDIA_PIWG_FW_FILE_DP, DevPathToTextFvFile},\r
+  {MEDIA_DEVICE_PATH, MEDIA_RELATIVE_OFFSET_RANGE_DP, DevPathRelativeOffsetRange},\r
   {BBS_DEVICE_PATH, BBS_BBS_DP, DevPathToTextBBS},\r
   {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, DevPathToTextEndInstance},\r
   {0, 0, NULL}\r
@@ -1768,7 +1878,7 @@ ConvertDevicePathToText (
     // Find the handler to dump this device path node\r
     //\r
     DumpNode = NULL;\r
-    for (Index = 0; DevPathToTextTable[Index].Function; Index += 1) {\r
+    for (Index = 0; DevPathToTextTable[Index].Function != NULL; Index += 1) {\r
 \r
       if (DevicePathType (DevPathNode) == DevPathToTextTable[Index].Type &&\r
           DevicePathSubType (DevPathNode) == DevPathToTextTable[Index].SubType\r
@@ -1784,7 +1894,7 @@ ConvertDevicePathToText (
       DumpNode = DevPathToTextNodeUnknown;\r
     }\r
     //\r
-    //  Put a path seperator in if needed\r
+    //  Put a path separator in if needed\r
     //\r
     if ((Str.Len != 0) && DumpNode != DevPathToTextEndInstance) {\r
       if (*(Str.Str + Str.Len / sizeof (CHAR16) - 1) != L',') {\r