]> git.proxmox.com Git - mirror_edk2.git/commitdiff
[PATHC] ShellPkg: control code flow with a PCD
authorJaben Carsey <jaben.carsey@intel.com>
Wed, 12 Nov 2014 21:28:51 +0000 (21:28 +0000)
committerjcarsey <jcarsey@Edk2>
Wed, 12 Nov 2014 21:28:51 +0000 (21:28 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16342 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
ShellPkg/ShellPkg.dec

index a009609ffc27e08f727fce96f64ec2c5217bbed5..4e03666a467d84e5eb4182a996960961f97bc2b2 100644 (file)
@@ -651,13 +651,6 @@ DevPathSerialIScsi (
   IN DEVICE_CONSIST_MAPPING_INFO  *MappingItem\r
   )\r
 {\r
-///@todo make this a PCD\r
-//\r
-// As Csd of ISCSI node is quite long, we comment\r
-// the code below to keep the consistent mapping\r
-// short. Uncomment if you really need it.\r
-//\r
-/*\r
   ISCSI_DEVICE_PATH  *IScsi;\r
   UINT8              *IScsiTargetName;\r
   CHAR16             *TargetName;\r
@@ -667,24 +660,25 @@ DevPathSerialIScsi (
   ASSERT(DevicePathNode != NULL);\r
   ASSERT(MappingItem != NULL);\r
 \r
-  IScsi = (ISCSI_DEVICE_PATH  *) DevicePathNode;\r
-  AppendCSDNum (MappingItem, IScsi->NetworkProtocol);\r
-  AppendCSDNum (MappingItem, IScsi->LoginOption);\r
-  AppendCSDNum (MappingItem, IScsi->Lun);\r
-  AppendCSDNum (MappingItem, IScsi->TargetPortalGroupTag);\r
-  TargetNameLength = DevicePathNodeLength (DevicePathNode) - sizeof (ISCSI_DEVICE_PATH);\r
-  if (TargetNameLength > 0) {\r
-    TargetName = AllocateZeroPool ((TargetNameLength + 1) * sizeof (CHAR16));\r
-    if (TargetName != NULL) {\r
-      IScsiTargetName = (UINT8 *) (IScsi + 1);\r
-      for (Index = 0; Index < TargetNameLength; Index++) {\r
-        TargetName[Index] = (CHAR16) IScsiTargetName[Index];\r
+  if (PcdGetBool(PcdShellDecodeIScsiMapNames)) {\r
+    IScsi = (ISCSI_DEVICE_PATH  *) DevicePathNode;\r
+    AppendCSDNum (MappingItem, IScsi->NetworkProtocol);\r
+    AppendCSDNum (MappingItem, IScsi->LoginOption);\r
+    AppendCSDNum (MappingItem, IScsi->Lun);\r
+    AppendCSDNum (MappingItem, IScsi->TargetPortalGroupTag);\r
+    TargetNameLength = DevicePathNodeLength (DevicePathNode) - sizeof (ISCSI_DEVICE_PATH);\r
+    if (TargetNameLength > 0) {\r
+      TargetName = AllocateZeroPool ((TargetNameLength + 1) * sizeof (CHAR16));\r
+      if (TargetName != NULL) {\r
+        IScsiTargetName = (UINT8 *) (IScsi + 1);\r
+        for (Index = 0; Index < TargetNameLength; Index++) {\r
+          TargetName[Index] = (CHAR16) IScsiTargetName[Index];\r
+        }\r
+        AppendCSDStr (MappingItem, TargetName);\r
+        FreePool (TargetName);\r
       }\r
-      AppendCSDStr (MappingItem, TargetName);\r
-      FreePool (TargetName);\r
     }\r
   }\r
- */\r
 }\r
 \r
 /**\r
index d3a2056405f62e9f5ed74786a93ad1e256c89a14..5ef82c64d717679ea62bdeebc8e020e48c16cfe8 100644 (file)
@@ -60,6 +60,7 @@
 [Pcd.common]\r
   gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel         ## ALWAYS_CONSUMED\r
   gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength        ## ALWAYS_CONSUMED\r
+  gEfiShellPkgTokenSpaceGuid.PcdShellDecodeIScsiMapNames  ## SOMETIMES_CONSUMED\r
 \r
 [Depex]\r
   gEfiUnicodeCollation2ProtocolGuid\r
index 90eb08ab85c4a8c494bed457583023d16acdcd0b..254c5b46cb30e8c99ad3b303a57389a52ffcad94 100644 (file)
 \r
   ## Unicode string of the shell supplier\r
   gEfiShellPkgTokenSpaceGuid.PcdShellSupplier|L"EDK II"|VOID*|0x00000010\r
+\r
+  ## Do iSCSI decode for map names.\r
+  # This is disabled by default due to the length of generated strings\r
+  gEfiShellPkgTokenSpaceGuid.PcdShellDecodeIScsiMapNames|FALSE|BOOLEAN|0x00000012\r