Revision: 16342
http://sourceforge.net/p/edk2/code/16342
Author: jcarsey
Date: 2014-11-12 21:28:51 +0000 (Wed, 12 Nov 2014)
Log Message:
-----------
[PATHC] ShellPkg: control code flow with a PCD
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <[email protected]>
Reviewed-by: Erik Bjorge <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
trunk/edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
trunk/edk2/ShellPkg/ShellPkg.dec
Modified: trunk/edk2/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
2014-11-12 20:33:36 UTC (rev 16341)
+++ trunk/edk2/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
2014-11-12 21:28:51 UTC (rev 16342)
@@ -651,13 +651,6 @@
IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
)
{
-///@todo make this a PCD
-//
-// As Csd of ISCSI node is quite long, we comment
-// the code below to keep the consistent mapping
-// short. Uncomment if you really need it.
-//
-/*
ISCSI_DEVICE_PATH *IScsi;
UINT8 *IScsiTargetName;
CHAR16 *TargetName;
@@ -667,24 +660,25 @@
ASSERT(DevicePathNode != NULL);
ASSERT(MappingItem != NULL);
- IScsi = (ISCSI_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, IScsi->NetworkProtocol);
- AppendCSDNum (MappingItem, IScsi->LoginOption);
- AppendCSDNum (MappingItem, IScsi->Lun);
- AppendCSDNum (MappingItem, IScsi->TargetPortalGroupTag);
- TargetNameLength = DevicePathNodeLength (DevicePathNode) - sizeof
(ISCSI_DEVICE_PATH);
- if (TargetNameLength > 0) {
- TargetName = AllocateZeroPool ((TargetNameLength + 1) * sizeof (CHAR16));
- if (TargetName != NULL) {
- IScsiTargetName = (UINT8 *) (IScsi + 1);
- for (Index = 0; Index < TargetNameLength; Index++) {
- TargetName[Index] = (CHAR16) IScsiTargetName[Index];
+ if (PcdGetBool(PcdShellDecodeIScsiMapNames)) {
+ IScsi = (ISCSI_DEVICE_PATH *) DevicePathNode;
+ AppendCSDNum (MappingItem, IScsi->NetworkProtocol);
+ AppendCSDNum (MappingItem, IScsi->LoginOption);
+ AppendCSDNum (MappingItem, IScsi->Lun);
+ AppendCSDNum (MappingItem, IScsi->TargetPortalGroupTag);
+ TargetNameLength = DevicePathNodeLength (DevicePathNode) - sizeof
(ISCSI_DEVICE_PATH);
+ if (TargetNameLength > 0) {
+ TargetName = AllocateZeroPool ((TargetNameLength + 1) * sizeof (CHAR16));
+ if (TargetName != NULL) {
+ IScsiTargetName = (UINT8 *) (IScsi + 1);
+ for (Index = 0; Index < TargetNameLength; Index++) {
+ TargetName[Index] = (CHAR16) IScsiTargetName[Index];
+ }
+ AppendCSDStr (MappingItem, TargetName);
+ FreePool (TargetName);
}
- AppendCSDStr (MappingItem, TargetName);
- FreePool (TargetName);
}
}
- */
}
/**
Modified:
trunk/edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
2014-11-12 20:33:36 UTC (rev 16341)
+++ trunk/edk2/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
2014-11-12 21:28:51 UTC (rev 16342)
@@ -60,6 +60,7 @@
[Pcd.common]
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## ALWAYS_CONSUMED
gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength ## ALWAYS_CONSUMED
+ gEfiShellPkgTokenSpaceGuid.PcdShellDecodeIScsiMapNames ## SOMETIMES_CONSUMED
[Depex]
gEfiUnicodeCollation2ProtocolGuid
Modified: trunk/edk2/ShellPkg/ShellPkg.dec
===================================================================
--- trunk/edk2/ShellPkg/ShellPkg.dec 2014-11-12 20:33:36 UTC (rev 16341)
+++ trunk/edk2/ShellPkg/ShellPkg.dec 2014-11-12 21:28:51 UTC (rev 16342)
@@ -128,3 +128,7 @@
## Unicode string of the shell supplier
gEfiShellPkgTokenSpaceGuid.PcdShellSupplier|L"EDK II"|VOID*|0x00000010
+
+ ## Do iSCSI decode for map names.
+ # This is disabled by default due to the length of generated strings
+
gEfiShellPkgTokenSpaceGuid.PcdShellDecodeIScsiMapNames|FALSE|BOOLEAN|0x00000012
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits