VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 3:17:44 PM (22 months ago)
Author:
vboxsync
Message:

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/IScsiDxe/IScsiDriver.c

    r85718 r99404  
    1212#include "IScsiImpl.h"
    1313
    14 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp4DriverBinding = {
     14EFI_DRIVER_BINDING_PROTOCOL  gIScsiIp4DriverBinding = {
    1515  IScsiIp4DriverBindingSupported,
    1616  IScsiIp4DriverBindingStart,
     
    2121};
    2222
    23 EFI_DRIVER_BINDING_PROTOCOL gIScsiIp6DriverBinding = {
     23EFI_DRIVER_BINDING_PROTOCOL  gIScsiIp6DriverBinding = {
    2424  IScsiIp6DriverBindingSupported,
    2525  IScsiIp6DriverBindingStart,
     
    3030};
    3131
    32 EFI_GUID                    gIScsiV4PrivateGuid = ISCSI_V4_PRIVATE_GUID;
    33 EFI_GUID                    gIScsiV6PrivateGuid = ISCSI_V6_PRIVATE_GUID;
    34 ISCSI_PRIVATE_DATA          *mPrivate           = NULL;
     32EFI_GUID            gIScsiV4PrivateGuid = ISCSI_V4_PRIVATE_GUID;
     33EFI_GUID            gIScsiV6PrivateGuid = ISCSI_V6_PRIVATE_GUID;
     34ISCSI_PRIVATE_DATA  *mPrivate           = NULL;
    3535
    3636/**
     
    5151EFI_STATUS
    5252IScsiIsDevicePathSupported (
    53   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL
     53  IN EFI_DEVICE_PATH_PROTOCOL  *RemainingDevicePath OPTIONAL
    5454  )
    5555{
     
    8686  )
    8787{
    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;
    102102
    103103  //
     
    106106  AipHandleCount  = 0;
    107107  AipHandleBuffer = NULL;
    108   Status = gBS->LocateHandleBuffer (
    109                   ByProtocol,
    110                   &gEfiAdapterInformationProtocolGuid,
    111                   NULL,
    112                   &AipHandleCount,
    113                   &AipHandleBuffer
    114                   );
    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)) {
    116116    return EFI_NOT_FOUND;
    117117  }
     
    125125                    AipHandleBuffer[AipIndex],
    126126                    &gEfiAdapterInformationProtocolGuid,
    127                     (VOID *) &Aip
     127                    (VOID *)&Aip
    128128                    );
    129129    ASSERT_EFI_ERROR (Status);
     
    133133                    AipHandleBuffer[AipIndex],
    134134                    &gEfiExtScsiPassThruProtocolGuid,
    135                     (VOID *) &ExtScsiPassThru
     135                    (VOID *)&ExtScsiPassThru
    136136                    );
    137     if (EFI_ERROR (Status) || ExtScsiPassThru == NULL) {
     137    if (EFI_ERROR (Status) || (ExtScsiPassThru == NULL)) {
    138138      continue;
    139139    }
     
    141141    InfoTypesBuffer     = NULL;
    142142    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)) {
    145145      continue;
    146146    }
     147
    147148    //
    148149    // Check whether the AIP instance has Network boot information block.
     
    166167    InfoBlock     = NULL;
    167168    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)) {
    170171      continue;
    171172    }
     
    174175    // Check whether the network boot policy matches.
    175176    //
    176     NetworkBoot = (EFI_ADAPTER_INFO_NETWORK_BOOT *) InfoBlock;
     177    NetworkBoot       = (EFI_ADAPTER_INFO_NETWORK_BOOT *)InfoBlock;
    177178    NetworkBootPolicy = PcdGet8 (PcdIScsiAIPNetworkBootPolicy);
    178179
     
    181182      goto Exit;
    182183    }
    183     if (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4) != 0 &&
     184
     185    if ((((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP4) != 0) &&
    184186         !NetworkBoot->iScsiIpv4BootCapablity) ||
    185          ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6) != 0 &&
     187        (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_IP6) != 0) &&
    186188         !NetworkBoot->iScsiIpv6BootCapablity) ||
    187          ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD) != 0 &&
     189        (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD) != 0) &&
    188190         !NetworkBoot->OffloadCapability) ||
    189          ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO) != 0 &&
     191        (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_SUPPORT_MPIO) != 0) &&
    190192         !NetworkBoot->iScsiMpioCapability) ||
    191          ((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4) != 0 &&
     193        (((NetworkBootPolicy & STOP_UEFI_ISCSI_IF_AIP_CONFIGURED_IP4) != 0) &&
    192194         !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    {
    195198      FreePool (InfoBlock);
    196199      continue;
     
    207210    FreePool (InfoBlock);
    208211  }
     212
    209213  if (AipHandleBuffer != NULL) {
    210214    FreePool (AipHandleBuffer);
    211215  }
     216
    212217  return Status;
    213218}
     
    247252  )
    248253{
    249   EFI_STATUS                Status;
    250   EFI_GUID                  *IScsiServiceBindingGuid;
    251   EFI_GUID                  *TcpServiceBindingGuid;
    252   EFI_GUID                  *DhcpServiceBindingGuid;
    253   EFI_GUID                  *DnsServiceBindingGuid;
     254  EFI_STATUS  Status;
     255  EFI_GUID    *IScsiServiceBindingGuid;
     256  EFI_GUID    *TcpServiceBindingGuid;
     257  EFI_GUID    *DhcpServiceBindingGuid;
     258  EFI_GUID    *DnsServiceBindingGuid;
    254259
    255260  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;
    261265  } else {
    262     IScsiServiceBindingGuid  = &gIScsiV6PrivateGuid;
    263     TcpServiceBindingGuid    = &gEfiTcp6ServiceBindingProtocolGuid;
    264     DhcpServiceBindingGuid   = &gEfiDhcp6ServiceBindingProtocolGuid;
    265     DnsServiceBindingGuid    = &gEfiDns6ServiceBindingProtocolGuid;
     266    IScsiServiceBindingGuid = &gIScsiV6PrivateGuid;
     267    TcpServiceBindingGuid   = &gEfiTcp6ServiceBindingProtocolGuid;
     268    DhcpServiceBindingGuid  = &gEfiDhcp6ServiceBindingProtocolGuid;
     269    DnsServiceBindingGuid   = &gEfiDns6ServiceBindingProtocolGuid;
    266270  }
    267271
     
    326330}
    327331
    328 
    329332/**
    330333  Start to manage the controller. This is the worker function for
     
    348351EFI_STATUS
    349352IScsiStart (
    350   IN EFI_HANDLE                   Image,
    351   IN EFI_HANDLE                   ControllerHandle,
    352   IN UINT8                        IpVersion
     353  IN EFI_HANDLE  Image,
     354  IN EFI_HANDLE  ControllerHandle,
     355  IN UINT8       IpVersion
    353356  )
    354357{
    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;
    377380
    378381  //
     
    519522    AttemptConfigData = NULL;
    520523    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);
    522525      if (AttemptConfigData->SessionConfigData.Enabled == ISCSI_ENABLED_FOR_MPIO) {
    523526        break;
     
    559562                      HandleBuffer[Index],
    560563                      &gEfiDevicePathProtocolGuid,
    561                       (VOID **) &DevicePath
     564                      (VOID **)&DevicePath
    562565                      );
    563566      if (EFI_ERROR (Status)) {
     
    573576                          HandleBuffer[Index],
    574577                          &gEfiExtScsiPassThruProtocolGuid,
    575                           (VOID **) &ExistIScsiExtScsiPassThru
     578                          (VOID **)&ExistIScsiExtScsiPassThru
    576579                          );
    577580          ASSERT_EFI_ERROR (Status);
     
    623626    // this attempt is disabled or established.
    624627    //
    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    {
    628632      continue;
    629633    }
     
    634638    //
    635639    if ((mPrivate->EnableMpio &&
    636          AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED_FOR_MPIO) ||
     640         (AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED_FOR_MPIO)) ||
    637641        (!mPrivate->EnableMpio &&
    638          AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED)) {
     642         (AttemptConfigData->SessionConfigData.Enabled != ISCSI_ENABLED)))
     643    {
    639644      continue;
    640645    }
     
    644649    //
    645650    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)) {
    648654        mPrivate->ValidSinglePathCount--;
    649655      }
     656
    650657      continue;
    651658    }
     
    654661    // Don't process the autoconfigure path if it is already established.
    655662    //
    656     if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&
    657         AttemptConfigData->AutoConfigureSuccess) {
     663    if ((AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) &&
     664        AttemptConfigData->AutoConfigureSuccess)
     665    {
    658666      continue;
    659667    }
     
    666674        continue;
    667675      }
    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      {
    670680        continue;
    671681      }
     
    674684        continue;
    675685      }
    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      {
    678690        continue;
    679691      }
     
    683695    // Fill in the Session and init it.
    684696    //
    685     Session = (ISCSI_SESSION *) AllocateZeroPool (sizeof (ISCSI_SESSION));
     697    Session = (ISCSI_SESSION *)AllocateZeroPool (sizeof (ISCSI_SESSION));
    686698    if (Session == NULL) {
    687699      Status = EFI_OUT_OF_RESOURCES;
     
    695707    UnicodeSPrint (
    696708      mPrivate->PortString,
    697       (UINTN) ISCSI_NAME_IFR_MAX_SIZE,
     709      (UINTN)ISCSI_NAME_IFR_MAX_SIZE,
    698710      L"Attempt %d",
    699       (UINTN) AttemptConfigData->AttemptConfigIndex
     711      (UINTN)AttemptConfigData->AttemptConfigIndex
    700712      );
    701713
     
    743755      // in multi-path mode, all the attempt entries in MPIO will be recorded in iBFT.
    744756      //
    745       if (!mPrivate->EnableMpio && mPrivate->ValidSinglePathCount > 0) {
     757      if (!mPrivate->EnableMpio && (mPrivate->ValidSinglePathCount > 0)) {
    746758        mPrivate->ValidSinglePathCount--;
    747759      }
    748760
    749761      FreePool (Session);
    750 
    751762    } else {
    752763      AttemptConfigData->ValidPath = TRUE;
     
    757768      //
    758769      if (Session->AuthType == ISCSI_AUTH_TYPE_KRB) {
    759         if (!mPrivate->EnableMpio && mPrivate->ValidSinglePathCount > 0) {
     770        if (!mPrivate->EnableMpio && (mPrivate->ValidSinglePathCount > 0)) {
    760771          mPrivate->ValidSinglePathCount--;
    761772        }
     
    815826    // Reinstall the original ExtScsiPassThru back.
    816827    //
    817     if (mPrivate->OneSessionEstablished && ExistPrivate != NULL) {
     828    if (mPrivate->OneSessionEstablished && (ExistPrivate != NULL)) {
    818829      Status = gBS->InstallProtocolInterface (
    819830                      &ExistPrivate->ExtScsiPassThruHandle,
     
    838849  // More than one attempt successes.
    839850  //
    840   if (Private->Session != NULL && mPrivate->OneSessionEstablished) {
    841 
     851  if ((Private->Session != NULL) && mPrivate->OneSessionEstablished) {
    842852    AttemptConfigOrder = IScsiGetVariableAndSize (
    843853                           L"AttemptOrder",
     
    848858      goto ON_ERROR;
    849859    }
     860
    850861    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      {
    853865        break;
    854866      }
     
    888900          goto ON_ERROR;
    889901        }
     902
    890903        mPrivate->BootSelectedIndex = BootSelected;
    891904        //
     
    918931        gBS->CloseEvent (ExistPrivate->ExitBootServiceEvent);
    919932        FreePool (ExistPrivate);
    920 
    921933      }
    922934    } else {
     
    928940      }
    929941    }
    930 
    931942  }
    932943
     
    946957    goto ON_ERROR;
    947958  }
     959
    948960  //
    949961  // Install the updated device path onto the ExtScsiPassThruHandle.
     
    10331045  )
    10341046{
    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;
    10451056
    10461057  if (NumberOfChildren != 0) {
     
    10511062                    ChildHandleBuffer[0],
    10521063                    &gEfiExtScsiPassThruProtocolGuid,
    1053                     (VOID **) &PassThru,
     1064                    (VOID **)&PassThru,
    10541065                    This->DriverBindingHandle,
    10551066                    ControllerHandle,
     
    10951106  //
    10961107  if (IpVersion == IP_VERSION_4) {
    1097     ProtocolGuid            = &gIScsiV4PrivateGuid;
    1098     TcpProtocolGuid         = &gEfiTcp4ProtocolGuid;
    1099     TcpServiceBindingGuid   = &gEfiTcp4ServiceBindingProtocolGuid;
     1108    ProtocolGuid          = &gIScsiV4PrivateGuid;
     1109    TcpProtocolGuid       = &gEfiTcp4ProtocolGuid;
     1110    TcpServiceBindingGuid = &gEfiTcp4ServiceBindingProtocolGuid;
    11001111  } else {
    1101     ProtocolGuid            = &gIScsiV6PrivateGuid;
    1102     TcpProtocolGuid         = &gEfiTcp6ProtocolGuid;
    1103     TcpServiceBindingGuid   = &gEfiTcp6ServiceBindingProtocolGuid;
    1104   }
     1112    ProtocolGuid          = &gIScsiV6PrivateGuid;
     1113    TcpProtocolGuid       = &gEfiTcp6ProtocolGuid;
     1114    TcpServiceBindingGuid = &gEfiTcp6ServiceBindingProtocolGuid;
     1115  }
     1116
    11051117  IScsiController = NetLibGetNicHandle (ControllerHandle, TcpProtocolGuid);
    11061118  if (IScsiController == NULL) {
     
    11111123                  IScsiController,
    11121124                  ProtocolGuid,
    1113                   (VOID **) &IScsiIdentifier,
     1125                  (VOID **)&IScsiIdentifier,
    11141126                  This->DriverBindingHandle,
    11151127                  ControllerHandle,
     
    12731285  )
    12741286{
    1275   EFI_STATUS        Status;
     1287  EFI_STATUS  Status;
    12761288
    12771289  Status = IScsiStart (This->DriverBindingHandle, ControllerHandle, IP_VERSION_4);
     
    14281440  )
    14291441{
    1430   EFI_STATUS        Status;
     1442  EFI_STATUS  Status;
    14311443
    14321444  Status = IScsiStart (This->DriverBindingHandle, ControllerHandle, IP_VERSION_6);
     
    14971509  )
    14981510{
    1499   EFI_STATUS                        Status;
    1500   UINTN                             DeviceHandleCount;
    1501   EFI_HANDLE                        *DeviceHandleBuffer;
    1502   UINTN                             Index;
    1503   EFI_COMPONENT_NAME_PROTOCOL       *ComponentName;
    1504   EFI_COMPONENT_NAME2_PROTOCOL      *ComponentName2;
     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;
    15051517
    15061518  //
     
    15251537               DeviceHandleBuffer[Index],
    15261538               gIScsiIp4DriverBinding.DriverBindingHandle,
    1527                &gEfiTcp4ProtocolGuid)
    1528                ;
     1539               &gEfiTcp4ProtocolGuid
     1540               )
     1541    ;
    15291542    if (EFI_ERROR (Status)) {
    15301543      continue;
    15311544    }
     1545
    15321546    Status = gBS->DisconnectController (
    15331547                    DeviceHandleBuffer[Index],
     
    15521566      continue;
    15531567    }
     1568
    15541569    Status = gBS->DisconnectController (
    15551570                    DeviceHandleBuffer[Index],
     
    15831598  }
    15841599
    1585   if (gIScsiControllerNameTable!= NULL) {
     1600  if (gIScsiControllerNameTable != NULL) {
    15861601    Status = FreeUnicodeStringTable (gIScsiControllerNameTable);
    15871602    if (EFI_ERROR (Status)) {
    15881603      goto ON_EXIT;
    15891604    }
     1605
    15901606    gIScsiControllerNameTable = NULL;
    15911607  }
     
    15981614                  gIScsiIp4DriverBinding.DriverBindingHandle,
    15991615                  &gEfiComponentNameProtocolGuid,
    1600                   (VOID **) &ComponentName
     1616                  (VOID **)&ComponentName
    16011617                  );
    16021618  if (!EFI_ERROR (Status)) {
    16031619    Status = gBS->UninstallMultipleProtocolInterfaces (
    1604            gIScsiIp4DriverBinding.DriverBindingHandle,
    1605            &gEfiComponentNameProtocolGuid,
    1606            ComponentName,
    1607            NULL
    1608            );
     1620                    gIScsiIp4DriverBinding.DriverBindingHandle,
     1621                    &gEfiComponentNameProtocolGuid,
     1622                    ComponentName,
     1623                    NULL
     1624                    );
    16091625    if (EFI_ERROR (Status)) {
    16101626      goto ON_EXIT;
     
    16151631                  gIScsiIp4DriverBinding.DriverBindingHandle,
    16161632                  &gEfiComponentName2ProtocolGuid,
    1617                   (VOID **) &ComponentName2
     1633                  (VOID **)&ComponentName2
    16181634                  );
    16191635  if (!EFI_ERROR (Status)) {
     
    16361652                  gIScsiIp6DriverBinding.DriverBindingHandle,
    16371653                  &gEfiComponentNameProtocolGuid,
    1638                   (VOID **) &ComponentName
     1654                  (VOID **)&ComponentName
    16391655                  );
    16401656  if (!EFI_ERROR (Status)) {
    16411657    Status = gBS->UninstallMultipleProtocolInterfaces (
    1642            gIScsiIp6DriverBinding.DriverBindingHandle,
    1643            &gEfiComponentNameProtocolGuid,
    1644            ComponentName,
    1645            NULL
    1646            );
     1658                    gIScsiIp6DriverBinding.DriverBindingHandle,
     1659                    &gEfiComponentNameProtocolGuid,
     1660                    ComponentName,
     1661                    NULL
     1662                    );
    16471663    if (EFI_ERROR (Status)) {
    16481664      goto ON_EXIT;
     
    16531669                  gIScsiIp6DriverBinding.DriverBindingHandle,
    16541670                  &gEfiComponentName2ProtocolGuid,
    1655                   (VOID **) &ComponentName2
     1671                  (VOID **)&ComponentName2
    16561672                  );
    16571673  if (!EFI_ERROR (Status)) {
     
    17171733EFIAPI
    17181734IScsiDriverEntryPoint (
    1719   IN EFI_HANDLE         ImageHandle,
    1720   IN EFI_SYSTEM_TABLE   *SystemTable
     1735  IN EFI_HANDLE        ImageHandle,
     1736  IN EFI_SYSTEM_TABLE  *SystemTable
    17211737  )
    17221738{
     
    17311747                  &gEfiIScsiInitiatorNameProtocolGuid,
    17321748                  NULL,
    1733                   (VOID **) &IScsiInitiatorName
     1749                  (VOID **)&IScsiInitiatorName
    17341750                  );
    17351751  if (!EFI_ERROR (Status)) {
     
    17801796  // Create the private data structures.
    17811797  //
     1798  IScsiCHAPInitHashList ();
     1799
    17821800  mPrivate = AllocateZeroPool (sizeof (ISCSI_PRIVATE_DATA));
    17831801  if (mPrivate == NULL) {
     
    18201838                  &gEfiAuthenticationInfoProtocolGuid,
    18211839                  NULL,
    1822                   (VOID **) &AuthenticationInfo
     1840                  (VOID **)&AuthenticationInfo
    18231841                  );
    18241842  if (Status == EFI_NOT_FOUND) {
     
    18721890  return Status;
    18731891}
    1874 
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette