NetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword.

The last 3 bytes of ISID should be able to changed by setting the keyword with
a value with length 6 (only last 3 bytes) or 12 (full ISID) according to the
keyword definition in UEFI configuration namespace website.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Fu Siyuan 2017-08-03 14:38:51 +08:00
parent bc2300577f
commit 41c9011cc1
3 changed files with 8 additions and 3 deletions

View File

@ -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';

View File

@ -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."

View File

@ -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,