From patchwork Fri Nov 22 07:16:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 293348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 6A3CF2C0098 for ; Fri, 22 Nov 2013 18:17:00 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vjkz4-0000gT-U0; Fri, 22 Nov 2013 07:16:58 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vjkyz-0000gJ-FV for fwts-devel@lists.ubuntu.com; Fri, 22 Nov 2013 07:16:53 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Vjkyy-0001TH-TD; Fri, 22 Nov 2013 07:16:53 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefi: uefidump: dealing with the End of Hardware Device Path sub-type 0x01 (LP:#1253906) Date: Fri, 22 Nov 2013 15:16:48 +0800 Message-Id: <1385104608-19998-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Uefidump don't do anything when uefidump parser device path for End of Hardware Device Path - End This Instance of a Device Path sub-type(sub-type 0x01). It causes that the device path be showed without knowing the "End This Instance of a Device Path sub-type" is included. For example, Device Path: \ACPI(0xa0341d0,0x0)\PCI(0x0,0x2)\ACPI_ADR(0x80010302)\ACPI(0xa0341d0,0x0)\PCI(0x0,0x1f)\ACPI(0x50141d0,0x0)\UART(115200,8,1,1)\VENDOR(11d2f9be-0c9a-9000-27-3f-c1-4d-7f-01-04-00)\ACPI(0xa0341d0,0x0)\PCI(0x0,0x2)\ACPI_ADR(0x80010100). According to the UEFI spec section 9.3.1 the "End This Instance of a Device Path sub-type", Sub-Type 0x01 – End This Instance of a Device Path and start a new Device Path It should be improved to show the device path end and new device path start. For example, Device Path: \ACPI(0xa0341d0,0x0)\PCI(0x0,0x2)\ACPI_ADR(0x80010302) Device Path: \ACPI(0xa0341d0,0x0)\PCI(0x0,0x1f)\ACPI(0x50141d0,0x0)\UART(115200,8,1,1)\VENDOR(11d2f9be-0c9a-9000-27-3f-c1-4d-7f-01-04-00) Device Path: \ACPI(0xa0341d0,0x0)\PCI(0x0,0x2)\ACPI_ADR(0x80010100). Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefidump/uefidump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c index cd57422..50a08b4 100644 --- a/src/uefi/uefidump/uefidump.c +++ b/src/uefi/uefidump/uefidump.c @@ -99,7 +99,9 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c case FWTS_UEFI_END_DEV_PATH_TYPE: switch (dev_path->subtype) { case FWTS_UEFI_END_ENTIRE_DEV_PATH_SUBTYPE: + break; case FWTS_UEFI_END_THIS_DEV_PATH_SUBTYPE: + path = uefidump_vprintf(path, "\n Device Path: "); break; default: return uefidump_vprintf(path, "\\Unknown-End(0x%" PRIx8 ")", dev_path->subtype);