#include "UefiShellCommandLib.h"\r
#include <Library/DevicePathLib.h>\r
#include <Library/SortLib.h>\r
+#include <Library/UefiLib.h>\r
\r
typedef enum {\r
MTDTypeUnknown,\r
{\r
VENDOR_DEVICE_PATH *Vendor;\r
SAS_DEVICE_PATH *Sas;\r
+ UINTN TargetNameLength;\r
+ UINTN Index;\r
+ CHAR16 *Buffer;\r
\r
if (DevicePathNode == NULL || MappingItem == NULL) {\r
return;\r
AppendCSDNum (MappingItem, Sas->Lun);\r
AppendCSDNum (MappingItem, Sas->DeviceTopology);\r
AppendCSDNum (MappingItem, Sas->RelativeTargetPort);\r
+ } else {\r
+ TargetNameLength = MIN(DevicePathNodeLength (DevicePathNode) - sizeof (VENDOR_DEVICE_PATH), PcdGet32(PcdShellVendorExtendedDecode));\r
+ if (TargetNameLength != 0) {\r
+ //\r
+ // String is 2 chars per data byte, plus NULL terminator\r
+ //\r
+ Buffer = AllocateZeroPool (((TargetNameLength * 2) + 1) * sizeof(CHAR16));\r
+ ASSERT(Buffer != NULL);\r
+ if (Buffer == NULL) {\r
+ return;\r
+ }\r
+\r
+ //\r
+ // Build the string data\r
+ //\r
+ for (Index = 0; Index < TargetNameLength; Index++) {\r
+ Buffer = CatSPrint (Buffer, L"%02x", *((UINT8*)Vendor + sizeof (VENDOR_DEVICE_PATH) + Index));\r
+ }\r
+\r
+ //\r
+ // Append the new data block\r
+ //\r
+ AppendCSDStr (MappingItem, Buffer);\r
+\r
+ FreePool(Buffer);\r
+ }\r
}\r
}\r
\r
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## ALWAYS_CONSUMED\r
gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength ## ALWAYS_CONSUMED\r
gEfiShellPkgTokenSpaceGuid.PcdShellDecodeIScsiMapNames ## SOMETIMES_CONSUMED\r
+ gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode ## SOMETIMES_CONSUMED\r
\r
[Depex]\r
gEfiUnicodeCollation2ProtocolGuid\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
+\r
+ ## Controls Extended decode for Vendor device path nodes for map names.\r
+ # Up to this many bytes of vendor specific data will be used. Default is 0\r
+ # (disabled).\r
+ gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode|0|UINT32|0x00000013\r