diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c index 9d46b1cfb0..2f22e7df7f 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c @@ -2,7 +2,7 @@ BDS internal function define the default device path string, it can be replaced by platform device path. -Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -15,1466 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "InternalBdsLib.h" -/** - Concatenates a formatted unicode string to allocated pool. - The caller must free the resulting buffer. - - @param Str Tracks the allocated pool, size in use, and amount of pool allocated. - @param Fmt The format string - @param ... The data will be printed. - - @return Allocated buffer with the formatted string printed in it. - The caller must free the allocated buffer. - The buffer allocation is not packed. - -**/ -CHAR16 * -EFIAPI -CatPrint ( - IN OUT POOL_PRINT *Str, - IN CHAR16 *Fmt, - ... - ) -{ - UINT16 *AppendStr; - VA_LIST Args; - UINTN StringSize; - - AppendStr = AllocateZeroPool (0x1000); - if (AppendStr == NULL) { - return Str->Str; - } - - VA_START (Args, Fmt); - UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args); - VA_END (Args); - if (NULL == Str->Str) { - StringSize = StrSize (AppendStr); - Str->Str = AllocateZeroPool (StringSize); - ASSERT (Str->Str != NULL); - } else { - StringSize = StrSize (AppendStr); - StringSize += (StrSize (Str->Str) - sizeof (UINT16)); - - Str->Str = ReallocatePool ( - StrSize (Str->Str), - StringSize, - Str->Str - ); - ASSERT (Str->Str != NULL); - } - - Str->Maxlen = MAX_CHAR * sizeof (UINT16); - if (StringSize < Str->Maxlen) { - StrCat (Str->Str, AppendStr); - Str->Len = StringSize - sizeof (UINT16); - } - - FreePool (AppendStr); - return Str->Str; -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathPci ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCI_DEVICE_PATH *Pci; - - Pci = DevPath; - CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathPccard ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCCARD_DEVICE_PATH *Pccard; - - Pccard = DevPath; - CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathMemMap ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEMMAP_DEVICE_PATH *MemMap; - - MemMap = DevPath; - CatPrint ( - Str, - L"MemMap(%d:%lx-%lx)", - (UINTN) MemMap->MemoryType, - MemMap->StartingAddress, - MemMap->EndingAddress - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathController ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CONTROLLER_DEVICE_PATH *Controller; - - Controller = DevPath; - CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber); -} - - -/** - Convert Vendor device path to device name. - - @param Str The buffer store device name - @param DevPath Pointer to vendor device path - -**/ -VOID -DevPathVendor ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VENDOR_DEVICE_PATH *Vendor; - CHAR16 *Type; - UINTN DataLength; - UINTN Index; - UINT32 FlowControlMap; - - UINT16 Info; - - Vendor = DevPath; - - switch (DevicePathType (&Vendor->Header)) { - case HARDWARE_DEVICE_PATH: - Type = L"Hw"; - break; - - case MESSAGING_DEVICE_PATH: - Type = L"Msg"; - if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) { - CatPrint (Str, L"VenPcAnsi()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) { - CatPrint (Str, L"VenVt100()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) { - CatPrint (Str, L"VenVt100Plus()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) { - CatPrint (Str, L"VenUft8()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) { - FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); - switch (FlowControlMap & 0x00000003) { - case 0: - CatPrint (Str, L"UartFlowCtrl(%s)", L"None"); - break; - - case 1: - CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware"); - break; - - case 2: - CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff"); - break; - - default: - break; - } - - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) { - CatPrint ( - Str, - L"SAS(%lx,%lx,%x,", - ((SAS_DEVICE_PATH *) Vendor)->SasAddress, - ((SAS_DEVICE_PATH *) Vendor)->Lun, - (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort - ); - Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology); - if ((Info & 0x0f) == 0) { - CatPrint (Str, L"NoTopology,0,0,0,"); - } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) { - CatPrint ( - Str, - L"%s,%s,%s,", - ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS", - ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal", - ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct" - ); - if ((Info & 0x0f) == 1) { - CatPrint (Str, L"0,"); - } else { - CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff)); - } - } else { - CatPrint (Str, L"0,0,0,0,"); - } - - CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved); - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) { - CatPrint (Str, L"DebugPort()"); - return ; - } - break; - - case MEDIA_DEVICE_PATH: - Type = L"Media"; - break; - - default: - Type = L"?"; - break; - } - - CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid); - DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH); - if (DataLength > 0) { - CatPrint (Str, L","); - for (Index = 0; Index < DataLength; Index++) { - CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]); - } - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_HID_DEVICE_PATH *Acpi; - - Acpi = DevPath; - if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID); - } else { - CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathExtendedAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; - - // - // Index for HID, UID and CID strings, 0 for non-exist - // - UINT16 HIDSTRIdx; - UINT16 UIDSTRIdx; - UINT16 CIDSTRIdx; - UINT16 Index; - UINT16 Length; - UINT16 Anchor; - CHAR8 *AsChar8Array; - - HIDSTRIdx = 0; - UIDSTRIdx = 0; - CIDSTRIdx = 0; - ExtendedAcpi = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi); - - AsChar8Array = (CHAR8 *) ExtendedAcpi; - - // - // find HIDSTR - // - Anchor = 16; - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - HIDSTRIdx = Anchor; - } - // - // find UIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - UIDSTRIdx = Anchor; - } - // - // find CIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - CIDSTRIdx = Anchor; - } - - if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) { - CatPrint (Str, L"AcpiExp("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } else { - CatPrint (Str, L"AcpiEx("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID); - - if (HIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (CIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } - -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathAdrAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_ADR_DEVICE_PATH *AcpiAdr; - UINT16 Index; - UINT16 Length; - UINT16 AdditionalAdrCount; - - AcpiAdr = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr); - AdditionalAdrCount = (UINT16) ((Length - 8) / 4); - - CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR); - for (Index = 0; Index < AdditionalAdrCount; Index++) { - CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4)); - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathAtapi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ATAPI_DEVICE_PATH *Atapi; - - Atapi = DevPath; - CatPrint ( - Str, - L"Ata(%s,%s)", - (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary", - (Atapi->SlaveMaster != 0)? L"Slave" : L"Master" - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathScsi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SCSI_DEVICE_PATH *Scsi; - - Scsi = DevPath; - CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathFibre ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FIBRECHANNEL_DEVICE_PATH *Fibre; - - Fibre = DevPath; - CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPath1394 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - F1394_DEVICE_PATH *F1394Path; - - F1394Path = DevPath; - CatPrint (Str, L"1394(%lx)", &F1394Path->Guid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathUsb ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_DEVICE_PATH *Usb; - - Usb = DevPath; - CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathUsbWWID ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_WWID_DEVICE_PATH *UsbWWId; - - UsbWWId = DevPath; - CatPrint ( - Str, - L"UsbWwid(%x,%x,%x,\"WWID\")", - (UINTN) UsbWWId->VendorId, - (UINTN) UsbWWId->ProductId, - (UINTN) UsbWWId->InterfaceNumber - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathLogicalUnit ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; - - LogicalUnit = DevPath; - CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathUsbClass ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_CLASS_DEVICE_PATH *UsbClass; - - UsbClass = DevPath; - CatPrint ( - Str, - L"Usb Class(%x,%x,%x,%x,%x)", - (UINTN) UsbClass->VendorId, - (UINTN) UsbClass->ProductId, - (UINTN) UsbClass->DeviceClass, - (UINTN) UsbClass->DeviceSubClass, - (UINTN) UsbClass->DeviceProtocol - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathSata ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SATA_DEVICE_PATH *Sata; - - Sata = DevPath; - if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) { - CatPrint ( - Str, - L"Sata(%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->Lun - ); - } else { - CatPrint ( - Str, - L"Sata(%x,%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->PortMultiplierPortNumber, - (UINTN) Sata->Lun - ); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathI2O ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - I2O_DEVICE_PATH *I2OPath; - - I2OPath = DevPath; - CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathMacAddr ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MAC_ADDR_DEVICE_PATH *MACDevPath; - UINTN HwAddressSize; - UINTN Index; - - MACDevPath = DevPath; - - HwAddressSize = sizeof (EFI_MAC_ADDRESS); - if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) { - HwAddressSize = 6; - } - - CatPrint (Str, L"Mac("); - - for (Index = 0; Index < HwAddressSize; Index++) { - CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]); - } - - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathIPv4 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv4_DEVICE_PATH *IPDevPath; - - IPDevPath = DevPath; - CatPrint ( - Str, - L"IPv4(%d.%d.%d.%d:%d)", - (UINTN) IPDevPath->RemoteIpAddress.Addr[0], - (UINTN) IPDevPath->RemoteIpAddress.Addr[1], - (UINTN) IPDevPath->RemoteIpAddress.Addr[2], - (UINTN) IPDevPath->RemoteIpAddress.Addr[3], - (UINTN) IPDevPath->RemotePort - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathIPv6 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv6_DEVICE_PATH *IPv6DevPath; - - IPv6DevPath = DevPath; - CatPrint ( - Str, - L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)", - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15] - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathInfiniBand ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - INFINIBAND_DEVICE_PATH *InfiniBand; - - InfiniBand = DevPath; - CatPrint ( - Str, - L"Infiniband(%x,%g,%lx,%lx,%lx)", - (UINTN) InfiniBand->ResourceFlags, - InfiniBand->PortGid, - InfiniBand->ServiceId, - InfiniBand->TargetPortId, - InfiniBand->DeviceId - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathUart ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - UART_DEVICE_PATH *Uart; - CHAR8 Parity; - - Uart = DevPath; - switch (Uart->Parity) { - case 0: - Parity = 'D'; - break; - - case 1: - Parity = 'N'; - break; - - case 2: - Parity = 'E'; - break; - - case 3: - Parity = 'O'; - break; - - case 4: - Parity = 'M'; - break; - - case 5: - Parity = 'S'; - break; - - default: - Parity = 'x'; - break; - } - - if (Uart->BaudRate == 0) { - CatPrint (Str, L"Uart(DEFAULT,%c,", Parity); - } else { - CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity); - } - - if (Uart->DataBits == 0) { - CatPrint (Str, L"D,"); - } else { - CatPrint (Str, L"%d,", (UINTN) Uart->DataBits); - } - - switch (Uart->StopBits) { - case 0: - CatPrint (Str, L"D)"); - break; - - case 1: - CatPrint (Str, L"1)"); - break; - - case 2: - CatPrint (Str, L"1.5)"); - break; - - case 3: - CatPrint (Str, L"2)"); - break; - - default: - CatPrint (Str, L"x)"); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathiSCSI ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ISCSI_DEVICE_PATH_WITH_NAME *IScsi; - UINT16 Options; - - IScsi = DevPath; - CatPrint ( - Str, - L"iSCSI(%a,%x,%lx,", - IScsi->TargetName, - (UINTN) IScsi->TargetPortalGroupTag, - IScsi->Lun - ); - - Options = IScsi->LoginOption; - CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None"); - CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None"); - if (((Options >> 11) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"None"); - } else if (((Options >> 12) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"CHAP_UNI"); - } else { - CatPrint (Str, L"%s,", L"CHAP_BI"); - - } - - CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathVlan ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VLAN_DEVICE_PATH *Vlan; - - Vlan = DevPath; - CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathHardDrive ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - HARDDRIVE_DEVICE_PATH *Hd; - - Hd = DevPath; - switch (Hd->SignatureType) { - case SIGNATURE_TYPE_MBR: - CatPrint ( - Str, - L"HD(Part%d,Sig%08x)", - (UINTN) Hd->PartitionNumber, - (UINTN) *((UINT32 *) (&(Hd->Signature[0]))) - ); - break; - - case SIGNATURE_TYPE_GUID: - CatPrint ( - Str, - L"HD(Part%d,Sig%g)", - (UINTN) Hd->PartitionNumber, - (EFI_GUID *) &(Hd->Signature[0]) - ); - break; - - default: - CatPrint ( - Str, - L"HD(Part%d,MBRType=%02x,SigType=%02x)", - (UINTN) Hd->PartitionNumber, - (UINTN) Hd->MBRType, - (UINTN) Hd->SignatureType - ); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathCDROM ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CDROM_DEVICE_PATH *Cd; - - Cd = DevPath; - CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FILEPATH_DEVICE_PATH *Fp; - - Fp = DevPath; - CatPrint (Str, L"%s", Fp->PathName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathMediaProtocol ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; - - MediaProt = DevPath; - CatPrint (Str, L"Media(%g)", &MediaProt->Protocol); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathFvFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath; - - FvFilePath = DevPath; - CatPrint (Str, L"%g", &FvFilePath->FvFileName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathRelativeOffsetRange ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset; - - Offset = DevPath; - CatPrint ( - Str, - L"Offset(%lx,%lx)", - Offset->StartingOffset, - Offset->EndingOffset - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathBssBss ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - BBS_BBS_DEVICE_PATH *Bbs; - CHAR16 *Type; - - Bbs = DevPath; - switch (Bbs->DeviceType) { - case BBS_TYPE_FLOPPY: - Type = L"Floppy"; - break; - - case BBS_TYPE_HARDDRIVE: - Type = L"Harddrive"; - break; - - case BBS_TYPE_CDROM: - Type = L"CDROM"; - break; - - case BBS_TYPE_PCMCIA: - Type = L"PCMCIA"; - break; - - case BBS_TYPE_USB: - Type = L"Usb"; - break; - - case BBS_TYPE_EMBEDDED_NETWORK: - Type = L"Net"; - break; - - case BBS_TYPE_BEV: - Type = L"BEV"; - break; - - default: - Type = L"?"; - break; - } - CatPrint (Str, L"Legacy-%s", Type); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathEndInstance ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L","); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maixmum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathNodeUnknown ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L"?"); -} -/** - Convert Device Path to a Unicode string for printing. - - @param Str The buffer holding the output string. - This buffer contains the length of the - string and the maximum length reserved - for the string buffer. - @param DevPath The device path. - -**/ -VOID -DevPathFvPath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_DEVICE_PATH *FvPath; - - FvPath = DevPath; - CatPrint (Str, L"Fv(%g)", &FvPath->FvName); -} - -DEVICE_PATH_STRING_TABLE DevPathTable[] = { - { - HARDWARE_DEVICE_PATH, - HW_PCI_DP, - DevPathPci - }, - { - HARDWARE_DEVICE_PATH, - HW_PCCARD_DP, - DevPathPccard - }, - { - HARDWARE_DEVICE_PATH, - HW_MEMMAP_DP, - DevPathMemMap - }, - { - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP, - DevPathVendor - }, - { - HARDWARE_DEVICE_PATH, - HW_CONTROLLER_DP, - DevPathController - }, - { - ACPI_DEVICE_PATH, - ACPI_DP, - DevPathAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_EXTENDED_DP, - DevPathExtendedAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_ADR_DP, - DevPathAdrAcpi - }, - { - MESSAGING_DEVICE_PATH, - MSG_ATAPI_DP, - DevPathAtapi - }, - { - MESSAGING_DEVICE_PATH, - MSG_SCSI_DP, - DevPathScsi - }, - { - MESSAGING_DEVICE_PATH, - MSG_FIBRECHANNEL_DP, - DevPathFibre - }, - { - MESSAGING_DEVICE_PATH, - MSG_1394_DP, - DevPath1394 - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_DP, - DevPathUsb - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_WWID_DP, - DevPathUsbWWID - }, - { - MESSAGING_DEVICE_PATH, - MSG_DEVICE_LOGICAL_UNIT_DP, - DevPathLogicalUnit - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_CLASS_DP, - DevPathUsbClass - }, - { - MESSAGING_DEVICE_PATH, - MSG_SATA_DP, - DevPathSata - }, - { - MESSAGING_DEVICE_PATH, - MSG_I2O_DP, - DevPathI2O - }, - { - MESSAGING_DEVICE_PATH, - MSG_MAC_ADDR_DP, - DevPathMacAddr - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv4_DP, - DevPathIPv4 - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv6_DP, - DevPathIPv6 - }, - { - MESSAGING_DEVICE_PATH, - MSG_INFINIBAND_DP, - DevPathInfiniBand - }, - { - MESSAGING_DEVICE_PATH, - MSG_UART_DP, - DevPathUart - }, - { - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - DevPathVendor - }, - { - MESSAGING_DEVICE_PATH, - MSG_ISCSI_DP, - DevPathiSCSI - }, - { - MESSAGING_DEVICE_PATH, - MSG_VLAN_DP, - DevPathVlan - }, - { - MEDIA_DEVICE_PATH, - MEDIA_HARDDRIVE_DP, - DevPathHardDrive - }, - { - MEDIA_DEVICE_PATH, - MEDIA_CDROM_DP, - DevPathCDROM - }, - { - MEDIA_DEVICE_PATH, - MEDIA_VENDOR_DP, - DevPathVendor - }, - { - MEDIA_DEVICE_PATH, - MEDIA_FILEPATH_DP, - DevPathFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PROTOCOL_DP, - DevPathMediaProtocol - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_VOL_DP, - DevPathFvPath, - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_FILE_DP, - DevPathFvFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_RELATIVE_OFFSET_RANGE_DP, - DevPathRelativeOffsetRange, - }, - { - BBS_DEVICE_PATH, - BBS_BBS_DP, - DevPathBssBss - }, - { - END_DEVICE_PATH_TYPE, - END_INSTANCE_DEVICE_PATH_SUBTYPE, - DevPathEndInstance - }, - { - 0, - 0, - NULL - } -}; - - /** This function converts an input device structure to a Unicode string. @@ -1489,83 +29,5 @@ DevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL *DevPath ) { - POOL_PRINT Str; - EFI_DEVICE_PATH_PROTOCOL *DevPathNode; - VOID (*DumpNode) (POOL_PRINT *, VOID *); - - UINTN Index; - UINTN NewSize; - - EFI_STATUS Status; - CHAR16 *ToText; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - - ZeroMem (&Str, sizeof (Str)); - - if (DevPath == NULL) { - goto Done; - } - - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevPathToText - ); - if (!EFI_ERROR (Status)) { - ToText = DevPathToText->ConvertDevicePathToText ( - DevPath, - FALSE, - TRUE - ); - ASSERT (ToText != NULL); - return ToText; - } - - // - // Process each device path node - // - DevPathNode = DevPath; - while (!IsDevicePathEnd (DevPathNode)) { - // - // Find the handler to dump this device path node - // - DumpNode = NULL; - for (Index = 0; DevPathTable[Index].Function != NULL; Index += 1) { - - if (DevicePathType (DevPathNode) == DevPathTable[Index].Type && - DevicePathSubType (DevPathNode) == DevPathTable[Index].SubType - ) { - DumpNode = DevPathTable[Index].Function; - break; - } - } - // - // If not found, use a generic function - // - if (!DumpNode) { - DumpNode = DevPathNodeUnknown; - } - // - // Put a path seperator in if needed - // - if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) { - CatPrint (&Str, L"/"); - } - // - // Print this node of the device path - // - DumpNode (&Str, DevPathNode); - - // - // Next device path node - // - DevPathNode = NextDevicePathNode (DevPathNode); - } - -Done: - NewSize = (Str.Len + 1) * sizeof (CHAR16); - Str.Str = ReallocatePool (NewSize, NewSize, Str.Str); - ASSERT (Str.Str != NULL); - Str.Str[Str.Len] = 0; - return Str.Str; + return ConvertDevicePathToText (DevPath, TRUE, TRUE); } diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf index 2d4a90f97d..545709c6eb 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf @@ -5,7 +5,7 @@ # 2) BDS boot device connect interface; # 3) BDS Misc interfaces for mainting boot variable, ouput string, etc. # -# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -70,24 +70,11 @@ ReportStatusCodeLib [Guids] - gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal) - gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal) - ## CONSUMES ## GUID HOB (The hob holding memory type information) gEfiMemoryTypeInformationGuid ## CONSUMES ## GUID (The identifier of memory type information type in system table) - gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal) - ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable) - ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar) - ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array) - ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list) - ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device) - ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device) - ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device) gEfiGlobalVariableGuid ## SOMETIMES_PRODUCES ## Variable:L"BootCurrent" (The boot option of current boot) gEfiFileInfoGuid ## CONSUMES ## GUID - gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal) gPerformanceProtocolGuid ## SOMETIMES_PRODUCES ## Variable:L"PerfDataMemAddr" (The ACPI address of performance data) gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device) - gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device) gLastEnumLangGuid ## SOMETIMES_PRODUCES ## Variable:L"LastEnumLang" (Platform language at last time enumeration.) gHdBootDevicePathVariablGuid ## SOMETIMES_PRODUCES ## Variable:L"HDDP" (The device path of Boot file on Hard device.) gBdsLibStringPackageGuid ## PRODUCES ## GUID (HII String PackageList Guid) @@ -98,7 +85,6 @@ gEfiSimpleTextOutProtocolGuid # PROTOCOL CONSUMES gEfiPciIoProtocolGuid # PROTOCOL CONSUMES gEfiLoadedImageProtocolGuid # PROTOCOL CONSUMES - gEfiDevicePathToTextProtocolGuid # PROTOCOL SOMETIMES_CONSUMES gEfiSimpleNetworkProtocolGuid # PROTOCOL CONSUMES gEfiDebugPortProtocolGuid # PROTOCOL CONSUMES gEfiSimpleTextInProtocolGuid # PROTOCOL CONSUMES diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h index 1384febc98..80b1f49a90 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h @@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h index 348ce392e6..fc62a251c2 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h @@ -1,7 +1,7 @@ /** @file Header files and data structures needed by PCI Bus module. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -32,7 +32,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf index 8c557f2fd7..34eb672df1 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf @@ -5,7 +5,7 @@ # space for these devices. Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable # hot plug supporting. # -# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -97,7 +97,6 @@ gEfiPciRootBridgeIoProtocolGuid ## CONSUMED gEfiIncompatiblePciDeviceSupportProtocolGuid ## CONSUMED gEfiLoadFile2ProtocolGuid ## CONSUMED - gEfiDevicePathToTextProtocolGuid ## CONSUMED [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c index a5cea9e52a..b3d91a8d30 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -290,7 +290,6 @@ DumpResourceMap ( PCI_RESOURCE_NODE *ChildPMem32Node; PCI_RESOURCE_NODE *ChildMem64Node; PCI_RESOURCE_NODE *ChildPMem64Node; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *ToText; CHAR16 *Str; DEBUG ((EFI_D_INFO, "PciBus: Resource Map for ")); @@ -309,19 +308,11 @@ DumpResourceMap ( Bridge->BusNumber, Bridge->DeviceNumber, Bridge->FunctionNumber )); } else { - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &ToText - ); - Str = NULL; - if (!EFI_ERROR (Status)) { - Str = ToText->ConvertDevicePathToText ( - DevicePathFromHandle (Bridge->Handle), - FALSE, - FALSE - ); - } + Str = ConvertDevicePathToText ( + DevicePathFromHandle (Bridge->Handle), + FALSE, + FALSE + ); DEBUG ((EFI_D_INFO, "Root Bridge %s\n", Str != NULL ? Str : L"")); if (Str != NULL) { FreePool (Str); diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index cb2cbe7932..d79a81a6d9 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -1798,14 +1798,12 @@ DriverSampleInit ( MY_EFI_VARSTORE_DATA *VarStoreConfig; EFI_INPUT_KEY HotKey; EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *PathToText; // // Initialize the local variables. // ConfigRequestHdr = NULL; NewString = NULL; - PathToText = NULL; // // Initialize screen dimensions for SendForm(). @@ -1922,18 +1920,11 @@ DriverSampleInit ( } PrivateData->HiiHandle[1] = HiiHandle[1]; - - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &PathToText - ); - ASSERT_EFI_ERROR (Status); // // Update the device path string. // - NewString = PathToText->ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)&mHiiVendorDevicePath0, FALSE, FALSE); + NewString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)&mHiiVendorDevicePath0, FALSE, FALSE); if (HiiSetString (HiiHandle[0], STRING_TOKEN (STR_DEVICE_PATH), NewString, NULL) == 0) { DriverSampleUnload (ImageHandle); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h index cd546bf388..29870c0f1f 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h @@ -32,7 +32,6 @@ Revision History #include #include #include -#include #include #include diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf index 36511e66d0..1affe874bc 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf @@ -55,6 +55,7 @@ HiiLib PrintLib UefiLib + DevicePathLib [Guids] gEfiIfrTianoGuid ## CONSUMES ## Guid @@ -70,7 +71,6 @@ gEfiHiiDatabaseProtocolGuid ## CONSUMES gEfiSimpleTextInputExProtocolGuid ## CONSUMES gEfiFormBrowserExProtocolGuid ## CONSUMES - gEfiDevicePathToTextProtocolGuid ## CONSUMES [Depex] gEfiSimpleTextOutProtocolGuid AND gEfiHiiDatabaseProtocolGuid AND gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h b/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h index 60113fee12..75af763522 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h @@ -2,7 +2,7 @@ Ihe internal heder file includes the required Protocol/Guid/Library and the shared function APIs. -Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,7 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 9c0064df29..ab254a0b45 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -13,7 +13,7 @@ 4. It save all the mapping info in NV variables which will be consumed by platform override protocol driver to publish the platform override protocol. -Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -104,45 +104,29 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = { }; /** - Converting a given device to an unicode string. - - This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol - does not installed, then return unknown device path L"?" directly. - + Converting a given device to an unicode string. + @param DevPath Given device path instance @return Converted string from given device path. - @retval L"?" Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting. + @retval L"?" Converting failed. **/ CHAR16 * DevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL *DevPath ) { - EFI_STATUS Status; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - CHAR16 *ToText; - - if (DevPath == NULL) { - return L""; + CHAR16 *Text; + Text = ConvertDevicePathToText ( + DevPath, + FALSE, + TRUE + ); + if (Text == NULL) { + return AllocateCopyPool (sizeof (L"?"), L"?"); + } else { + return Text; } - - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevPathToText - ); - if (!EFI_ERROR (Status)) { - ToText = DevPathToText->ConvertDevicePathToText ( - DevPath, - FALSE, - TRUE - ); - ASSERT (ToText != NULL); - return ToText; - } - - return L"?"; } /** diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf index bf333d29df..9702f249b5 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf @@ -16,7 +16,7 @@ # 4. It save all the mapping info in NV variables for the following boot, # which will be consumed by GetDriver API of the produced the platform override protocol. # -# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -95,7 +95,6 @@ gEfiFormBrowser2ProtocolGuid ## CONSUMED gEfiHiiConfigRoutingProtocolGuid ## CONSUMED gEfiHiiConfigAccessProtocolGuid ## PRODUCED - gEfiDevicePathToTextProtocolGuid ## CONSUMED gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED [Depex] diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index c97342b981..cfcfc4234d 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -84,7 +84,7 @@ UefiLib|MdePkg/Library/UefiLib/UefiLib.inf UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf @@ -311,6 +311,7 @@ MdeModulePkg/Core/Dxe/DxeMain.inf { NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf *_*_IA32_CC_FLAGS = } @@ -363,7 +364,10 @@ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf } - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { + + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + } MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf index b191a86bc9..2b8a8e76d3 100644 --- a/Nt32Pkg/Nt32Pkg.fdf +++ b/Nt32Pkg/Nt32Pkg.fdf @@ -167,6 +167,7 @@ APRIORI PEI { INF Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf } APRIORI DXE { + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF Nt32Pkg/MetronomeDxe/MetronomeDxe.inf } diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c index 781b415178..ba6af2caef 100644 --- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c @@ -1,7 +1,7 @@ /** @file Platform BDS customizations. - Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -209,14 +209,16 @@ Returns: // Print Device Path // DevPathStr = DevicePathToStr(DevicePath); - DEBUG(( - EFI_D_INFO, - "BdsPlatform.c+%d: COM%d DevPath: %s\n", - __LINE__, - gPnp16550ComPortDeviceNode.UID + 1, - DevPathStr - )); - FreePool(DevPathStr); + if (DevPathStr != NULL) { + DEBUG(( + EFI_D_INFO, + "BdsPlatform.c+%d: COM%d DevPath: %s\n", + __LINE__, + gPnp16550ComPortDeviceNode.UID + 1, + DevPathStr + )); + FreePool(DevPathStr); + } BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL); BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL); @@ -236,14 +238,16 @@ Returns: // Print Device Path // DevPathStr = DevicePathToStr(DevicePath); - DEBUG(( - EFI_D_INFO, - "BdsPlatform.c+%d: COM%d DevPath: %s\n", - __LINE__, - gPnp16550ComPortDeviceNode.UID + 1, - DevPathStr - )); - FreePool(DevPathStr); + if (DevPathStr != NULL) { + DEBUG(( + EFI_D_INFO, + "BdsPlatform.c+%d: COM%d DevPath: %s\n", + __LINE__, + gPnp16550ComPortDeviceNode.UID + 1, + DevPathStr + )); + FreePool(DevPathStr); + } BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL); BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL); @@ -799,12 +803,14 @@ ConnectRecursivelyIfPciMassStorage ( // Print Device Path // DevPathStr = DevicePathToStr (DevicePath); - DEBUG(( - EFI_D_INFO, - "Found Mass Storage device: %s\n", - DevPathStr - )); - FreePool(DevPathStr); + if (DevPathStr != NULL) { + DEBUG(( + EFI_D_INFO, + "Found Mass Storage device: %s\n", + DevPathStr + )); + FreePool(DevPathStr); + } Status = gBS->ConnectController (Handle, NULL, NULL, TRUE); if (EFI_ERROR (Status)) { diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c index 9f94e2424a..c9b8556fab 100644 --- a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c +++ b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c @@ -1,7 +1,7 @@ /** @file Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file. - Copyright (C) 2012, Red Hat, Inc. + Copyright (C) 2012 - 2013, Red Hat, Inc. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include @@ -866,18 +866,17 @@ BOOLEAN Match ( IN CONST CHAR16 *Translated, IN UINTN TranslatedLength, - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) { CHAR16 *Converted; BOOLEAN Result; - Converted = DevPathToText->ConvertDevicePathToText ( - DevicePath, - FALSE, // DisplayOnly - FALSE // AllowShortcuts - ); + Converted = ConvertDevicePathToText ( + DevicePath, + FALSE, // DisplayOnly + FALSE // AllowShortcuts + ); if (Converted == NULL) { return FALSE; } @@ -933,9 +932,6 @@ SetBootOrderFromQemu ( ) { RETURN_STATUS Status; - - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - FIRMWARE_CONFIG_ITEM FwCfgItem; UINTN FwCfgSize; CHAR8 *FwCfg; @@ -946,15 +942,6 @@ SetBootOrderFromQemu ( UINTN TranslatedSize; CHAR16 Translated[TRANSLATION_OUTPUT_SIZE]; - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, // optional registration key - (VOID **) &DevPathToText - ); - if (Status != EFI_SUCCESS) { - return Status; - } - Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize); if (Status != RETURN_SUCCESS) { return Status; @@ -1019,8 +1006,7 @@ SetBootOrderFromQemu ( Match ( Translated, TranslatedSize, // contains length, not size, in CHAR16's here - BootOption->DevicePath, - DevPathToText + BootOption->DevicePath ) ) { // diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 7c8cd0dca4..dcfb95aa32 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -1,7 +1,7 @@ ## @file # EFI/Framework Open Virtual Machine Firmware (OVMF) platform # -# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -90,7 +90,7 @@ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf NvVarsFileLib|OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf @@ -370,6 +370,7 @@ MdeModulePkg/Core/Dxe/DxeMain.inf { NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf } IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf @@ -431,7 +432,11 @@ MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { + + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Universal/PrintDxe/PrintDxe.inf MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 89e86e6804..fe77a3a3de 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -1,7 +1,7 @@ ## @file # Open Virtual Machine Firmware: FDF # -# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -155,6 +155,7 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE APRIORI DXE { + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf } diff --git a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDevicePath.c b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDevicePath.c index ae44626594..28c4d4f8b6 100644 --- a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDevicePath.c +++ b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDevicePath.c @@ -1,7 +1,7 @@ /** @file Internal function defines the default device path string for SecureBoot configuration module. -Copyright (c) 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -14,1431 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "SecureBootConfigImpl.h" -/** - Concatenates a formatted unicode string to allocated pool. - The caller must free the resulting buffer. - - @param[in, out] Str Tracks the allocated pool, size in use, and amount of pool allocated. - @param[in] Fmt The format string - @param[in] ... The data will be printed. - - @return Allocated buffer with the formatted string printed in it. - The caller must free the allocated buffer. - The buffer allocation is not packed. - -**/ -CHAR16 * -EFIAPI -CatPrint ( - IN OUT POOL_PRINT *Str, - IN CHAR16 *Fmt, - ... - ) -{ - UINT16 *AppendStr; - VA_LIST Args; - UINTN StringSize; - - AppendStr = AllocateZeroPool (0x1000); - if (AppendStr == NULL) { - return Str->Str; - } - - VA_START (Args, Fmt); - UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args); - VA_END (Args); - if (NULL == Str->Str) { - StringSize = StrSize (AppendStr); - Str->Str = AllocateZeroPool (StringSize); - ASSERT (Str->Str != NULL); - } else { - StringSize = StrSize (AppendStr); - StringSize += (StrSize (Str->Str) - sizeof (UINT16)); - - Str->Str = ReallocatePool ( - StrSize (Str->Str), - StringSize, - Str->Str - ); - ASSERT (Str->Str != NULL); - } - - Str->Maxlen = MAX_CHAR * sizeof (UINT16); - if (StringSize < Str->Maxlen) { - StrCat (Str->Str, AppendStr); - Str->Len = StringSize - sizeof (UINT16); - } - - FreePool (AppendStr); - return Str->Str; -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathPci ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCI_DEVICE_PATH *Pci; - - Pci = DevPath; - CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathPccard ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCCARD_DEVICE_PATH *Pccard; - - Pccard = DevPath; - CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMemMap ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEMMAP_DEVICE_PATH *MemMap; - - MemMap = DevPath; - CatPrint ( - Str, - L"MemMap(%d:%lx-%lx)", - (UINTN) MemMap->MemoryType, - MemMap->StartingAddress, - MemMap->EndingAddress - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathController ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CONTROLLER_DEVICE_PATH *Controller; - - Controller = DevPath; - CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber); -} - - -/** - Convert Vendor device path to device name. - - @param[in, out] Str The buffer store device name - @param[in] DevPath Pointer to vendor device path - -**/ -VOID -DevPathVendor ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VENDOR_DEVICE_PATH *Vendor; - CHAR16 *Type; - UINTN DataLength; - UINTN Index; - UINT32 FlowControlMap; - - UINT16 Info; - - Vendor = DevPath; - - switch (DevicePathType (&Vendor->Header)) { - case HARDWARE_DEVICE_PATH: - Type = L"Hw"; - break; - - case MESSAGING_DEVICE_PATH: - Type = L"Msg"; - if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) { - CatPrint (Str, L"VenPcAnsi()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) { - CatPrint (Str, L"VenVt100()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) { - CatPrint (Str, L"VenVt100Plus()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) { - CatPrint (Str, L"VenUft8()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) { - FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); - switch (FlowControlMap & 0x00000003) { - case 0: - CatPrint (Str, L"UartFlowCtrl(%s)", L"None"); - break; - - case 1: - CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware"); - break; - - case 2: - CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff"); - break; - - default: - break; - } - - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) { - CatPrint ( - Str, - L"SAS(%lx,%lx,%x,", - ((SAS_DEVICE_PATH *) Vendor)->SasAddress, - ((SAS_DEVICE_PATH *) Vendor)->Lun, - (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort - ); - Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology); - if ((Info & 0x0f) == 0) { - CatPrint (Str, L"NoTopology,0,0,0,"); - } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) { - CatPrint ( - Str, - L"%s,%s,%s,", - ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS", - ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal", - ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct" - ); - if ((Info & 0x0f) == 1) { - CatPrint (Str, L"0,"); - } else { - CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff)); - } - } else { - CatPrint (Str, L"0,0,0,0,"); - } - - CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved); - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) { - CatPrint (Str, L"DebugPort()"); - return ; - } - break; - - case MEDIA_DEVICE_PATH: - Type = L"Media"; - break; - - default: - Type = L"?"; - break; - } - - CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid); - DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH); - if (DataLength > 0) { - CatPrint (Str, L","); - for (Index = 0; Index < DataLength; Index++) { - CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]); - } - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_HID_DEVICE_PATH *Acpi; - - Acpi = DevPath; - if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID); - } else { - CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathExtendedAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; - - // - // Index for HID, UID and CID strings, 0 for non-exist - // - UINT16 HIDSTRIdx; - UINT16 UIDSTRIdx; - UINT16 CIDSTRIdx; - UINT16 Index; - UINT16 Length; - UINT16 Anchor; - CHAR8 *AsChar8Array; - - HIDSTRIdx = 0; - UIDSTRIdx = 0; - CIDSTRIdx = 0; - ExtendedAcpi = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi); - - AsChar8Array = (CHAR8 *) ExtendedAcpi; - - // - // find HIDSTR - // - Anchor = 16; - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - HIDSTRIdx = Anchor; - } - // - // find UIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - UIDSTRIdx = Anchor; - } - // - // find CIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - CIDSTRIdx = Anchor; - } - - if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) { - CatPrint (Str, L"AcpiExp("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } else { - CatPrint (Str, L"AcpiEx("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID); - - if (HIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (CIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } - -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAdrAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_ADR_DEVICE_PATH *AcpiAdr; - UINT16 Index; - UINT16 Length; - UINT16 AdditionalAdrCount; - - AcpiAdr = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr); - AdditionalAdrCount = (UINT16) ((Length - 8) / 4); - - CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR); - for (Index = 0; Index < AdditionalAdrCount; Index++) { - CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4)); - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAtapi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ATAPI_DEVICE_PATH *Atapi; - - Atapi = DevPath; - CatPrint ( - Str, - L"Ata(%s,%s)", - (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary", - (Atapi->SlaveMaster != 0)? L"Slave" : L"Master" - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathScsi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SCSI_DEVICE_PATH *Scsi; - - Scsi = DevPath; - CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFibre ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FIBRECHANNEL_DEVICE_PATH *Fibre; - - Fibre = DevPath; - CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPath1394 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - F1394_DEVICE_PATH *F1394Path; - - F1394Path = DevPath; - CatPrint (Str, L"1394(%lx)", &F1394Path->Guid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsb ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_DEVICE_PATH *Usb; - - Usb = DevPath; - CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsbWWID ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_WWID_DEVICE_PATH *UsbWWId; - - UsbWWId = DevPath; - CatPrint ( - Str, - L"UsbWwid(%x,%x,%x,\"WWID\")", - (UINTN) UsbWWId->VendorId, - (UINTN) UsbWWId->ProductId, - (UINTN) UsbWWId->InterfaceNumber - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathLogicalUnit ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; - - LogicalUnit = DevPath; - CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsbClass ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_CLASS_DEVICE_PATH *UsbClass; - - UsbClass = DevPath; - CatPrint ( - Str, - L"Usb Class(%x,%x,%x,%x,%x)", - (UINTN) UsbClass->VendorId, - (UINTN) UsbClass->ProductId, - (UINTN) UsbClass->DeviceClass, - (UINTN) UsbClass->DeviceSubClass, - (UINTN) UsbClass->DeviceProtocol - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathSata ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SATA_DEVICE_PATH *Sata; - - Sata = DevPath; - if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) { - CatPrint ( - Str, - L"Sata(%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->Lun - ); - } else { - CatPrint ( - Str, - L"Sata(%x,%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->PortMultiplierPortNumber, - (UINTN) Sata->Lun - ); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathI2O ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - I2O_DEVICE_PATH *I2OPath; - - I2OPath = DevPath; - CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMacAddr ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MAC_ADDR_DEVICE_PATH *MACDevPath; - UINTN HwAddressSize; - UINTN Index; - - MACDevPath = DevPath; - - HwAddressSize = sizeof (EFI_MAC_ADDRESS); - if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) { - HwAddressSize = 6; - } - - CatPrint (Str, L"Mac("); - - for (Index = 0; Index < HwAddressSize; Index++) { - CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]); - } - - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathIPv4 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv4_DEVICE_PATH *IPDevPath; - - IPDevPath = DevPath; - CatPrint ( - Str, - L"IPv4(%d.%d.%d.%d:%d)", - (UINTN) IPDevPath->RemoteIpAddress.Addr[0], - (UINTN) IPDevPath->RemoteIpAddress.Addr[1], - (UINTN) IPDevPath->RemoteIpAddress.Addr[2], - (UINTN) IPDevPath->RemoteIpAddress.Addr[3], - (UINTN) IPDevPath->RemotePort - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathIPv6 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv6_DEVICE_PATH *IPv6DevPath; - - IPv6DevPath = DevPath; - CatPrint ( - Str, - L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)", - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15] - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathInfiniBand ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - INFINIBAND_DEVICE_PATH *InfiniBand; - - InfiniBand = DevPath; - CatPrint ( - Str, - L"Infiniband(%x,%g,%lx,%lx,%lx)", - (UINTN) InfiniBand->ResourceFlags, - InfiniBand->PortGid, - InfiniBand->ServiceId, - InfiniBand->TargetPortId, - InfiniBand->DeviceId - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUart ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - UART_DEVICE_PATH *Uart; - CHAR8 Parity; - - Uart = DevPath; - switch (Uart->Parity) { - case 0: - Parity = 'D'; - break; - - case 1: - Parity = 'N'; - break; - - case 2: - Parity = 'E'; - break; - - case 3: - Parity = 'O'; - break; - - case 4: - Parity = 'M'; - break; - - case 5: - Parity = 'S'; - break; - - default: - Parity = 'x'; - break; - } - - if (Uart->BaudRate == 0) { - CatPrint (Str, L"Uart(DEFAULT,%c,", Parity); - } else { - CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity); - } - - if (Uart->DataBits == 0) { - CatPrint (Str, L"D,"); - } else { - CatPrint (Str, L"%d,", (UINTN) Uart->DataBits); - } - - switch (Uart->StopBits) { - case 0: - CatPrint (Str, L"D)"); - break; - - case 1: - CatPrint (Str, L"1)"); - break; - - case 2: - CatPrint (Str, L"1.5)"); - break; - - case 3: - CatPrint (Str, L"2)"); - break; - - default: - CatPrint (Str, L"x)"); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathiSCSI ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ISCSI_DEVICE_PATH_WITH_NAME *IScsi; - UINT16 Options; - - IScsi = DevPath; - CatPrint ( - Str, - L"iSCSI(%a,%x,%lx,", - IScsi->TargetName, - (UINTN) IScsi->TargetPortalGroupTag, - IScsi->Lun - ); - - Options = IScsi->LoginOption; - CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None"); - CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None"); - if (((Options >> 11) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"None"); - } else if (((Options >> 12) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"CHAP_UNI"); - } else { - CatPrint (Str, L"%s,", L"CHAP_BI"); - - } - - CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathVlan ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VLAN_DEVICE_PATH *Vlan; - - Vlan = DevPath; - CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathHardDrive ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - HARDDRIVE_DEVICE_PATH *Hd; - - Hd = DevPath; - switch (Hd->SignatureType) { - case SIGNATURE_TYPE_MBR: - CatPrint ( - Str, - L"HD(Part%d,Sig%08x)", - (UINTN) Hd->PartitionNumber, - (UINTN) *((UINT32 *) (&(Hd->Signature[0]))) - ); - break; - - case SIGNATURE_TYPE_GUID: - CatPrint ( - Str, - L"HD(Part%d,Sig%g)", - (UINTN) Hd->PartitionNumber, - (EFI_GUID *) &(Hd->Signature[0]) - ); - break; - - default: - CatPrint ( - Str, - L"HD(Part%d,MBRType=%02x,SigType=%02x)", - (UINTN) Hd->PartitionNumber, - (UINTN) Hd->MBRType, - (UINTN) Hd->SignatureType - ); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathCDROM ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CDROM_DEVICE_PATH *Cd; - - Cd = DevPath; - CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FILEPATH_DEVICE_PATH *Fp; - - Fp = DevPath; - CatPrint (Str, L"%s", Fp->PathName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMediaProtocol ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; - - MediaProt = DevPath; - CatPrint (Str, L"Media(%g)", &MediaProt->Protocol); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFvFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath; - - FvFilePath = DevPath; - CatPrint (Str, L"%g", &FvFilePath->FvFileName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathRelativeOffsetRange ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset; - - Offset = DevPath; - CatPrint ( - Str, - L"Offset(%lx,%lx)", - Offset->StartingOffset, - Offset->EndingOffset - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathBssBss ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - BBS_BBS_DEVICE_PATH *Bbs; - CHAR16 *Type; - - Bbs = DevPath; - switch (Bbs->DeviceType) { - case BBS_TYPE_FLOPPY: - Type = L"Floppy"; - break; - - case BBS_TYPE_HARDDRIVE: - Type = L"Harddrive"; - break; - - case BBS_TYPE_CDROM: - Type = L"CDROM"; - break; - - case BBS_TYPE_PCMCIA: - Type = L"PCMCIA"; - break; - - case BBS_TYPE_USB: - Type = L"Usb"; - break; - - case BBS_TYPE_EMBEDDED_NETWORK: - Type = L"Net"; - break; - - case BBS_TYPE_BEV: - Type = L"BEV"; - break; - - default: - Type = L"?"; - break; - } - CatPrint (Str, L"Legacy-%s", Type); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathEndInstance ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L","); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathNodeUnknown ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L"?"); -} -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFvPath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_DEVICE_PATH *FvPath; - - FvPath = DevPath; - CatPrint (Str, L"Fv(%g)", &FvPath->FvName); -} - -DEVICE_PATH_STRING_TABLE DevPathTable[] = { - { - HARDWARE_DEVICE_PATH, - HW_PCI_DP, - DevPathPci - }, - { - HARDWARE_DEVICE_PATH, - HW_PCCARD_DP, - DevPathPccard - }, - { - HARDWARE_DEVICE_PATH, - HW_MEMMAP_DP, - DevPathMemMap - }, - { - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP, - DevPathVendor - }, - { - HARDWARE_DEVICE_PATH, - HW_CONTROLLER_DP, - DevPathController - }, - { - ACPI_DEVICE_PATH, - ACPI_DP, - DevPathAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_EXTENDED_DP, - DevPathExtendedAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_ADR_DP, - DevPathAdrAcpi - }, - { - MESSAGING_DEVICE_PATH, - MSG_ATAPI_DP, - DevPathAtapi - }, - { - MESSAGING_DEVICE_PATH, - MSG_SCSI_DP, - DevPathScsi - }, - { - MESSAGING_DEVICE_PATH, - MSG_FIBRECHANNEL_DP, - DevPathFibre - }, - { - MESSAGING_DEVICE_PATH, - MSG_1394_DP, - DevPath1394 - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_DP, - DevPathUsb - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_WWID_DP, - DevPathUsbWWID - }, - { - MESSAGING_DEVICE_PATH, - MSG_DEVICE_LOGICAL_UNIT_DP, - DevPathLogicalUnit - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_CLASS_DP, - DevPathUsbClass - }, - { - MESSAGING_DEVICE_PATH, - MSG_SATA_DP, - DevPathSata - }, - { - MESSAGING_DEVICE_PATH, - MSG_I2O_DP, - DevPathI2O - }, - { - MESSAGING_DEVICE_PATH, - MSG_MAC_ADDR_DP, - DevPathMacAddr - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv4_DP, - DevPathIPv4 - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv6_DP, - DevPathIPv6 - }, - { - MESSAGING_DEVICE_PATH, - MSG_INFINIBAND_DP, - DevPathInfiniBand - }, - { - MESSAGING_DEVICE_PATH, - MSG_UART_DP, - DevPathUart - }, - { - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - DevPathVendor - }, - { - MESSAGING_DEVICE_PATH, - MSG_ISCSI_DP, - DevPathiSCSI - }, - { - MESSAGING_DEVICE_PATH, - MSG_VLAN_DP, - DevPathVlan - }, - { - MEDIA_DEVICE_PATH, - MEDIA_HARDDRIVE_DP, - DevPathHardDrive - }, - { - MEDIA_DEVICE_PATH, - MEDIA_CDROM_DP, - DevPathCDROM - }, - { - MEDIA_DEVICE_PATH, - MEDIA_VENDOR_DP, - DevPathVendor - }, - { - MEDIA_DEVICE_PATH, - MEDIA_FILEPATH_DP, - DevPathFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PROTOCOL_DP, - DevPathMediaProtocol - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_VOL_DP, - DevPathFvPath, - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_FILE_DP, - DevPathFvFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_RELATIVE_OFFSET_RANGE_DP, - DevPathRelativeOffsetRange, - }, - { - BBS_DEVICE_PATH, - BBS_BBS_DP, - DevPathBssBss - }, - { - END_DEVICE_PATH_TYPE, - END_INSTANCE_DEVICE_PATH_SUBTYPE, - DevPathEndInstance - }, - { - 0, - 0, - NULL - } -}; - /** This function converts an input device structure to a Unicode string. @@ -1454,84 +29,10 @@ DevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL *DevPath ) { - POOL_PRINT Str; - EFI_DEVICE_PATH_PROTOCOL *DevPathNode; - VOID (*DumpNode) (POOL_PRINT *, VOID *); - - UINTN Index; - UINTN NewSize; - - EFI_STATUS Status; - CHAR16 *ToText; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - - ZeroMem (&Str, sizeof (Str)); - - if (DevPath == NULL) { - goto Done; - } - - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevPathToText - ); - if (!EFI_ERROR (Status)) { - ToText = DevPathToText->ConvertDevicePathToText ( - DevPath, - FALSE, - TRUE - ); - ASSERT (ToText != NULL); - return ToText; - } - - // - // Process each device path node - // - DevPathNode = DevPath; - while (!IsDevicePathEnd (DevPathNode)) { - // - // Find the handler to dump this device path node - // - DumpNode = NULL; - for (Index = 0; DevPathTable[Index].Function != NULL; Index += 1) { - - if (DevicePathType (DevPathNode) == DevPathTable[Index].Type && - DevicePathSubType (DevPathNode) == DevPathTable[Index].SubType - ) { - DumpNode = DevPathTable[Index].Function; - break; - } - } - // - // If not found, use a generic function - // - if (!DumpNode) { - DumpNode = DevPathNodeUnknown; - } - // - // Put a path seperator in if needed - // - if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) { - CatPrint (&Str, L"/"); - } - // - // Print this node of the device path - // - DumpNode (&Str, DevPathNode); - - // - // Next device path node - // - DevPathNode = NextDevicePathNode (DevPathNode); - } - -Done: - NewSize = (Str.Len + 1) * sizeof (CHAR16); - Str.Str = ReallocatePool (NewSize, NewSize, Str.Str); - ASSERT (Str.Str != NULL); - Str.Str[Str.Len] = 0; - return Str.Str; + return ConvertDevicePathToText ( + DevPath, + FALSE, + TRUE + ); } diff --git a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf index 74d4745bfa..a6bd1a3613 100644 --- a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf +++ b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf @@ -4,7 +4,7 @@ # Need custom SecureBootConfigDxe for OVMF that does not force # resets after PK changes since OVMF doesn't have persistent variables # -# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -56,7 +56,8 @@ UefiHiiServicesLib DebugLib HiiLib - PlatformSecureLib + PlatformSecureLib + DevicePathLib [Guids] gEfiIfrTianoGuid @@ -72,21 +73,7 @@ gEfiImageSecurityDatabaseGuid ## CONSUMES gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid - gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal) - gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal) - ## CONSUMES ## GUID HOB (The hob holding memory type information) - gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal) - ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable) - ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar) - ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array) - ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list) - ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device) - ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device) - ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device) gEfiFileInfoGuid ## CONSUMES ## GUID - gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal) - gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device) - gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device) [Protocols] gEfiHiiConfigAccessProtocolGuid ## PRODUCES @@ -95,8 +82,6 @@ gEfiLoadFileProtocolGuid ## PROTOCOL CONSUMES gEfiBlockIoProtocolGuid ## PROTOCOL CONSUMES gEfiDevicePathProtocolGuid ## PROTOCOL CONSUMES - gEfiDevicePathToTextProtocolGuid - gEfiDebugPortProtocolGuid [Depex] gEfiHiiConfigRoutingProtocolGuid AND diff --git a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.h b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.h index 5a5ac12426..414ab65c8b 100644 --- a/OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.h +++ b/OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.h @@ -2,7 +2,7 @@ The header file of HII Config Access protocol implementation of SecureBoot configuration module. -Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -23,7 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include diff --git a/PerformancePkg/Dp_App/Dp.inf b/PerformancePkg/Dp_App/Dp.inf index a27ebe65ac..c6c76b4789 100644 --- a/PerformancePkg/Dp_App/Dp.inf +++ b/PerformancePkg/Dp_App/Dp.inf @@ -1,7 +1,7 @@ ## @file # Display Performance Application, Module information file. # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -66,7 +66,6 @@ gEfiDriverBindingProtocolGuid # SOMETIMES_CONSUMED gEfiComponentName2ProtocolGuid # SOMETIMES_CONSUMED gEfiLoadedImageDevicePathProtocolGuid # SOMETIMES_CONSUMED - gEfiDevicePathToTextProtocolGuid # SOMETIMES_CONSUMED [Pcd] gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize diff --git a/PerformancePkg/Dp_App/DpUtilities.c b/PerformancePkg/Dp_App/DpUtilities.c index 5e160708b8..4daca0b853 100644 --- a/PerformancePkg/Dp_App/DpUtilities.c +++ b/PerformancePkg/Dp_App/DpUtilities.c @@ -1,7 +1,7 @@ /** @file Utility functions used by the Dp application. - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -31,7 +31,6 @@ #include #include #include -#include #include @@ -220,7 +219,6 @@ GetNameFromHandle ( UINTN StringSize; CHAR8 *PlatformLanguage; EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText; // // Method 1: Get the name string from image PDB @@ -336,19 +334,12 @@ GetNameFromHandle ( // // Method 5: Get the name string from image DevicePath // - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevicePathToText - ); - if (!EFI_ERROR (Status)) { - NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE); - if (NameString != NULL) { - StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH); - mGaugeString[DP_GAUGE_STRING_LENGTH] = 0; - FreePool (NameString); - return; - } + NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE); + if (NameString != NULL) { + StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH); + mGaugeString[DP_GAUGE_STRING_LENGTH] = 0; + FreePool (NameString); + return; } } } diff --git a/PerformancePkg/PerformancePkg.dsc b/PerformancePkg/PerformancePkg.dsc index 6d48ae30a5..8c0890e85e 100644 --- a/PerformancePkg/PerformancePkg.dsc +++ b/PerformancePkg/PerformancePkg.dsc @@ -41,7 +41,7 @@ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf diff --git a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c index 665e4b6c80..d11ec13373 100644 --- a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c +++ b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c @@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include @@ -940,21 +939,14 @@ DxeTpmMeasureBootHandler ( // DEBUG_CODE_BEGIN (); CHAR16 *ToText; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevPathToText - ); - if (!EFI_ERROR (Status)) { - ToText = DevPathToText->ConvertDevicePathToText ( - DevicePathNode, - FALSE, - TRUE - ); - if (ToText != NULL) { - DEBUG ((DEBUG_INFO, "The measured image path is %s.\n", ToText)); - } + ToText = ConvertDevicePathToText ( + DevicePathNode, + FALSE, + TRUE + ); + if (ToText != NULL) { + DEBUG ((DEBUG_INFO, "The measured image path is %s.\n", ToText)); + FreePool (ToText); } DEBUG_CODE_END (); diff --git a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf index 53b26b0284..8552c12996 100644 --- a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf +++ b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf @@ -6,7 +6,7 @@ # This external input must be validated carefully to avoid security issue like # buffer overflow, integer overflow. # -# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -60,4 +60,4 @@ gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMES gEfiBlockIoProtocolGuid ## CONSUMES gEfiDiskIoProtocolGuid ## CONSUMES - gEfiDevicePathToTextProtocolGuid ## SOMETIMES_CONSUMES (Only used in debug mode) + diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c index 97bb077e2e..5b4171ddec 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c @@ -1,7 +1,7 @@ /** @file The functions for access policy modification. -Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -229,24 +229,10 @@ AddDevicePath ( IN VOID *OpCodeHandle ) { - EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *Next; EFI_STRING_ID NameID; EFI_STRING DriverName; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathText; - // - // Locate device path to text protocol. - // - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevicePathText - ); - if (EFI_ERROR (Status)) { - return ; - } - // // Get driver file name node. // @@ -259,7 +245,7 @@ AddDevicePath ( // // Display the device path in form. // - DriverName = DevicePathText->ConvertDevicePathToText (DevicePath, FALSE, FALSE); + DriverName = ConvertDevicePathToText (DevicePath, FALSE, FALSE); NameID = HiiSetString (mCallbackInfo->HiiHandle, 0, DriverName, NULL); FreePool (DriverName); if (NameID == 0) { diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h index fc0efaa4f5..afa420ea7b 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h @@ -1,7 +1,7 @@ /** @file The header file for user profile manager driver. -Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -21,7 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#include #include #include diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf index bd19323296..847aaa2156 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerDxe.inf @@ -1,7 +1,7 @@ ## @file # Component description file for user profile manager driver. # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -45,6 +45,7 @@ DebugLib HiiLib UefiLib + DevicePathLib [Guids] gEfiIfrTianoGuid ## CONSUMES ## Guid @@ -58,7 +59,6 @@ gEfiHiiConfigAccessProtocolGuid gEfiUserCredential2ProtocolGuid gEfiUserManagerProtocolGuid - gEfiDevicePathToTextProtocolGuid [Depex] gEfiUserManagerProtocolGuid \ No newline at end of file diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDevicePath.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDevicePath.c index ae44626594..28c4d4f8b6 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDevicePath.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDevicePath.c @@ -1,7 +1,7 @@ /** @file Internal function defines the default device path string for SecureBoot configuration module. -Copyright (c) 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -14,1431 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "SecureBootConfigImpl.h" -/** - Concatenates a formatted unicode string to allocated pool. - The caller must free the resulting buffer. - - @param[in, out] Str Tracks the allocated pool, size in use, and amount of pool allocated. - @param[in] Fmt The format string - @param[in] ... The data will be printed. - - @return Allocated buffer with the formatted string printed in it. - The caller must free the allocated buffer. - The buffer allocation is not packed. - -**/ -CHAR16 * -EFIAPI -CatPrint ( - IN OUT POOL_PRINT *Str, - IN CHAR16 *Fmt, - ... - ) -{ - UINT16 *AppendStr; - VA_LIST Args; - UINTN StringSize; - - AppendStr = AllocateZeroPool (0x1000); - if (AppendStr == NULL) { - return Str->Str; - } - - VA_START (Args, Fmt); - UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args); - VA_END (Args); - if (NULL == Str->Str) { - StringSize = StrSize (AppendStr); - Str->Str = AllocateZeroPool (StringSize); - ASSERT (Str->Str != NULL); - } else { - StringSize = StrSize (AppendStr); - StringSize += (StrSize (Str->Str) - sizeof (UINT16)); - - Str->Str = ReallocatePool ( - StrSize (Str->Str), - StringSize, - Str->Str - ); - ASSERT (Str->Str != NULL); - } - - Str->Maxlen = MAX_CHAR * sizeof (UINT16); - if (StringSize < Str->Maxlen) { - StrCat (Str->Str, AppendStr); - Str->Len = StringSize - sizeof (UINT16); - } - - FreePool (AppendStr); - return Str->Str; -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathPci ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCI_DEVICE_PATH *Pci; - - Pci = DevPath; - CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathPccard ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - PCCARD_DEVICE_PATH *Pccard; - - Pccard = DevPath; - CatPrint (Str, L"Pcmcia(Function%x)", (UINTN) Pccard->FunctionNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMemMap ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEMMAP_DEVICE_PATH *MemMap; - - MemMap = DevPath; - CatPrint ( - Str, - L"MemMap(%d:%lx-%lx)", - (UINTN) MemMap->MemoryType, - MemMap->StartingAddress, - MemMap->EndingAddress - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathController ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CONTROLLER_DEVICE_PATH *Controller; - - Controller = DevPath; - CatPrint (Str, L"Ctrl(%d)", (UINTN) Controller->ControllerNumber); -} - - -/** - Convert Vendor device path to device name. - - @param[in, out] Str The buffer store device name - @param[in] DevPath Pointer to vendor device path - -**/ -VOID -DevPathVendor ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VENDOR_DEVICE_PATH *Vendor; - CHAR16 *Type; - UINTN DataLength; - UINTN Index; - UINT32 FlowControlMap; - - UINT16 Info; - - Vendor = DevPath; - - switch (DevicePathType (&Vendor->Header)) { - case HARDWARE_DEVICE_PATH: - Type = L"Hw"; - break; - - case MESSAGING_DEVICE_PATH: - Type = L"Msg"; - if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid)) { - CatPrint (Str, L"VenPcAnsi()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid)) { - CatPrint (Str, L"VenVt100()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid)) { - CatPrint (Str, L"VenVt100Plus()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) { - CatPrint (Str, L"VenUft8()"); - return ; - } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) { - FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); - switch (FlowControlMap & 0x00000003) { - case 0: - CatPrint (Str, L"UartFlowCtrl(%s)", L"None"); - break; - - case 1: - CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware"); - break; - - case 2: - CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff"); - break; - - default: - break; - } - - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) { - CatPrint ( - Str, - L"SAS(%lx,%lx,%x,", - ((SAS_DEVICE_PATH *) Vendor)->SasAddress, - ((SAS_DEVICE_PATH *) Vendor)->Lun, - (UINTN) ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort - ); - Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology); - if ((Info & 0x0f) == 0) { - CatPrint (Str, L"NoTopology,0,0,0,"); - } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) { - CatPrint ( - Str, - L"%s,%s,%s,", - ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS", - ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal", - ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct" - ); - if ((Info & 0x0f) == 1) { - CatPrint (Str, L"0,"); - } else { - CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff)); - } - } else { - CatPrint (Str, L"0,0,0,0,"); - } - - CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved); - return ; - - } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid)) { - CatPrint (Str, L"DebugPort()"); - return ; - } - break; - - case MEDIA_DEVICE_PATH: - Type = L"Media"; - break; - - default: - Type = L"?"; - break; - } - - CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid); - DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH); - if (DataLength > 0) { - CatPrint (Str, L","); - for (Index = 0; Index < DataLength; Index++) { - CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]); - } - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_HID_DEVICE_PATH *Acpi; - - Acpi = DevPath; - if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID); - } else { - CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathExtendedAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; - - // - // Index for HID, UID and CID strings, 0 for non-exist - // - UINT16 HIDSTRIdx; - UINT16 UIDSTRIdx; - UINT16 CIDSTRIdx; - UINT16 Index; - UINT16 Length; - UINT16 Anchor; - CHAR8 *AsChar8Array; - - HIDSTRIdx = 0; - UIDSTRIdx = 0; - CIDSTRIdx = 0; - ExtendedAcpi = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi); - - AsChar8Array = (CHAR8 *) ExtendedAcpi; - - // - // find HIDSTR - // - Anchor = 16; - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - HIDSTRIdx = Anchor; - } - // - // find UIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - UIDSTRIdx = Anchor; - } - // - // find CIDSTR - // - Anchor = (UINT16) (Index + 1); - for (Index = Anchor; Index < Length && AsChar8Array[Index] != '\0'; Index++) { - ; - } - if (Index > Anchor) { - CIDSTRIdx = Anchor; - } - - if (HIDSTRIdx == 0 && CIDSTRIdx == 0 && ExtendedAcpi->UID == 0) { - CatPrint (Str, L"AcpiExp("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } else { - CatPrint (Str, L"AcpiEx("); - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); - } - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); - } - CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID); - - if (HIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (CIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx); - } else { - CatPrint (Str, L"\"\","); - } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); - } else { - CatPrint (Str, L"\"\")"); - } - } - -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAdrAcpi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ACPI_ADR_DEVICE_PATH *AcpiAdr; - UINT16 Index; - UINT16 Length; - UINT16 AdditionalAdrCount; - - AcpiAdr = DevPath; - Length = (UINT16) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr); - AdditionalAdrCount = (UINT16) ((Length - 8) / 4); - - CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR); - for (Index = 0; Index < AdditionalAdrCount; Index++) { - CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4)); - } - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathAtapi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ATAPI_DEVICE_PATH *Atapi; - - Atapi = DevPath; - CatPrint ( - Str, - L"Ata(%s,%s)", - (Atapi->PrimarySecondary != 0)? L"Secondary" : L"Primary", - (Atapi->SlaveMaster != 0)? L"Slave" : L"Master" - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathScsi ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SCSI_DEVICE_PATH *Scsi; - - Scsi = DevPath; - CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFibre ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FIBRECHANNEL_DEVICE_PATH *Fibre; - - Fibre = DevPath; - CatPrint (Str, L"Fibre(Wwn%lx,Lun%x)", Fibre->WWN, Fibre->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPath1394 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - F1394_DEVICE_PATH *F1394Path; - - F1394Path = DevPath; - CatPrint (Str, L"1394(%lx)", &F1394Path->Guid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsb ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_DEVICE_PATH *Usb; - - Usb = DevPath; - CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsbWWID ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_WWID_DEVICE_PATH *UsbWWId; - - UsbWWId = DevPath; - CatPrint ( - Str, - L"UsbWwid(%x,%x,%x,\"WWID\")", - (UINTN) UsbWWId->VendorId, - (UINTN) UsbWWId->ProductId, - (UINTN) UsbWWId->InterfaceNumber - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathLogicalUnit ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; - - LogicalUnit = DevPath; - CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUsbClass ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - USB_CLASS_DEVICE_PATH *UsbClass; - - UsbClass = DevPath; - CatPrint ( - Str, - L"Usb Class(%x,%x,%x,%x,%x)", - (UINTN) UsbClass->VendorId, - (UINTN) UsbClass->ProductId, - (UINTN) UsbClass->DeviceClass, - (UINTN) UsbClass->DeviceSubClass, - (UINTN) UsbClass->DeviceProtocol - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathSata ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - SATA_DEVICE_PATH *Sata; - - Sata = DevPath; - if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) { - CatPrint ( - Str, - L"Sata(%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->Lun - ); - } else { - CatPrint ( - Str, - L"Sata(%x,%x,%x)", - (UINTN) Sata->HBAPortNumber, - (UINTN) Sata->PortMultiplierPortNumber, - (UINTN) Sata->Lun - ); - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathI2O ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - I2O_DEVICE_PATH *I2OPath; - - I2OPath = DevPath; - CatPrint (Str, L"I2O(%x)", (UINTN) I2OPath->Tid); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMacAddr ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MAC_ADDR_DEVICE_PATH *MACDevPath; - UINTN HwAddressSize; - UINTN Index; - - MACDevPath = DevPath; - - HwAddressSize = sizeof (EFI_MAC_ADDRESS); - if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) { - HwAddressSize = 6; - } - - CatPrint (Str, L"Mac("); - - for (Index = 0; Index < HwAddressSize; Index++) { - CatPrint (Str, L"%02x", (UINTN) MACDevPath->MacAddress.Addr[Index]); - } - - CatPrint (Str, L")"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathIPv4 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv4_DEVICE_PATH *IPDevPath; - - IPDevPath = DevPath; - CatPrint ( - Str, - L"IPv4(%d.%d.%d.%d:%d)", - (UINTN) IPDevPath->RemoteIpAddress.Addr[0], - (UINTN) IPDevPath->RemoteIpAddress.Addr[1], - (UINTN) IPDevPath->RemoteIpAddress.Addr[2], - (UINTN) IPDevPath->RemoteIpAddress.Addr[3], - (UINTN) IPDevPath->RemotePort - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathIPv6 ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - IPv6_DEVICE_PATH *IPv6DevPath; - - IPv6DevPath = DevPath; - CatPrint ( - Str, - L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)", - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[0], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[1], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[2], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[3], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[4], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[5], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[6], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[7], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[8], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[9], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[10], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[11], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[12], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[13], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[14], - (UINTN) IPv6DevPath->RemoteIpAddress.Addr[15] - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathInfiniBand ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - INFINIBAND_DEVICE_PATH *InfiniBand; - - InfiniBand = DevPath; - CatPrint ( - Str, - L"Infiniband(%x,%g,%lx,%lx,%lx)", - (UINTN) InfiniBand->ResourceFlags, - InfiniBand->PortGid, - InfiniBand->ServiceId, - InfiniBand->TargetPortId, - InfiniBand->DeviceId - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathUart ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - UART_DEVICE_PATH *Uart; - CHAR8 Parity; - - Uart = DevPath; - switch (Uart->Parity) { - case 0: - Parity = 'D'; - break; - - case 1: - Parity = 'N'; - break; - - case 2: - Parity = 'E'; - break; - - case 3: - Parity = 'O'; - break; - - case 4: - Parity = 'M'; - break; - - case 5: - Parity = 'S'; - break; - - default: - Parity = 'x'; - break; - } - - if (Uart->BaudRate == 0) { - CatPrint (Str, L"Uart(DEFAULT,%c,", Parity); - } else { - CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity); - } - - if (Uart->DataBits == 0) { - CatPrint (Str, L"D,"); - } else { - CatPrint (Str, L"%d,", (UINTN) Uart->DataBits); - } - - switch (Uart->StopBits) { - case 0: - CatPrint (Str, L"D)"); - break; - - case 1: - CatPrint (Str, L"1)"); - break; - - case 2: - CatPrint (Str, L"1.5)"); - break; - - case 3: - CatPrint (Str, L"2)"); - break; - - default: - CatPrint (Str, L"x)"); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathiSCSI ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - ISCSI_DEVICE_PATH_WITH_NAME *IScsi; - UINT16 Options; - - IScsi = DevPath; - CatPrint ( - Str, - L"iSCSI(%a,%x,%lx,", - IScsi->TargetName, - (UINTN) IScsi->TargetPortalGroupTag, - IScsi->Lun - ); - - Options = IScsi->LoginOption; - CatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None"); - CatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None"); - if (((Options >> 11) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"None"); - } else if (((Options >> 12) & 0x0001) != 0) { - CatPrint (Str, L"%s,", L"CHAP_UNI"); - } else { - CatPrint (Str, L"%s,", L"CHAP_BI"); - - } - - CatPrint (Str, L"%s)", (IScsi->NetworkProtocol == 0) ? L"TCP" : L"reserved"); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathVlan ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - VLAN_DEVICE_PATH *Vlan; - - Vlan = DevPath; - CatPrint (Str, L"Vlan(%d)", (UINTN) Vlan->VlanId); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathHardDrive ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - HARDDRIVE_DEVICE_PATH *Hd; - - Hd = DevPath; - switch (Hd->SignatureType) { - case SIGNATURE_TYPE_MBR: - CatPrint ( - Str, - L"HD(Part%d,Sig%08x)", - (UINTN) Hd->PartitionNumber, - (UINTN) *((UINT32 *) (&(Hd->Signature[0]))) - ); - break; - - case SIGNATURE_TYPE_GUID: - CatPrint ( - Str, - L"HD(Part%d,Sig%g)", - (UINTN) Hd->PartitionNumber, - (EFI_GUID *) &(Hd->Signature[0]) - ); - break; - - default: - CatPrint ( - Str, - L"HD(Part%d,MBRType=%02x,SigType=%02x)", - (UINTN) Hd->PartitionNumber, - (UINTN) Hd->MBRType, - (UINTN) Hd->SignatureType - ); - break; - } -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathCDROM ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CDROM_DEVICE_PATH *Cd; - - Cd = DevPath; - CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - FILEPATH_DEVICE_PATH *Fp; - - Fp = DevPath; - CatPrint (Str, L"%s", Fp->PathName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathMediaProtocol ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; - - MediaProt = DevPath; - CatPrint (Str, L"Media(%g)", &MediaProt->Protocol); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFvFilePath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath; - - FvFilePath = DevPath; - CatPrint (Str, L"%g", &FvFilePath->FvFileName); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathRelativeOffsetRange ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset; - - Offset = DevPath; - CatPrint ( - Str, - L"Offset(%lx,%lx)", - Offset->StartingOffset, - Offset->EndingOffset - ); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathBssBss ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - BBS_BBS_DEVICE_PATH *Bbs; - CHAR16 *Type; - - Bbs = DevPath; - switch (Bbs->DeviceType) { - case BBS_TYPE_FLOPPY: - Type = L"Floppy"; - break; - - case BBS_TYPE_HARDDRIVE: - Type = L"Harddrive"; - break; - - case BBS_TYPE_CDROM: - Type = L"CDROM"; - break; - - case BBS_TYPE_PCMCIA: - Type = L"PCMCIA"; - break; - - case BBS_TYPE_USB: - Type = L"Usb"; - break; - - case BBS_TYPE_EMBEDDED_NETWORK: - Type = L"Net"; - break; - - case BBS_TYPE_BEV: - Type = L"BEV"; - break; - - default: - Type = L"?"; - break; - } - CatPrint (Str, L"Legacy-%s", Type); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathEndInstance ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L","); -} - -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathNodeUnknown ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - CatPrint (Str, L"?"); -} -/** - Convert Device Path to a Unicode string for printing. - - @param[in, out] Str The buffer holding the output string. - This buffer contains the length of the string and - the maixmum length reserved for the string buffer. - @param[in] DevPath The device path. - -**/ -VOID -DevPathFvPath ( - IN OUT POOL_PRINT *Str, - IN VOID *DevPath - ) -{ - MEDIA_FW_VOL_DEVICE_PATH *FvPath; - - FvPath = DevPath; - CatPrint (Str, L"Fv(%g)", &FvPath->FvName); -} - -DEVICE_PATH_STRING_TABLE DevPathTable[] = { - { - HARDWARE_DEVICE_PATH, - HW_PCI_DP, - DevPathPci - }, - { - HARDWARE_DEVICE_PATH, - HW_PCCARD_DP, - DevPathPccard - }, - { - HARDWARE_DEVICE_PATH, - HW_MEMMAP_DP, - DevPathMemMap - }, - { - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP, - DevPathVendor - }, - { - HARDWARE_DEVICE_PATH, - HW_CONTROLLER_DP, - DevPathController - }, - { - ACPI_DEVICE_PATH, - ACPI_DP, - DevPathAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_EXTENDED_DP, - DevPathExtendedAcpi - }, - { - ACPI_DEVICE_PATH, - ACPI_ADR_DP, - DevPathAdrAcpi - }, - { - MESSAGING_DEVICE_PATH, - MSG_ATAPI_DP, - DevPathAtapi - }, - { - MESSAGING_DEVICE_PATH, - MSG_SCSI_DP, - DevPathScsi - }, - { - MESSAGING_DEVICE_PATH, - MSG_FIBRECHANNEL_DP, - DevPathFibre - }, - { - MESSAGING_DEVICE_PATH, - MSG_1394_DP, - DevPath1394 - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_DP, - DevPathUsb - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_WWID_DP, - DevPathUsbWWID - }, - { - MESSAGING_DEVICE_PATH, - MSG_DEVICE_LOGICAL_UNIT_DP, - DevPathLogicalUnit - }, - { - MESSAGING_DEVICE_PATH, - MSG_USB_CLASS_DP, - DevPathUsbClass - }, - { - MESSAGING_DEVICE_PATH, - MSG_SATA_DP, - DevPathSata - }, - { - MESSAGING_DEVICE_PATH, - MSG_I2O_DP, - DevPathI2O - }, - { - MESSAGING_DEVICE_PATH, - MSG_MAC_ADDR_DP, - DevPathMacAddr - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv4_DP, - DevPathIPv4 - }, - { - MESSAGING_DEVICE_PATH, - MSG_IPv6_DP, - DevPathIPv6 - }, - { - MESSAGING_DEVICE_PATH, - MSG_INFINIBAND_DP, - DevPathInfiniBand - }, - { - MESSAGING_DEVICE_PATH, - MSG_UART_DP, - DevPathUart - }, - { - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - DevPathVendor - }, - { - MESSAGING_DEVICE_PATH, - MSG_ISCSI_DP, - DevPathiSCSI - }, - { - MESSAGING_DEVICE_PATH, - MSG_VLAN_DP, - DevPathVlan - }, - { - MEDIA_DEVICE_PATH, - MEDIA_HARDDRIVE_DP, - DevPathHardDrive - }, - { - MEDIA_DEVICE_PATH, - MEDIA_CDROM_DP, - DevPathCDROM - }, - { - MEDIA_DEVICE_PATH, - MEDIA_VENDOR_DP, - DevPathVendor - }, - { - MEDIA_DEVICE_PATH, - MEDIA_FILEPATH_DP, - DevPathFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PROTOCOL_DP, - DevPathMediaProtocol - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_VOL_DP, - DevPathFvPath, - }, - { - MEDIA_DEVICE_PATH, - MEDIA_PIWG_FW_FILE_DP, - DevPathFvFilePath - }, - { - MEDIA_DEVICE_PATH, - MEDIA_RELATIVE_OFFSET_RANGE_DP, - DevPathRelativeOffsetRange, - }, - { - BBS_DEVICE_PATH, - BBS_BBS_DP, - DevPathBssBss - }, - { - END_DEVICE_PATH_TYPE, - END_INSTANCE_DEVICE_PATH_SUBTYPE, - DevPathEndInstance - }, - { - 0, - 0, - NULL - } -}; - /** This function converts an input device structure to a Unicode string. @@ -1454,84 +29,10 @@ DevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL *DevPath ) { - POOL_PRINT Str; - EFI_DEVICE_PATH_PROTOCOL *DevPathNode; - VOID (*DumpNode) (POOL_PRINT *, VOID *); - - UINTN Index; - UINTN NewSize; - - EFI_STATUS Status; - CHAR16 *ToText; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; - - ZeroMem (&Str, sizeof (Str)); - - if (DevPath == NULL) { - goto Done; - } - - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevPathToText - ); - if (!EFI_ERROR (Status)) { - ToText = DevPathToText->ConvertDevicePathToText ( - DevPath, - FALSE, - TRUE - ); - ASSERT (ToText != NULL); - return ToText; - } - - // - // Process each device path node - // - DevPathNode = DevPath; - while (!IsDevicePathEnd (DevPathNode)) { - // - // Find the handler to dump this device path node - // - DumpNode = NULL; - for (Index = 0; DevPathTable[Index].Function != NULL; Index += 1) { - - if (DevicePathType (DevPathNode) == DevPathTable[Index].Type && - DevicePathSubType (DevPathNode) == DevPathTable[Index].SubType - ) { - DumpNode = DevPathTable[Index].Function; - break; - } - } - // - // If not found, use a generic function - // - if (!DumpNode) { - DumpNode = DevPathNodeUnknown; - } - // - // Put a path seperator in if needed - // - if ((Str.Len != 0) && (DumpNode != DevPathEndInstance)) { - CatPrint (&Str, L"/"); - } - // - // Print this node of the device path - // - DumpNode (&Str, DevPathNode); - - // - // Next device path node - // - DevPathNode = NextDevicePathNode (DevPathNode); - } - -Done: - NewSize = (Str.Len + 1) * sizeof (CHAR16); - Str.Str = ReallocatePool (NewSize, NewSize, Str.Str); - ASSERT (Str.Str != NULL); - Str.Str[Str.Len] = 0; - return Str.Str; + return ConvertDevicePathToText ( + DevPath, + FALSE, + TRUE + ); } diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf index a0f497f559..071ca30338 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf @@ -1,7 +1,7 @@ ## @file # Component name for SecureBoot configuration module. # -# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -53,7 +53,8 @@ UefiHiiServicesLib DebugLib HiiLib - PlatformSecureLib + PlatformSecureLib + DevicePathLib [Guids] gEfiIfrTianoGuid @@ -69,21 +70,7 @@ gEfiImageSecurityDatabaseGuid ## CONSUMES gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid - gEfiVT100PlusGuid ## CONSUMES ## GUID (The type of terminal) - gEfiVT100Guid ## CONSUMES ## GUID (The type of terminal) - ## CONSUMES ## GUID HOB (The hob holding memory type information) - gEfiVTUTF8Guid ## CONSUMES ## GUID (The type of terminal) - ## SOMETIMES_CONSUMES ## Variable:L"BootXX" (Boot option variable) - ## CONSUMES ## Variable:L"Timeout" (The time out value in second of showing progress bar) - ## SOMETIMES_CONSUMES ## Variable:L"BootOrder" (The boot option array) - ## SOMETIMES_CONSUMES ## Variable:L"DriverOrder" (The driver order list) - ## SOMETIMES_CONSUMES ## Variable:L"ConIn" (The device path of console in device) - ## SOMETIMES_CONSUMES ## Variable:L"ConOut" (The device path of console out device) - ## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device) gEfiFileInfoGuid ## CONSUMES ## GUID - gEfiPcAnsiGuid ## CONSUMES ## GUID (The type of terminal) - gEfiUartDevicePathGuid ## CONSUMES ## GUID (Identify the device path for UARD device) - gEfiSasDevicePathGuid ## CONSUMES ## GUID (Identify the device path for SAS device) [Protocols] gEfiHiiConfigAccessProtocolGuid ## PRODUCES @@ -92,8 +79,6 @@ gEfiLoadFileProtocolGuid ## PROTOCOL CONSUMES gEfiBlockIoProtocolGuid ## PROTOCOL CONSUMES gEfiDevicePathProtocolGuid ## PROTOCOL CONSUMES - gEfiDevicePathToTextProtocolGuid - gEfiDebugPortProtocolGuid [Depex] gEfiHiiConfigRoutingProtocolGuid AND diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h index 5a5ac12426..f87afbe709 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h @@ -23,7 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf index 756e84137e..c3af617430 100644 --- a/ShellPkg/Application/Shell/Shell.inf +++ b/ShellPkg/Application/Shell/Shell.inf @@ -1,7 +1,7 @@ ## @file # This is the shell application # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -93,7 +93,6 @@ gEfiComponentName2ProtocolGuid # ALWAYS_CONSUMED gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED - gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED [Pcd] gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index df4874a23c..d39114f50e 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -115,27 +115,18 @@ InternalShellProtocolDebugPrintMessage ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) { - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText; EFI_STATUS Status; CHAR16 *Temp; - Status = EFI_SUCCESS; DEBUG_CODE_BEGIN(); - DevicePathToText = NULL; - Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID**)&DevicePathToText); if (Mapping != NULL) { DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping)); } - if (!EFI_ERROR(Status)) { - if (DevicePath != NULL) { - Temp = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE); - DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp)); - FreePool(Temp); - } - } + Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE); + DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp)); + FreePool(Temp); + DEBUG_CODE_END(); return (Status); } @@ -647,7 +638,6 @@ EfiShellGetDeviceName( { EFI_STATUS Status; EFI_COMPONENT_NAME2_PROTOCOL *CompName2; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_HANDLE *HandleList; UINTN HandleCount; @@ -815,28 +805,19 @@ EfiShellGetDeviceName( } } if ((Flags & EFI_DEVICE_NAME_USE_DEVICE_PATH) != 0) { - Status = gBS->LocateProtocol( - &gEfiDevicePathToTextProtocolGuid, + Status = gBS->OpenProtocol( + DeviceHandle, + &gEfiDevicePathProtocolGuid, + (VOID**)&DevicePath, + gImageHandle, NULL, - (VOID**)&DevicePathToText); - // - // we now have the device path to text protocol - // + EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (!EFI_ERROR(Status)) { - Status = gBS->OpenProtocol( - DeviceHandle, - &gEfiDevicePathProtocolGuid, - (VOID**)&DevicePath, - gImageHandle, - NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!EFI_ERROR(Status)) { - // - // use device path to text on the device path - // - *BestDeviceName = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE); - return (EFI_SUCCESS); - } + // + // use device path to text on the device path + // + *BestDeviceName = ConvertDevicePathToText(DevicePath, TRUE, TRUE); + return (EFI_SUCCESS); } } // @@ -1583,11 +1564,11 @@ EfiShellExecute( DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath); DEBUG_CODE_BEGIN(); - Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE); + Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE); FreePool(Temp); - Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE); + Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE); FreePool(Temp); - Temp = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE); + Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE); FreePool(Temp); DEBUG_CODE_END(); diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h index 0f4f503410..13d526edf7 100644 --- a/ShellPkg/Include/Library/ShellCommandLib.h +++ b/ShellPkg/Include/Library/ShellCommandLib.h @@ -4,7 +4,7 @@ This library is for use ONLY by shell commands linked into the shell application. This library will not funciton if it is used for UEFI Shell 2.0 Applications. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -33,7 +32,6 @@ // The extern global protocol poionters. // extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation; -extern EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText; extern CONST CHAR16* SupportLevel[]; // diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c b/ShellPkg/Library/UefiDpLib/DpUtilities.c index 89c9919e03..57c81288da 100644 --- a/ShellPkg/Library/UefiDpLib/DpUtilities.c +++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c @@ -31,7 +31,6 @@ #include #include #include -#include #include @@ -204,7 +203,6 @@ GetNameFromHandle ( UINTN StringSize; CHAR8 *PlatformLanguage; EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText; // // Method 1: Get the name string from image PDB @@ -320,19 +318,12 @@ GetNameFromHandle ( // // Method 5: Get the name string from image DevicePath // - Status = gBS->LocateProtocol ( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID **) &DevicePathToText - ); - if (!EFI_ERROR (Status)) { - NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE); - if (NameString != NULL) { - StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH); - mGaugeString[DP_GAUGE_STRING_LENGTH] = 0; - FreePool (NameString); - return; - } + NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE); + if (NameString != NULL) { + StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH); + mGaugeString[DP_GAUGE_STRING_LENGTH] = 0; + FreePool (NameString); + return; } } } diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.h b/ShellPkg/Library/UefiDpLib/UefiDpLib.h index 2cec991483..d16f55fe02 100644 --- a/ShellPkg/Library/UefiDpLib/UefiDpLib.h +++ b/ShellPkg/Library/UefiDpLib/UefiDpLib.h @@ -25,7 +25,6 @@ extern EFI_GUID gDpHiiGuid; #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.inf b/ShellPkg/Library/UefiDpLib/UefiDpLib.inf index cb53a59496..9488a49813 100644 --- a/ShellPkg/Library/UefiDpLib/UefiDpLib.inf +++ b/ShellPkg/Library/UefiDpLib/UefiDpLib.inf @@ -62,13 +62,13 @@ UefiBootServicesTableLib SortLib PrintLib + DevicePathLib [Protocols] gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED gEfiDriverBindingProtocolGuid # SOMETIMES_CONSUMED gEfiComponentName2ProtocolGuid # SOMETIMES_CONSUMED gEfiLoadedImageDevicePathProtocolGuid # SOMETIMES_CONSUMED - gEfiDevicePathToTextProtocolGuid # SOMETIMES_CONSUMED [Pcd] gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index 45ee9bd5d0..0c78d0da20 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -414,19 +414,15 @@ DevicePathProtocolDumpInformation( CHAR16 *Temp; CHAR16 *Temp2; EFI_STATUS Status; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText; Temp = NULL; - Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&DevPathToText); + Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (!EFI_ERROR(Status)) { - Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (!EFI_ERROR(Status)) { - // - // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line) - // - Temp = DevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE); - gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL); - } + // + // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line) + // + Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE); + gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL); } if (!Verbose && Temp != NULL && StrLen(Temp) > 30) { Temp2 = NULL; diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index 88c78ee15e..935e8397fe 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -30,7 +30,6 @@ STATIC BUFFER_LIST mFileHandleList; // global variables required by library class. EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL; -EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText = NULL; SHELL_MAP_LIST gShellMapList; SHELL_MAP_LIST *gShellCurDir = NULL; @@ -58,12 +57,6 @@ CommandInit( return (EFI_DEVICE_ERROR); } } - if (gDevPathToText == NULL) { - Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&gDevPathToText); - if (EFI_ERROR(Status)) { - return (EFI_DEVICE_ERROR); - } - } return (EFI_SUCCESS); } @@ -184,7 +177,6 @@ ShellCommandLibDestructor ( } gUnicodeCollation = NULL; - gDevPathToText = NULL; gShellCurDir = NULL; return (RETURN_SUCCESS); diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf index 6b3d774f47..5768059487 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -1,7 +1,7 @@ ## @file # Provides interface to shell internal functions for shell commands. # -# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -52,7 +52,6 @@ gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED gEfiShellProtocolGuid # ALWAYS_CONSUMED gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED - gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED [Guids] gEfiSasDevicePathGuid # ALWAYS_CONSUMED diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c index c26fad7b38..87f2383fad 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c @@ -1,7 +1,7 @@ /** @file Main file for bcfg shell Debug1 function. - Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1052,7 +1052,7 @@ BcfgDisplayDumpDebug1( if ((*(UINT16*)(Buffer+4)) != 0) { DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4)); CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4)); - DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE); + DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE); } else { DevPath = NULL; DevPathString = NULL; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c index 34eb6af8ac..8d26c9d93b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c @@ -1,7 +1,7 @@ /** @file Main file for SetVar shell Debug1 function. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -49,7 +49,6 @@ ShellCommandRunSetVar ( UINTN Size; UINTN LoopVar; EFI_DEVICE_PATH_PROTOCOL *DevPath; - EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *DevPathFromText; ShellStatus = SHELL_SUCCESS; Status = EFI_SUCCESS; @@ -226,9 +225,7 @@ ShellCommandRunSetVar ( // Data++; Data++; - Status = gBS->LocateProtocol(&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID**)&DevPathFromText); - ASSERT_EFI_ERROR(Status); - DevPath = DevPathFromText->ConvertTextToDevicePath(Data); + DevPath = ConvertTextToDevicePath(Data); if (DevPath == NULL) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, Status); ShellStatus = SHELL_INVALID_PARAMETER; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h index bbc539126b..d8755bfefc 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for Profile1 shell command functions. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c index 9947c56117..bfbd8d76b0 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c @@ -1,7 +1,7 @@ /** @file Main file for Dh shell Driver1 function. - Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -260,7 +260,7 @@ GetDriverImageName ( return (Status); } DevicePath = LoadedImage->FilePath; - *Name = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE); + *Name = ConvertDevicePathToText(DevicePath, TRUE, TRUE); return (EFI_SUCCESS); } @@ -354,7 +354,7 @@ DisplayDriverModelHandle ( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L""); SHELL_FREE_NON_NULL(TempStringPointer); - TempStringPointer = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, FALSE); + TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE); ShellPrintHiiEx( -1, -1, diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 1f7675b8b5..fe314f70f8 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -1,7 +1,7 @@ /** @file Main file for Drivers shell Driver1 function. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -80,7 +80,7 @@ GetDevicePathTextForHandle( } RetVal = gEfiShellProtocol->GetFilePathFromDevicePath(FinalPath); if (RetVal == NULL) { - RetVal = gDevPathToText->ConvertDevicePathToText(FinalPath, TRUE, TRUE); + RetVal = ConvertDevicePathToText(FinalPath, TRUE, TRUE); } FreePool(FinalPath); return (RetVal); diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c index b82bdf8f36..35ddd441b1 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c @@ -1,7 +1,7 @@ /** @file Main file for DrvCfg shell Driver1 function. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -406,7 +406,7 @@ ConfigFromFile( // // print out an error. // - TempDevPathString = gDevPathToText->ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE); + TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE); ShellPrintHiiEx( -1, -1, diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h index 19633a4b71..46ba8fdd8f 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for Profile1 shell command functions. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c index 940f72d89a..4e1ac0da82 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c @@ -1,7 +1,7 @@ /** @file Main file for Unload shell Driver1 function. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -67,7 +67,6 @@ DumpLoadedImageProtocolInfo ( { EFI_LOADED_IMAGE_PROTOCOL *Image; EFI_STATUS Status; - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText; CHAR16 *DevicePathText; CHAR16 *CodeTypeText; CHAR16 *DataTypeText; @@ -79,23 +78,10 @@ DumpLoadedImageProtocolInfo ( if (EFI_ERROR(Status)) { return (EFI_INVALID_PARAMETER); } - - Status = gBS->LocateProtocol( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID**)&DevicePathToText); - // - // we now have the device path to text protocol - // - if (!EFI_ERROR(Status)) { - DevicePathText = DevicePathToText->ConvertDevicePathToText(Image->FilePath, TRUE, TRUE); - } else { - DevicePathText = NULL; - } - - CodeTypeText = ConvertMemoryType(Image->ImageCodeType); - DataTypeText = ConvertMemoryType(Image->ImageDataType); - PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase); + DevicePathText = ConvertDevicePathToText(Image->FilePath, TRUE, TRUE); + CodeTypeText = ConvertMemoryType(Image->ImageCodeType); + DataTypeText = ConvertMemoryType(Image->ImageDataType); + PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_UNLOAD_VERBOSE), gShellDriver1HiiHandle, ConvertHandleToHandleIndex(TheHandle), TheHandle, diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c index 5dcbfb6950..390f1b6da9 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c @@ -1050,7 +1050,7 @@ BcfgDisplayDumpInstall1( if ((*(UINT16*)(Buffer+4)) != 0) { DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4)); CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4)); - DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE); + DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE); } else { DevPath = NULL; DevPathString = NULL; diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h index 09207c0698..8b47a29a86 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for install 1 shell command functions. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h index b0ef503158..c4ef536202 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h @@ -1,7 +1,7 @@ /** @file Main file for NULL named library for level 1 shell command functions. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 2725f4ad39..bd004beaaf 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -421,7 +421,7 @@ PerformSingleMappingDisplay( if (TempSpot != NULL) { *TempSpot = CHAR_NULL; } - DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE); + DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE); if (!SFO) { TempLen = StrLen(CurrentName); ShellPrintHiiEx ( diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h index 2018247573..8abf7e02a8 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h @@ -9,7 +9,7 @@ * functions are non-interactive only - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf index 5787c817f9..52844429ea 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf @@ -1,7 +1,7 @@ ## @file # Provides shell level 2 functions # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -65,6 +65,7 @@ HiiLib HandleParsingLib PathLib + DevicePathLib [Protocols] gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED @@ -73,7 +74,6 @@ gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED - gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED [Pcd.common] gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h index 5636d497c0..bd5b9bec9c 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.c b/ShellPkg/Library/UefiSortLib/UefiSortLib.c index 9cff46d4e6..2aab9d2691 100644 --- a/ShellPkg/Library/UefiSortLib/UefiSortLib.c +++ b/ShellPkg/Library/UefiSortLib/UefiSortLib.c @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -25,8 +24,8 @@ #include #include #include +#include -STATIC EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathToText = NULL; STATIC EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation = NULL; @@ -224,15 +223,6 @@ DevicePathCompare ( return 1; } - if (mDevicePathToText == NULL) { - Status = gBS->LocateProtocol( - &gEfiDevicePathToTextProtocolGuid, - NULL, - (VOID**)&mDevicePathToText); - - ASSERT_EFI_ERROR(Status); - } - if (mUnicodeCollation == NULL) { Status = gBS->LocateProtocol( &gEfiUnicodeCollation2ProtocolGuid, @@ -242,12 +232,12 @@ DevicePathCompare ( ASSERT_EFI_ERROR(Status); } - TextPath1 = mDevicePathToText->ConvertDevicePathToText( + TextPath1 = ConvertDevicePathToText( DevicePath1, FALSE, FALSE); - TextPath2 = mDevicePathToText->ConvertDevicePathToText( + TextPath2 = ConvertDevicePathToText( DevicePath2, FALSE, FALSE); diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf b/ShellPkg/Library/UefiSortLib/UefiSortLib.inf index 8080cc0c82..31afb27920 100644 --- a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf +++ b/ShellPkg/Library/UefiSortLib/UefiSortLib.inf @@ -1,7 +1,7 @@ ## @file # Library used for sorting routines. # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -38,9 +38,9 @@ BaseMemoryLib DebugLib UefiBootServicesTableLib + DevicePathLib [Protocols] gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED - gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index e0b258839b..3284c1cdc5 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -26,7 +26,7 @@ [LibraryClasses.common] UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf