BDS internal function define the default device path string, it can be\r
replaced by platform device path.\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
\r
#include "InternalBdsLib.h"\r
\r
-/**\r
- Concatenates a formatted unicode string to allocated pool.\r
- The caller must free the resulting buffer.\r
-\r
- @param Str Tracks the allocated pool, size in use, and amount of pool allocated.\r
- @param Fmt The format string\r
- @param ... The data will be printed.\r
-\r
- @return Allocated buffer with the formatted string printed in it.\r
- The caller must free the allocated buffer.\r
- The buffer allocation is not packed.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-CatPrint (\r
- IN OUT POOL_PRINT *Str,\r
- IN CHAR16 *Fmt,\r
- ...\r
- )\r
-{\r
- UINT16 *AppendStr;\r
- VA_LIST Args;\r
- UINTN StringSize;\r
-\r
- AppendStr = AllocateZeroPool (0x1000);\r
- if (AppendStr == NULL) {\r
- return Str->Str;\r
- }\r
-\r
- VA_START (Args, Fmt);\r
- UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args);\r
- VA_END (Args);\r
- if (NULL == Str->Str) {\r
- StringSize = StrSize (AppendStr);\r
- Str->Str = AllocateZeroPool (StringSize);\r
- ASSERT (Str->Str != NULL);\r
- } else {\r
- StringSize = StrSize (AppendStr);\r
- StringSize += (StrSize (Str->Str) - sizeof (UINT16));\r
-\r
- Str->Str = ReallocatePool (\r
- StrSize (Str->Str),\r
- StringSize,\r
- Str->Str\r
- );\r
- ASSERT (Str->Str != NULL);\r
- }\r
-\r
- Str->Maxlen = MAX_CHAR * sizeof (UINT16);\r
- if (StringSize < Str->Maxlen) {\r
- StrCat (Str->Str, AppendStr);\r
- Str->Len = StringSize - sizeof (UINT16);\r
- }\r
-\r
- FreePool (AppendStr);\r
- return Str->Str;\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
-DevPathPci (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCI_DEVICE_PATH *Pci;\r
-\r
- Pci = DevPath;\r
- CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);\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
-DevPathPccard (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCCARD_DEVICE_PATH *Pccard;\r
-\r
- Pccard = DevPath;\r
- CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);\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
-DevPathMemMap (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEMMAP_DEVICE_PATH *MemMap;\r
-\r
- MemMap = DevPath;\r
- CatPrint (\r
- Str,\r
- L"MemMap(%d:%lx-%lx)",\r
- (UINTN) MemMap->MemoryType,\r
- MemMap->StartingAddress,\r
- MemMap->EndingAddress\r
- );\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
-DevPathController (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CONTROLLER_DEVICE_PATH *Controller;\r
-\r
- Controller = DevPath;\r
- CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);\r
-}\r
-\r
-\r
-/**\r
- Convert Vendor device path to device name.\r
-\r
- @param Str The buffer store device name\r
- @param DevPath Pointer to vendor device path\r
-\r
-**/\r
-VOID\r
-DevPathVendor (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- VENDOR_DEVICE_PATH *Vendor;\r
- CHAR16 *Type;\r
- UINTN DataLength;\r
- UINTN Index;\r
- UINT32 FlowControlMap;\r
-\r
- UINT16 Info;\r
-\r
- Vendor = DevPath;\r
-\r
- switch (DevicePathType (&Vendor->Header)) {\r
- case HARDWARE_DEVICE_PATH:\r
- Type = L"Hw";\r
- break;\r
-\r
- case MESSAGING_DEVICE_PATH:\r
- Type = L"Msg";\r
- if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) {\r
- CatPrint (Str, L"VenPcAnsi()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) {\r
- CatPrint (Str, L"VenVt100()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) {\r
- CatPrint (Str, L"VenVt100Plus()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
- CatPrint (Str, L"VenUft8()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {\r
- FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
- switch (FlowControlMap & 0x00000003) {\r
- case 0:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"None");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
-\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
- CatPrint (\r
- Str,\r
- L"SAS(%lx,%lx,%x,",\r
- ((SAS_DEVICE_PATH *) Vendor)->SasAddress,\r
- ((SAS_DEVICE_PATH *) Vendor)->Lun,\r
- (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
- );\r
- Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);\r
- if ((Info & 0x0f) == 0) {\r
- CatPrint (Str, L"NoTopology,0,0,0,");\r
- } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {\r
- CatPrint (\r
- Str,\r
- L"%s,%s,%s,",\r
- ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
- ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
- ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
- );\r
- if ((Info & 0x0f) == 1) {\r
- CatPrint (Str, L"0,");\r
- } else {\r
- CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));\r
- }\r
- } else {\r
- CatPrint (Str, L"0,0,0,0,");\r
- }\r
-\r
- CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {\r
- CatPrint (Str, L"DebugPort()");\r
- return ;\r
- }\r
- break;\r
-\r
- case MEDIA_DEVICE_PATH:\r
- Type = L"Media";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
-\r
- CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);\r
- DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH);\r
- if (DataLength > 0) {\r
- CatPrint (Str, L",");\r
- for (Index = 0; Index < DataLength; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);\r
- }\r
- }\r
- CatPrint (Str, L")");\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
-DevPathAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_HID_DEVICE_PATH *Acpi;\r
-\r
- Acpi = DevPath;\r
- if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);\r
- } else {\r
- CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);\r
- }\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
-DevPathExtendedAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
- \r
- //\r
- // Index for HID, UID and CID strings, 0 for non-exist\r
- //\r
- UINT16 HIDSTRIdx;\r
- UINT16 UIDSTRIdx;\r
- UINT16 CIDSTRIdx;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 Anchor;\r
- CHAR8 *AsChar8Array;\r
-\r
- HIDSTRIdx = 0;\r
- UIDSTRIdx = 0;\r
- CIDSTRIdx = 0;\r
- ExtendedAcpi = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi);\r
-\r
- AsChar8Array = (CHAR8 *) ExtendedAcpi;\r
-\r
- //\r
- // find HIDSTR\r
- //\r
- Anchor = 16;\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- HIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find UIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- UIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find CIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- CIDSTRIdx = Anchor;\r
- }\r
-\r
- if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) {\r
- CatPrint (Str, L"AcpiExp(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- } else {\r
- CatPrint (Str, L"AcpiEx(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);\r
-\r
- if (HIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (CIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- }\r
-\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
-DevPathAdrAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_ADR_DEVICE_PATH *AcpiAdr;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 AdditionalAdrCount;\r
-\r
- AcpiAdr = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);\r
- AdditionalAdrCount = (UINT16) ((Length - 8) / 4);\r
-\r
- CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);\r
- for (Index = 0; Index < AdditionalAdrCount; Index++) {\r
- CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));\r
- }\r
- CatPrint (Str, L")");\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
-DevPathAtapi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ATAPI_DEVICE_PATH *Atapi;\r
-\r
- Atapi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Ata(%s,%s)",\r
- (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",\r
- (Atapi->SlaveMaster != 0)? L"Slave" : L"Master"\r
- );\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
-DevPathScsi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SCSI_DEVICE_PATH *Scsi;\r
-\r
- Scsi = DevPath;\r
- CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);\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
-DevPathFibre (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FIBRECHANNEL_DEVICE_PATH *Fibre;\r
-\r
- Fibre = DevPath;\r
- CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);\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
-DevPath1394 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- F1394_DEVICE_PATH *F1394Path;\r
-\r
- F1394Path = DevPath;\r
- CatPrint (Str, L"1394(%lx)", &F1394Path->Guid);\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
-DevPathUsb (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_DEVICE_PATH *Usb;\r
-\r
- Usb = DevPath;\r
- CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);\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
-DevPathUsbWWID (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_WWID_DEVICE_PATH *UsbWWId;\r
-\r
- UsbWWId = DevPath;\r
- CatPrint (\r
- Str,\r
- L"UsbWwid(%x,%x,%x,\"WWID\")",\r
- (UINTN) UsbWWId->VendorId,\r
- (UINTN) UsbWWId->ProductId,\r
- (UINTN) UsbWWId->InterfaceNumber\r
- );\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
-DevPathLogicalUnit (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;\r
-\r
- LogicalUnit = DevPath;\r
- CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);\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
-DevPathUsbClass (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_CLASS_DEVICE_PATH *UsbClass;\r
-\r
- UsbClass = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Usb Class(%x,%x,%x,%x,%x)",\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
- 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
-DevPathSata (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SATA_DEVICE_PATH *Sata;\r
-\r
- Sata = DevPath;\r
- if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- } else {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->PortMultiplierPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- }\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
-DevPathI2O (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- I2O_DEVICE_PATH *I2OPath;\r
-\r
- I2OPath = DevPath;\r
- CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);\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
-DevPathMacAddr (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MAC_ADDR_DEVICE_PATH *MACDevPath;\r
- UINTN HwAddressSize;\r
- UINTN Index;\r
-\r
- MACDevPath = DevPath;\r
-\r
- HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
- if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {\r
- HwAddressSize = 6;\r
- }\r
-\r
- CatPrint (Str, L"Mac(");\r
-\r
- for (Index = 0; Index < HwAddressSize; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);\r
- }\r
-\r
- CatPrint (Str, L")");\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
-DevPathIPv4 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv4_DEVICE_PATH *IPDevPath;\r
-\r
- IPDevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv4(%d.%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
- (UINTN) IPDevPath->RemotePort\r
- );\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
-DevPathIPv6 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv6_DEVICE_PATH *IPv6DevPath;\r
-\r
- IPv6DevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15]\r
- );\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
-DevPathInfiniBand (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- INFINIBAND_DEVICE_PATH *InfiniBand;\r
-\r
- InfiniBand = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Infiniband(%x,%g,%lx,%lx,%lx)",\r
- (UINTN) InfiniBand->ResourceFlags,\r
- InfiniBand->PortGid,\r
- InfiniBand->ServiceId,\r
- InfiniBand->TargetPortId,\r
- InfiniBand->DeviceId\r
- );\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
-DevPathUart (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- UART_DEVICE_PATH *Uart;\r
- CHAR8 Parity;\r
-\r
- Uart = DevPath;\r
- switch (Uart->Parity) {\r
- case 0:\r
- Parity = 'D';\r
- break;\r
-\r
- case 1:\r
- Parity = 'N';\r
- break;\r
-\r
- case 2:\r
- Parity = 'E';\r
- break;\r
-\r
- case 3:\r
- Parity = 'O';\r
- break;\r
-\r
- case 4:\r
- Parity = 'M';\r
- break;\r
-\r
- case 5:\r
- Parity = 'S';\r
- break;\r
-\r
- default:\r
- Parity = 'x';\r
- break;\r
- }\r
-\r
- if (Uart->BaudRate == 0) {\r
- CatPrint (Str, L"Uart(DEFAULT,%c,", Parity);\r
- } else {\r
- CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);\r
- }\r
-\r
- if (Uart->DataBits == 0) {\r
- CatPrint (Str, L"D,");\r
- } else {\r
- CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);\r
- }\r
-\r
- switch (Uart->StopBits) {\r
- case 0:\r
- CatPrint (Str, L"D)");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"1)");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"1.5)");\r
- break;\r
-\r
- case 3:\r
- CatPrint (Str, L"2)");\r
- break;\r
-\r
- default:\r
- CatPrint (Str, L"x)");\r
- break;\r
- }\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
-DevPathiSCSI (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ISCSI_DEVICE_PATH_WITH_NAME *IScsi;\r
- UINT16 Options;\r
-\r
- IScsi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"iSCSI(%a,%x,%lx,",\r
- IScsi->TargetName,\r
- (UINTN) IScsi->TargetPortalGroupTag,\r
- IScsi->Lun\r
- );\r
-\r
- Options = IScsi->LoginOption;\r
- CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- if (((Options >> 11) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"None");\r
- } else if (((Options >> 12) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"CHAP_UNI");\r
- } else {\r
- CatPrint (Str, L"%s,", L"CHAP_BI");\r
-\r
- }\r
-\r
- 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
- @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
-DevPathHardDrive (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- HARDDRIVE_DEVICE_PATH *Hd;\r
-\r
- Hd = DevPath;\r
- switch (Hd->SignatureType) {\r
- case SIGNATURE_TYPE_MBR:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%08x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) *((UINT32 *) (&(Hd->Signature[0])))\r
- );\r
- break;\r
-\r
- case SIGNATURE_TYPE_GUID:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%g)",\r
- (UINTN) Hd->PartitionNumber,\r
- (EFI_GUID *) &(Hd->Signature[0])\r
- );\r
- break;\r
-\r
- default:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,MBRType=%02x,SigType=%02x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) Hd->MBRType,\r
- (UINTN) Hd->SignatureType\r
- );\r
- break;\r
- }\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
-DevPathCDROM (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CDROM_DEVICE_PATH *Cd;\r
-\r
- Cd = DevPath;\r
- CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);\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
-DevPathFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FILEPATH_DEVICE_PATH *Fp;\r
-\r
- Fp = DevPath;\r
- CatPrint (Str, L"%s", Fp->PathName);\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
-DevPathMediaProtocol (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;\r
-\r
- MediaProt = DevPath;\r
- CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);\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
-DevPathFvFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;\r
-\r
- FvFilePath = DevPath;\r
- CatPrint (Str, L"%g", &FvFilePath->FvFileName);\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
-DevPathRelativeOffsetRange (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
-\r
- Offset = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Offset(%lx,%lx)",\r
- Offset->StartingOffset,\r
- Offset->EndingOffset\r
- );\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
-DevPathBssBss (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- BBS_BBS_DEVICE_PATH *Bbs;\r
- CHAR16 *Type;\r
-\r
- Bbs = DevPath;\r
- switch (Bbs->DeviceType) {\r
- case BBS_TYPE_FLOPPY:\r
- Type = L"Floppy";\r
- break;\r
-\r
- case BBS_TYPE_HARDDRIVE:\r
- Type = L"Harddrive";\r
- break;\r
-\r
- case BBS_TYPE_CDROM:\r
- Type = L"CDROM";\r
- break;\r
-\r
- case BBS_TYPE_PCMCIA:\r
- Type = L"PCMCIA";\r
- break;\r
-\r
- case BBS_TYPE_USB:\r
- Type = L"Usb";\r
- break;\r
-\r
- case BBS_TYPE_EMBEDDED_NETWORK:\r
- Type = L"Net";\r
- break;\r
-\r
- case BBS_TYPE_BEV:\r
- Type = L"BEV";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
- CatPrint (Str, L"Legacy-%s", Type);\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
-DevPathEndInstance (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L",");\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
-DevPathNodeUnknown (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L"?");\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 maximum length reserved\r
- for the string buffer.\r
- @param DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFvPath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_DEVICE_PATH *FvPath;\r
-\r
- FvPath = DevPath;\r
- CatPrint (Str, L"Fv(%g)", &FvPath->FvName);\r
-}\r
-\r
-DEVICE_PATH_STRING_TABLE DevPathTable[] = {\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCI_DP,\r
- DevPathPci\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCCARD_DP,\r
- DevPathPccard\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_MEMMAP_DP,\r
- DevPathMemMap\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_CONTROLLER_DP,\r
- DevPathController\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_DP,\r
- DevPathAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_EXTENDED_DP,\r
- DevPathExtendedAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_ADR_DP,\r
- DevPathAdrAcpi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_ATAPI_DP,\r
- DevPathAtapi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SCSI_DP,\r
- DevPathScsi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_FIBRECHANNEL_DP,\r
- DevPathFibre\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_1394_DP,\r
- DevPath1394\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_DP,\r
- DevPathUsb\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_WWID_DP,\r
- DevPathUsbWWID\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_DEVICE_LOGICAL_UNIT_DP,\r
- DevPathLogicalUnit\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_CLASS_DP,\r
- DevPathUsbClass\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SATA_DP,\r
- DevPathSata\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_I2O_DP,\r
- DevPathI2O\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_MAC_ADDR_DP,\r
- DevPathMacAddr\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv4_DP,\r
- DevPathIPv4\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv6_DP,\r
- DevPathIPv6\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_INFINIBAND_DP,\r
- DevPathInfiniBand\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_UART_DP,\r
- DevPathUart\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- 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
- DevPathHardDrive\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_CDROM_DP,\r
- DevPathCDROM\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_FILEPATH_DP,\r
- DevPathFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PROTOCOL_DP,\r
- DevPathMediaProtocol\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_VOL_DP,\r
- DevPathFvPath,\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_FILE_DP,\r
- DevPathFvFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_RELATIVE_OFFSET_RANGE_DP,\r
- DevPathRelativeOffsetRange,\r
- },\r
- {\r
- BBS_DEVICE_PATH,\r
- BBS_BBS_DP,\r
- DevPathBssBss\r
- },\r
- {\r
- END_DEVICE_PATH_TYPE,\r
- END_INSTANCE_DEVICE_PATH_SUBTYPE,\r
- DevPathEndInstance\r
- },\r
- {\r
- 0,\r
- 0,\r
- NULL\r
- }\r
-};\r
-\r
-\r
/**\r
This function converts an input device structure to a Unicode string.\r
\r
IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
)\r
{\r
- POOL_PRINT Str;\r
- EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
- VOID (*DumpNode) (POOL_PRINT *, VOID *);\r
-\r
- UINTN Index;\r
- UINTN NewSize;\r
-\r
- EFI_STATUS Status;\r
- CHAR16 *ToText;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-\r
- ZeroMem (&Str, sizeof (Str));\r
-\r
- if (DevPath == NULL) {\r
- goto Done;\r
- }\r
-\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevPathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- ToText = DevPathToText->ConvertDevicePathToText (\r
- DevPath,\r
- FALSE,\r
- TRUE\r
- );\r
- ASSERT (ToText != NULL);\r
- return ToText;\r
- }\r
-\r
- //\r
- // Process each device path node\r
- //\r
- DevPathNode = DevPath;\r
- while (!IsDevicePathEnd (DevPathNode)) {\r
- //\r
- // Find the handler to dump this device path node\r
- //\r
- DumpNode = NULL;\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
- ) {\r
- DumpNode = DevPathTable[Index].Function;\r
- break;\r
- }\r
- }\r
- //\r
- // If not found, use a generic function\r
- //\r
- if (!DumpNode) {\r
- DumpNode = DevPathNodeUnknown;\r
- }\r
- //\r
- // Put a path seperator in if needed\r
- //\r
- if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {\r
- CatPrint (&Str, L"/");\r
- }\r
- //\r
- // Print this node of the device path\r
- //\r
- DumpNode (&Str, DevPathNode);\r
-\r
- //\r
- // Next device path node\r
- //\r
- DevPathNode = NextDevicePathNode (DevPathNode);\r
- }\r
-\r
-Done:\r
- NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
- Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
- ASSERT (Str.Str != NULL);\r
- Str.Str[Str.Len] = 0;\r
- return Str.Str;\r
+ return ConvertDevicePathToText (DevPath, TRUE, TRUE);\r
}\r
# 2) BDS boot device connect interface;\r
# 3) BDS Misc interfaces for mainting boot variable, ouput string, etc.\r
# \r
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2013, 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
ReportStatusCodeLib\r
\r
[Guids]\r
- gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal)\r
- gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## CONSUMES ## GUID HOB (The hob holding memory type information)\r
gEfiMemoryTypeInformationGuid ## CONSUMES ## GUID (The identifier of memory type information type in system table)\r
- gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable)\r
- ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array)\r
- ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)\r
gEfiGlobalVariableGuid ## SOMETIMES_PRODUCES ## Variable:L"BootCurrent" (The boot option of current boot)\r
gEfiFileInfoGuid ## CONSUMES ## GUID\r
- gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal)\r
gPerformanceProtocolGuid ## SOMETIMES_PRODUCES ## Variable:L"PerfDataMemAddr" (The ACPI address of performance data)\r
gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device)\r
- gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device)\r
gLastEnumLangGuid ## SOMETIMES_PRODUCES ## Variable:L"LastEnumLang" (Platform language at last time enumeration.)\r
gHdBootDevicePathVariablGuid ## SOMETIMES_PRODUCES ## Variable:L"HDDP" (The device path of Boot file on Hard device.)\r
gBdsLibStringPackageGuid ## PRODUCES ## GUID (HII String PackageList Guid)\r
gEfiSimpleTextOutProtocolGuid # PROTOCOL CONSUMES\r
gEfiPciIoProtocolGuid # PROTOCOL CONSUMES\r
gEfiLoadedImageProtocolGuid # PROTOCOL CONSUMES\r
- gEfiDevicePathToTextProtocolGuid # PROTOCOL SOMETIMES_CONSUMES\r
gEfiSimpleNetworkProtocolGuid # PROTOCOL CONSUMES\r
gEfiDebugPortProtocolGuid # PROTOCOL CONSUMES\r
gEfiSimpleTextInProtocolGuid # PROTOCOL CONSUMES\r
#include <Protocol/LegacyBios.h>\r
#include <Protocol/SimpleTextOut.h>\r
#include <Protocol/SimpleNetwork.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/FirmwareVolume2.h>\r
#include <Protocol/PciIo.h>\r
#include <Protocol/AcpiS3Save.h>\r
/** @file\r
Header files and data structures needed by PCI Bus module.\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, 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
#include <Protocol/IncompatiblePciDeviceSupport.h>\r
#include <Protocol/PciOverride.h>\r
#include <Protocol/PciEnumerationComplete.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/DebugLib.h>\r
#include <Library/UefiDriverEntryPoint.h>\r
# space for these devices. Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable\r
# hot plug supporting.\r
#\r
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiPciRootBridgeIoProtocolGuid ## CONSUMED\r
gEfiIncompatiblePciDeviceSupportProtocolGuid ## CONSUMED\r
gEfiLoadFile2ProtocolGuid ## CONSUMED\r
- gEfiDevicePathToTextProtocolGuid ## CONSUMED\r
\r
[FeaturePcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport\r
PCI_RESOURCE_NODE *ChildPMem32Node;\r
PCI_RESOURCE_NODE *ChildMem64Node;\r
PCI_RESOURCE_NODE *ChildPMem64Node;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *ToText;\r
CHAR16 *Str;\r
\r
DEBUG ((EFI_D_INFO, "PciBus: Resource Map for "));\r
Bridge->BusNumber, Bridge->DeviceNumber, Bridge->FunctionNumber\r
));\r
} else {\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &ToText\r
- );\r
- Str = NULL;\r
- if (!EFI_ERROR (Status)) {\r
- Str = ToText->ConvertDevicePathToText (\r
- DevicePathFromHandle (Bridge->Handle),\r
- FALSE,\r
- FALSE\r
- );\r
- }\r
+ Str = ConvertDevicePathToText (\r
+ DevicePathFromHandle (Bridge->Handle),\r
+ FALSE,\r
+ FALSE\r
+ );\r
DEBUG ((EFI_D_INFO, "Root Bridge %s\n", Str != NULL ? Str : L""));\r
if (Str != NULL) {\r
FreePool (Str);\r
MY_EFI_VARSTORE_DATA *VarStoreConfig;\r
EFI_INPUT_KEY HotKey;\r
EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *PathToText;\r
\r
//\r
// Initialize the local variables.\r
//\r
ConfigRequestHdr = NULL;\r
NewString = NULL;\r
- PathToText = NULL;\r
\r
//\r
// Initialize screen dimensions for SendForm().\r
}\r
\r
PrivateData->HiiHandle[1] = HiiHandle[1];\r
- \r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &PathToText\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
\r
//\r
// Update the device path string.\r
//\r
- NewString = PathToText->ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)&mHiiVendorDevicePath0, FALSE, FALSE);\r
+ NewString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)&mHiiVendorDevicePath0, FALSE, FALSE);\r
if (HiiSetString (HiiHandle[0], STRING_TOKEN (STR_DEVICE_PATH), NewString, NULL) == 0) {\r
DriverSampleUnload (ImageHandle);\r
return EFI_OUT_OF_RESOURCES;\r
#include <Protocol/HiiDatabase.h>\r
#include <Protocol/HiiString.h>\r
#include <Protocol/FormBrowserEx.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Guid/MdeModuleHii.h>\r
#include <Library/DebugLib.h>\r
HiiLib\r
PrintLib\r
UefiLib\r
+ DevicePathLib\r
\r
[Guids]\r
gEfiIfrTianoGuid ## CONSUMES ## Guid\r
gEfiHiiDatabaseProtocolGuid ## CONSUMES\r
gEfiSimpleTextInputExProtocolGuid ## CONSUMES\r
gEfiFormBrowserExProtocolGuid ## CONSUMES\r
- gEfiDevicePathToTextProtocolGuid ## CONSUMES\r
\r
[Depex]\r
gEfiSimpleTextOutProtocolGuid AND gEfiHiiDatabaseProtocolGuid AND gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
Ihe internal heder file includes the required Protocol/Guid/Library\r
and the shared function APIs.\r
\r
-Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, 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
#include <Protocol/ComponentName2.h>\r
#include <Protocol/ComponentName.h>\r
#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/PlatformDriverOverride.h>\r
#include <Guid/MdeModuleHii.h>\r
4. It save all the mapping info in NV variables which will be consumed\r
by platform override protocol driver to publish the platform override protocol.\r
\r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, 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
};\r
\r
/**\r
- Converting a given device to an unicode string. \r
- \r
- This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol\r
- does not installed, then return unknown device path L"?" directly.\r
- \r
+ Converting a given device to an unicode string.\r
+\r
@param DevPath Given device path instance\r
\r
@return Converted string from given device path.\r
- @retval L"?" Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.\r
+ @retval L"?" Converting failed.\r
**/\r
CHAR16 *\r
DevicePathToStr (\r
IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
- CHAR16 *ToText;\r
- \r
- if (DevPath == NULL) {\r
- return L"";\r
- }\r
- \r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevPathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- ToText = DevPathToText->ConvertDevicePathToText (\r
- DevPath,\r
- FALSE,\r
- TRUE\r
- );\r
- ASSERT (ToText != NULL);\r
- return ToText;\r
+ CHAR16 *Text;\r
+ Text = ConvertDevicePathToText (\r
+ DevPath,\r
+ FALSE,\r
+ TRUE\r
+ );\r
+ if (Text == NULL) {\r
+ return AllocateCopyPool (sizeof (L"?"), L"?");\r
+ } else {\r
+ return Text;\r
}\r
-\r
- return L"?";\r
}\r
\r
/**\r
# 4. It save all the mapping info in NV variables for the following boot, \r
# which will be consumed by GetDriver API of the produced the platform override protocol.\r
#\r
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiFormBrowser2ProtocolGuid ## CONSUMED\r
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED\r
gEfiHiiConfigAccessProtocolGuid ## PRODUCED\r
- gEfiDevicePathToTextProtocolGuid ## CONSUMED\r
gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED\r
\r
[Depex]\r
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf\r
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
MdeModulePkg/Core/Dxe/DxeMain.inf {\r
<LibraryClasses>\r
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
<BuildOptions>\r
*_*_IA32_CC_FLAGS =\r
}\r
<LibraryClasses>\r
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
}\r
- MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
+ MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {\r
+ <LibraryClasses>\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ }\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
INF Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf\r
}\r
APRIORI DXE {\r
+ INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
INF Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
}\r
/** @file\r
Platform BDS customizations.\r
\r
- Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2004 - 2013, 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
// Print Device Path\r
//\r
DevPathStr = DevicePathToStr(DevicePath);\r
- DEBUG((\r
- EFI_D_INFO,\r
- "BdsPlatform.c+%d: COM%d DevPath: %s\n",\r
- __LINE__,\r
- gPnp16550ComPortDeviceNode.UID + 1,\r
- DevPathStr\r
- ));\r
- FreePool(DevPathStr);\r
+ if (DevPathStr != NULL) {\r
+ DEBUG((\r
+ EFI_D_INFO,\r
+ "BdsPlatform.c+%d: COM%d DevPath: %s\n",\r
+ __LINE__,\r
+ gPnp16550ComPortDeviceNode.UID + 1,\r
+ DevPathStr\r
+ ));\r
+ FreePool(DevPathStr);\r
+ }\r
\r
BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL);\r
BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL);\r
// Print Device Path\r
//\r
DevPathStr = DevicePathToStr(DevicePath);\r
- DEBUG((\r
- EFI_D_INFO,\r
- "BdsPlatform.c+%d: COM%d DevPath: %s\n",\r
- __LINE__,\r
- gPnp16550ComPortDeviceNode.UID + 1,\r
- DevPathStr\r
- ));\r
- FreePool(DevPathStr);\r
+ if (DevPathStr != NULL) {\r
+ DEBUG((\r
+ EFI_D_INFO,\r
+ "BdsPlatform.c+%d: COM%d DevPath: %s\n",\r
+ __LINE__,\r
+ gPnp16550ComPortDeviceNode.UID + 1,\r
+ DevPathStr\r
+ ));\r
+ FreePool(DevPathStr);\r
+ }\r
\r
BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL);\r
BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL);\r
// Print Device Path\r
//\r
DevPathStr = DevicePathToStr (DevicePath);\r
- DEBUG((\r
- EFI_D_INFO,\r
- "Found Mass Storage device: %s\n",\r
- DevPathStr\r
- ));\r
- FreePool(DevPathStr);\r
+ if (DevPathStr != NULL) {\r
+ DEBUG((\r
+ EFI_D_INFO,\r
+ "Found Mass Storage device: %s\n",\r
+ DevPathStr\r
+ ));\r
+ FreePool(DevPathStr);\r
+ }\r
\r
Status = gBS->ConnectController (Handle, NULL, NULL, TRUE);\r
if (EFI_ERROR (Status)) {\r
/** @file\r
Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file.\r
\r
- Copyright (C) 2012, Red Hat, Inc.\r
+ Copyright (C) 2012 - 2013, Red Hat, Inc.\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/PrintLib.h>\r
-#include <Protocol/DevicePathToText.h>\r
+#include <Library/DevicePathLib.h>\r
#include <Guid/GlobalVariable.h>\r
\r
\r
Match (\r
IN CONST CHAR16 *Translated,\r
IN UINTN TranslatedLength,\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
- IN CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText\r
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
{\r
CHAR16 *Converted;\r
BOOLEAN Result;\r
\r
- Converted = DevPathToText->ConvertDevicePathToText (\r
- DevicePath,\r
- FALSE, // DisplayOnly\r
- FALSE // AllowShortcuts\r
- );\r
+ Converted = ConvertDevicePathToText (\r
+ DevicePath,\r
+ FALSE, // DisplayOnly\r
+ FALSE // AllowShortcuts\r
+ );\r
if (Converted == NULL) {\r
return FALSE;\r
}\r
)\r
{\r
RETURN_STATUS Status;\r
-\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-\r
FIRMWARE_CONFIG_ITEM FwCfgItem;\r
UINTN FwCfgSize;\r
CHAR8 *FwCfg;\r
UINTN TranslatedSize;\r
CHAR16 Translated[TRANSLATION_OUTPUT_SIZE];\r
\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL, // optional registration key\r
- (VOID **) &DevPathToText\r
- );\r
- if (Status != EFI_SUCCESS) {\r
- return Status;\r
- }\r
-\r
Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize);\r
if (Status != RETURN_SUCCESS) {\r
return Status;\r
Match (\r
Translated,\r
TranslatedSize, // contains length, not size, in CHAR16's here\r
- BootOption->DevicePath,\r
- DevPathToText\r
+ BootOption->DevicePath\r
)\r
) {\r
//\r
## @file\r
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform\r
#\r
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf\r
NvVarsFileLib|OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf\r
FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf\r
UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf\r
MdeModulePkg/Core/Dxe/DxeMain.inf {\r
<LibraryClasses>\r
NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
}\r
\r
IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
- MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
+ MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {\r
+ <LibraryClasses>\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
+ }\r
MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
## @file\r
# Open Virtual Machine Firmware: FDF\r
#\r
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
READ_LOCK_STATUS = TRUE\r
\r
APRIORI DXE {\r
+ INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
}\r
\r
/** @file\r
Internal function defines the default device path string for SecureBoot configuration module.\r
\r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2013, 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
\r
#include "SecureBootConfigImpl.h"\r
\r
-/**\r
- Concatenates a formatted unicode string to allocated pool.\r
- The caller must free the resulting buffer.\r
-\r
- @param[in, out] Str Tracks the allocated pool, size in use, and amount of pool allocated.\r
- @param[in] Fmt The format string\r
- @param[in] ... The data will be printed.\r
-\r
- @return Allocated buffer with the formatted string printed in it.\r
- The caller must free the allocated buffer.\r
- The buffer allocation is not packed.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-CatPrint (\r
- IN OUT POOL_PRINT *Str,\r
- IN CHAR16 *Fmt,\r
- ...\r
- )\r
-{\r
- UINT16 *AppendStr;\r
- VA_LIST Args;\r
- UINTN StringSize;\r
-\r
- AppendStr = AllocateZeroPool (0x1000);\r
- if (AppendStr == NULL) {\r
- return Str->Str;\r
- }\r
-\r
- VA_START (Args, Fmt);\r
- UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args);\r
- VA_END (Args);\r
- if (NULL == Str->Str) {\r
- StringSize = StrSize (AppendStr);\r
- Str->Str = AllocateZeroPool (StringSize);\r
- ASSERT (Str->Str != NULL);\r
- } else {\r
- StringSize = StrSize (AppendStr);\r
- StringSize += (StrSize (Str->Str) - sizeof (UINT16));\r
-\r
- Str->Str = ReallocatePool (\r
- StrSize (Str->Str),\r
- StringSize,\r
- Str->Str\r
- );\r
- ASSERT (Str->Str != NULL);\r
- }\r
-\r
- Str->Maxlen = MAX_CHAR * sizeof (UINT16);\r
- if (StringSize < Str->Maxlen) {\r
- StrCat (Str->Str, AppendStr);\r
- Str->Len = StringSize - sizeof (UINT16);\r
- }\r
-\r
- FreePool (AppendStr);\r
- return Str->Str;\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathPci (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCI_DEVICE_PATH *Pci;\r
-\r
- Pci = DevPath;\r
- CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathPccard (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCCARD_DEVICE_PATH *Pccard;\r
-\r
- Pccard = DevPath;\r
- CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMemMap (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEMMAP_DEVICE_PATH *MemMap;\r
-\r
- MemMap = DevPath;\r
- CatPrint (\r
- Str,\r
- L"MemMap(%d:%lx-%lx)",\r
- (UINTN) MemMap->MemoryType,\r
- MemMap->StartingAddress,\r
- MemMap->EndingAddress\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathController (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CONTROLLER_DEVICE_PATH *Controller;\r
-\r
- Controller = DevPath;\r
- CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);\r
-}\r
-\r
-\r
-/**\r
- Convert Vendor device path to device name.\r
-\r
- @param[in, out] Str The buffer store device name\r
- @param[in] DevPath Pointer to vendor device path\r
-\r
-**/\r
-VOID\r
-DevPathVendor (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- VENDOR_DEVICE_PATH *Vendor;\r
- CHAR16 *Type;\r
- UINTN DataLength;\r
- UINTN Index;\r
- UINT32 FlowControlMap;\r
-\r
- UINT16 Info;\r
-\r
- Vendor = DevPath;\r
-\r
- switch (DevicePathType (&Vendor->Header)) {\r
- case HARDWARE_DEVICE_PATH:\r
- Type = L"Hw";\r
- break;\r
-\r
- case MESSAGING_DEVICE_PATH:\r
- Type = L"Msg";\r
- if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) {\r
- CatPrint (Str, L"VenPcAnsi()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) {\r
- CatPrint (Str, L"VenVt100()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) {\r
- CatPrint (Str, L"VenVt100Plus()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
- CatPrint (Str, L"VenUft8()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {\r
- FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
- switch (FlowControlMap & 0x00000003) {\r
- case 0:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"None");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
-\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
- CatPrint (\r
- Str,\r
- L"SAS(%lx,%lx,%x,",\r
- ((SAS_DEVICE_PATH *) Vendor)->SasAddress,\r
- ((SAS_DEVICE_PATH *) Vendor)->Lun,\r
- (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
- );\r
- Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);\r
- if ((Info & 0x0f) == 0) {\r
- CatPrint (Str, L"NoTopology,0,0,0,");\r
- } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {\r
- CatPrint (\r
- Str,\r
- L"%s,%s,%s,",\r
- ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
- ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
- ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
- );\r
- if ((Info & 0x0f) == 1) {\r
- CatPrint (Str, L"0,");\r
- } else {\r
- CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));\r
- }\r
- } else {\r
- CatPrint (Str, L"0,0,0,0,");\r
- }\r
-\r
- CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {\r
- CatPrint (Str, L"DebugPort()");\r
- return ;\r
- }\r
- break;\r
-\r
- case MEDIA_DEVICE_PATH:\r
- Type = L"Media";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
-\r
- CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);\r
- DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH);\r
- if (DataLength > 0) {\r
- CatPrint (Str, L",");\r
- for (Index = 0; Index < DataLength; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);\r
- }\r
- }\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_HID_DEVICE_PATH *Acpi;\r
-\r
- Acpi = DevPath;\r
- if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);\r
- } else {\r
- CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathExtendedAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
- \r
- //\r
- // Index for HID, UID and CID strings, 0 for non-exist\r
- //\r
- UINT16 HIDSTRIdx;\r
- UINT16 UIDSTRIdx;\r
- UINT16 CIDSTRIdx;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 Anchor;\r
- CHAR8 *AsChar8Array;\r
-\r
- HIDSTRIdx = 0;\r
- UIDSTRIdx = 0;\r
- CIDSTRIdx = 0;\r
- ExtendedAcpi = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi);\r
-\r
- AsChar8Array = (CHAR8 *) ExtendedAcpi;\r
-\r
- //\r
- // find HIDSTR\r
- //\r
- Anchor = 16;\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- HIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find UIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- UIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find CIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- CIDSTRIdx = Anchor;\r
- }\r
-\r
- if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) {\r
- CatPrint (Str, L"AcpiExp(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- } else {\r
- CatPrint (Str, L"AcpiEx(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);\r
-\r
- if (HIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (CIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- }\r
-\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAdrAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_ADR_DEVICE_PATH *AcpiAdr;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 AdditionalAdrCount;\r
-\r
- AcpiAdr = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);\r
- AdditionalAdrCount = (UINT16) ((Length - 8) / 4);\r
-\r
- CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);\r
- for (Index = 0; Index < AdditionalAdrCount; Index++) {\r
- CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));\r
- }\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAtapi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ATAPI_DEVICE_PATH *Atapi;\r
-\r
- Atapi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Ata(%s,%s)",\r
- (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",\r
- (Atapi->SlaveMaster != 0)? L"Slave" : L"Master"\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathScsi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SCSI_DEVICE_PATH *Scsi;\r
-\r
- Scsi = DevPath;\r
- CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
- \r
-**/\r
-VOID\r
-DevPathFibre (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FIBRECHANNEL_DEVICE_PATH *Fibre;\r
-\r
- Fibre = DevPath;\r
- CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPath1394 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- F1394_DEVICE_PATH *F1394Path;\r
-\r
- F1394Path = DevPath;\r
- CatPrint (Str, L"1394(%lx)", &F1394Path->Guid);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
- \r
-**/\r
-VOID\r
-DevPathUsb (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_DEVICE_PATH *Usb;\r
-\r
- Usb = DevPath;\r
- CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUsbWWID (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_WWID_DEVICE_PATH *UsbWWId;\r
-\r
- UsbWWId = DevPath;\r
- CatPrint (\r
- Str,\r
- L"UsbWwid(%x,%x,%x,\"WWID\")",\r
- (UINTN) UsbWWId->VendorId,\r
- (UINTN) UsbWWId->ProductId,\r
- (UINTN) UsbWWId->InterfaceNumber\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathLogicalUnit (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;\r
-\r
- LogicalUnit = DevPath;\r
- CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUsbClass (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_CLASS_DEVICE_PATH *UsbClass;\r
-\r
- UsbClass = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Usb Class(%x,%x,%x,%x,%x)",\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
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathSata (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SATA_DEVICE_PATH *Sata;\r
-\r
- Sata = DevPath;\r
- if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- } else {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->PortMultiplierPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathI2O (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- I2O_DEVICE_PATH *I2OPath;\r
-\r
- I2OPath = DevPath;\r
- CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMacAddr (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MAC_ADDR_DEVICE_PATH *MACDevPath;\r
- UINTN HwAddressSize;\r
- UINTN Index;\r
-\r
- MACDevPath = DevPath;\r
-\r
- HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
- if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {\r
- HwAddressSize = 6;\r
- }\r
-\r
- CatPrint (Str, L"Mac(");\r
-\r
- for (Index = 0; Index < HwAddressSize; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);\r
- }\r
-\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathIPv4 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv4_DEVICE_PATH *IPDevPath;\r
-\r
- IPDevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv4(%d.%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
- (UINTN) IPDevPath->RemotePort\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathIPv6 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv6_DEVICE_PATH *IPv6DevPath;\r
-\r
- IPv6DevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15]\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathInfiniBand (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- INFINIBAND_DEVICE_PATH *InfiniBand;\r
-\r
- InfiniBand = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Infiniband(%x,%g,%lx,%lx,%lx)",\r
- (UINTN) InfiniBand->ResourceFlags,\r
- InfiniBand->PortGid,\r
- InfiniBand->ServiceId,\r
- InfiniBand->TargetPortId,\r
- InfiniBand->DeviceId\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUart (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- UART_DEVICE_PATH *Uart;\r
- CHAR8 Parity;\r
-\r
- Uart = DevPath;\r
- switch (Uart->Parity) {\r
- case 0:\r
- Parity = 'D';\r
- break;\r
-\r
- case 1:\r
- Parity = 'N';\r
- break;\r
-\r
- case 2:\r
- Parity = 'E';\r
- break;\r
-\r
- case 3:\r
- Parity = 'O';\r
- break;\r
-\r
- case 4:\r
- Parity = 'M';\r
- break;\r
-\r
- case 5:\r
- Parity = 'S';\r
- break;\r
-\r
- default:\r
- Parity = 'x';\r
- break;\r
- }\r
-\r
- if (Uart->BaudRate == 0) {\r
- CatPrint (Str, L"Uart(DEFAULT,%c,", Parity);\r
- } else {\r
- CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);\r
- }\r
-\r
- if (Uart->DataBits == 0) {\r
- CatPrint (Str, L"D,");\r
- } else {\r
- CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);\r
- }\r
-\r
- switch (Uart->StopBits) {\r
- case 0:\r
- CatPrint (Str, L"D)");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"1)");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"1.5)");\r
- break;\r
-\r
- case 3:\r
- CatPrint (Str, L"2)");\r
- break;\r
-\r
- default:\r
- CatPrint (Str, L"x)");\r
- break;\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathiSCSI (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ISCSI_DEVICE_PATH_WITH_NAME *IScsi;\r
- UINT16 Options;\r
-\r
- IScsi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"iSCSI(%a,%x,%lx,",\r
- IScsi->TargetName,\r
- (UINTN) IScsi->TargetPortalGroupTag,\r
- IScsi->Lun\r
- );\r
-\r
- Options = IScsi->LoginOption;\r
- CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- if (((Options >> 11) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"None");\r
- } else if (((Options >> 12) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"CHAP_UNI");\r
- } else {\r
- CatPrint (Str, L"%s,", L"CHAP_BI");\r
-\r
- }\r
-\r
- 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[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] 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
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathHardDrive (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- HARDDRIVE_DEVICE_PATH *Hd;\r
-\r
- Hd = DevPath;\r
- switch (Hd->SignatureType) {\r
- case SIGNATURE_TYPE_MBR:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%08x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) *((UINT32 *) (&(Hd->Signature[0])))\r
- );\r
- break;\r
-\r
- case SIGNATURE_TYPE_GUID:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%g)",\r
- (UINTN) Hd->PartitionNumber,\r
- (EFI_GUID *) &(Hd->Signature[0])\r
- );\r
- break;\r
-\r
- default:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,MBRType=%02x,SigType=%02x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) Hd->MBRType,\r
- (UINTN) Hd->SignatureType\r
- );\r
- break;\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathCDROM (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CDROM_DEVICE_PATH *Cd;\r
-\r
- Cd = DevPath;\r
- CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FILEPATH_DEVICE_PATH *Fp;\r
-\r
- Fp = DevPath;\r
- CatPrint (Str, L"%s", Fp->PathName);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMediaProtocol (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;\r
-\r
- MediaProt = DevPath;\r
- CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFvFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;\r
-\r
- FvFilePath = DevPath;\r
- CatPrint (Str, L"%g", &FvFilePath->FvFileName);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathRelativeOffsetRange (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
-\r
- Offset = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Offset(%lx,%lx)",\r
- Offset->StartingOffset,\r
- Offset->EndingOffset\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathBssBss (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- BBS_BBS_DEVICE_PATH *Bbs;\r
- CHAR16 *Type;\r
-\r
- Bbs = DevPath;\r
- switch (Bbs->DeviceType) {\r
- case BBS_TYPE_FLOPPY:\r
- Type = L"Floppy";\r
- break;\r
-\r
- case BBS_TYPE_HARDDRIVE:\r
- Type = L"Harddrive";\r
- break;\r
-\r
- case BBS_TYPE_CDROM:\r
- Type = L"CDROM";\r
- break;\r
-\r
- case BBS_TYPE_PCMCIA:\r
- Type = L"PCMCIA";\r
- break;\r
-\r
- case BBS_TYPE_USB:\r
- Type = L"Usb";\r
- break;\r
-\r
- case BBS_TYPE_EMBEDDED_NETWORK:\r
- Type = L"Net";\r
- break;\r
-\r
- case BBS_TYPE_BEV:\r
- Type = L"BEV";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
- CatPrint (Str, L"Legacy-%s", Type);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathEndInstance (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L",");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathNodeUnknown (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L"?");\r
-}\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFvPath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_DEVICE_PATH *FvPath;\r
-\r
- FvPath = DevPath;\r
- CatPrint (Str, L"Fv(%g)", &FvPath->FvName);\r
-}\r
-\r
-DEVICE_PATH_STRING_TABLE DevPathTable[] = {\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCI_DP,\r
- DevPathPci\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCCARD_DP,\r
- DevPathPccard\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_MEMMAP_DP,\r
- DevPathMemMap\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_CONTROLLER_DP,\r
- DevPathController\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_DP,\r
- DevPathAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_EXTENDED_DP,\r
- DevPathExtendedAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_ADR_DP,\r
- DevPathAdrAcpi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_ATAPI_DP,\r
- DevPathAtapi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SCSI_DP,\r
- DevPathScsi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_FIBRECHANNEL_DP,\r
- DevPathFibre\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_1394_DP,\r
- DevPath1394\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_DP,\r
- DevPathUsb\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_WWID_DP,\r
- DevPathUsbWWID\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_DEVICE_LOGICAL_UNIT_DP,\r
- DevPathLogicalUnit\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_CLASS_DP,\r
- DevPathUsbClass\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SATA_DP,\r
- DevPathSata\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_I2O_DP,\r
- DevPathI2O\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_MAC_ADDR_DP,\r
- DevPathMacAddr\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv4_DP,\r
- DevPathIPv4\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv6_DP,\r
- DevPathIPv6\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_INFINIBAND_DP,\r
- DevPathInfiniBand\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_UART_DP,\r
- DevPathUart\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- 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
- DevPathHardDrive\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_CDROM_DP,\r
- DevPathCDROM\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_FILEPATH_DP,\r
- DevPathFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PROTOCOL_DP,\r
- DevPathMediaProtocol\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_VOL_DP,\r
- DevPathFvPath,\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_FILE_DP,\r
- DevPathFvFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_RELATIVE_OFFSET_RANGE_DP,\r
- DevPathRelativeOffsetRange,\r
- },\r
- {\r
- BBS_DEVICE_PATH,\r
- BBS_BBS_DP,\r
- DevPathBssBss\r
- },\r
- {\r
- END_DEVICE_PATH_TYPE,\r
- END_INSTANCE_DEVICE_PATH_SUBTYPE,\r
- DevPathEndInstance\r
- },\r
- {\r
- 0,\r
- 0,\r
- NULL\r
- }\r
-};\r
-\r
\r
/**\r
This function converts an input device structure to a Unicode string.\r
IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
)\r
{\r
- POOL_PRINT Str;\r
- EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
- VOID (*DumpNode) (POOL_PRINT *, VOID *);\r
-\r
- UINTN Index;\r
- UINTN NewSize;\r
-\r
- EFI_STATUS Status;\r
- CHAR16 *ToText;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-\r
- ZeroMem (&Str, sizeof (Str));\r
-\r
- if (DevPath == NULL) {\r
- goto Done;\r
- }\r
-\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevPathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- ToText = DevPathToText->ConvertDevicePathToText (\r
- DevPath,\r
- FALSE,\r
- TRUE\r
- );\r
- ASSERT (ToText != NULL);\r
- return ToText;\r
- }\r
-\r
- //\r
- // Process each device path node\r
- //\r
- DevPathNode = DevPath;\r
- while (!IsDevicePathEnd (DevPathNode)) {\r
- //\r
- // Find the handler to dump this device path node\r
- //\r
- DumpNode = NULL;\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
- ) {\r
- DumpNode = DevPathTable[Index].Function;\r
- break;\r
- }\r
- }\r
- //\r
- // If not found, use a generic function\r
- //\r
- if (!DumpNode) {\r
- DumpNode = DevPathNodeUnknown;\r
- }\r
- //\r
- // Put a path seperator in if needed\r
- //\r
- if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {\r
- CatPrint (&Str, L"/");\r
- }\r
- //\r
- // Print this node of the device path\r
- //\r
- DumpNode (&Str, DevPathNode);\r
-\r
- //\r
- // Next device path node\r
- //\r
- DevPathNode = NextDevicePathNode (DevPathNode);\r
- }\r
-\r
-Done:\r
- NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
- Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
- ASSERT (Str.Str != NULL);\r
- Str.Str[Str.Len] = 0;\r
- return Str.Str;\r
+ return ConvertDevicePathToText (\r
+ DevPath,\r
+ FALSE,\r
+ TRUE\r
+ );\r
}\r
\r
# Need custom SecureBootConfigDxe for OVMF that does not force\r
# resets after PK changes since OVMF doesn't have persistent variables\r
#\r
-# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2013, 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
UefiHiiServicesLib\r
DebugLib\r
HiiLib\r
- PlatformSecureLib \r
+ PlatformSecureLib\r
+ DevicePathLib\r
\r
[Guids]\r
gEfiIfrTianoGuid\r
gEfiImageSecurityDatabaseGuid ## CONSUMES\r
gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES\r
gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid\r
- gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal)\r
- gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## CONSUMES ## GUID HOB (The hob holding memory type information)\r
- gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable)\r
- ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array)\r
- ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)\r
gEfiFileInfoGuid ## CONSUMES ## GUID\r
- gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal)\r
- gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device)\r
- gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device)\r
\r
[Protocols]\r
gEfiHiiConfigAccessProtocolGuid ## PRODUCES\r
gEfiLoadFileProtocolGuid ## PROTOCOL CONSUMES\r
gEfiBlockIoProtocolGuid ## PROTOCOL CONSUMES\r
gEfiDevicePathProtocolGuid ## PROTOCOL CONSUMES\r
- gEfiDevicePathToTextProtocolGuid\r
- gEfiDebugPortProtocolGuid\r
\r
[Depex]\r
gEfiHiiConfigRoutingProtocolGuid AND\r
The header file of HII Config Access protocol implementation of SecureBoot\r
configuration module.\r
\r
-Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2013, 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
#include <Protocol/SimpleFileSystem.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/DebugPort.h>\r
#include <Protocol/LoadFile.h>\r
\r
## @file\r
# Display Performance Application, Module information file.\r
#\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2013, 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
gEfiDriverBindingProtocolGuid # SOMETIMES_CONSUMED\r
gEfiComponentName2ProtocolGuid # SOMETIMES_CONSUMED\r
gEfiLoadedImageDevicePathProtocolGuid # SOMETIMES_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # SOMETIMES_CONSUMED\r
\r
[Pcd]\r
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize\r
/** @file\r
Utility functions used by the Dp application.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, 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
#include <Protocol/DriverBinding.h>\r
#include <Protocol/ComponentName2.h>\r
#include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Guid/Performance.h>\r
\r
UINTN StringSize;\r
CHAR8 *PlatformLanguage;\r
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;\r
\r
//\r
// Method 1: Get the name string from image PDB\r
//\r
// Method 5: Get the name string from image DevicePath\r
//\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevicePathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
- if (NameString != NULL) {\r
- StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
- FreePool (NameString);\r
- return;\r
- }\r
+ NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
+ if (NameString != NULL) {\r
+ StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
+ mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+ FreePool (NameString);\r
+ return;\r
}\r
}\r
}\r
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf \r
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
#include <Protocol/TcgService.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/DiskIo.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/FirmwareVolumeBlock.h>\r
\r
#include <Guid/MeasuredFvHob.h>\r
// \r
DEBUG_CODE_BEGIN ();\r
CHAR16 *ToText;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevPathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- ToText = DevPathToText->ConvertDevicePathToText (\r
- DevicePathNode,\r
- FALSE,\r
- TRUE\r
- );\r
- if (ToText != NULL) {\r
- DEBUG ((DEBUG_INFO, "The measured image path is %s.\n", ToText));\r
- }\r
+ ToText = ConvertDevicePathToText (\r
+ DevicePathNode,\r
+ FALSE,\r
+ TRUE\r
+ );\r
+ if (ToText != NULL) {\r
+ DEBUG ((DEBUG_INFO, "The measured image path is %s.\n", ToText));\r
+ FreePool (ToText);\r
}\r
DEBUG_CODE_END ();\r
\r
# This external input must be validated carefully to avoid security issue like\r
# buffer overflow, integer overflow.\r
#\r
-# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2013, 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
gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMES\r
gEfiBlockIoProtocolGuid ## CONSUMES\r
gEfiDiskIoProtocolGuid ## CONSUMES\r
- gEfiDevicePathToTextProtocolGuid ## SOMETIMES_CONSUMES (Only used in debug mode)\r
+\r
/** @file\r
The functions for access policy modification.\r
\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, 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
IN VOID *OpCodeHandle\r
)\r
{\r
- EFI_STATUS Status;\r
EFI_DEVICE_PATH_PROTOCOL *Next;\r
EFI_STRING_ID NameID;\r
EFI_STRING DriverName;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathText;\r
\r
- //\r
- // Locate device path to text protocol.\r
- //\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevicePathText\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return ;\r
- }\r
- \r
//\r
// Get driver file name node.\r
//\r
//\r
// Display the device path in form.\r
//\r
- DriverName = DevicePathText->ConvertDevicePathToText (DevicePath, FALSE, FALSE);\r
+ DriverName = ConvertDevicePathToText (DevicePath, FALSE, FALSE);\r
NameID = HiiSetString (mCallbackInfo->HiiHandle, 0, DriverName, NULL);\r
FreePool (DriverName);\r
if (NameID == 0) {\r
/** @file\r
The header file for user profile manager driver.\r
\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, 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
#include <Guid/MdeModuleHii.h>\r
\r
#include <Protocol/HiiConfigAccess.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/UserCredential2.h>\r
#include <Protocol/UserManager.h>\r
\r
## @file\r
# Component description file for user profile manager driver.\r
#\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2013, 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
DebugLib\r
HiiLib\r
UefiLib\r
+ DevicePathLib\r
\r
[Guids]\r
gEfiIfrTianoGuid ## CONSUMES ## Guid\r
gEfiHiiConfigAccessProtocolGuid\r
gEfiUserCredential2ProtocolGuid\r
gEfiUserManagerProtocolGuid\r
- gEfiDevicePathToTextProtocolGuid\r
\r
[Depex]\r
gEfiUserManagerProtocolGuid
\ No newline at end of file
/** @file\r
Internal function defines the default device path string for SecureBoot configuration module.\r
\r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2013, 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
\r
#include "SecureBootConfigImpl.h"\r
\r
-/**\r
- Concatenates a formatted unicode string to allocated pool.\r
- The caller must free the resulting buffer.\r
-\r
- @param[in, out] Str Tracks the allocated pool, size in use, and amount of pool allocated.\r
- @param[in] Fmt The format string\r
- @param[in] ... The data will be printed.\r
-\r
- @return Allocated buffer with the formatted string printed in it.\r
- The caller must free the allocated buffer.\r
- The buffer allocation is not packed.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-CatPrint (\r
- IN OUT POOL_PRINT *Str,\r
- IN CHAR16 *Fmt,\r
- ...\r
- )\r
-{\r
- UINT16 *AppendStr;\r
- VA_LIST Args;\r
- UINTN StringSize;\r
-\r
- AppendStr = AllocateZeroPool (0x1000);\r
- if (AppendStr == NULL) {\r
- return Str->Str;\r
- }\r
-\r
- VA_START (Args, Fmt);\r
- UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args);\r
- VA_END (Args);\r
- if (NULL == Str->Str) {\r
- StringSize = StrSize (AppendStr);\r
- Str->Str = AllocateZeroPool (StringSize);\r
- ASSERT (Str->Str != NULL);\r
- } else {\r
- StringSize = StrSize (AppendStr);\r
- StringSize += (StrSize (Str->Str) - sizeof (UINT16));\r
-\r
- Str->Str = ReallocatePool (\r
- StrSize (Str->Str),\r
- StringSize,\r
- Str->Str\r
- );\r
- ASSERT (Str->Str != NULL);\r
- }\r
-\r
- Str->Maxlen = MAX_CHAR * sizeof (UINT16);\r
- if (StringSize < Str->Maxlen) {\r
- StrCat (Str->Str, AppendStr);\r
- Str->Len = StringSize - sizeof (UINT16);\r
- }\r
-\r
- FreePool (AppendStr);\r
- return Str->Str;\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathPci (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCI_DEVICE_PATH *Pci;\r
-\r
- Pci = DevPath;\r
- CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathPccard (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- PCCARD_DEVICE_PATH *Pccard;\r
-\r
- Pccard = DevPath;\r
- CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMemMap (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEMMAP_DEVICE_PATH *MemMap;\r
-\r
- MemMap = DevPath;\r
- CatPrint (\r
- Str,\r
- L"MemMap(%d:%lx-%lx)",\r
- (UINTN) MemMap->MemoryType,\r
- MemMap->StartingAddress,\r
- MemMap->EndingAddress\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathController (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CONTROLLER_DEVICE_PATH *Controller;\r
-\r
- Controller = DevPath;\r
- CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber);\r
-}\r
-\r
-\r
-/**\r
- Convert Vendor device path to device name.\r
-\r
- @param[in, out] Str The buffer store device name\r
- @param[in] DevPath Pointer to vendor device path\r
-\r
-**/\r
-VOID\r
-DevPathVendor (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- VENDOR_DEVICE_PATH *Vendor;\r
- CHAR16 *Type;\r
- UINTN DataLength;\r
- UINTN Index;\r
- UINT32 FlowControlMap;\r
-\r
- UINT16 Info;\r
-\r
- Vendor = DevPath;\r
-\r
- switch (DevicePathType (&Vendor->Header)) {\r
- case HARDWARE_DEVICE_PATH:\r
- Type = L"Hw";\r
- break;\r
-\r
- case MESSAGING_DEVICE_PATH:\r
- Type = L"Msg";\r
- if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) {\r
- CatPrint (Str, L"VenPcAnsi()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) {\r
- CatPrint (Str, L"VenVt100()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) {\r
- CatPrint (Str, L"VenVt100Plus()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
- CatPrint (Str, L"VenUft8()");\r
- return ;\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {\r
- FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
- switch (FlowControlMap & 0x00000003) {\r
- case 0:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"None");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff");\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
-\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
- CatPrint (\r
- Str,\r
- L"SAS(%lx,%lx,%x,",\r
- ((SAS_DEVICE_PATH *) Vendor)->SasAddress,\r
- ((SAS_DEVICE_PATH *) Vendor)->Lun,\r
- (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
- );\r
- Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);\r
- if ((Info & 0x0f) == 0) {\r
- CatPrint (Str, L"NoTopology,0,0,0,");\r
- } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {\r
- CatPrint (\r
- Str,\r
- L"%s,%s,%s,",\r
- ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
- ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
- ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
- );\r
- if ((Info & 0x0f) == 1) {\r
- CatPrint (Str, L"0,");\r
- } else {\r
- CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff));\r
- }\r
- } else {\r
- CatPrint (Str, L"0,0,0,0,");\r
- }\r
-\r
- CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
- return ;\r
-\r
- } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) {\r
- CatPrint (Str, L"DebugPort()");\r
- return ;\r
- }\r
- break;\r
-\r
- case MEDIA_DEVICE_PATH:\r
- Type = L"Media";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
-\r
- CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid);\r
- DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH);\r
- if (DataLength > 0) {\r
- CatPrint (Str, L",");\r
- for (Index = 0; Index < DataLength; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]);\r
- }\r
- }\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_HID_DEVICE_PATH *Acpi;\r
-\r
- Acpi = DevPath;\r
- if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID);\r
- } else {\r
- CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID);\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathExtendedAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
- \r
- //\r
- // Index for HID, UID and CID strings, 0 for non-exist\r
- //\r
- UINT16 HIDSTRIdx;\r
- UINT16 UIDSTRIdx;\r
- UINT16 CIDSTRIdx;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 Anchor;\r
- CHAR8 *AsChar8Array;\r
-\r
- HIDSTRIdx = 0;\r
- UIDSTRIdx = 0;\r
- CIDSTRIdx = 0;\r
- ExtendedAcpi = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi);\r
-\r
- AsChar8Array = (CHAR8 *) ExtendedAcpi;\r
-\r
- //\r
- // find HIDSTR\r
- //\r
- Anchor = 16;\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- HIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find UIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- UIDSTRIdx = Anchor;\r
- }\r
- //\r
- // find CIDSTR\r
- //\r
- Anchor = (UINT16) (Index + 1);\r
- for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) {\r
- ;\r
- }\r
- if (Index > Anchor) {\r
- CIDSTRIdx = Anchor;\r
- }\r
-\r
- if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) {\r
- CatPrint (Str, L"AcpiExp(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- } else {\r
- CatPrint (Str, L"AcpiEx(");\r
- if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID);\r
- }\r
- if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {\r
- CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID));\r
- } else {\r
- CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID);\r
- }\r
- CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID);\r
-\r
- if (HIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (CIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\",");\r
- }\r
- if (UIDSTRIdx != 0) {\r
- CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx);\r
- } else {\r
- CatPrint (Str, L"\"\")");\r
- }\r
- }\r
-\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAdrAcpi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ACPI_ADR_DEVICE_PATH *AcpiAdr;\r
- UINT16 Index;\r
- UINT16 Length;\r
- UINT16 AdditionalAdrCount;\r
-\r
- AcpiAdr = DevPath;\r
- Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr);\r
- AdditionalAdrCount = (UINT16) ((Length - 8) / 4);\r
-\r
- CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR);\r
- for (Index = 0; Index < AdditionalAdrCount; Index++) {\r
- CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4));\r
- }\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathAtapi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ATAPI_DEVICE_PATH *Atapi;\r
-\r
- Atapi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Ata(%s,%s)",\r
- (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary",\r
- (Atapi->SlaveMaster != 0)? L"Slave" : L"Master"\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathScsi (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SCSI_DEVICE_PATH *Scsi;\r
-\r
- Scsi = DevPath;\r
- CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
- \r
-**/\r
-VOID\r
-DevPathFibre (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FIBRECHANNEL_DEVICE_PATH *Fibre;\r
-\r
- Fibre = DevPath;\r
- CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPath1394 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- F1394_DEVICE_PATH *F1394Path;\r
-\r
- F1394Path = DevPath;\r
- CatPrint (Str, L"1394(%lx)", &F1394Path->Guid);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
- \r
-**/\r
-VOID\r
-DevPathUsb (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_DEVICE_PATH *Usb;\r
-\r
- Usb = DevPath;\r
- CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUsbWWID (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_WWID_DEVICE_PATH *UsbWWId;\r
-\r
- UsbWWId = DevPath;\r
- CatPrint (\r
- Str,\r
- L"UsbWwid(%x,%x,%x,\"WWID\")",\r
- (UINTN) UsbWWId->VendorId,\r
- (UINTN) UsbWWId->ProductId,\r
- (UINTN) UsbWWId->InterfaceNumber\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathLogicalUnit (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit;\r
-\r
- LogicalUnit = DevPath;\r
- CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUsbClass (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- USB_CLASS_DEVICE_PATH *UsbClass;\r
-\r
- UsbClass = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Usb Class(%x,%x,%x,%x,%x)",\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
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathSata (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- SATA_DEVICE_PATH *Sata;\r
-\r
- Sata = DevPath;\r
- if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- } else {\r
- CatPrint (\r
- Str,\r
- L"Sata(%x,%x,%x)",\r
- (UINTN) Sata->HBAPortNumber,\r
- (UINTN) Sata->PortMultiplierPortNumber,\r
- (UINTN) Sata->Lun\r
- );\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathI2O (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- I2O_DEVICE_PATH *I2OPath;\r
-\r
- I2OPath = DevPath;\r
- CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMacAddr (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MAC_ADDR_DEVICE_PATH *MACDevPath;\r
- UINTN HwAddressSize;\r
- UINTN Index;\r
-\r
- MACDevPath = DevPath;\r
-\r
- HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
- if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {\r
- HwAddressSize = 6;\r
- }\r
-\r
- CatPrint (Str, L"Mac(");\r
-\r
- for (Index = 0; Index < HwAddressSize; Index++) {\r
- CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]);\r
- }\r
-\r
- CatPrint (Str, L")");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathIPv4 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv4_DEVICE_PATH *IPDevPath;\r
-\r
- IPDevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv4(%d.%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
- (UINTN) IPDevPath->RemotePort\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathIPv6 (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- IPv6_DEVICE_PATH *IPv6DevPath;\r
-\r
- IPv6DevPath = DevPath;\r
- CatPrint (\r
- Str,\r
- L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14],\r
- (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15]\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathInfiniBand (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- INFINIBAND_DEVICE_PATH *InfiniBand;\r
-\r
- InfiniBand = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Infiniband(%x,%g,%lx,%lx,%lx)",\r
- (UINTN) InfiniBand->ResourceFlags,\r
- InfiniBand->PortGid,\r
- InfiniBand->ServiceId,\r
- InfiniBand->TargetPortId,\r
- InfiniBand->DeviceId\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathUart (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- UART_DEVICE_PATH *Uart;\r
- CHAR8 Parity;\r
-\r
- Uart = DevPath;\r
- switch (Uart->Parity) {\r
- case 0:\r
- Parity = 'D';\r
- break;\r
-\r
- case 1:\r
- Parity = 'N';\r
- break;\r
-\r
- case 2:\r
- Parity = 'E';\r
- break;\r
-\r
- case 3:\r
- Parity = 'O';\r
- break;\r
-\r
- case 4:\r
- Parity = 'M';\r
- break;\r
-\r
- case 5:\r
- Parity = 'S';\r
- break;\r
-\r
- default:\r
- Parity = 'x';\r
- break;\r
- }\r
-\r
- if (Uart->BaudRate == 0) {\r
- CatPrint (Str, L"Uart(DEFAULT,%c,", Parity);\r
- } else {\r
- CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity);\r
- }\r
-\r
- if (Uart->DataBits == 0) {\r
- CatPrint (Str, L"D,");\r
- } else {\r
- CatPrint (Str, L"%d,", (UINTN) Uart->DataBits);\r
- }\r
-\r
- switch (Uart->StopBits) {\r
- case 0:\r
- CatPrint (Str, L"D)");\r
- break;\r
-\r
- case 1:\r
- CatPrint (Str, L"1)");\r
- break;\r
-\r
- case 2:\r
- CatPrint (Str, L"1.5)");\r
- break;\r
-\r
- case 3:\r
- CatPrint (Str, L"2)");\r
- break;\r
-\r
- default:\r
- CatPrint (Str, L"x)");\r
- break;\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathiSCSI (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- ISCSI_DEVICE_PATH_WITH_NAME *IScsi;\r
- UINT16 Options;\r
-\r
- IScsi = DevPath;\r
- CatPrint (\r
- Str,\r
- L"iSCSI(%a,%x,%lx,",\r
- IScsi->TargetName,\r
- (UINTN) IScsi->TargetPortalGroupTag,\r
- IScsi->Lun\r
- );\r
-\r
- Options = IScsi->LoginOption;\r
- CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
- if (((Options >> 11) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"None");\r
- } else if (((Options >> 12) & 0x0001) != 0) {\r
- CatPrint (Str, L"%s,", L"CHAP_UNI");\r
- } else {\r
- CatPrint (Str, L"%s,", L"CHAP_BI");\r
-\r
- }\r
-\r
- 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[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] 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
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathHardDrive (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- HARDDRIVE_DEVICE_PATH *Hd;\r
-\r
- Hd = DevPath;\r
- switch (Hd->SignatureType) {\r
- case SIGNATURE_TYPE_MBR:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%08x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) *((UINT32 *) (&(Hd->Signature[0])))\r
- );\r
- break;\r
-\r
- case SIGNATURE_TYPE_GUID:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,Sig%g)",\r
- (UINTN) Hd->PartitionNumber,\r
- (EFI_GUID *) &(Hd->Signature[0])\r
- );\r
- break;\r
-\r
- default:\r
- CatPrint (\r
- Str,\r
- L"HD(Part%d,MBRType=%02x,SigType=%02x)",\r
- (UINTN) Hd->PartitionNumber,\r
- (UINTN) Hd->MBRType,\r
- (UINTN) Hd->SignatureType\r
- );\r
- break;\r
- }\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathCDROM (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CDROM_DEVICE_PATH *Cd;\r
-\r
- Cd = DevPath;\r
- CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- FILEPATH_DEVICE_PATH *Fp;\r
-\r
- Fp = DevPath;\r
- CatPrint (Str, L"%s", Fp->PathName);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathMediaProtocol (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;\r
-\r
- MediaProt = DevPath;\r
- CatPrint (Str, L"Media(%g)", &MediaProt->Protocol);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFvFilePath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;\r
-\r
- FvFilePath = DevPath;\r
- CatPrint (Str, L"%g", &FvFilePath->FvFileName);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathRelativeOffsetRange (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
-\r
- Offset = DevPath;\r
- CatPrint (\r
- Str,\r
- L"Offset(%lx,%lx)",\r
- Offset->StartingOffset,\r
- Offset->EndingOffset\r
- );\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathBssBss (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- BBS_BBS_DEVICE_PATH *Bbs;\r
- CHAR16 *Type;\r
-\r
- Bbs = DevPath;\r
- switch (Bbs->DeviceType) {\r
- case BBS_TYPE_FLOPPY:\r
- Type = L"Floppy";\r
- break;\r
-\r
- case BBS_TYPE_HARDDRIVE:\r
- Type = L"Harddrive";\r
- break;\r
-\r
- case BBS_TYPE_CDROM:\r
- Type = L"CDROM";\r
- break;\r
-\r
- case BBS_TYPE_PCMCIA:\r
- Type = L"PCMCIA";\r
- break;\r
-\r
- case BBS_TYPE_USB:\r
- Type = L"Usb";\r
- break;\r
-\r
- case BBS_TYPE_EMBEDDED_NETWORK:\r
- Type = L"Net";\r
- break;\r
-\r
- case BBS_TYPE_BEV:\r
- Type = L"BEV";\r
- break;\r
-\r
- default:\r
- Type = L"?";\r
- break;\r
- }\r
- CatPrint (Str, L"Legacy-%s", Type);\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathEndInstance (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L",");\r
-}\r
-\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathNodeUnknown (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- CatPrint (Str, L"?");\r
-}\r
-/**\r
- Convert Device Path to a Unicode string for printing.\r
-\r
- @param[in, out] Str The buffer holding the output string.\r
- This buffer contains the length of the string and \r
- the maixmum length reserved for the string buffer.\r
- @param[in] DevPath The device path.\r
-\r
-**/\r
-VOID\r
-DevPathFvPath (\r
- IN OUT POOL_PRINT *Str,\r
- IN VOID *DevPath\r
- )\r
-{\r
- MEDIA_FW_VOL_DEVICE_PATH *FvPath;\r
-\r
- FvPath = DevPath;\r
- CatPrint (Str, L"Fv(%g)", &FvPath->FvName);\r
-}\r
-\r
-DEVICE_PATH_STRING_TABLE DevPathTable[] = {\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCI_DP,\r
- DevPathPci\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_PCCARD_DP,\r
- DevPathPccard\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_MEMMAP_DP,\r
- DevPathMemMap\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- HARDWARE_DEVICE_PATH,\r
- HW_CONTROLLER_DP,\r
- DevPathController\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_DP,\r
- DevPathAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_EXTENDED_DP,\r
- DevPathExtendedAcpi\r
- },\r
- {\r
- ACPI_DEVICE_PATH,\r
- ACPI_ADR_DP,\r
- DevPathAdrAcpi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_ATAPI_DP,\r
- DevPathAtapi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SCSI_DP,\r
- DevPathScsi\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_FIBRECHANNEL_DP,\r
- DevPathFibre\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_1394_DP,\r
- DevPath1394\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_DP,\r
- DevPathUsb\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_WWID_DP,\r
- DevPathUsbWWID\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_DEVICE_LOGICAL_UNIT_DP,\r
- DevPathLogicalUnit\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_USB_CLASS_DP,\r
- DevPathUsbClass\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_SATA_DP,\r
- DevPathSata\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_I2O_DP,\r
- DevPathI2O\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_MAC_ADDR_DP,\r
- DevPathMacAddr\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv4_DP,\r
- DevPathIPv4\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_IPv6_DP,\r
- DevPathIPv6\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_INFINIBAND_DP,\r
- DevPathInfiniBand\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_UART_DP,\r
- DevPathUart\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- MSG_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MESSAGING_DEVICE_PATH,\r
- 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
- DevPathHardDrive\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_CDROM_DP,\r
- DevPathCDROM\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_VENDOR_DP,\r
- DevPathVendor\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_FILEPATH_DP,\r
- DevPathFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PROTOCOL_DP,\r
- DevPathMediaProtocol\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_VOL_DP,\r
- DevPathFvPath,\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_PIWG_FW_FILE_DP,\r
- DevPathFvFilePath\r
- },\r
- {\r
- MEDIA_DEVICE_PATH,\r
- MEDIA_RELATIVE_OFFSET_RANGE_DP,\r
- DevPathRelativeOffsetRange,\r
- },\r
- {\r
- BBS_DEVICE_PATH,\r
- BBS_BBS_DP,\r
- DevPathBssBss\r
- },\r
- {\r
- END_DEVICE_PATH_TYPE,\r
- END_INSTANCE_DEVICE_PATH_SUBTYPE,\r
- DevPathEndInstance\r
- },\r
- {\r
- 0,\r
- 0,\r
- NULL\r
- }\r
-};\r
-\r
\r
/**\r
This function converts an input device structure to a Unicode string.\r
IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
)\r
{\r
- POOL_PRINT Str;\r
- EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
- VOID (*DumpNode) (POOL_PRINT *, VOID *);\r
-\r
- UINTN Index;\r
- UINTN NewSize;\r
-\r
- EFI_STATUS Status;\r
- CHAR16 *ToText;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-\r
- ZeroMem (&Str, sizeof (Str));\r
-\r
- if (DevPath == NULL) {\r
- goto Done;\r
- }\r
-\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevPathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- ToText = DevPathToText->ConvertDevicePathToText (\r
- DevPath,\r
- FALSE,\r
- TRUE\r
- );\r
- ASSERT (ToText != NULL);\r
- return ToText;\r
- }\r
-\r
- //\r
- // Process each device path node\r
- //\r
- DevPathNode = DevPath;\r
- while (!IsDevicePathEnd (DevPathNode)) {\r
- //\r
- // Find the handler to dump this device path node\r
- //\r
- DumpNode = NULL;\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
- ) {\r
- DumpNode = DevPathTable[Index].Function;\r
- break;\r
- }\r
- }\r
- //\r
- // If not found, use a generic function\r
- //\r
- if (!DumpNode) {\r
- DumpNode = DevPathNodeUnknown;\r
- }\r
- //\r
- // Put a path seperator in if needed\r
- //\r
- if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) {\r
- CatPrint (&Str, L"/");\r
- }\r
- //\r
- // Print this node of the device path\r
- //\r
- DumpNode (&Str, DevPathNode);\r
-\r
- //\r
- // Next device path node\r
- //\r
- DevPathNode = NextDevicePathNode (DevPathNode);\r
- }\r
-\r
-Done:\r
- NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
- Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
- ASSERT (Str.Str != NULL);\r
- Str.Str[Str.Len] = 0;\r
- return Str.Str;\r
+ return ConvertDevicePathToText (\r
+ DevPath,\r
+ FALSE,\r
+ TRUE\r
+ );\r
}\r
\r
## @file\r
# Component name for SecureBoot configuration module.\r
#\r
-# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2013, 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
UefiHiiServicesLib\r
DebugLib\r
HiiLib\r
- PlatformSecureLib \r
+ PlatformSecureLib\r
+ DevicePathLib\r
\r
[Guids]\r
gEfiIfrTianoGuid\r
gEfiImageSecurityDatabaseGuid ## CONSUMES\r
gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES\r
gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid\r
- gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal)\r
- gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## CONSUMES ## GUID HOB (The hob holding memory type information)\r
- gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable)\r
- ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar)\r
- ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array)\r
- ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device)\r
- ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)\r
gEfiFileInfoGuid ## CONSUMES ## GUID\r
- gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal)\r
- gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device)\r
- gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device)\r
\r
[Protocols]\r
gEfiHiiConfigAccessProtocolGuid ## PRODUCES\r
gEfiLoadFileProtocolGuid ## PROTOCOL CONSUMES\r
gEfiBlockIoProtocolGuid ## PROTOCOL CONSUMES\r
gEfiDevicePathProtocolGuid ## PROTOCOL CONSUMES\r
- gEfiDevicePathToTextProtocolGuid\r
- gEfiDebugPortProtocolGuid\r
\r
[Depex]\r
gEfiHiiConfigRoutingProtocolGuid AND\r
#include <Protocol/SimpleFileSystem.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/DebugPort.h>\r
#include <Protocol/LoadFile.h>\r
\r
## @file\r
# This is the shell application\r
#\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiComponentName2ProtocolGuid # ALWAYS_CONSUMED\r
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED\r
gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED\r
\r
[Pcd]\r
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED\r
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
)\r
{\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;\r
EFI_STATUS Status;\r
CHAR16 *Temp;\r
\r
- Status = EFI_SUCCESS;\r
DEBUG_CODE_BEGIN();\r
- DevicePathToText = NULL;\r
\r
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID**)&DevicePathToText);\r
if (Mapping != NULL) {\r
DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));\r
}\r
- if (!EFI_ERROR(Status)) {\r
- if (DevicePath != NULL) {\r
- Temp = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
- DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));\r
- FreePool(Temp);\r
- }\r
- }\r
+ Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
+ DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));\r
+ FreePool(Temp);\r
+\r
DEBUG_CODE_END();\r
return (Status);\r
}\r
{\r
EFI_STATUS Status;\r
EFI_COMPONENT_NAME2_PROTOCOL *CompName2;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
EFI_HANDLE *HandleList;\r
UINTN HandleCount;\r
}\r
}\r
if ((Flags & EFI_DEVICE_NAME_USE_DEVICE_PATH) != 0) {\r
- Status = gBS->LocateProtocol(\r
- &gEfiDevicePathToTextProtocolGuid,\r
+ Status = gBS->OpenProtocol(\r
+ DeviceHandle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ (VOID**)&DevicePath,\r
+ gImageHandle,\r
NULL,\r
- (VOID**)&DevicePathToText);\r
- //\r
- // we now have the device path to text protocol\r
- //\r
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
if (!EFI_ERROR(Status)) {\r
- Status = gBS->OpenProtocol(\r
- DeviceHandle,\r
- &gEfiDevicePathProtocolGuid,\r
- (VOID**)&DevicePath,\r
- gImageHandle,\r
- NULL,\r
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
- if (!EFI_ERROR(Status)) {\r
- //\r
- // use device path to text on the device path\r
- //\r
- *BestDeviceName = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
- return (EFI_SUCCESS);\r
- }\r
+ //\r
+ // use device path to text on the device path\r
+ //\r
+ *BestDeviceName = ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
+ return (EFI_SUCCESS);\r
}\r
}\r
//\r
DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);\r
\r
DEBUG_CODE_BEGIN();\r
- Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE);\r
+ Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE);\r
FreePool(Temp);\r
- Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE);\r
+ Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE);\r
FreePool(Temp);\r
- Temp = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
+ Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
FreePool(Temp);\r
DEBUG_CODE_END();\r
\r
This library is for use ONLY by shell commands linked into the shell application.\r
This library will not funciton if it is used for UEFI Shell 2.0 Applications.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, 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
#include <Protocol/EfiShell.h>\r
#include <Protocol/EfiShellParameters.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/SimpleFileSystem.h>\r
\r
#include <Library/UefiBootServicesTableLib.h>\r
// The extern global protocol poionters.\r
//\r
extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;\r
-extern EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText;\r
extern CONST CHAR16* SupportLevel[];\r
\r
//\r
#include <Protocol/DriverBinding.h>\r
#include <Protocol/ComponentName2.h>\r
#include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Guid/Performance.h>\r
\r
UINTN StringSize;\r
CHAR8 *PlatformLanguage;\r
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;\r
\r
//\r
// Method 1: Get the name string from image PDB\r
//\r
// Method 5: Get the name string from image DevicePath\r
//\r
- Status = gBS->LocateProtocol (\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID **) &DevicePathToText\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
- if (NameString != NULL) {\r
- StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
- FreePool (NameString);\r
- return;\r
- }\r
+ NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
+ if (NameString != NULL) {\r
+ StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
+ mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+ FreePool (NameString);\r
+ return;\r
}\r
}\r
}\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
UefiBootServicesTableLib\r
SortLib\r
PrintLib\r
+ DevicePathLib\r
\r
[Protocols]\r
gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED\r
gEfiDriverBindingProtocolGuid # SOMETIMES_CONSUMED\r
gEfiComponentName2ProtocolGuid # SOMETIMES_CONSUMED\r
gEfiLoadedImageDevicePathProtocolGuid # SOMETIMES_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # SOMETIMES_CONSUMED\r
\r
[Pcd]\r
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize\r
CHAR16 *Temp;\r
CHAR16 *Temp2;\r
EFI_STATUS Status;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
Temp = NULL;\r
\r
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&DevPathToText);\r
+ Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
if (!EFI_ERROR(Status)) {\r
- Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
- if (!EFI_ERROR(Status)) {\r
- //\r
- // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)\r
- //\r
- Temp = DevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
- gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);\r
- }\r
+ //\r
+ // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)\r
+ //\r
+ Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
+ gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);\r
}\r
if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {\r
Temp2 = NULL;\r
\r
// global variables required by library class.\r
EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL;\r
-EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText = NULL;\r
SHELL_MAP_LIST gShellMapList;\r
SHELL_MAP_LIST *gShellCurDir = NULL;\r
\r
return (EFI_DEVICE_ERROR);\r
}\r
}\r
- if (gDevPathToText == NULL) {\r
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&gDevPathToText);\r
- if (EFI_ERROR(Status)) {\r
- return (EFI_DEVICE_ERROR);\r
- }\r
- }\r
return (EFI_SUCCESS);\r
}\r
\r
}\r
\r
gUnicodeCollation = NULL;\r
- gDevPathToText = NULL;\r
gShellCurDir = NULL;\r
\r
return (RETURN_SUCCESS);\r
## @file\r
# Provides interface to shell internal functions for shell commands.\r
#\r
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved. <BR>\r
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. <BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED\r
gEfiShellProtocolGuid # ALWAYS_CONSUMED\r
gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED\r
\r
[Guids]\r
gEfiSasDevicePathGuid # ALWAYS_CONSUMED\r
/** @file\r
Main file for bcfg shell Debug1 function.\r
\r
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
if ((*(UINT16*)(Buffer+4)) != 0) {\r
DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));\r
CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));\r
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
} else {\r
DevPath = NULL;\r
DevPathString = NULL;\r
/** @file\r
Main file for SetVar shell Debug1 function.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
UINTN Size;\r
UINTN LoopVar;\r
EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *DevPathFromText;\r
\r
ShellStatus = SHELL_SUCCESS;\r
Status = EFI_SUCCESS;\r
//\r
Data++;\r
Data++;\r
- Status = gBS->LocateProtocol(&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID**)&DevPathFromText);\r
- ASSERT_EFI_ERROR(Status);\r
- DevPath = DevPathFromText->ConvertTextToDevicePath(Data);\r
+ DevPath = ConvertTextToDevicePath(Data);\r
if (DevPath == NULL) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, Status);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
/** @file\r
Main file for NULL named library for Profile1 shell command functions.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/DriverDiagnostics2.h>\r
#include <Protocol/DriverDiagnostics.h>\r
#include <Protocol/PlatformDriverOverride.h>\r
#include <Protocol/DriverSupportedEfiVersion.h>\r
#include <Protocol/DriverFamilyOverride.h>\r
#include <Protocol/DriverHealth.h>\r
-#include <Protocol/DevicePathFromText.h>\r
#include <Protocol/SimplePointer.h>\r
#include <Protocol/PciRootBridgeIo.h>\r
\r
/** @file\r
Main file for Dh shell Driver1 function.\r
\r
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
return (Status);\r
}\r
DevicePath = LoadedImage->FilePath;\r
- *Name = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
+ *Name = ConvertDevicePathToText(DevicePath, TRUE, TRUE);\r
return (EFI_SUCCESS);\r
}\r
\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"<Unknown>");\r
SHELL_FREE_NON_NULL(TempStringPointer);\r
\r
- TempStringPointer = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, FALSE);\r
+ TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE);\r
ShellPrintHiiEx(\r
-1, \r
-1, \r
/** @file\r
Main file for Drivers shell Driver1 function.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
}\r
RetVal = gEfiShellProtocol->GetFilePathFromDevicePath(FinalPath);\r
if (RetVal == NULL) {\r
- RetVal = gDevPathToText->ConvertDevicePathToText(FinalPath, TRUE, TRUE);\r
+ RetVal = ConvertDevicePathToText(FinalPath, TRUE, TRUE);\r
}\r
FreePool(FinalPath);\r
return (RetVal);\r
/** @file\r
Main file for DrvCfg shell Driver1 function.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
//\r
// print out an error.\r
//\r
- TempDevPathString = gDevPathToText->ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);\r
+ TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);\r
ShellPrintHiiEx(\r
-1, \r
-1, \r
/** @file\r
Main file for NULL named library for Profile1 shell command functions.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
#include <Protocol/DriverDiagnostics2.h>\r
#include <Protocol/DriverDiagnostics.h>\r
#include <Protocol/PlatformDriverOverride.h>\r
/** @file\r
Main file for Unload shell Driver1 function.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
{\r
EFI_LOADED_IMAGE_PROTOCOL *Image;\r
EFI_STATUS Status;\r
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;\r
CHAR16 *DevicePathText;\r
CHAR16 *CodeTypeText;\r
CHAR16 *DataTypeText;\r
if (EFI_ERROR(Status)) {\r
return (EFI_INVALID_PARAMETER);\r
}\r
-\r
- Status = gBS->LocateProtocol(\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID**)&DevicePathToText);\r
- //\r
- // we now have the device path to text protocol\r
- //\r
- if (!EFI_ERROR(Status)) {\r
- DevicePathText = DevicePathToText->ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);\r
- } else {\r
- DevicePathText = NULL;\r
- }\r
-\r
- CodeTypeText = ConvertMemoryType(Image->ImageCodeType);\r
- DataTypeText = ConvertMemoryType(Image->ImageDataType);\r
- PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);\r
+ DevicePathText = ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);\r
+ CodeTypeText = ConvertMemoryType(Image->ImageCodeType);\r
+ DataTypeText = ConvertMemoryType(Image->ImageDataType);\r
+ PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_UNLOAD_VERBOSE), gShellDriver1HiiHandle,\r
ConvertHandleToHandleIndex(TheHandle),\r
TheHandle,\r
if ((*(UINT16*)(Buffer+4)) != 0) {\r
DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));\r
CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));\r
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
} else {\r
DevPath = NULL;\r
DevPathString = NULL;\r
/** @file\r
Main file for NULL named library for install 1 shell command functions.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2013, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
/** @file\r
Main file for NULL named library for level 1 shell command functions.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
if (TempSpot != NULL) {\r
*TempSpot = CHAR_NULL;\r
}\r
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
if (!SFO) {\r
TempLen = StrLen(CurrentName);\r
ShellPrintHiiEx (\r
* functions are non-interactive only\r
\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
## @file\r
# Provides shell level 2 functions\r
#\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
HiiLib\r
HandleParsingLib\r
PathLib\r
+ DevicePathLib\r
\r
[Protocols]\r
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED\r
gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED\r
gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED\r
gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED\r
\r
[Pcd.common]\r
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
\r
#include <Protocol/UnicodeCollation.h>\r
#include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/SortLib.h>\r
+#include <Library/DevicePathLib.h>\r
\r
-STATIC EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathToText = NULL;\r
STATIC EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation = NULL;\r
\r
\r
return 1;\r
}\r
\r
- if (mDevicePathToText == NULL) {\r
- Status = gBS->LocateProtocol(\r
- &gEfiDevicePathToTextProtocolGuid,\r
- NULL,\r
- (VOID**)&mDevicePathToText);\r
-\r
- ASSERT_EFI_ERROR(Status);\r
- }\r
-\r
if (mUnicodeCollation == NULL) {\r
Status = gBS->LocateProtocol(\r
&gEfiUnicodeCollation2ProtocolGuid,\r
ASSERT_EFI_ERROR(Status);\r
}\r
\r
- TextPath1 = mDevicePathToText->ConvertDevicePathToText(\r
+ TextPath1 = ConvertDevicePathToText(\r
DevicePath1,\r
FALSE,\r
FALSE);\r
\r
- TextPath2 = mDevicePathToText->ConvertDevicePathToText(\r
+ TextPath2 = ConvertDevicePathToText(\r
DevicePath2,\r
FALSE,\r
FALSE);\r
## @file\r
# Library used for sorting routines.\r
#\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
BaseMemoryLib\r
DebugLib\r
UefiBootServicesTableLib\r
+ DevicePathLib\r
\r
[Protocols]\r
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED\r
gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED\r
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED\r
\r
[LibraryClasses.common]\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf\r
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf \r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r