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.93; helo=mga11.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 4C2BA220E8DEF for ; Tue, 24 Apr 2018 23:05:23 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2018 23:05:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,325,1520924400"; d="scan'208";a="223180780" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga006.fm.intel.com with ESMTP; 24 Apr 2018 23:05:22 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Liming Gao Date: Wed, 25 Apr 2018 14:05:18 +0800 Message-Id: <20180425060518.41236-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 Subject: [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 06:05:23 -0000 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Liming Gao --- MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 63542dba96..df1f218776 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -2,7 +2,7 @@ DevicePathToText protocol as defined in the UEFI 2.0 specification. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1539,18 +1539,20 @@ DevPathToTextiSCSI ( { ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath; UINT16 Options; + UINTN Index; ISCSIDevPath = DevPath; UefiDevicePathLibCatPrint ( Str, - L"iSCSI(%a,0x%x,0x%lx,", + L"iSCSI(%a,0x%x,0x", ISCSIDevPath->TargetName, - ISCSIDevPath->TargetPortalGroupTag, - ISCSIDevPath->Lun + ISCSIDevPath->TargetPortalGroupTag ); - + for (Index = 0; Index < ARRAY_SIZE (ISCSIDevPath->Lun); Index++) { + UefiDevicePathLibCatPrint (Str, L"%02x", ISCSIDevPath->Lun[Index]); + } Options = ISCSIDevPath->LoginOption; - UefiDevicePathLibCatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None"); + UefiDevicePathLibCatPrint (Str, L",%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None"); UefiDevicePathLibCatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None"); if (((Options >> 11) & 0x0001) != 0) { UefiDevicePathLibCatPrint (Str, L"%s,", L"None"); -- 2.16.1.windows.1