public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue
@ 2018-04-25  6:05 Ruiyu Ni
  2018-04-28  5:43 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Ruiyu Ni @ 2018-04-25  6:05 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 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.<BR>
-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue
  2018-04-25  6:05 [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue Ruiyu Ni
@ 2018-04-28  5:43 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-04-28  5:43 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Ni, Ruiyu
>Sent: Wednesday, April 25, 2018 2:05 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> 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.<BR>
>-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-28  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-25  6:05 [PATCH] MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue Ruiyu Ni
2018-04-28  5:43 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox