From patchwork Fri Nov 6 03:16:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 540801 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 990BA1402D7; Fri, 6 Nov 2015 14:16:59 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZuXWK-0008JQ-Fs; Fri, 06 Nov 2015 03:16:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZuXWF-0008JL-LE for fwts-devel@lists.ubuntu.com; Fri, 06 Nov 2015 03:16:51 +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.76) (envelope-from ) id 1ZuXWF-0002if-33; Fri, 06 Nov 2015 03:16:51 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/3][Resend] uefibootpath: add test for the UFS device path Date: Fri, 6 Nov 2015 11:16:45 +0800 Message-Id: <1446779805-29844-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.9.1 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 Sync up with uefi spec. 2.5 for new messaging device path, UFS device path. And also fix some typos. Signed-off-by: Ivan Hu Acked-by: Alex Hung Acked-by: Colin Ian King --- src/uefi/uefibootpath/uefibootpath.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c index 3232bd1..fc75594 100644 --- a/src/uefi/uefibootpath/uefibootpath.c +++ b/src/uefi/uefibootpath/uefibootpath.c @@ -62,7 +62,7 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d } break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of End of Hardware Device Path."); + fwts_log_info_verbatum(fw, "Unknown subtype of End of Hardware Device Path."); break; } break; @@ -138,7 +138,7 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d } break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of Hardware Device Path."); + fwts_log_info_verbatum(fw, "Unknown subtype of Hardware Device Path."); break; } break; @@ -202,7 +202,7 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d } break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of ACPI Device Path."); + fwts_log_info_verbatum(fw, "Unknown subtype of ACPI Device Path."); break; } break; @@ -563,8 +563,29 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d errors++; } break; + case FWTS_UEFI_UFS_DEVICE_PATH_SUBTYPE: + if (len != sizeof(fwts_uefi_ufs_dev_path)) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIUFSDevPathLength", + "The length of UFS(Universal Flash Storage) is %" PRIu16 " bytes " + "and differs from UEFI specification defined %" PRIu16 " bytes.", + len, + (uint16_t)sizeof(fwts_uefi_ufs_dev_path)); + errors++; + } + + fwts_uefi_ufs_dev_path *ufs = (fwts_uefi_ufs_dev_path *)dev_path; + if (ufs->target_id != 0) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIPUNFieldInvalid", + "The Target ID on the UFS interface(PUN) is %" PRIu8 " ." + "This value should be 0 for current UFS2.0 spec compliance " + "and reserve/introduce this field to support multiple devices " + "per UFS port.", + ufs->target_id); + errors++; + } + break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of Messaging Device PaERRORth."); + fwts_log_info_verbatum(fw, "Unknown subtype of Messaging Device Path."); break; } break; @@ -670,7 +691,7 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d } break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of Media Device Path."); + fwts_log_info_verbatum(fw, "Unknown subtype of Media Device Path."); break; } break; @@ -698,12 +719,12 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d } break; default: - fwts_log_info_verbatum(fw, "Unknow subtype of BIOS Boot Specification Device Path."); + fwts_log_info_verbatum(fw, "Unknown subtype of BIOS Boot Specification Device Path."); break; } break; default: - fwts_log_info_verbatum(fw, "Unknow Type of Device Path."); + fwts_log_info_verbatum(fw, "Unknown Type of Device Path."); break; }