]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 5 Mar 2018 03:27:34 +0000 (11:27 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 2 May 2018 08:54:07 +0000 (16:54 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/UefiDevicePathLib/DevicePathToText.c

index 63542dba960eac8c518d183483beb1cf7338b356..813ea243343d4c9921ea231dacb7d1c1f5acbc0b 100644 (file)
@@ -2,7 +2,7 @@
   DevicePathToText protocol as defined in the UEFI 2.0 specification.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1539,18 +1539,20 @@ DevPathToTextiSCSI (
 {\r
   ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;\r
   UINT16                      Options;\r
+  UINTN                       Index;\r
 \r
   ISCSIDevPath = DevPath;\r
   UefiDevicePathLibCatPrint (\r
     Str,\r
-    L"iSCSI(%a,0x%x,0x%lx,",\r
+    L"iSCSI(%a,0x%x,0x",\r
     ISCSIDevPath->TargetName,\r
-    ISCSIDevPath->TargetPortalGroupTag,\r
-    ISCSIDevPath->Lun\r
+    ISCSIDevPath->TargetPortalGroupTag\r
     );\r
-\r
+  for (Index = 0; Index < sizeof (ISCSIDevPath->Lun) / sizeof (UINT8); Index++) {\r
+    UefiDevicePathLibCatPrint (Str, L"%02x", ((UINT8 *)&ISCSIDevPath->Lun)[Index]);\r
+  }\r
   Options = ISCSIDevPath->LoginOption;\r
-  UefiDevicePathLibCatPrint (Str, L"%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
+  UefiDevicePathLibCatPrint (Str, L",%s,", (((Options >> 1) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
   UefiDevicePathLibCatPrint (Str, L"%s,", (((Options >> 3) & 0x0001) != 0) ? L"CRC32C" : L"None");\r
   if (((Options >> 11) & 0x0001) != 0) {\r
     UefiDevicePathLibCatPrint (Str, L"%s,", L"None");\r