From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F26A3211158DA for ; Sun, 7 Oct 2018 23:49:08 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2018 23:49:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,355,1534834800"; d="scan'208";a="79579835" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.11]) ([10.239.9.11]) by orsmga008.jf.intel.com with ESMTP; 07 Oct 2018 23:49:07 -0700 To: Dandan Bi , edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao References: <20181008033158.10652-1-dandan.bi@intel.com> <20181008033158.10652-4-dandan.bi@intel.com> From: "Ni, Ruiyu" Message-ID: <89de7494-f784-52e0-7ba0-16456716940e@Intel.com> Date: Mon, 8 Oct 2018 14:50:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181008033158.10652-4-dandan.bi@intel.com> Subject: Re: [patch 4/5] MdePkg: Add PciRoot/PcieRoot text for ACPI Expanded Device Path X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 06:49:09 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/8/2018 11:31 AM, Dandan Bi wrote: > 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 > Cc: Michael D Kinney > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > .../UefiDevicePathLib/DevicePathToText.c | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > index 8e5efba1e8..7ad9eadf6c 100644 > --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > @@ -431,10 +431,31 @@ DevPathToTextAcpiEx ( > AcpiEx = DevPath; > HIDStr = (CHAR8 *) (((UINT8 *) AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); > 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. > // > UnicodeSPrint ( > HIDText, > Reviewed-by: Ruiyu Ni -- Thanks, Ray