Skip to content

Commit

Permalink
MdePkg: Add PciRoot/PcieRoot text for ACPI Expanded Device Path
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1228

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.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
  • Loading branch information
dandanbi authored and lgao4 committed Oct 9, 2018
1 parent fb4bea5 commit 78af098
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,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, L"PciRoot(%a)", UIDStr);
} else {
UefiDevicePathLibCatPrint (Str, L"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, L"PcieRoot(%a)", UIDStr);
} else {
UefiDevicePathLibCatPrint (Str, L"PcieRoot(0x%x)", AcpiEx->UID);
}
return;
}
}

//
// Converts EISA identification to string.
//
Expand Down

0 comments on commit 78af098

Please sign in to comment.