From patchwork Thu Dec 5 10:04:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 296758 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 DEA0F2C0087 for ; Thu, 5 Dec 2013 21:04:48 +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 1VoVnb-0002Fv-P2; Thu, 05 Dec 2013 10:04:47 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VoVnW-0002FV-KH for fwts-devel@lists.ubuntu.com; Thu, 05 Dec 2013 10:04:42 +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 1VoVnW-0004aD-2Z; Thu, 05 Dec 2013 10:04:42 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 4/4] uefi: uefidump: add the NVM Express namespace subtype-23 support on messaging device path type for uefidump (LP: #1255387) Date: Thu, 5 Dec 2013 18:04:36 +0800 Message-Id: <1386237876-22722-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 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: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Add the NVM Express Namespace subtype 23 support on messaging device path follow the section 9.3.5.22 on UEFI spec2.4. Signed-off-by: Ivan Hu Acked-by: Colin Ian King --- src/lib/include/fwts_uefi.h | 9 ++++++++- src/uefi/uefidump/uefidump.c | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h index 864ce43..c834d28 100644 --- a/src/lib/include/fwts_uefi.h +++ b/src/lib/include/fwts_uefi.h @@ -210,7 +210,8 @@ typedef enum { FWTS_UEFI_ISCSI_DEVICE_PATH_SUBTYPE = (0x13), FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE = (0x14), FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15), - FWTS_UEFI_SAS_EX_DEVICE_PATH_SUBTYPE = (0x16) + FWTS_UEFI_SAS_EX_DEVICE_PATH_SUBTYPE = (0x16), + FWTS_UEFI_NVM_EXPRESS_NAMESP_DEVICE_PATH_SUBTYPE = (0x17) } messaging_dev_path_subtypes; typedef enum { @@ -425,6 +426,12 @@ typedef struct { uint16_t tpg_tag; char iscsi_tn[0]; } __attribute__((packed)) fwts_uefi_iscsi_dev_path; + +typedef struct { + fwts_uefi_dev_path dev_path; + uint32_t namesp_id; + uint64_t ext_unique_id; +} __attribute__((packed)) fwts_uefi_nvm_express_namespace_dev_path; typedef struct { fwts_uefi_dev_path dev_path; diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c index e965043..d389551 100644 --- a/src/uefi/uefidump/uefidump.c +++ b/src/uefi/uefidump/uefidump.c @@ -406,6 +406,13 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c path = uefidump_vprintf(path, ",%s)", i->iscsi_tn); } break; + case FWTS_UEFI_NVM_EXPRESS_NAMESP_DEVICE_PATH_SUBTYPE: + if (dev_path_len >= sizeof(fwts_uefi_nvm_express_namespace_dev_path)) { + fwts_uefi_nvm_express_namespace_dev_path *n = (fwts_uefi_nvm_express_namespace_dev_path *)dev_path; + path = uefidump_vprintf(path, "\\NVMEXPRESS(0x%" PRIx32 ",0x%" PRIx64 ")", + n->namesp_id, n->ext_unique_id); + } + break; default: path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype); break;