11CHAR16 mVendorStorageName[] = L
"ISCSI_CONFIG_IFR_NVDATA";
28 END_ENTIRE_DEVICE_PATH_SUBTYPE,
30 (UINT8)(END_DEVICE_PATH_LENGTH),
31 (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
56 CHAR16 FormatString[8];
63 (
UINTN)2 * IP4_STR_MAX_SIZE,
77 for (Index = 0; Index < 15; Index = Index + 2) {
80 (Ip6->Addr[Index] == 0) &&
81 (Ip6->Addr[Index + 1] == 0)
96 while ((Index < 15) && (Ip6->Addr[Index] == 0) && (Ip6->Addr[Index + 1] == 0)) {
113 if (Ip6->Addr[Index] == 0) {
114 Number =
UnicodeSPrint (Str, 2 * IP_STR_MAX_SIZE, L
"%x:", (
UINTN)Ip6->Addr[Index + 1]);
116 if (Ip6->Addr[Index + 1] < 0x10) {
125 (
CONST CHAR16 *)FormatString,
126 (
UINTN)Ip6->Addr[Index],
127 (
UINTN)Ip6->Addr[Index + 1]
133 if (Index + 2 == 16) {
135 if (*(Str - 1) == L
':') {
158 if (IpMode == IP_MODE_IP4) {
159 if (IP4_IS_UNSPECIFIED (NTOHL (Ip->Addr[0])) || IP4_IS_LOCAL_BROADCAST (NTOHL (Ip->Addr[0]))) {
164 }
else if (IpMode == IP_MODE_IP6) {
167 DEBUG ((DEBUG_ERROR,
"IpMode %d is invalid when configuring the iSCSI target IP!\n", IpMode));
192 CHAR16 PortString[ISCSI_NAME_IFR_MAX_SIZE];
195 if ((String ==
NULL) || (IsId ==
NULL)) {
196 return EFI_INVALID_PARAMETER;
199 IsIdStr = (CHAR16 *)String;
201 if ((
StrLen (IsIdStr) != 6) && (
StrLen (IsIdStr) != 12)) {
204 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
205 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"
209 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
215 return EFI_INVALID_PARAMETER;
218 if (
StrLen (IsIdStr) == 12) {
222 for (Index = 3; Index < 6; Index++) {
223 CopyMem (TempStr, IsIdStr,
sizeof (TempStr));
232 IsId[Index] = (UINT8)NodeVal;
234 IsIdStr = IsIdStr + 2;
259 if ((String ==
NULL) || (IsId ==
NULL)) {
260 return EFI_INVALID_PARAMETER;
263 for (Index = 0; Index < 6; Index++) {
264 if (IsId[Index] <= 0xF) {
267 2 * ISID_CONFIGURABLE_STORAGE,
274 2 * ISID_CONFIGURABLE_STORAGE,
280 String = String + Number;
304 IN CONST EFI_STRING Configuration,
324 StringPtr =
StrStr (Configuration, String);
325 ASSERT (StringPtr !=
NULL);
326 StringPtr +=
StrLen (String);
329 while (*StringPtr != L
'\0' && *StringPtr != L
'&') {
333 Length = StringPtr - TmpPtr;
338 Status = EFI_OUT_OF_RESOURCES;
342 CopyMem (Str, TmpPtr, Len *
sizeof (CHAR16));
343 *(Str + Length) = L
'\0';
348 Status = EFI_OUT_OF_RESOURCES;
352 ZeroMem (TmpStr,
sizeof (TmpStr));
353 for (Index = 0; Index < Length; Index++) {
354 TmpStr[0] = Str[Length - Index - 1];
356 if ((Index & 1) == 0) {
357 Buf[Index/2] = DigitUint8;
359 Buf[Index/2] = (UINT8)((DigitUint8 << 4) + Buf[Index/2]);
367 (((Length + 1) / 2) <
sizeof (
UINTN)) ? ((Length + 1) / 2) :
sizeof (
UINTN)
392 IN UINT8 AttemptConfigIndex
398 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
400 if (Attempt->AttemptConfigIndex == AttemptConfigIndex) {
429 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
431 if ((Attempt != NewAttempt) && (Attempt->NicIndex == NewAttempt->NicIndex) &&
432 (Attempt->SessionConfigData.Enabled == IScsiMode))
455 IN CHAR16 *AttemptNameList,
456 OUT UINT8 *AttemptIndexList,
457 IN BOOLEAN IsAddAttempts
468 if ((AttemptNameList ==
NULL) || (*AttemptNameList == L
'\0')) {
469 return EFI_INVALID_PARAMETER;
472 AttemptStr = AttemptNameList;
473 Len =
StrLen (L
"attempt:");
475 while (*AttemptStr != L
'\0') {
476 AttemptStr =
StrStr (AttemptStr, L
"attempt:");
477 if (AttemptStr ==
NULL) {
478 return EFI_INVALID_PARAMETER;
482 AttemptIndex = (UINT8)(*AttemptStr - L
'0');
485 if ((AttemptConfigData !=
NULL) || ((AttemptIndex) >
PcdGet8 (PcdMaxIScsiAttemptNumber))) {
486 return EFI_INVALID_PARAMETER;
489 if (AttemptConfigData ==
NULL) {
490 return EFI_INVALID_PARAMETER;
494 AttemptIndexList[Index] = AttemptIndex;
523 SessionConfigData = &Attempt->SessionConfigData;
524 IfrNvData->Enabled = SessionConfigData->Enabled;
525 IfrNvData->IpMode = SessionConfigData->IpMode;
526 DnsMode = SessionConfigData->DnsMode;
528 IfrNvData->InitiatorInfoFromDhcp = SessionConfigData->InitiatorInfoFromDhcp;
529 IfrNvData->TargetInfoFromDhcp = SessionConfigData->TargetInfoFromDhcp;
530 IfrNvData->TargetPort = SessionConfigData->TargetPort;
532 if (IfrNvData->IpMode == IP_MODE_IP4) {
539 ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp));
540 if (SessionConfigData->TargetIp.v4.Addr[0] !=
'\0') {
544 }
else if (IfrNvData->IpMode == IP_MODE_IP6) {
545 ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp));
546 if (SessionConfigData->TargetIp.v6.Addr[0] !=
'\0') {
547 IP6_COPY_ADDRESS (&Ip.v6, &SessionConfigData->TargetIp);
553 SessionConfigData->TargetName,
554 IfrNvData->TargetName,
555 sizeof (IfrNvData->TargetName) / sizeof (IfrNvData->TargetName[0])
560 SessionConfigData->TargetUrl,
562 sizeof (IfrNvData->TargetIp) / sizeof (IfrNvData->TargetIp[0])
569 IfrNvData->ConnectRetryCount = SessionConfigData->ConnectRetryCount;
575 IfrNvData->AuthenticationType = Attempt->AuthenticationType;
577 if (IfrNvData->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
578 AuthConfigData = &Attempt->AuthConfigData.CHAP;
579 IfrNvData->CHAPType = AuthConfigData->CHAPType;
581 AuthConfigData->CHAPName,
583 sizeof (IfrNvData->CHAPName) / sizeof (IfrNvData->CHAPName[0])
586 AuthConfigData->CHAPSecret,
587 IfrNvData->CHAPSecret,
588 sizeof (IfrNvData->CHAPSecret) / sizeof (IfrNvData->CHAPSecret[0])
591 AuthConfigData->ReverseCHAPName,
592 IfrNvData->ReverseCHAPName,
593 sizeof (IfrNvData->ReverseCHAPName) / sizeof (IfrNvData->ReverseCHAPName[0])
596 AuthConfigData->ReverseCHAPSecret,
597 IfrNvData->ReverseCHAPSecret,
598 sizeof (IfrNvData->ReverseCHAPSecret) / sizeof (IfrNvData->ReverseCHAPSecret[0])
606 Attempt->AttemptName,
607 IfrNvData->AttemptName,
608 sizeof (IfrNvData->AttemptName) / sizeof (IfrNvData->AttemptName[0])
629 CHAR16 AttemptNameList[ATTEMPT_NAME_LIST_SIZE];
631 CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
637 ZeroMem (AttemptNameList,
sizeof (AttemptNameList));
639 if ((mPrivate !=
NULL) && (mPrivate->AttemptCount != 0)) {
640 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
645 SessionConfigData = &Attempt->SessionConfigData;
647 ASSERT ((Attempt->AttemptConfigIndex > 0) && (Attempt->AttemptConfigIndex <=
FixedPcdGet8 (PcdMaxIScsiAttemptNumber)));
648 Index = Attempt->AttemptConfigIndex - 1;
654 Attempt->AttemptName,
655 AttemptNameList +
StrLen (AttemptNameList),
656 ATTEMPT_NAME_LIST_SIZE -
StrLen (AttemptNameList)
659 StringLen =
StrLen (AttemptNameList);
660 ASSERT (StringLen > 2);
661 *(AttemptNameList + StringLen - 2) = L
':';
662 *(AttemptNameList + StringLen) = L
' ';
665 Attempt->AttemptName,
666 IfrNvData->ISCSIAttemptName + ATTEMPT_NAME_SIZE * Index,
667 ATTEMPT_NAME_LIST_SIZE - ATTEMPT_NAME_SIZE * Index
670 IfrNvData->ISCSIBootEnableList[Index] = SessionConfigData->Enabled;
671 IfrNvData->ISCSIIpAddressTypeList[Index] = SessionConfigData->IpMode;
673 IfrNvData->ISCSIInitiatorInfoViaDHCP[Index] = SessionConfigData->InitiatorInfoFromDhcp;
674 IfrNvData->ISCSITargetInfoViaDHCP[Index] = SessionConfigData->TargetInfoFromDhcp;
675 IfrNvData->ISCSIConnectRetry[Index] = SessionConfigData->ConnectRetryCount;
676 IfrNvData->ISCSIConnectTimeout[Index] = SessionConfigData->
ConnectTimeout;
677 IfrNvData->ISCSITargetTcpPort[Index] = SessionConfigData->TargetPort;
679 if (SessionConfigData->IpMode == IP_MODE_IP4) {
686 if (SessionConfigData->TargetIp.v4.Addr[0] !=
'\0') {
690 }
else if (SessionConfigData->IpMode == IP_MODE_IP6) {
691 ZeroMem (IfrNvData->Keyword[Index].ISCSITargetIpAddress, sizeof (IfrNvData->TargetIp));
692 if (SessionConfigData->TargetIp.v6.Addr[0] !=
'\0') {
693 IP6_COPY_ADDRESS (&Ip.v6, &SessionConfigData->TargetIp);
699 SessionConfigData->TargetName,
700 IfrNvData->Keyword[Index].ISCSITargetName,
704 if (SessionConfigData->DnsMode) {
706 SessionConfigData->TargetUrl,
707 IfrNvData->Keyword[Index].ISCSITargetIpAddress,
708 sizeof (IfrNvData->Keyword[Index].ISCSITargetIpAddress) / sizeof (IfrNvData->Keyword[Index].ISCSITargetIpAddress[0])
715 IfrNvData->ISCSIAuthenticationMethod[Index] = Attempt->AuthenticationType;
717 if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
718 AuthConfigData = &Attempt->AuthConfigData.CHAP;
719 IfrNvData->ISCSIChapType[Index] = AuthConfigData->CHAPType;
721 AuthConfigData->CHAPName,
722 IfrNvData->Keyword[Index].ISCSIChapUsername,
723 ISCSI_CHAP_NAME_STORAGE
727 AuthConfigData->CHAPSecret,
728 IfrNvData->Keyword[Index].ISCSIChapSecret,
729 ISCSI_CHAP_SECRET_STORAGE
733 AuthConfigData->ReverseCHAPName,
734 IfrNvData->Keyword[Index].ISCSIReverseChapUsername,
735 ISCSI_CHAP_NAME_STORAGE
739 AuthConfigData->ReverseCHAPSecret,
740 IfrNvData->Keyword[Index].ISCSIReverseChapSecret,
741 ISCSI_CHAP_SECRET_STORAGE
745 CopyMem (IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, ATTEMPT_NAME_LIST_SIZE);
747 ZeroMem (IfrNvData->ISCSIMacAddr, sizeof (IfrNvData->ISCSIMacAddr));
748 NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
751 &NicInfo->PermanentAddress,
752 NicInfo->HwAddressSize,
757 IfrNvData->ISCSIMacAddr +
StrLen (IfrNvData->ISCSIMacAddr),
759 StrLen (MacString) *
sizeof (CHAR16)
762 *(IfrNvData->ISCSIMacAddr +
StrLen (IfrNvData->ISCSIMacAddr)) = L
'/';
765 StringLen =
StrLen (IfrNvData->ISCSIMacAddr);
767 *(IfrNvData->ISCSIMacAddr + StringLen - 1) = L
'\0';
795 CHAR16 *AttemptName1;
796 CHAR16 *AttemptName2;
799 CHAR16 IScsiMode[64];
803 UINT8 *AttemptConfigOrder;
804 UINTN AttemptConfigOrderSize;
805 UINT8 *AttemptOrderTmp;
809 if ((IfrNvData ==
NULL) || (Attempt ==
NULL)) {
810 return EFI_INVALID_PARAMETER;
816 Attempt->SessionConfigData.ConnectRetryCount = IfrNvData->ConnectRetryCount;
817 Attempt->SessionConfigData.ConnectTimeout = IfrNvData->ConnectTimeout;
818 Attempt->SessionConfigData.IpMode = IfrNvData->IpMode;
820 if (IfrNvData->IpMode < IP_MODE_AUTOCONFIG) {
821 Attempt->SessionConfigData.InitiatorInfoFromDhcp = IfrNvData->InitiatorInfoFromDhcp;
822 Attempt->SessionConfigData.TargetPort = IfrNvData->TargetPort;
824 if (Attempt->SessionConfigData.TargetPort == 0) {
825 Attempt->SessionConfigData.TargetPort = ISCSI_WELL_KNOWN_PORT;
828 Attempt->SessionConfigData.TargetInfoFromDhcp = IfrNvData->TargetInfoFromDhcp;
831 Attempt->AuthenticationType = IfrNvData->AuthenticationType;
833 if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
834 Attempt->AuthConfigData.CHAP.CHAPType = IfrNvData->CHAPType;
840 if (IfrNvData->Enabled != ISCSI_DISABLED) {
841 if (Attempt->SessionConfigData.ConnectTimeout < CONNECT_MIN_TIMEOUT) {
843 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
845 L
"Connection Establishing Timeout is less than minimum value 100ms.",
849 return EFI_INVALID_PARAMETER;
856 if (!Attempt->SessionConfigData.InitiatorInfoFromDhcp) {
857 CopyMem (&HostIp.v4, &Attempt->SessionConfigData.LocalIp, sizeof (HostIp.v4));
858 CopyMem (&SubnetMask.v4, &Attempt->SessionConfigData.SubnetMask, sizeof (SubnetMask.v4));
859 CopyMem (&Gateway.v4, &Attempt->SessionConfigData.Gateway, sizeof (Gateway.v4));
861 if ((Gateway.Addr[0] != 0)) {
862 if (SubnetMask.Addr[0] == 0) {
864 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
866 L
"Gateway address is set but subnet mask is zero.",
870 return EFI_INVALID_PARAMETER;
871 }
else if (!IP4_NET_EQUAL (HostIp.Addr[0], Gateway.Addr[0], SubnetMask.Addr[0])) {
873 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
875 L
"Local IP and Gateway are not in the same subnet.",
879 return EFI_INVALID_PARAMETER;
887 if (!Attempt->SessionConfigData.TargetInfoFromDhcp && (Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG)) {
888 if (!Attempt->SessionConfigData.DnsMode) {
889 if (!
IpIsUnicast (&Attempt->SessionConfigData.TargetIp, IfrNvData->IpMode)) {
891 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
893 L
"Target IP is invalid!",
896 return EFI_INVALID_PARAMETER;
899 if (Attempt->SessionConfigData.TargetUrl[0] ==
'\0') {
901 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
903 L
"iSCSI target Url should not be NULL!",
906 return EFI_INVALID_PARAMETER;
915 if (Attempt->SessionConfigData.TargetName[0] ==
'\0') {
917 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
919 L
"iSCSI target name is NULL!",
922 return EFI_INVALID_PARAMETER;
929 if (IfrNvData->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
930 if ((IfrNvData->CHAPName[0] ==
'\0') || (IfrNvData->CHAPSecret[0] ==
'\0')) {
932 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
934 L
"CHAP Name or CHAP Secret is invalid!",
938 return EFI_INVALID_PARAMETER;
941 if ((IfrNvData->CHAPType == ISCSI_CHAP_MUTUAL) &&
942 ((IfrNvData->ReverseCHAPName[0] ==
'\0') || (IfrNvData->ReverseCHAPSecret[0] ==
'\0'))
946 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
948 L
"Reverse CHAP Name or Reverse CHAP Secret is invalid!",
951 return EFI_INVALID_PARAMETER;
959 if (SameNicAttempt !=
NULL) {
960 AttemptName1 = (CHAR16 *)
AllocateZeroPool (ATTEMPT_NAME_SIZE *
sizeof (CHAR16));
961 if (AttemptName1 ==
NULL) {
962 return EFI_OUT_OF_RESOURCES;
965 AttemptName2 = (CHAR16 *)
AllocateZeroPool (ATTEMPT_NAME_SIZE *
sizeof (CHAR16));
966 if (AttemptName2 ==
NULL) {
968 return EFI_OUT_OF_RESOURCES;
975 mPrivate->PortString,
976 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
977 L
"Warning! Attempt \"%s\" uses same NIC as Attempt \"%s\".",
983 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
985 mPrivate->PortString,
997 if (IfrNvData->Enabled == ISCSI_DISABLED) {
999 }
else if (IfrNvData->Enabled == ISCSI_ENABLED) {
1001 }
else if (IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) {
1005 if (IfrNvData->IpMode == IP_MODE_IP4) {
1007 }
else if (IfrNvData->IpMode == IP_MODE_IP6) {
1009 }
else if (IfrNvData->IpMode == IP_MODE_AUTOCONFIG) {
1014 if (NicInfo ==
NULL) {
1015 return EFI_NOT_FOUND;
1018 MacString = (CHAR16 *)
AllocateZeroPool (ISCSI_MAX_MAC_STRING_LEN *
sizeof (CHAR16));
1019 if (MacString ==
NULL) {
1020 return EFI_OUT_OF_RESOURCES;
1026 mPrivate->PortString,
1027 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
1028 L
"MAC: %s, PFA: Bus %d | Dev %d | Func %d, iSCSI mode: %s, IP version: %s",
1031 NicInfo->DeviceNumber,
1032 NicInfo->FunctionNumber,
1038 mCallbackInfo->RegisteredHandle,
1039 Attempt->AttemptTitleHelpToken,
1040 mPrivate->PortString,
1043 if (Attempt->AttemptTitleHelpToken == 0) {
1045 return EFI_OUT_OF_RESOURCES;
1052 if (ExistAttempt !=
NULL) {
1053 ASSERT (ExistAttempt == Attempt);
1055 if ((IfrNvData->Enabled == ISCSI_DISABLED) &&
1056 (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED))
1061 if (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO) {
1062 if (mPrivate->MpioCount < 1) {
1066 if (--mPrivate->MpioCount == 0) {
1067 mPrivate->EnableMpio =
FALSE;
1069 }
else if (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED) {
1070 if (mPrivate->SinglePathCount < 1) {
1074 mPrivate->SinglePathCount--;
1076 }
else if ((IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) &&
1077 (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED))
1082 if (mPrivate->SinglePathCount < 1) {
1086 mPrivate->EnableMpio =
TRUE;
1087 mPrivate->MpioCount++;
1088 mPrivate->SinglePathCount--;
1089 }
else if ((IfrNvData->Enabled == ISCSI_ENABLED) &&
1090 (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO))
1095 if (mPrivate->MpioCount < 1) {
1099 if (--mPrivate->MpioCount == 0) {
1100 mPrivate->EnableMpio =
FALSE;
1103 mPrivate->SinglePathCount++;
1104 }
else if ((IfrNvData->Enabled != ISCSI_DISABLED) &&
1105 (Attempt->SessionConfigData.Enabled == ISCSI_DISABLED))
1110 if (IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) {
1111 mPrivate->EnableMpio =
TRUE;
1112 mPrivate->MpioCount++;
1113 }
else if (IfrNvData->Enabled == ISCSI_ENABLED) {
1114 mPrivate->SinglePathCount++;
1117 }
else if (ExistAttempt ==
NULL) {
1131 &AttemptConfigOrderSize
1134 TotalNumber = AttemptConfigOrderSize /
sizeof (UINT8);
1141 if (AttemptOrderTmp ==
NULL) {
1142 if (AttemptConfigOrder !=
NULL) {
1146 return EFI_OUT_OF_RESOURCES;
1149 if (AttemptConfigOrder !=
NULL) {
1150 CopyMem (AttemptOrderTmp, AttemptConfigOrder, AttemptConfigOrderSize);
1154 AttemptOrderTmp[TotalNumber - 1] = Attempt->AttemptConfigIndex;
1155 AttemptConfigOrder = AttemptOrderTmp;
1156 AttemptConfigOrderSize = TotalNumber *
sizeof (UINT8);
1158 Status =
gRT->SetVariable (
1162 AttemptConfigOrderSize,
1166 if (EFI_ERROR (Status)) {
1174 mPrivate->AttemptCount++;
1176 if (IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) {
1180 mPrivate->EnableMpio =
TRUE;
1181 mPrivate->MpioCount++;
1182 }
else if (IfrNvData->Enabled == ISCSI_ENABLED) {
1183 mPrivate->SinglePathCount++;
1189 Attempt->SessionConfigData.Enabled = IfrNvData->Enabled;
1194 UnicodeSPrint (mPrivate->PortString, (
UINTN)ISCSI_NAME_IFR_MAX_SIZE, L
"Attempt %d", Attempt->AttemptConfigIndex);
1198 return gRT->SetVariable (
1199 mPrivate->PortString,
1200 &gEfiIScsiInitiatorNameProtocolGuid,
1201 ISCSI_CONFIG_VAR_ATTR,
1226 UINT8 ChapSecretLen;
1227 UINT8 ReverseChapSecretLen;
1228 CHAR16 *AttemptName1;
1229 CHAR16 *AttemptName2;
1231 CHAR8 LunString[ISCSI_LUN_STR_MAX_LEN];
1232 CHAR8 IScsiName[ISCSI_NAME_MAX_SIZE];
1233 CHAR8 IpString[IP_STR_MAX_SIZE];
1242 ZeroMem (IScsiName,
sizeof (IScsiName));
1244 if (OffSet < ATTEMPT_BOOTENABLE_VAR_OFFSET) {
1246 }
else if ((OffSet >= ATTEMPT_BOOTENABLE_VAR_OFFSET) && (OffSet < ATTEMPT_ADDRESS_TYPE_VAR_OFFSET)) {
1247 AttemptIndex = (UINT8)((OffSet - ATTEMPT_BOOTENABLE_VAR_OFFSET) + 1);
1249 if (Attempt ==
NULL) {
1250 return EFI_INVALID_PARAMETER;
1253 IfrNvData->Enabled = IfrNvData->ISCSIBootEnableList[AttemptIndex - 1];
1257 if (IfrNvData->Enabled != ISCSI_DISABLED) {
1262 if (SameNicAttempt !=
NULL) {
1263 AttemptName1 = (CHAR16 *)
AllocateZeroPool (ATTEMPT_NAME_SIZE *
sizeof (CHAR16));
1264 if (AttemptName1 ==
NULL) {
1265 return EFI_OUT_OF_RESOURCES;
1268 AttemptName2 = (CHAR16 *)
AllocateZeroPool (ATTEMPT_NAME_SIZE *
sizeof (CHAR16));
1269 if (AttemptName2 ==
NULL) {
1271 return EFI_OUT_OF_RESOURCES;
1278 mPrivate->PortString,
1279 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
1280 L
"Warning! \"%s\" uses same NIC as Attempt \"%s\".",
1286 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1288 mPrivate->PortString,
1297 if ((IfrNvData->Enabled == ISCSI_DISABLED) &&
1298 (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED))
1303 if (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO) {
1304 if (mPrivate->MpioCount < 1) {
1308 if (--mPrivate->MpioCount == 0) {
1309 mPrivate->EnableMpio =
FALSE;
1311 }
else if (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED) {
1312 if (mPrivate->SinglePathCount < 1) {
1316 mPrivate->SinglePathCount--;
1318 }
else if ((IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) &&
1319 (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED))
1324 if (mPrivate->SinglePathCount < 1) {
1328 mPrivate->EnableMpio =
TRUE;
1329 mPrivate->MpioCount++;
1330 mPrivate->SinglePathCount--;
1331 }
else if ((IfrNvData->Enabled == ISCSI_ENABLED) &&
1332 (Attempt->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO))
1337 if (mPrivate->MpioCount < 1) {
1341 if (--mPrivate->MpioCount == 0) {
1342 mPrivate->EnableMpio =
FALSE;
1345 mPrivate->SinglePathCount++;
1346 }
else if ((IfrNvData->Enabled != ISCSI_DISABLED) &&
1347 (Attempt->SessionConfigData.Enabled == ISCSI_DISABLED))
1352 if (IfrNvData->Enabled == ISCSI_ENABLED_FOR_MPIO) {
1353 mPrivate->EnableMpio =
TRUE;
1354 mPrivate->MpioCount++;
1355 }
else if (IfrNvData->Enabled == ISCSI_ENABLED) {
1356 mPrivate->SinglePathCount++;
1360 Attempt->SessionConfigData.Enabled = IfrNvData->Enabled;
1361 }
else if ((OffSet >= ATTEMPT_ADDRESS_TYPE_VAR_OFFSET) && (OffSet < ATTEMPT_CONNECT_RETRY_VAR_OFFSET)) {
1362 AttemptIndex = (UINT8)((OffSet - ATTEMPT_ADDRESS_TYPE_VAR_OFFSET) + 1);
1364 if (Attempt ==
NULL) {
1365 return EFI_INVALID_PARAMETER;
1368 Attempt->SessionConfigData.IpMode = IfrNvData->ISCSIIpAddressTypeList[AttemptIndex - 1];
1369 if (Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) {
1370 Attempt->AutoConfigureMode = 0;
1372 }
else if ((OffSet >= ATTEMPT_CONNECT_RETRY_VAR_OFFSET) && (OffSet < ATTEMPT_CONNECT_TIMEOUT_VAR_OFFSET)) {
1373 AttemptIndex = (UINT8)((OffSet - ATTEMPT_CONNECT_RETRY_VAR_OFFSET) + 1);
1375 if (Attempt ==
NULL) {
1376 return EFI_INVALID_PARAMETER;
1379 if (IfrNvData->ISCSIConnectRetry[AttemptIndex - 1] > CONNECT_MAX_RETRY) {
1381 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1383 L
"The minimum value is 0 and the maximum is 16. 0 means no retry.",
1386 return EFI_INVALID_PARAMETER;
1389 Attempt->SessionConfigData.ConnectRetryCount = IfrNvData->ISCSIConnectRetry[AttemptIndex - 1];
1390 }
else if ((OffSet >= ATTEMPT_CONNECT_TIMEOUT_VAR_OFFSET) && (OffSet < ATTEMPT_INITIATOR_VIA_DHCP_VAR_OFFSET)) {
1391 AttemptIndex = (UINT8)((OffSet - ATTEMPT_CONNECT_TIMEOUT_VAR_OFFSET) / 2 + 1);
1393 if (Attempt ==
NULL) {
1394 return EFI_INVALID_PARAMETER;
1397 if ((IfrNvData->ISCSIConnectTimeout[AttemptIndex - 1] < CONNECT_MIN_TIMEOUT) ||
1398 (IfrNvData->ISCSIConnectTimeout[AttemptIndex - 1] > CONNECT_MAX_TIMEOUT))
1401 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1403 L
"The minimum value is 100 milliseconds and the maximum is 20 seconds.",
1406 return EFI_INVALID_PARAMETER;
1409 Attempt->SessionConfigData.
ConnectTimeout = IfrNvData->ISCSIConnectTimeout[AttemptIndex - 1];
1411 Attempt->SessionConfigData.
ConnectTimeout = CONNECT_DEFAULT_TIMEOUT;
1413 }
else if ((OffSet >= ATTEMPT_INITIATOR_VIA_DHCP_VAR_OFFSET) && (OffSet < ATTEMPT_TARGET_VIA_DHCP_VAR_OFFSET)) {
1414 AttemptIndex = (UINT8)((OffSet - ATTEMPT_INITIATOR_VIA_DHCP_VAR_OFFSET) + 1);
1416 if (Attempt ==
NULL) {
1417 return EFI_INVALID_PARAMETER;
1420 Attempt->SessionConfigData.InitiatorInfoFromDhcp = IfrNvData->ISCSIInitiatorInfoViaDHCP[AttemptIndex - 1];
1421 }
else if ((OffSet >= ATTEMPT_TARGET_VIA_DHCP_VAR_OFFSET) && (OffSet < ATTEMPT_TARGET_TCP_PORT_VAR_OFFSET)) {
1422 AttemptIndex = (UINT8)((OffSet - ATTEMPT_TARGET_VIA_DHCP_VAR_OFFSET) + 1);
1424 if (Attempt ==
NULL) {
1425 return EFI_INVALID_PARAMETER;
1428 if ((Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) && (Attempt->SessionConfigData.InitiatorInfoFromDhcp)) {
1429 Attempt->SessionConfigData.TargetInfoFromDhcp = IfrNvData->ISCSITargetInfoViaDHCP[AttemptIndex - 1];
1432 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1434 L
"Invalid Configuration, Check value of IpMode or Enable DHCP!",
1437 return EFI_INVALID_PARAMETER;
1439 }
else if ((OffSet >= ATTEMPT_TARGET_TCP_PORT_VAR_OFFSET) && (OffSet < ATTEMPT_AUTHENTICATION_METHOD_VAR_OFFSET)) {
1440 AttemptIndex = (UINT8)((OffSet - ATTEMPT_TARGET_TCP_PORT_VAR_OFFSET) / 2 + 1);
1442 if (Attempt ==
NULL) {
1443 return EFI_INVALID_PARAMETER;
1446 if ((Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) && (!Attempt->SessionConfigData.TargetInfoFromDhcp)) {
1447 Attempt->SessionConfigData.TargetPort = IfrNvData->ISCSITargetTcpPort[AttemptIndex - 1];
1448 if (Attempt->SessionConfigData.TargetPort == 0) {
1449 Attempt->SessionConfigData.TargetPort = ISCSI_WELL_KNOWN_PORT;
1453 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1455 L
"Invalid Configuration, Check value of IpMode or Target Via DHCP!",
1458 return EFI_INVALID_PARAMETER;
1460 }
else if ((OffSet >= ATTEMPT_AUTHENTICATION_METHOD_VAR_OFFSET) && (OffSet < ATTEMPT_CHARTYPE_VAR_OFFSET)) {
1461 AttemptIndex = (UINT8)((OffSet - ATTEMPT_AUTHENTICATION_METHOD_VAR_OFFSET) + 1);
1463 if (Attempt ==
NULL) {
1464 return EFI_INVALID_PARAMETER;
1467 Attempt->AuthenticationType = IfrNvData->ISCSIAuthenticationMethod[AttemptIndex - 1];
1468 }
else if ((OffSet >= ATTEMPT_CHARTYPE_VAR_OFFSET) && (OffSet < ATTEMPT_ISID_VAR_OFFSET)) {
1469 AttemptIndex = (UINT8)((OffSet - ATTEMPT_CHARTYPE_VAR_OFFSET) + 1);
1471 if (Attempt ==
NULL) {
1472 return EFI_INVALID_PARAMETER;
1475 if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
1476 Attempt->AuthConfigData.CHAP.CHAPType = IfrNvData->ISCSIChapType[AttemptIndex - 1];
1478 }
else if (OffSet >= ATTEMPT_ISID_VAR_OFFSET) {
1479 Index = (UINT8)((OffSet - ATTEMPT_ISID_VAR_OFFSET) /
sizeof (
KEYWORD_STR));
1480 AttemptIndex = Index + 1;
1482 if (Attempt ==
NULL) {
1483 return EFI_INVALID_PARAMETER;
1488 if ((OffSet >= ATTEMPT_ISID_VAR_OFFSET) && (OffSet < ATTEMPT_INITIATOR_IP_ADDRESS_VAR_OFFSET)) {
1490 }
else if ((OffSet >= ATTEMPT_INITIATOR_IP_ADDRESS_VAR_OFFSET) && (OffSet < ATTEMPT_INITIATOR_NET_MASK_VAR_OFFSET)) {
1491 if ((Attempt->SessionConfigData.IpMode == IP_MODE_IP4) && (!Attempt->SessionConfigData.InitiatorInfoFromDhcp)) {
1495 Status =
NetLibStrToIp4 (IfrNvData->Keyword[Index].ISCSIInitiatorIpAddress, &HostIp.v4);
1496 if (EFI_ERROR (Status) || ((Attempt->SessionConfigData.SubnetMask.Addr[0] != 0) &&
1497 !
NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), NTOHL (*(UINT32 *)Attempt->SessionConfigData.SubnetMask.Addr))))
1500 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1502 L
"Invalid IP address!",
1505 return EFI_INVALID_PARAMETER;
1507 CopyMem (&Attempt->SessionConfigData.LocalIp, &HostIp.v4, sizeof (HostIp.v4));
1511 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1513 L
"Invalid Configuration, Check value of IpMode or Enable DHCP!",
1516 return EFI_INVALID_PARAMETER;
1518 }
else if ((OffSet >= ATTEMPT_INITIATOR_NET_MASK_VAR_OFFSET) && (OffSet < ATTEMPT_INITIATOR_GATE_WAY_VAR_OFFSET)) {
1519 if ((Attempt->SessionConfigData.IpMode == IP_MODE_IP4) && (!Attempt->SessionConfigData.InitiatorInfoFromDhcp)) {
1520 Status =
NetLibStrToIp4 (IfrNvData->Keyword[Index].ISCSIInitiatorNetmask, &SubnetMask.v4);
1523 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1525 L
"Invalid Subnet Mask!",
1528 return EFI_INVALID_PARAMETER;
1530 CopyMem (&Attempt->SessionConfigData.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));
1534 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1536 L
"Invalid Configuration, Check value of IpMode or Enable DHCP!",
1539 return EFI_INVALID_PARAMETER;
1541 }
else if ((OffSet >= ATTEMPT_INITIATOR_GATE_WAY_VAR_OFFSET) && (OffSet < ATTEMPT_TARGET_NAME_VAR_OFFSET)) {
1542 if ((Attempt->SessionConfigData.IpMode == IP_MODE_IP4) && (!Attempt->SessionConfigData.InitiatorInfoFromDhcp)) {
1543 Status =
NetLibStrToIp4 (IfrNvData->Keyword[Index].ISCSIInitiatorGateway, &Gateway.v4);
1544 if (EFI_ERROR (Status) ||
1545 ((Gateway.Addr[0] != 0) && (Attempt->SessionConfigData.SubnetMask.Addr[0] != 0) &&
1546 !
NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), NTOHL (*(UINT32 *)Attempt->SessionConfigData.SubnetMask.Addr))))
1549 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1551 L
"Invalid Gateway!",
1554 return EFI_INVALID_PARAMETER;
1556 CopyMem (&Attempt->SessionConfigData.Gateway, &Gateway.v4, sizeof (Gateway.v4));
1560 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1562 L
"Invalid Configuration, Check value of IpMode or Enable DHCP!",
1565 return EFI_INVALID_PARAMETER;
1567 }
else if ((OffSet >= ATTEMPT_TARGET_NAME_VAR_OFFSET) && (OffSet < ATTEMPT_TARGET_IP_ADDRESS_VAR_OFFSET)) {
1568 if ((Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) && (!Attempt->SessionConfigData.TargetInfoFromDhcp)) {
1571 if (EFI_ERROR (Status)) {
1573 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1575 L
"Invalid iSCSI Name!",
1579 AsciiStrCpyS (Attempt->SessionConfigData.TargetName, ISCSI_NAME_MAX_SIZE, IScsiName);
1582 if (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED) {
1583 if (Attempt->SessionConfigData.TargetName[0] == L
'\0') {
1585 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1587 L
"iSCSI target name is NULL!",
1590 return EFI_INVALID_PARAMETER;
1595 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1597 L
"Invalid Configuration, Check value of IpMode or Target Via DHCP!",
1600 return EFI_INVALID_PARAMETER;
1602 }
else if ((OffSet >= ATTEMPT_TARGET_IP_ADDRESS_VAR_OFFSET) && (OffSet < ATTEMPT_LUN_VAR_OFFSET)) {
1603 if ((Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) && (!Attempt->SessionConfigData.TargetInfoFromDhcp)) {
1604 UnicodeStrToAsciiStrS (IfrNvData->Keyword[Index].ISCSITargetIpAddress, IpString, sizeof (IpString));
1605 Status =
IScsiAsciiStrToIp (IpString, Attempt->SessionConfigData.IpMode, &HostIp);
1606 if (EFI_ERROR (Status) || !
IpIsUnicast (&HostIp, Attempt->SessionConfigData.IpMode)) {
1607 Attempt->SessionConfigData.DnsMode =
TRUE;
1608 ZeroMem (&Attempt->SessionConfigData.TargetIp, sizeof (Attempt->SessionConfigData.TargetIp));
1609 UnicodeStrToAsciiStrS (IfrNvData->Keyword[Index].ISCSITargetIpAddress, Attempt->SessionConfigData.TargetUrl, ISCSI_NAME_MAX_SIZE);
1611 Attempt->SessionConfigData.DnsMode =
FALSE;
1612 CopyMem (&Attempt->SessionConfigData.TargetIp, &HostIp, sizeof (HostIp));
1616 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1618 L
"Invalid Configuration, Check value of IpMode or Target Via DHCP!",
1621 return EFI_INVALID_PARAMETER;
1623 }
else if ((OffSet >= ATTEMPT_LUN_VAR_OFFSET) && (OffSet < ATTEMPT_CHAR_USER_NAME_VAR_OFFSET)) {
1624 if ((Attempt->SessionConfigData.IpMode < IP_MODE_AUTOCONFIG) && (Attempt->SessionConfigData.TargetInfoFromDhcp == 0)) {
1630 if (EFI_ERROR (Status)) {
1632 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1634 L
"Invalid LUN string, Examples are: 4752-3A4F-6b7e-2F99, 6734-9-156f-127, 4186-9!",
1638 CopyMem (&Attempt->SessionConfigData.BootLun, &Lun, sizeof (Lun));
1642 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1644 L
"Invalid Configuration, Check value of IpMode or Target Via DHCP!",
1647 return EFI_INVALID_PARAMETER;
1649 }
else if ((OffSet >= ATTEMPT_CHAR_USER_NAME_VAR_OFFSET) && (OffSet < ATTEMPT_CHAR_SECRET_VAR_OFFSET)) {
1650 if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
1652 IfrNvData->Keyword[Index].ISCSIChapUsername,
1653 Attempt->AuthConfigData.CHAP.CHAPName,
1654 ISCSI_CHAP_NAME_STORAGE
1657 if (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED) {
1658 if (IfrNvData->Keyword[Index].ISCSIChapUsername[0] == L
'\0') {
1660 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1662 L
"CHAP Name is invalid!",
1665 return EFI_INVALID_PARAMETER;
1670 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1672 L
"Invalid Configuration, Check value of AuthenticationType!",
1675 return EFI_INVALID_PARAMETER;
1677 }
else if ((OffSet >= ATTEMPT_CHAR_SECRET_VAR_OFFSET) && (OffSet < ATTEMPT_CHAR_REVERSE_USER_NAME_VAR_OFFSET)) {
1678 if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
1679 ChapSecretLen = (UINT8)
StrLen (IfrNvData->Keyword[Index].ISCSIChapSecret);
1681 IfrNvData->Keyword[Index].ISCSIChapSecret,
1682 Attempt->AuthConfigData.CHAP.CHAPSecret,
1683 ISCSI_CHAP_SECRET_STORAGE
1686 if (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED) {
1687 if ((ChapSecretLen < ISCSI_CHAP_SECRET_MIN_LEN) || (ChapSecretLen > ISCSI_CHAP_SECRET_MAX_LEN)) {
1689 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1691 L
"The Chap Secret minimum length is 12 bytes and the maximum length is 16 bytes.",
1694 return EFI_INVALID_PARAMETER;
1699 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1701 L
"Invalid Configuration, Check value of AuthenticationType!",
1704 return EFI_INVALID_PARAMETER;
1706 }
else if ((OffSet >= ATTEMPT_CHAR_REVERSE_USER_NAME_VAR_OFFSET) && (OffSet < ATTEMPT_CHAR_REVERSE_SECRET_VAR_OFFSET)) {
1707 if (Attempt->AuthConfigData.CHAP.CHAPType == ISCSI_CHAP_MUTUAL) {
1709 IfrNvData->Keyword[Index].ISCSIReverseChapUsername,
1710 Attempt->AuthConfigData.CHAP.ReverseCHAPName,
1711 ISCSI_CHAP_NAME_STORAGE
1713 if (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED) {
1714 if (IfrNvData->Keyword[Index].ISCSIReverseChapUsername[0] == L
'\0') {
1716 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1718 L
"Reverse CHAP Name is invalid!",
1721 return EFI_INVALID_PARAMETER;
1726 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1728 L
"Invalid Configuration, Check value of AuthenticationType or Chap Type!",
1731 return EFI_INVALID_PARAMETER;
1733 }
else if (OffSet >= ATTEMPT_CHAR_REVERSE_SECRET_VAR_OFFSET) {
1734 if (Attempt->AuthConfigData.CHAP.CHAPType == ISCSI_CHAP_MUTUAL) {
1735 ReverseChapSecretLen = (UINT8)
StrLen (IfrNvData->Keyword[Index].ISCSIReverseChapSecret);
1737 IfrNvData->Keyword[Index].ISCSIReverseChapSecret,
1738 Attempt->AuthConfigData.CHAP.ReverseCHAPSecret,
1739 ISCSI_CHAP_SECRET_STORAGE
1742 if (Attempt->SessionConfigData.Enabled != ISCSI_DISABLED) {
1743 if ((ReverseChapSecretLen < ISCSI_CHAP_SECRET_MIN_LEN) || (ReverseChapSecretLen > ISCSI_CHAP_SECRET_MAX_LEN)) {
1745 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1747 L
"The Reverse CHAP Secret minimum length is 12 bytes and the maximum length is 16 bytes.",
1750 return EFI_INVALID_PARAMETER;
1755 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
1757 L
"Invalid Configuration, Check value of AuthenticationType or Chap Type!",
1760 return EFI_INVALID_PARAMETER;
1768 ASSERT (Attempt !=
NULL);
1769 UnicodeSPrint (mPrivate->PortString, (
UINTN)ISCSI_NAME_IFR_MAX_SIZE, L
"Attempt %d", Attempt->AttemptConfigIndex);
1770 return gRT->SetVariable (
1771 mPrivate->PortString,
1772 &gEfiIScsiInitiatorNameProtocolGuid,
1773 ISCSI_CONFIG_VAR_ATTR,
1797 IN UINT16 StartLabelNumber,
1798 OUT VOID **StartOpCodeHandle,
1800 OUT VOID **EndOpCodeHandle,
1808 if ((StartOpCodeHandle ==
NULL) || (StartLabel ==
NULL) || (EndOpCodeHandle ==
NULL) || (EndLabel ==
NULL)) {
1809 return EFI_INVALID_PARAMETER;
1812 *StartOpCodeHandle =
NULL;
1813 *EndOpCodeHandle =
NULL;
1814 Status = EFI_OUT_OF_RESOURCES;
1820 if (*StartOpCodeHandle ==
NULL) {
1825 if (*EndOpCodeHandle ==
NULL) {
1838 if (InternalStartLabel ==
NULL) {
1843 InternalStartLabel->
Number = StartLabelNumber;
1854 if (InternalEndLabel ==
NULL) {
1859 InternalEndLabel->
Number = LABEL_END;
1861 *StartLabel = InternalStartLabel;
1862 *EndLabel = InternalEndLabel;
1868 if (*StartOpCodeHandle !=
NULL) {
1872 if (*EndOpCodeHandle !=
NULL) {
1890 VOID *StartOpCodeHandle;
1892 VOID *EndOpCodeHandle;
1897 ATTEMPT_ENTRY_LABEL,
1903 if (EFI_ERROR (Status)) {
1907 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
1909 if (AttemptConfigData->Actived == ISCSI_ACTIVE_ENABLED) {
1913 UnicodeSPrint (mPrivate->PortString, (
UINTN)ISCSI_NAME_IFR_MAX_SIZE, L
"Attempt %d", (
UINTN)AttemptConfigData->AttemptConfigIndex);
1915 mCallbackInfo->RegisteredHandle,
1917 mPrivate->PortString,
1920 if (AttemptConfigData->AttemptTitleToken == 0) {
1926 FORMID_ATTEMPT_FORM,
1927 AttemptConfigData->AttemptTitleToken,
1928 AttemptConfigData->AttemptTitleHelpToken,
1929 EFI_IFR_FLAG_CALLBACK,
1930 (UINT16)(KEY_ATTEMPT_ENTRY_BASE + AttemptConfigData->AttemptConfigIndex)
1936 mCallbackInfo->RegisteredHandle,
1962 EFI_STRING_ID PortTitleToken;
1963 EFI_STRING_ID PortTitleHelpToken;
1964 CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
1966 VOID *StartOpCodeHandle;
1968 VOID *EndOpCodeHandle;
1978 if (EFI_ERROR (Status)) {
1985 NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
1988 &NicInfo->PermanentAddress,
1989 NicInfo->HwAddressSize,
1994 UnicodeSPrint (mPrivate->PortString, (
UINTN)ISCSI_NAME_IFR_MAX_SIZE, L
"MAC %s", MacString);
1996 mCallbackInfo->RegisteredHandle,
1998 mPrivate->PortString,
2001 if (PortTitleToken == 0) {
2002 Status = EFI_INVALID_PARAMETER;
2007 mPrivate->PortString,
2008 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2009 L
"PFA: Bus %d | Dev %d | Func %d",
2011 NicInfo->DeviceNumber,
2012 NicInfo->FunctionNumber
2014 PortTitleHelpToken =
HiiSetString (mCallbackInfo->RegisteredHandle, 0, mPrivate->PortString,
NULL);
2015 if (PortTitleHelpToken == 0) {
2016 Status = EFI_INVALID_PARAMETER;
2022 FORMID_ATTEMPT_FORM,
2025 EFI_IFR_FLAG_CALLBACK,
2026 (UINT16)(KEY_MAC_ENTRY_BASE + NicInfo->NicIndex)
2031 mCallbackInfo->RegisteredHandle,
2061 IN UINT8 *AttemptList
2068 UINT8 *AttemptConfigOrder;
2069 UINTN AttemptConfigOrderSize;
2070 UINT8 *AttemptConfigOrderTmp;
2073 CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
2074 CHAR16 IScsiMode[64];
2078 Nic = mPrivate->CurrentNic;
2080 if (NicInfo ==
NULL) {
2081 return EFI_NOT_FOUND;
2088 &NicInfo->PermanentAddress,
2089 NicInfo->HwAddressSize,
2094 for (Index = 0; Index <
PcdGet8 (PcdMaxIScsiAttemptNumber); Index++) {
2095 if (AttemptList[Index] == 0) {
2102 Number = AttemptList[Index];
2105 mPrivate->PortString,
2106 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2112 mPrivate->PortString,
2113 &gEfiIScsiInitiatorNameProtocolGuid,
2114 (VOID **)&AttemptConfigData,
2117 if ((AttemptConfigData ==
NULL) || (AttemptConfigData->Actived == ISCSI_ACTIVE_ENABLED)) {
2118 return EFI_INVALID_PARAMETER;
2121 AttemptConfigData->Actived = ISCSI_ACTIVE_ENABLED;
2122 AttemptConfigData->NicIndex = NicInfo->NicIndex;
2128 CopyMem (AttemptConfigData->SessionConfigData.IsId, &NicInfo->PermanentAddress, 6);
2129 AttemptConfigData->SessionConfigData.IsId[0] =
2130 (UINT8)(AttemptConfigData->SessionConfigData.IsId[0] & 0x3F);
2139 mPrivate->PortString,
2140 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2141 L
"MAC: %s, PFA: Bus %d | Dev %d | Func %d, iSCSI mode: %s, IP version: %s",
2144 NicInfo->DeviceNumber,
2145 NicInfo->FunctionNumber,
2150 AttemptConfigData->AttemptTitleHelpToken =
HiiSetString (
2151 mCallbackInfo->RegisteredHandle,
2153 mPrivate->PortString,
2156 if (AttemptConfigData->AttemptTitleHelpToken == 0) {
2157 return EFI_OUT_OF_RESOURCES;
2166 &AttemptConfigOrderSize
2168 TotalNumber = AttemptConfigOrderSize /
sizeof (UINT8);
2175 if (AttemptConfigOrderTmp ==
NULL) {
2176 if (AttemptConfigOrder !=
NULL) {
2180 return EFI_OUT_OF_RESOURCES;
2183 if (AttemptConfigOrder !=
NULL) {
2184 CopyMem (AttemptConfigOrderTmp, AttemptConfigOrder, AttemptConfigOrderSize);
2188 AttemptConfigOrderTmp[TotalNumber - 1] = Number;
2189 AttemptConfigOrder = AttemptConfigOrderTmp;
2190 AttemptConfigOrderSize = TotalNumber *
sizeof (UINT8);
2192 Status =
gRT->SetVariable (
2196 AttemptConfigOrderSize,
2200 if (EFI_ERROR (Status)) {
2207 InsertTailList (&mPrivate->AttemptConfigs, &AttemptConfigData->Link);
2208 mPrivate->AttemptCount++;
2209 UnicodeSPrint (mPrivate->PortString, (
UINTN)ISCSI_NAME_IFR_MAX_SIZE, L
"Attempt %d", AttemptConfigData->AttemptConfigIndex);
2211 mPrivate->PortString,
2212 &gEfiIScsiInitiatorNameProtocolGuid,
2213 ISCSI_CONFIG_VAR_ATTR,
2244 UINT8 *AttemptConfigOrder;
2245 UINTN AttemptConfigOrderSize;
2246 UINT8 *AttemptNewOrder;
2247 UINT8 AttemptConfigIndex;
2260 &AttemptConfigOrderSize
2262 if ((AttemptConfigOrder ==
NULL) || (AttemptConfigOrderSize == 0)) {
2263 return EFI_NOT_FOUND;
2267 if (AttemptNewOrder ==
NULL) {
2268 Status = EFI_OUT_OF_RESOURCES;
2272 Total = AttemptConfigOrderSize /
sizeof (UINT8);
2275 NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &mPrivate->AttemptConfigs) {
2276 if (IfrNvData->DeleteAttemptList[Index] == 0) {
2291 mPrivate->AttemptCount--;
2293 if (AttemptConfigData->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO) {
2294 if (mPrivate->MpioCount < 1) {
2295 Status = EFI_ABORTED;
2302 if (--mPrivate->MpioCount == 0) {
2303 mPrivate->EnableMpio =
FALSE;
2305 }
else if (AttemptConfigData->SessionConfigData.Enabled == ISCSI_ENABLED) {
2306 if (mPrivate->SinglePathCount < 1) {
2307 Status = EFI_ABORTED;
2311 mPrivate->SinglePathCount--;
2314 AttemptConfigIndex = AttemptConfigData->AttemptConfigIndex;
2321 if (AttemptConfigData ==
NULL) {
2322 return EFI_OUT_OF_RESOURCES;
2325 ConfigData = &AttemptConfigData->SessionConfigData;
2326 ConfigData->TargetPort = ISCSI_WELL_KNOWN_PORT;
2328 ConfigData->ConnectRetryCount = CONNECT_MIN_RETRY;
2330 AttemptConfigData->AuthenticationType = ISCSI_AUTH_TYPE_CHAP;
2331 AttemptConfigData->AuthConfigData.CHAP.CHAPType = ISCSI_CHAP_UNI;
2335 AttemptConfigData->AttemptConfigIndex = AttemptConfigIndex;
2341 mPrivate->PortString,
2342 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2344 (
UINTN)AttemptConfigData->AttemptConfigIndex
2348 mPrivate->PortString,
2349 &gEfiIScsiInitiatorNameProtocolGuid,
2350 ISCSI_CONFIG_VAR_ATTR,
2358 for (NewIndex = 0; NewIndex < Total; NewIndex++) {
2359 if (AttemptConfigOrder[NewIndex] == AttemptConfigData->AttemptConfigIndex) {
2360 AttemptConfigOrder[NewIndex] = 0;
2366 if (mCallbackInfo->Current == AttemptConfigData) {
2367 mCallbackInfo->Current =
NULL;
2381 for (Index = 0, NewIndex = 0; Index < Total; Index++) {
2382 if (AttemptConfigOrder[Index] != 0) {
2383 AttemptNewOrder[NewIndex] = AttemptConfigOrder[Index];
2393 Status =
gRT->SetVariable (
2397 NewTotal *
sizeof (UINT8),
2402 if (AttemptConfigOrder !=
NULL) {
2406 if (AttemptNewOrder !=
NULL) {
2428 UINT8 *AttemptConfigOrder;
2429 UINTN AttemptConfigOrderSize;
2433 VOID *StartOpCodeHandle;
2435 VOID *EndOpCodeHandle;
2446 if (EFI_ERROR (Status)) {
2453 &AttemptConfigOrderSize
2455 if (AttemptConfigOrder !=
NULL) {
2461 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
2463 IfrNvData->DeleteAttemptList[Index] = 0x00;
2467 (EFI_QUESTION_ID)(ATTEMPT_DEL_QUESTION_ID + Index),
2468 CONFIGURATION_VARSTORE_ID,
2469 (UINT16)(ATTEMPT_DEL_VAR_OFFSET + Index),
2470 AttemptConfigData->AttemptTitleToken,
2471 AttemptConfigData->AttemptTitleHelpToken,
2479 if (Index == ISCSI_MAX_ATTEMPTS_NUM) {
2488 mCallbackInfo->RegisteredHandle,
2519 VOID *StartOpCodeHandle;
2521 VOID *EndOpCodeHandle;
2523 VOID *OptionsOpCodeHandle;
2532 if (EFI_ERROR (Status)) {
2536 ASSERT (StartOpCodeHandle !=
NULL);
2538 OptionsOpCodeHandle =
NULL;
2543 if (mPrivate->AttemptCount == 0) {
2551 if (OptionsOpCodeHandle ==
NULL) {
2552 Status = EFI_OUT_OF_RESOURCES;
2558 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) {
2561 OptionsOpCodeHandle,
2562 AttemptConfigData->AttemptTitleToken,
2564 EFI_IFR_NUMERIC_SIZE_1,
2565 AttemptConfigData->AttemptConfigIndex
2570 ASSERT (Index == mPrivate->AttemptCount);
2574 DYNAMIC_ORDERED_LIST_QUESTION_ID,
2575 CONFIGURATION_VARSTORE_ID,
2576 DYNAMIC_ORDERED_LIST_VAR_OFFSET,
2581 EFI_IFR_NUMERIC_SIZE_1,
2582 ISCSI_MAX_ATTEMPTS_NUM,
2583 OptionsOpCodeHandle,
2589 mCallbackInfo->RegisteredHandle,
2599 if (OptionsOpCodeHandle !=
NULL) {
2625 UINT8 AttemptConfigIndex;
2627 UINT8 *AttemptConfigOrder;
2628 UINT8 *AttemptConfigOrderTmp;
2629 UINTN AttemptConfigOrderSize;
2634 &AttemptConfigOrderSize
2636 if (AttemptConfigOrder ==
NULL) {
2637 return EFI_NOT_FOUND;
2641 if (AttemptConfigOrderTmp ==
NULL) {
2642 Status = EFI_OUT_OF_RESOURCES;
2646 for (Index = 0; Index < ISCSI_MAX_ATTEMPTS_NUM; Index++) {
2650 if (IfrNvData->DynamicOrderedList[Index] == 0) {
2654 AttemptConfigIndex = IfrNvData->DynamicOrderedList[Index];
2656 if (AttemptConfigData ==
NULL) {
2657 Status = EFI_NOT_FOUND;
2665 InsertTailList (&mPrivate->AttemptConfigs, &AttemptConfigData->Link);
2667 AttemptConfigOrderTmp[Index] = AttemptConfigIndex;
2672 for (Indexj = 0; Indexj < AttemptConfigOrderSize /
sizeof (UINT8); Indexj++) {
2673 if (AttemptConfigOrder[Indexj] == AttemptConfigIndex) {
2674 AttemptConfigOrder[Indexj] = 0;
2683 for ( ; Index < AttemptConfigOrderSize /
sizeof (UINT8); Index++) {
2684 for (Indexj = 0; Indexj < AttemptConfigOrderSize /
sizeof (UINT8); Indexj++) {
2685 if (AttemptConfigOrder[Indexj] != 0) {
2686 AttemptConfigOrderTmp[Index] = AttemptConfigOrder[Indexj];
2687 AttemptConfigOrder[Indexj] = 0;
2693 Status =
gRT->SetVariable (
2697 AttemptConfigOrderSize,
2698 AttemptConfigOrderTmp
2702 if (AttemptConfigOrderTmp !=
NULL) {
2728 IN EFI_QUESTION_ID KeyValue,
2734 UINT8 CurrentAttemptConfigIndex;
2737 CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
2738 UINT8 *AttemptConfigOrder;
2739 UINTN AttemptConfigOrderSize;
2743 AttemptConfigData =
NULL;
2749 if ((KeyValue >= KEY_MAC_ENTRY_BASE) &&
2750 (KeyValue <= (UINT16)(mPrivate->MaxNic + KEY_MAC_ENTRY_BASE)))
2756 }
else if ((KeyValue >= KEY_ATTEMPT_ENTRY_BASE) &&
2757 (KeyValue < (ISCSI_MAX_ATTEMPTS_NUM + KEY_ATTEMPT_ENTRY_BASE)))
2774 NicIndex = (UINT8)(KeyValue - KEY_MAC_ENTRY_BASE);
2776 if (NicInfo ==
NULL) {
2777 return EFI_NOT_FOUND;
2784 L
"InitialAttemptOrder",
2786 &AttemptConfigOrderSize
2789 if (AttemptConfigOrder ==
NULL) {
2790 return EFI_NOT_FOUND;
2793 for (Index = 0; Index < AttemptConfigOrderSize /
sizeof (UINT8); Index++) {
2795 mPrivate->PortString,
2796 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2798 (
UINTN)AttemptConfigOrder[Index]
2801 mPrivate->PortString,
2802 &gEfiIScsiInitiatorNameProtocolGuid,
2803 (VOID **)&AttemptConfigData,
2806 if ((AttemptConfigData ==
NULL) || (AttemptConfigData->Actived == ISCSI_ACTIVE_ENABLED)) {
2813 if (Index >
PcdGet8 (PcdMaxIScsiAttemptNumber)) {
2815 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
2817 L
"Can not create more attempts, Please configure the PcdMaxIScsiAttemptNumber if needed!",
2820 return EFI_UNSUPPORTED;
2823 if (AttemptConfigOrder !=
NULL) {
2831 &NicInfo->PermanentAddress,
2832 NicInfo->HwAddressSize,
2837 ASSERT (AttemptConfigData !=
NULL);
2838 UnicodeStrToAsciiStrS (MacString, AttemptConfigData->MacString, sizeof (AttemptConfigData->MacString));
2839 AttemptConfigData->NicIndex = NicIndex;
2840 AttemptConfigData->Actived = ISCSI_ACTIVE_ENABLED;
2845 CopyMem (AttemptConfigData->SessionConfigData.IsId, &NicInfo->PermanentAddress, 6);
2846 AttemptConfigData->SessionConfigData.IsId[0] =
2847 (UINT8)(AttemptConfigData->SessionConfigData.IsId[0] & 0x3F);
2853 mPrivate->PortString,
2854 (
UINTN)ISCSI_NAME_IFR_MAX_SIZE,
2855 L
"MAC: %s, PFA: Bus %d | Dev %d | Func %d",
2858 NicInfo->DeviceNumber,
2859 NicInfo->FunctionNumber
2862 AttemptConfigData->AttemptTitleHelpToken =
HiiSetString (
2863 mCallbackInfo->RegisteredHandle,
2865 mPrivate->PortString,
2868 if (AttemptConfigData->AttemptTitleHelpToken == 0) {
2870 return EFI_OUT_OF_RESOURCES;
2877 CurrentAttemptConfigIndex = (UINT8)(KeyValue - KEY_ATTEMPT_ENTRY_BASE);
2880 if (AttemptConfigData ==
NULL) {
2881 DEBUG ((DEBUG_ERROR,
"Corresponding configuration data can not be retrieved!\n"));
2882 return EFI_NOT_FOUND;
2889 if (IfrNvData->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
2890 ZeroMem (IfrNvData->CHAPName, sizeof (IfrNvData->CHAPName));
2891 ZeroMem (IfrNvData->CHAPSecret, sizeof (IfrNvData->CHAPSecret));
2892 ZeroMem (IfrNvData->ReverseCHAPName, sizeof (IfrNvData->ReverseCHAPName));
2893 ZeroMem (IfrNvData->ReverseCHAPSecret, sizeof (IfrNvData->ReverseCHAPSecret));
2901 mCallbackInfo->Current = AttemptConfigData;
2982 OUT EFI_STRING *Progress,
2983 OUT EFI_STRING *Results
2987 CHAR8 *InitiatorName;
2991 EFI_STRING ConfigRequestHdr;
2992 EFI_STRING ConfigRequest;
2993 BOOLEAN AllocatedRequest;
2996 if ((This ==
NULL) || (Progress ==
NULL) || (Results ==
NULL)) {
2997 return EFI_INVALID_PARAMETER;
3000 *Progress = Request;
3002 return EFI_NOT_FOUND;
3005 ConfigRequestHdr =
NULL;
3006 ConfigRequest =
NULL;
3007 AllocatedRequest =
FALSE;
3010 Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
3012 if (IfrNvData ==
NULL) {
3013 return EFI_OUT_OF_RESOURCES;
3016 if (Private->Current !=
NULL) {
3025 BufferSize = ISCSI_NAME_MAX_SIZE;
3027 if (InitiatorName ==
NULL) {
3029 return EFI_OUT_OF_RESOURCES;
3032 Status = gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSize, InitiatorName);
3033 if (EFI_ERROR (Status)) {
3034 IfrNvData->InitiatorName[0] = L
'\0';
3038 IfrNvData->InitiatorName,
3039 sizeof (IfrNvData->InitiatorName) / sizeof (IfrNvData->InitiatorName[0])
3047 ConfigRequest = Request;
3048 if ((Request ==
NULL) || (
StrStr (Request, L
"OFFSET") ==
NULL)) {
3054 ConfigRequestHdr =
HiiConstructConfigHdr (&gIScsiConfigGuid, mVendorStorageName, Private->DriverHandle);
3055 Size = (
StrLen (ConfigRequestHdr) + 32 + 1) *
sizeof (CHAR16);
3057 if (ConfigRequest ==
NULL) {
3060 return EFI_OUT_OF_RESOURCES;
3063 AllocatedRequest =
TRUE;
3064 UnicodeSPrint (ConfigRequest, Size, L
"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
3082 if (AllocatedRequest) {
3084 ConfigRequest =
NULL;
3090 if (Request ==
NULL) {
3092 }
else if (
StrStr (Request, L
"OFFSET") ==
NULL) {
3093 *Progress = Request +
StrLen (Request);
3143 IN CONST EFI_STRING Configuration,
3144 OUT EFI_STRING *Progress
3154 CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
3155 CHAR8 *InitiatorName;
3168 if ((This ==
NULL) || (Configuration ==
NULL) || (Progress ==
NULL)) {
3169 return EFI_INVALID_PARAMETER;
3177 *Progress = Configuration;
3178 return EFI_NOT_FOUND;
3182 if (IfrNvData ==
NULL) {
3183 return EFI_OUT_OF_RESOURCES;
3186 BufferSize = ISCSI_NAME_MAX_SIZE;
3188 if (InitiatorName ==
NULL) {
3189 Status = EFI_OUT_OF_RESOURCES;
3204 if (EFI_ERROR (Status)) {
3208 if (IfrNvData->InitiatorName[0] != L
'\0') {
3212 Status = gIScsiInitiatorName.Set (&gIScsiInitiatorName, &BufferSize, InitiatorName);
3213 if (EFI_ERROR (Status)) {
3215 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3217 L
"Invalid iSCSI Name!",
3223 Status =
IScsiGetValue (Configuration, L
"&OFFSET=", &OffSet);
3224 if (EFI_ERROR (Status)) {
3228 if (OffSet >= ATTEMPT_MAC_ADDR_VAR_OFFSET) {
3229 Status = gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSize, InitiatorName);
3230 if (EFI_ERROR (Status)) {
3232 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3234 L
"Error: please configure iSCSI initiator name first!",
3243 if (IfrNvData->ISCSIAddAttemptList[0] != L
'\0') {
3245 if (EFI_ERROR (Status)) {
3247 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3249 L
"Error: The add attempt list is invalid",
3256 if (EFI_ERROR (Status)) {
3259 }
else if (IfrNvData->ISCSIDeleteAttemptList[0] != L
'\0') {
3260 AttemptList = (UINT8 *)
AllocateZeroPool ((ISCSI_MAX_ATTEMPTS_NUM + 1) *
sizeof (UINT8));
3261 if (AttemptList ==
NULL) {
3262 Status = EFI_OUT_OF_RESOURCES;
3267 if (EFI_ERROR (Status)) {
3269 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3271 L
"Error: The delete attempt list is invalid",
3280 NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &mPrivate->AttemptConfigs) {
3282 while (AttemptList[Index] != 0) {
3283 if (AttemptConfigData->AttemptConfigIndex == AttemptList[Index]) {
3284 IfrNvData->DeleteAttemptList[Index2] = 1;
3296 if (EFI_ERROR (Status)) {
3301 }
else if (IfrNvData->ISCSIAttemptOrder[0] != L
'\0') {
3303 if (EFI_ERROR (Status)) {
3305 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3307 L
"Error: The new attempt order list is invalid",
3314 if (EFI_ERROR (Status)) {
3317 }
else if (IfrNvData->ISCSIMacAddr[0] != L
'\0') {
3318 NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
3321 &NicInfo->PermanentAddress,
3322 NicInfo->HwAddressSize,
3326 if (!
StrCmp (MacString, IfrNvData->ISCSIMacAddr)) {
3327 mPrivate->CurrentNic = NicInfo->NicIndex;
3332 if ((NicInfo ==
NULL) || (NicInfo->NicIndex == 0)) {
3333 Status = EFI_NOT_FOUND;
3338 if (EFI_ERROR (Status)) {
3347 if (InitiatorName !=
NULL) {
3351 if (IfrNvData !=
NULL) {
3387 IN EFI_BROWSER_ACTION Action,
3388 IN EFI_QUESTION_ID QuestionId,
3391 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
3397 CHAR8 IpString[ISCSI_NAME_MAX_SIZE];
3398 CHAR8 LunString[ISCSI_LUN_STR_MAX_LEN];
3411 if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {
3418 if ((Action != EFI_BROWSER_ACTION_CHANGING) && (Action != EFI_BROWSER_ACTION_CHANGED)) {
3422 return EFI_UNSUPPORTED;
3425 if ((Value ==
NULL) || (ActionRequest ==
NULL)) {
3426 return EFI_INVALID_PARAMETER;
3429 Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
3437 if (IfrNvData ==
NULL) {
3438 return EFI_OUT_OF_RESOURCES;
3442 if (IScsiName ==
NULL) {
3444 return EFI_OUT_OF_RESOURCES;
3449 ZeroMem (&OldIfrNvData, BufferSize);
3453 CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
3455 if (Action == EFI_BROWSER_ACTION_CHANGING) {
3456 switch (QuestionId) {
3457 case KEY_ADD_ATTEMPT:
3461 mPrivate->InitiatorNameLength = ISCSI_NAME_MAX_SIZE;
3462 Status = gIScsiInitiatorName.Get (
3463 &gIScsiInitiatorName,
3464 &mPrivate->InitiatorNameLength,
3465 mPrivate->InitiatorName
3467 if (EFI_ERROR (Status)) {
3469 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3471 L
"Error: please configure iSCSI initiator name first!",
3480 case KEY_DELETE_ATTEMPT:
3482 OldIfrNvData.DeleteAttemptList,
3483 IfrNvData->DeleteAttemptList,
3484 sizeof (IfrNvData->DeleteAttemptList)
3489 case KEY_ORDER_ATTEMPT_CONFIG:
3494 OldIfrNvData.DynamicOrderedList,
3495 IfrNvData->DynamicOrderedList,
3496 sizeof (IfrNvData->DynamicOrderedList)
3505 }
else if (Action == EFI_BROWSER_ACTION_CHANGED) {
3506 switch (QuestionId) {
3507 case KEY_INITIATOR_NAME:
3511 Status = gIScsiInitiatorName.Set (&gIScsiInitiatorName, &BufferSize, IScsiName);
3512 if (EFI_ERROR (Status)) {
3514 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3516 L
"Invalid iSCSI Name!",
3521 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
3524 case KEY_SAVE_ATTEMPT_CONFIG:
3526 if (EFI_ERROR (Status)) {
3530 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
3533 case KEY_SAVE_ORDER_CHANGES:
3538 if (EFI_ERROR (Status)) {
3543 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
3546 case KEY_IGNORE_ORDER_CHANGES:
3548 IfrNvData->DynamicOrderedList,
3549 OldIfrNvData.DynamicOrderedList,
3550 sizeof (IfrNvData->DynamicOrderedList)
3552 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
3555 case KEY_SAVE_DELETE_ATTEMPT:
3560 if (EFI_ERROR (Status)) {
3565 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
3568 case KEY_IGNORE_DELETE_ATTEMPT:
3570 IfrNvData->DeleteAttemptList,
3571 OldIfrNvData.DeleteAttemptList,
3572 sizeof (IfrNvData->DeleteAttemptList)
3574 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
3578 switch (Value->u8) {
3581 if (NicInfo ==
NULL) {
3585 if (!NicInfo->Ipv6Available) {
3589 IfrNvData->IpMode = IP_MODE_IP4;
3592 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3594 L
"Current NIC doesn't Support IPv6!",
3600 ZeroMem (IfrNvData->LocalIp, sizeof (IfrNvData->LocalIp));
3601 ZeroMem (IfrNvData->SubnetMask, sizeof (IfrNvData->SubnetMask));
3602 ZeroMem (IfrNvData->Gateway, sizeof (IfrNvData->Gateway));
3603 ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp));
3604 Private->Current->AutoConfigureMode = 0;
3617 if (EFI_ERROR (Status) ||
3618 ((Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
3619 !
NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), NTOHL (*(UINT32 *)Private->Current->SessionConfigData.SubnetMask.Addr))))
3622 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3624 L
"Invalid IP address!",
3628 Status = EFI_INVALID_PARAMETER;
3630 CopyMem (&Private->Current->SessionConfigData.LocalIp, &HostIp.v4, sizeof (HostIp.v4));
3635 case KEY_SUBNET_MASK:
3639 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3641 L
"Invalid Subnet Mask!",
3645 Status = EFI_INVALID_PARAMETER;
3647 CopyMem (&Private->Current->SessionConfigData.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));
3654 if (EFI_ERROR (Status) ||
3655 ((Gateway.Addr[0] != 0) &&
3656 (Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
3657 !
NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), NTOHL (*(UINT32 *)Private->Current->SessionConfigData.SubnetMask.Addr))))
3660 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3662 L
"Invalid Gateway!",
3665 Status = EFI_INVALID_PARAMETER;
3667 CopyMem (&Private->Current->SessionConfigData.Gateway, &Gateway.v4, sizeof (Gateway.v4));
3675 if (EFI_ERROR (Status) || !
IpIsUnicast (&HostIp, IfrNvData->IpMode)) {
3679 Private->Current->SessionConfigData.DnsMode =
TRUE;
3680 ZeroMem (&Private->Current->SessionConfigData.TargetIp, sizeof (Private->Current->SessionConfigData.TargetIp));
3681 UnicodeStrToAsciiStrS (IfrNvData->TargetIp, Private->Current->SessionConfigData.TargetUrl, ISCSI_NAME_MAX_SIZE);
3683 Private->Current->SessionConfigData.DnsMode =
FALSE;
3684 CopyMem (&Private->Current->SessionConfigData.TargetIp, &HostIp, sizeof (HostIp));
3689 case KEY_TARGET_NAME:
3692 if (EFI_ERROR (Status)) {
3694 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3696 L
"Invalid iSCSI Name!",
3700 AsciiStrCpyS (Private->Current->SessionConfigData.TargetName, ISCSI_NAME_MAX_SIZE, IScsiName);
3705 case KEY_DHCP_ENABLE:
3706 if (IfrNvData->InitiatorInfoFromDhcp == 0) {
3707 IfrNvData->TargetInfoFromDhcp = 0;
3715 if (EFI_ERROR (Status)) {
3717 EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
3719 L
"Invalid LUN string!",
3723 CopyMem (Private->Current->SessionConfigData.BootLun, &Lun, sizeof (Lun));
3729 switch (Value->u8) {
3730 case ISCSI_AUTH_TYPE_CHAP:
3731 IfrNvData->CHAPType = ISCSI_CHAP_UNI;
3741 IfrNvData->CHAPName,
3742 Private->Current->AuthConfigData.CHAP.CHAPName,
3743 sizeof (Private->Current->AuthConfigData.CHAP.CHAPName)
3747 case KEY_CHAP_SECRET:
3749 IfrNvData->CHAPSecret,
3750 Private->Current->AuthConfigData.CHAP.CHAPSecret,
3751 sizeof (Private->Current->AuthConfigData.CHAP.CHAPSecret)
3755 case KEY_REVERSE_CHAP_NAME:
3757 IfrNvData->ReverseCHAPName,
3758 Private->Current->AuthConfigData.CHAP.ReverseCHAPName,
3759 sizeof (Private->Current->AuthConfigData.CHAP.ReverseCHAPName)
3763 case KEY_REVERSE_CHAP_SECRET:
3765 IfrNvData->ReverseCHAPSecret,
3766 Private->Current->AuthConfigData.CHAP.ReverseCHAPSecret,
3767 sizeof (Private->Current->AuthConfigData.CHAP.ReverseCHAPSecret)
3771 case KEY_CONFIG_ISID:
3782 if (!EFI_ERROR (Status)) {
3814 if (CallbackInfo ==
NULL) {
3815 return EFI_OUT_OF_RESOURCES;
3818 CallbackInfo->Signature = ISCSI_FORM_CALLBACK_INFO_SIGNATURE;
3819 CallbackInfo->Current =
NULL;
3828 Status =
gBS->InstallMultipleProtocolInterfaces (
3829 &CallbackInfo->DriverHandle,
3830 &gEfiDevicePathProtocolGuid,
3831 &mIScsiHiiVendorDevicePath,
3832 &gEfiHiiConfigAccessProtocolGuid,
3833 &CallbackInfo->ConfigAccess,
3843 CallbackInfo->DriverHandle,
3848 if (CallbackInfo->RegisteredHandle ==
NULL) {
3849 gBS->UninstallMultipleProtocolInterfaces (
3850 CallbackInfo->DriverHandle,
3851 &gEfiDevicePathProtocolGuid,
3852 &mIScsiHiiVendorDevicePath,
3853 &gEfiHiiConfigAccessProtocolGuid,
3854 &CallbackInfo->ConfigAccess,
3858 return EFI_OUT_OF_RESOURCES;
3861 mCallbackInfo = CallbackInfo;
3887 while (!
IsListEmpty (&mPrivate->AttemptConfigs)) {
3891 mPrivate->AttemptCount--;
3894 ASSERT (mPrivate->AttemptCount == 0);
3900 mPrivate->NicCount--;
3903 ASSERT (mPrivate->NicCount == 0);
3916 Status =
gBS->UninstallMultipleProtocolInterfaces (
3917 mCallbackInfo->DriverHandle,
3918 &gEfiDevicePathProtocolGuid,
3919 &mIScsiHiiVendorDevicePath,
3920 &gEfiHiiConfigAccessProtocolGuid,
3921 &mCallbackInfo->ConfigAccess,
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define HARDWARE_DEVICE_PATH
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STRING EFIAPI HiiConstructConfigHdr(IN CONST EFI_GUID *Guid OPTIONAL, IN CONST CHAR16 *Name OPTIONAL, IN EFI_HANDLE DriverHandle)
BOOLEAN EFIAPI HiiGetBrowserData(IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL, IN UINTN BufferSize, OUT UINT8 *Buffer)
UINT8 *EFIAPI HiiCreateGotoOpCode(IN VOID *OpCodeHandle, IN EFI_FORM_ID FormId, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN UINT8 QuestionFlags, IN EFI_QUESTION_ID QuestionId)
VOID *EFIAPI HiiAllocateOpCodeHandle(VOID)
VOID EFIAPI HiiFreeOpCodeHandle(VOID *OpCodeHandle)
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
UINT8 *EFIAPI HiiCreateGuidOpCode(IN VOID *OpCodeHandle, IN CONST EFI_GUID *Guid, IN CONST VOID *GuidOpCode OPTIONAL, IN UINTN OpCodeSize)
UINT8 *EFIAPI HiiCreateCheckBoxOpCode(IN VOID *OpCodeHandle, IN EFI_QUESTION_ID QuestionId, IN EFI_VARSTORE_ID VarStoreId, IN UINT16 VarOffset, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN UINT8 QuestionFlags, IN UINT8 CheckBoxFlags, IN VOID *DefaultsOpCodeHandle OPTIONAL)
BOOLEAN EFIAPI HiiSetBrowserData(IN CONST EFI_GUID *VariableGuid OPTIONAL, IN CONST CHAR16 *VariableName OPTIONAL, IN UINTN BufferSize, IN CONST UINT8 *Buffer, IN CONST CHAR16 *RequestElement OPTIONAL)
UINT8 *EFIAPI HiiCreateOneOfOptionOpCode(IN VOID *OpCodeHandle, IN UINT16 StringId, IN UINT8 Flags, IN UINT8 Type, IN UINT64 Value)
EFI_STATUS EFIAPI HiiUpdateForm(IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid OPTIONAL, IN EFI_FORM_ID FormId, IN VOID *StartOpCodeHandle, IN VOID *EndOpCodeHandle OPTIONAL)
BOOLEAN EFIAPI HiiIsConfigHdrMatch(IN CONST EFI_STRING ConfigHdr, IN CONST EFI_GUID *Guid OPTIONAL, IN CONST CHAR16 *Name OPTIONAL)
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
UINT8 *EFIAPI HiiCreateOrderedListOpCode(IN VOID *OpCodeHandle, IN EFI_QUESTION_ID QuestionId, IN EFI_VARSTORE_ID VarStoreId, IN UINT16 VarOffset, IN EFI_STRING_ID Prompt, IN EFI_STRING_ID Help, IN UINT8 QuestionFlags, IN UINT8 OrderedListFlags, IN UINT8 DataType, IN UINT8 MaxContainers, IN VOID *OptionsOpCodeHandle, IN VOID *DefaultsOpCodeHandle OPTIONAL)
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
EFI_STATUS IScsiConfigDisplayDeleteAttempts(IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
EFI_STATUS IScsiConfigFormUnload(IN EFI_HANDLE DriverBindingHandle)
EFI_STATUS IScsiConvertlfrNvDataToAttemptConfigDataByKeyword(IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData, IN UINTN OffSet)
EFI_STATUS IScsiGetValue(IN CONST EFI_STRING Configuration, IN CHAR16 *String, OUT UINTN *Value)
EFI_STATUS IScsiConfigOrderAttempts(IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
EFI_STATUS IScsiConfigAddAttemptsByKeywords(IN UINT8 *AttemptList)
VOID IScsiIpToStr(IN EFI_IP_ADDRESS *Ip, IN BOOLEAN Ipv6Flag, OUT CHAR16 *Str)
EFI_STATUS IScsiConvertIfrNvDataToAttemptConfigData(IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData, IN OUT ISCSI_ATTEMPT_CONFIG_NVDATA *Attempt)
EFI_STATUS IScsiConfigAddAttempt(VOID)
ISCSI_ATTEMPT_CONFIG_NVDATA * IScsiConfigGetAttemptByNic(IN ISCSI_ATTEMPT_CONFIG_NVDATA *NewAttempt, IN UINT8 IScsiMode)
ISCSI_ATTEMPT_CONFIG_NVDATA * IScsiConfigGetAttemptByConfigIndex(IN UINT8 AttemptConfigIndex)
EFI_STATUS IScsiConvertIsIdToString(OUT CHAR16 *String, IN UINT8 *IsId)
EFI_STATUS IScsiGetAttemptIndexList(IN CHAR16 *AttemptNameList, OUT UINT8 *AttemptIndexList, IN BOOLEAN IsAddAttempts)
EFI_STATUS EFIAPI IScsiFormRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS IScsiConfigDeleteAttempts(IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
BOOLEAN IpIsUnicast(IN EFI_IP_ADDRESS *Ip, IN UINT8 IpMode)
VOID IScsiConfigUpdateAttempt(VOID)
EFI_STATUS IScsiCreateOpCode(IN UINT16 StartLabelNumber, OUT VOID **StartOpCodeHandle, OUT EFI_IFR_GUID_LABEL **StartLabel, OUT VOID **EndOpCodeHandle, OUT EFI_IFR_GUID_LABEL **EndLabel)
EFI_STATUS IScsiParseIsIdFromString(IN CONST CHAR16 *String, IN OUT UINT8 *IsId)
VOID EFIAPI IScsiConvertAttemptConfigDataToIfrNvDataByKeyword(IN OUT ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
EFI_STATUS IScsiConfigDisplayOrderAttempts(VOID)
EFI_STATUS IScsiConfigFormInit(IN EFI_HANDLE DriverBindingHandle)
VOID IScsiConvertAttemptConfigDataToIfrNvData(IN ISCSI_ATTEMPT_CONFIG_NVDATA *Attempt, IN OUT ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
EFI_STATUS IScsiConfigProcessDefault(IN EFI_QUESTION_ID KeyValue, IN ISCSI_CONFIG_IFR_NVDATA *IfrNvData)
EFI_STATUS EFIAPI IScsiFormExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI IScsiFormCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN OUT EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
VOID * IScsiGetVariableAndSize(IN CHAR16 *Name, IN EFI_GUID *VendorGuid, OUT UINTN *VariableSize)
EFI_STATUS IScsiAsciiStrToIp(IN CHAR8 *Str, IN UINT8 IpMode, OUT EFI_IP_ADDRESS *Ip)
UINT8 IScsiGetSubnetMaskPrefixLength(IN EFI_IPv4_ADDRESS *SubnetMask)
ISCSI_NIC_INFO * IScsiGetNicInfoByIndex(IN UINT8 NicIndex)
VOID IScsiLunToUnicodeStr(IN UINT8 *Lun, OUT CHAR16 *Str)
VOID IScsiMacAddrToStr(IN EFI_MAC_ADDRESS *Mac, IN UINT32 Len, IN UINT16 VlanId, OUT CHAR16 *Str)
EFI_STATUS IScsiAsciiStrToLun(IN CHAR8 *Str, OUT UINT8 *Lun)
EFI_STATUS IScsiNormalizeName(IN OUT CHAR8 *Name, IN UINTN Len)
#define EFI_IFR_EXTEND_OP_LABEL
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
LIST_ENTRY *EFIAPI NetListRemoveHead(IN OUT LIST_ENTRY *Head)
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
EFI_STATUS EFIAPI NetLibStrToIp4(IN CONST CHAR16 *String, OUT EFI_IPv4_ADDRESS *Ip4Address)
#define PcdGet8(TokenName)
#define FixedPcdGet8(TokenName)
VOID EFIAPI Exit(IN EFI_STATUS Status)
EFI_HII_CONFIG_ROUTING_PROTOCOL * gHiiConfigRouting
EFI_STATUS EFIAPI GetVariable2(IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
VOID EFIAPI CreatePopUp(IN UINTN Attribute, OUT EFI_INPUT_KEY *Key OPTIONAL,...)
#define EFI_VARIABLE_NON_VOLATILE
UINT16 ConnectTimeout
timeout value in milliseconds.