Changeset 99404 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/IScsiDxe/IScsiDriver.c
- Timestamp:
- Apr 14, 2023 3:17:44 PM (22 months ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-145445 /vendor/edk2/current 103735-103757,103769-103776,129194-156846
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/IScsiDxe/IScsiDriver.c
r85718 r99404 12 12 #include "IScsiImpl.h" 13 13 14 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp4DriverBinding = {14 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp4DriverBinding = { 15 15 IScsiIp4DriverBindingSupported, 16 16 IScsiIp4DriverBindingStart, … … 21 21 }; 22 22 23 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp6DriverBinding = {23 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp6DriverBinding = { 24 24 IScsiIp6DriverBindingSupported, 25 25 IScsiIp6DriverBindingStart, … … 30 30 }; 31 31 32 EFI_GUID 33 EFI_GUID 34 ISCSI_PRIVATE_DATA 32 EFI_GUID gIScsiV4PrivateGuid = ISCSI_V4_PRIVATE_GUID; 33 EFI_GUID gIScsiV6PrivateGuid = ISCSI_V6_PRIVATE_GUID; 34 ISCSI_PRIVATE_DATA *mPrivate = NULL; 35 35 36 36 /** … … 51 51 EFI_STATUS 52 52 IScsiIsDevicePathSupported ( 53 IN EFI_DEVICE_PATH_PROTOCOL 53 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL 54 54 ) 55 55 { … … 86 86 ) 87 87 { 88 UINTN AipHandleCount;89 EFI_HANDLE *AipHandleBuffer;90 UINTN AipIndex;91 EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;92 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiPassThru;93 EFI_GUID *InfoTypesBuffer;94 UINTN InfoTypeBufferCount;95 UINTN TypeIndex;96 VOID *InfoBlock;97 UINTN InfoBlockSize;98 BOOLEAN Supported;99 EFI_ADAPTER_INFO_NETWORK_BOOT *NetworkBoot;100 EFI_STATUS Status;101 UINT8 NetworkBootPolicy;88 UINTN AipHandleCount; 89 EFI_HANDLE *AipHandleBuffer; 90 UINTN AipIndex; 91 EFI_ADAPTER_INFORMATION_PROTOCOL *Aip; 92 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiPassThru; 93 EFI_GUID *InfoTypesBuffer; 94 UINTN InfoTypeBufferCount; 95 UINTN TypeIndex; 96 VOID *InfoBlock; 97 UINTN InfoBlockSize; 98 BOOLEAN Supported; 99 EFI_ADAPTER_INFO_NETWORK_BOOT *NetworkBoot; 100 EFI_STATUS Status; 101 UINT8 NetworkBootPolicy; 102 102 103 103 // … … 106 106 AipHandleCount = 0; 107 107 AipHandleBuffer = NULL; 108 Status = gBS->LocateHandleBuffer (109 ByProtocol,110 &gEfiAdapterInformationProtocolGuid,111 NULL,112 &AipHandleCount,113 &AipHandleBuffer114 );115 if (EFI_ERROR (Status) || AipHandleCount == 0) {108 Status = gBS->LocateHandleBuffer ( 109 ByProtocol, 110 &gEfiAdapterInformationProtocolGuid, 111 NULL, 112 &AipHandleCount, 113 &AipHandleBuffer 114 ); 115 if (EFI_ERROR (Status) || (AipHandleCount == 0)) { 116 116 return EFI_NOT_FOUND; 117 117 } … … 125 125 AipHandleBuffer[AipIndex], 126 126 &gEfiAdapterInformationProtocolGuid, 127 (VOID *) 127 (VOID *)&Aip 128 128 ); 129 129 ASSERT_EFI_ERROR (Status); … … 133 133 AipHandleBuffer[AipIndex], 134 134 &gEfiExtScsiPassThruProtocolGuid, 135 (VOID *) 135 (VOID *)&ExtScsiPassThru 136 136 ); 137 if (EFI_ERROR (Status) || ExtScsiPassThru == NULL) {137 if (EFI_ERROR (Status) || (ExtScsiPassThru == NULL)) { 138 138 continue; 139 139 } … … 141 141 InfoTypesBuffer = NULL; 142 142 InfoTypeBufferCount = 0; 143 Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);144 if (EFI_ERROR (Status) || InfoTypesBuffer == NULL) {143 Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount); 144 if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL)) { 145 145 continue; 146 146 } 147 147 148 // 148 149 // Check whether the AIP instance has Network boot information block. … … 166 167 InfoBlock = NULL; 167 168 InfoBlockSize = 0; 168 Status = Aip->GetInformation (Aip, &gEfiAdapterInfoNetworkBootGuid, &InfoBlock, &InfoBlockSize);169 if (EFI_ERROR (Status) || InfoBlock == NULL) {169 Status = Aip->GetInformation (Aip, &gEfiAdapterInfoNetworkBootGuid, &InfoBlock, &InfoBlockSize); 170 if (EFI_ERROR (Status) || (InfoBlock == NULL)) { 170 171 continue; 171 172 } … … 174 175 // Check whether the network boot policy matches. 175 176 // 176 NetworkBoot = (EFI_ADAPTER_INFO_NETWORK_BOOT *)InfoBlock;177 NetworkBoot = (EFI_ADAPTER_INFO_NETWORK_BOOT *)InfoBlock; 177 178 NetworkBootPolicy = PcdGet8 (PcdIScsiAIPNetworkBootPolicy); 178 179 … … 181 182 goto Exit; 182 183 } 183 if (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4) != 0 && 184 185 if ((((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4) != 0) && 184 186 !NetworkBoot->iScsiIpv4BootCapablity) || 185 ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6) != 0&&187 (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6) != 0) && 186 188 !NetworkBoot->iScsiIpv6BootCapablity) || 187 ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD) != 0&&189 (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD) != 0) && 188 190 !NetworkBoot->OffloadCapability) || 189 ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO) != 0&&191 (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO) != 0) && 190 192 !NetworkBoot->iScsiMpioCapability) || 191 ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4) != 0&&193 (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4) != 0) && 192 194 !NetworkBoot->iScsiIpv4Boot) || 193 ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP6) != 0 && 194 !NetworkBoot->iScsiIpv6Boot)) { 195 (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP6) != 0) && 196 !NetworkBoot->iScsiIpv6Boot)) 197 { 195 198 FreePool (InfoBlock); 196 199 continue; … … 207 210 FreePool (InfoBlock); 208 211 } 212 209 213 if (AipHandleBuffer != NULL) { 210 214 FreePool (AipHandleBuffer); 211 215 } 216 212 217 return Status; 213 218 } … … 247 252 ) 248 253 { 249 EFI_STATUS 250 EFI_GUID 251 EFI_GUID 252 EFI_GUID 253 EFI_GUID 254 EFI_STATUS Status; 255 EFI_GUID *IScsiServiceBindingGuid; 256 EFI_GUID *TcpServiceBindingGuid; 257 EFI_GUID *DhcpServiceBindingGuid; 258 EFI_GUID *DnsServiceBindingGuid; 254 259 255 260 if (IpVersion == IP_VERSION_4) { 256 IScsiServiceBindingGuid = &gIScsiV4PrivateGuid; 257 TcpServiceBindingGuid = &gEfiTcp4ServiceBindingProtocolGuid; 258 DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid; 259 DnsServiceBindingGuid = &gEfiDns4ServiceBindingProtocolGuid; 260 261 IScsiServiceBindingGuid = &gIScsiV4PrivateGuid; 262 TcpServiceBindingGuid = &gEfiTcp4ServiceBindingProtocolGuid; 263 DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid; 264 DnsServiceBindingGuid = &gEfiDns4ServiceBindingProtocolGuid; 261 265 } else { 262 IScsiServiceBindingGuid 263 TcpServiceBindingGuid 264 DhcpServiceBindingGuid 265 DnsServiceBindingGuid 266 IScsiServiceBindingGuid = &gIScsiV6PrivateGuid; 267 TcpServiceBindingGuid = &gEfiTcp6ServiceBindingProtocolGuid; 268 DhcpServiceBindingGuid = &gEfiDhcp6ServiceBindingProtocolGuid; 269 DnsServiceBindingGuid = &gEfiDns6ServiceBindingProtocolGuid; 266 270 } 267 271 … … 326 330 } 327 331 328 329 332 /** 330 333 Start to manage the controller. This is the worker function for … … 348 351 EFI_STATUS 349 352 IScsiStart ( 350 IN EFI_HANDLE 351 IN EFI_HANDLE 352 IN UINT8 353 IN EFI_HANDLE Image, 354 IN EFI_HANDLE ControllerHandle, 355 IN UINT8 IpVersion 353 356 ) 354 357 { 355 EFI_STATUS Status;356 ISCSI_DRIVER_DATA *Private;357 LIST_ENTRY *Entry;358 LIST_ENTRY *NextEntry;359 ISCSI_ATTEMPT_CONFIG_NVDATA *AttemptConfigData;360 ISCSI_SESSION *Session;361 UINT8 Index;362 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExistIScsiExtScsiPassThru;363 ISCSI_DRIVER_DATA *ExistPrivate;364 UINT8 *AttemptConfigOrder;365 UINTN AttemptConfigOrderSize;366 UINT8 BootSelected;367 EFI_HANDLE *HandleBuffer;368 UINTN NumberOfHandles;369 EFI_DEVICE_PATH_PROTOCOL *DevicePath;370 EFI_GUID *IScsiPrivateGuid;371 EFI_GUID *TcpServiceBindingGuid;372 BOOLEAN NeedUpdate;373 VOID *Interface;374 EFI_GUID *ProtocolGuid;375 UINT8 NetworkBootPolicy;376 ISCSI_SESSION_CONFIG_NVDATA *NvData;358 EFI_STATUS Status; 359 ISCSI_DRIVER_DATA *Private; 360 LIST_ENTRY *Entry; 361 LIST_ENTRY *NextEntry; 362 ISCSI_ATTEMPT_CONFIG_NVDATA *AttemptConfigData; 363 ISCSI_SESSION *Session; 364 UINT8 Index; 365 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExistIScsiExtScsiPassThru; 366 ISCSI_DRIVER_DATA *ExistPrivate; 367 UINT8 *AttemptConfigOrder; 368 UINTN AttemptConfigOrderSize; 369 UINT8 BootSelected; 370 EFI_HANDLE *HandleBuffer; 371 UINTN NumberOfHandles; 372 EFI_DEVICE_PATH_PROTOCOL *DevicePath; 373 EFI_GUID *IScsiPrivateGuid; 374 EFI_GUID *TcpServiceBindingGuid; 375 BOOLEAN NeedUpdate; 376 VOID *Interface; 377 EFI_GUID *ProtocolGuid; 378 UINT8 NetworkBootPolicy; 379 ISCSI_SESSION_CONFIG_NVDATA *NvData; 377 380 378 381 // … … 519 522 AttemptConfigData = NULL; 520 523 NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) { 521 AttemptConfigData = NET_LIST_USER_STRUCT (Entry, ISCSI_ATTEMPT_CONFIG_NVDATA, Link);524 AttemptConfigData = NET_LIST_USER_STRUCT (Entry, ISCSI_ATTEMPT_CONFIG_NVDATA, Link); 522 525 if (AttemptConfigData->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO) { 523 526 break; … … 559 562 HandleBuffer[Index], 560 563 &gEfiDevicePathProtocolGuid, 561 (VOID **) 564 (VOID **)&DevicePath 562 565 ); 563 566 if (EFI_ERROR (Status)) { … … 573 576 HandleBuffer[Index], 574 577 &gEfiExtScsiPassThruProtocolGuid, 575 (VOID **) 578 (VOID **)&ExistIScsiExtScsiPassThru 576 579 ); 577 580 ASSERT_EFI_ERROR (Status); … … 623 626 // this attempt is disabled or established. 624 627 // 625 if (AttemptConfigData->NicIndex != mPrivate->CurrentNic || 626 AttemptConfigData->SessionConfigData.Enabled == ISCSI_DISABLED || 627 AttemptConfigData->ValidPath) { 628 if ((AttemptConfigData->NicIndex != mPrivate->CurrentNic) || 629 (AttemptConfigData->SessionConfigData.Enabled == ISCSI_DISABLED) || 630 AttemptConfigData->ValidPath) 631 { 628 632 continue; 629 633 } … … 634 638 // 635 639 if ((mPrivate->EnableMpio && 636 AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED_FOR_MPIO) ||640 (AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED_FOR_MPIO)) || 637 641 (!mPrivate->EnableMpio && 638 AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED)) { 642 (AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED))) 643 { 639 644 continue; 640 645 } … … 644 649 // 645 650 if (AttemptConfigData->SessionConfigData.InitiatorInfoFromDhcp && 646 !AttemptConfigData->DhcpSuccess) { 647 if (!mPrivate->EnableMpio && mPrivate->ValidSinglePathCount > 0) { 651 !AttemptConfigData->DhcpSuccess) 652 { 653 if (!mPrivate->EnableMpio && (mPrivate->ValidSinglePathCount > 0)) { 648 654 mPrivate->ValidSinglePathCount--; 649 655 } 656 650 657 continue; 651 658 } … … 654 661 // Don't process the autoconfigure path if it is already established. 655 662 // 656 if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG && 657 AttemptConfigData->AutoConfigureSuccess) { 663 if ((AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) && 664 AttemptConfigData->AutoConfigureSuccess) 665 { 658 666 continue; 659 667 } … … 666 674 continue; 667 675 } 668 if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG && 669 AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) { 676 677 if ((AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) && 678 (AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6)) 679 { 670 680 continue; 671 681 } … … 674 684 continue; 675 685 } 676 if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG && 677 AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP4) { 686 687 if ((AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) && 688 (AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP4)) 689 { 678 690 continue; 679 691 } … … 683 695 // Fill in the Session and init it. 684 696 // 685 Session = (ISCSI_SESSION *) 697 Session = (ISCSI_SESSION *)AllocateZeroPool (sizeof (ISCSI_SESSION)); 686 698 if (Session == NULL) { 687 699 Status = EFI_OUT_OF_RESOURCES; … … 695 707 UnicodeSPrint ( 696 708 mPrivate->PortString, 697 (UINTN) 709 (UINTN)ISCSI_NAME_IFR_MAX_SIZE, 698 710 L"Attempt %d", 699 (UINTN) 711 (UINTN)AttemptConfigData->AttemptConfigIndex 700 712 ); 701 713 … … 743 755 // in multi-path mode, all the attempt entries in MPIO will be recorded in iBFT. 744 756 // 745 if (!mPrivate->EnableMpio && mPrivate->ValidSinglePathCount > 0) {757 if (!mPrivate->EnableMpio && (mPrivate->ValidSinglePathCount > 0)) { 746 758 mPrivate->ValidSinglePathCount--; 747 759 } 748 760 749 761 FreePool (Session); 750 751 762 } else { 752 763 AttemptConfigData->ValidPath = TRUE; … … 757 768 // 758 769 if (Session->AuthType == ISCSI_AUTH_TYPE_KRB) { 759 if (!mPrivate->EnableMpio && mPrivate->ValidSinglePathCount > 0) {770 if (!mPrivate->EnableMpio && (mPrivate->ValidSinglePathCount > 0)) { 760 771 mPrivate->ValidSinglePathCount--; 761 772 } … … 815 826 // Reinstall the original ExtScsiPassThru back. 816 827 // 817 if (mPrivate->OneSessionEstablished && ExistPrivate != NULL) {828 if (mPrivate->OneSessionEstablished && (ExistPrivate != NULL)) { 818 829 Status = gBS->InstallProtocolInterface ( 819 830 &ExistPrivate->ExtScsiPassThruHandle, … … 838 849 // More than one attempt successes. 839 850 // 840 if (Private->Session != NULL && mPrivate->OneSessionEstablished) { 841 851 if ((Private->Session != NULL) && mPrivate->OneSessionEstablished) { 842 852 AttemptConfigOrder = IScsiGetVariableAndSize ( 843 853 L"AttemptOrder", … … 848 858 goto ON_ERROR; 849 859 } 860 850 861 for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) { 851 if (AttemptConfigOrder[Index] == mPrivate->BootSelectedIndex || 852 AttemptConfigOrder[Index] == BootSelected) { 862 if ((AttemptConfigOrder[Index] == mPrivate->BootSelectedIndex) || 863 (AttemptConfigOrder[Index] == BootSelected)) 864 { 853 865 break; 854 866 } … … 888 900 goto ON_ERROR; 889 901 } 902 890 903 mPrivate->BootSelectedIndex = BootSelected; 891 904 // … … 918 931 gBS->CloseEvent (ExistPrivate->ExitBootServiceEvent); 919 932 FreePool (ExistPrivate); 920 921 933 } 922 934 } else { … … 928 940 } 929 941 } 930 931 942 } 932 943 … … 946 957 goto ON_ERROR; 947 958 } 959 948 960 // 949 961 // Install the updated device path onto the ExtScsiPassThruHandle. … … 1033 1045 ) 1034 1046 { 1035 EFI_HANDLE IScsiController; 1036 EFI_STATUS Status; 1037 ISCSI_PRIVATE_PROTOCOL *IScsiIdentifier; 1038 ISCSI_DRIVER_DATA *Private; 1039 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru; 1040 ISCSI_CONNECTION *Conn; 1041 EFI_GUID *ProtocolGuid; 1042 EFI_GUID *TcpServiceBindingGuid; 1043 EFI_GUID *TcpProtocolGuid; 1044 1047 EFI_HANDLE IScsiController; 1048 EFI_STATUS Status; 1049 ISCSI_PRIVATE_PROTOCOL *IScsiIdentifier; 1050 ISCSI_DRIVER_DATA *Private; 1051 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru; 1052 ISCSI_CONNECTION *Conn; 1053 EFI_GUID *ProtocolGuid; 1054 EFI_GUID *TcpServiceBindingGuid; 1055 EFI_GUID *TcpProtocolGuid; 1045 1056 1046 1057 if (NumberOfChildren != 0) { … … 1051 1062 ChildHandleBuffer[0], 1052 1063 &gEfiExtScsiPassThruProtocolGuid, 1053 (VOID **) 1064 (VOID **)&PassThru, 1054 1065 This->DriverBindingHandle, 1055 1066 ControllerHandle, … … 1095 1106 // 1096 1107 if (IpVersion == IP_VERSION_4) { 1097 ProtocolGuid 1098 TcpProtocolGuid 1099 TcpServiceBindingGuid 1108 ProtocolGuid = &gIScsiV4PrivateGuid; 1109 TcpProtocolGuid = &gEfiTcp4ProtocolGuid; 1110 TcpServiceBindingGuid = &gEfiTcp4ServiceBindingProtocolGuid; 1100 1111 } else { 1101 ProtocolGuid = &gIScsiV6PrivateGuid; 1102 TcpProtocolGuid = &gEfiTcp6ProtocolGuid; 1103 TcpServiceBindingGuid = &gEfiTcp6ServiceBindingProtocolGuid; 1104 } 1112 ProtocolGuid = &gIScsiV6PrivateGuid; 1113 TcpProtocolGuid = &gEfiTcp6ProtocolGuid; 1114 TcpServiceBindingGuid = &gEfiTcp6ServiceBindingProtocolGuid; 1115 } 1116 1105 1117 IScsiController = NetLibGetNicHandle (ControllerHandle, TcpProtocolGuid); 1106 1118 if (IScsiController == NULL) { … … 1111 1123 IScsiController, 1112 1124 ProtocolGuid, 1113 (VOID **) 1125 (VOID **)&IScsiIdentifier, 1114 1126 This->DriverBindingHandle, 1115 1127 ControllerHandle, … … 1273 1285 ) 1274 1286 { 1275 EFI_STATUS 1287 EFI_STATUS Status; 1276 1288 1277 1289 Status = IScsiStart (This->DriverBindingHandle, ControllerHandle, IP_VERSION_4); … … 1428 1440 ) 1429 1441 { 1430 EFI_STATUS 1442 EFI_STATUS Status; 1431 1443 1432 1444 Status = IScsiStart (This->DriverBindingHandle, ControllerHandle, IP_VERSION_6); … … 1497 1509 ) 1498 1510 { 1499 EFI_STATUS 1500 UINTN 1501 EFI_HANDLE 1502 UINTN 1503 EFI_COMPONENT_NAME_PROTOCOL 1504 EFI_COMPONENT_NAME2_PROTOCOL 1511 EFI_STATUS Status; 1512 UINTN DeviceHandleCount; 1513 EFI_HANDLE *DeviceHandleBuffer; 1514 UINTN Index; 1515 EFI_COMPONENT_NAME_PROTOCOL *ComponentName; 1516 EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2; 1505 1517 1506 1518 // … … 1525 1537 DeviceHandleBuffer[Index], 1526 1538 gIScsiIp4DriverBinding.DriverBindingHandle, 1527 &gEfiTcp4ProtocolGuid) 1528 ; 1539 &gEfiTcp4ProtocolGuid 1540 ) 1541 ; 1529 1542 if (EFI_ERROR (Status)) { 1530 1543 continue; 1531 1544 } 1545 1532 1546 Status = gBS->DisconnectController ( 1533 1547 DeviceHandleBuffer[Index], … … 1552 1566 continue; 1553 1567 } 1568 1554 1569 Status = gBS->DisconnectController ( 1555 1570 DeviceHandleBuffer[Index], … … 1583 1598 } 1584 1599 1585 if (gIScsiControllerNameTable != NULL) {1600 if (gIScsiControllerNameTable != NULL) { 1586 1601 Status = FreeUnicodeStringTable (gIScsiControllerNameTable); 1587 1602 if (EFI_ERROR (Status)) { 1588 1603 goto ON_EXIT; 1589 1604 } 1605 1590 1606 gIScsiControllerNameTable = NULL; 1591 1607 } … … 1598 1614 gIScsiIp4DriverBinding.DriverBindingHandle, 1599 1615 &gEfiComponentNameProtocolGuid, 1600 (VOID **) 1616 (VOID **)&ComponentName 1601 1617 ); 1602 1618 if (!EFI_ERROR (Status)) { 1603 1619 Status = gBS->UninstallMultipleProtocolInterfaces ( 1604 gIScsiIp4DriverBinding.DriverBindingHandle,1605 &gEfiComponentNameProtocolGuid,1606 ComponentName,1607 NULL1608 );1620 gIScsiIp4DriverBinding.DriverBindingHandle, 1621 &gEfiComponentNameProtocolGuid, 1622 ComponentName, 1623 NULL 1624 ); 1609 1625 if (EFI_ERROR (Status)) { 1610 1626 goto ON_EXIT; … … 1615 1631 gIScsiIp4DriverBinding.DriverBindingHandle, 1616 1632 &gEfiComponentName2ProtocolGuid, 1617 (VOID **) 1633 (VOID **)&ComponentName2 1618 1634 ); 1619 1635 if (!EFI_ERROR (Status)) { … … 1636 1652 gIScsiIp6DriverBinding.DriverBindingHandle, 1637 1653 &gEfiComponentNameProtocolGuid, 1638 (VOID **) 1654 (VOID **)&ComponentName 1639 1655 ); 1640 1656 if (!EFI_ERROR (Status)) { 1641 1657 Status = gBS->UninstallMultipleProtocolInterfaces ( 1642 gIScsiIp6DriverBinding.DriverBindingHandle,1643 &gEfiComponentNameProtocolGuid,1644 ComponentName,1645 NULL1646 );1658 gIScsiIp6DriverBinding.DriverBindingHandle, 1659 &gEfiComponentNameProtocolGuid, 1660 ComponentName, 1661 NULL 1662 ); 1647 1663 if (EFI_ERROR (Status)) { 1648 1664 goto ON_EXIT; … … 1653 1669 gIScsiIp6DriverBinding.DriverBindingHandle, 1654 1670 &gEfiComponentName2ProtocolGuid, 1655 (VOID **) 1671 (VOID **)&ComponentName2 1656 1672 ); 1657 1673 if (!EFI_ERROR (Status)) { … … 1717 1733 EFIAPI 1718 1734 IScsiDriverEntryPoint ( 1719 IN EFI_HANDLE 1720 IN EFI_SYSTEM_TABLE 1735 IN EFI_HANDLE ImageHandle, 1736 IN EFI_SYSTEM_TABLE *SystemTable 1721 1737 ) 1722 1738 { … … 1731 1747 &gEfiIScsiInitiatorNameProtocolGuid, 1732 1748 NULL, 1733 (VOID **) 1749 (VOID **)&IScsiInitiatorName 1734 1750 ); 1735 1751 if (!EFI_ERROR (Status)) { … … 1780 1796 // Create the private data structures. 1781 1797 // 1798 IScsiCHAPInitHashList (); 1799 1782 1800 mPrivate = AllocateZeroPool (sizeof (ISCSI_PRIVATE_DATA)); 1783 1801 if (mPrivate == NULL) { … … 1820 1838 &gEfiAuthenticationInfoProtocolGuid, 1821 1839 NULL, 1822 (VOID **) 1840 (VOID **)&AuthenticationInfo 1823 1841 ); 1824 1842 if (Status == EFI_NOT_FOUND) { … … 1872 1890 return Status; 1873 1891 } 1874
Note:
See TracChangeset
for help on using the changeset viewer.