diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index a588403017..498221a339 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -205,11 +205,11 @@ IScsiParseIsIdFromString ( IsIdStr = (CHAR16 *) String; - if (StrLen (IsIdStr) != 6) { + if (StrLen (IsIdStr) != 6 && StrLen (IsIdStr) != 12) { UnicodeSPrint ( PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, - L"Error! Input is incorrect, please input 6 hex numbers!\n" + L"Error! Only last 3 bytes are configurable, please input 6 hex numbers for last 3 bytes only or 12 hex numbers for full SSID!\n" ); CreatePopUp ( @@ -222,6 +222,10 @@ IScsiParseIsIdFromString ( return EFI_INVALID_PARAMETER; } + if (StrLen (IsIdStr) == 12) { + IsIdStr += 6; + } + for (Index = 3; Index < 6; Index++) { CopyMem (TempStr, IsIdStr, sizeof (TempStr)); TempStr[2] = L'\0'; diff --git a/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni b/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni index 79522583de..10583f8f3b 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni +++ b/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni @@ -99,3 +99,4 @@ #language x-UEFI-ns "iSCSIDisplayAttemptList" #string STR_ISCSI_ATTEMPT_ORDER #language en-US "New Attempt Order" #language x-UEFI-ns "iSCSIAttemptOrder" +#string STR_ISCSI_ISID_HELP #language en-US "The iSCSI ISID. Default value are derived from MAC address. Only last 3 bytes are configurable." diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c index 2c93590deb..e20fe9194a 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.c +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c @@ -952,7 +952,7 @@ IScsiCreateKeywords ( CONFIGURATION_VARSTORE_ID, (UINT16) (ATTEMPT_ISID_VAR_OFFSET + sizeof (KEYWORD_STR) * (Index - 1)), StringToken, - StringToken, + STRING_TOKEN (STR_ISCSI_ISID_HELP), 0, 0, ISID_CONFIGURABLE_MIN_LEN,