libefivar: Add PciRoot/PcieRoot text for ACPI Expanded Device Path

According to UEFI spec,for ACPI Expanded Device Path
when HID=PNP0A03 or CID=PNP0A03 and HID != PNP0A08,
the device path node can be displayed as: PciRoot(UID|UIDSTR)
When HID=PNP0A08 or CID=PNP0A08, the device path node can be
displayed as: PcieRoot(UID|UIDSTR). But current code miss the
code logic.

This commit is to do the enhancement.

Upstream Bug:	https://bugzilla.tianocore.org/show_bug.cgi?id=1228
Obtained from:	78af0984b4
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581
This commit is contained in:
Jose Luis Duran 2022-02-23 13:50:19 -03:00 committed by Warner Losh
parent ac2b16d3b1
commit a51ae7212d

View File

@ -492,6 +492,27 @@ DevPathToTextAcpiEx (
UIDStr = HIDStr + AsciiStrLen (HIDStr) + 1;
CIDStr = UIDStr + AsciiStrLen (UIDStr) + 1;
if (DisplayOnly) {
if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A03) ||
(EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A03 && EISA_ID_TO_NUM (AcpiEx->HID) != 0x0A08)) {
if (AcpiEx->UID == 0) {
UefiDevicePathLibCatPrint (Str, "PciRoot(%s)", UIDStr);
} else {
UefiDevicePathLibCatPrint (Str, "PciRoot(0x%x)", AcpiEx->UID);
}
return;
}
if (EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A08 || EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A08) {
if (AcpiEx->UID == 0) {
UefiDevicePathLibCatPrint (Str, "PcieRoot(%s)", UIDStr);
} else {
UefiDevicePathLibCatPrint (Str, "PcieRoot(0x%x)", AcpiEx->UID);
}
return;
}
}
//
// Converts EISA identification to string.
//