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/HttpBootDxe/HttpBootDxe.c

    r85718 r99404  
    1212/// Driver Binding Protocol instance
    1313///
    14 EFI_DRIVER_BINDING_PROTOCOL gHttpBootIp4DxeDriverBinding = {
     14EFI_DRIVER_BINDING_PROTOCOL  gHttpBootIp4DxeDriverBinding = {
    1515  HttpBootIp4DxeDriverBindingSupported,
    1616  HttpBootIp4DxeDriverBindingStart,
     
    2121};
    2222
    23 EFI_DRIVER_BINDING_PROTOCOL gHttpBootIp6DxeDriverBinding = {
     23EFI_DRIVER_BINDING_PROTOCOL  gHttpBootIp6DxeDriverBinding = {
    2424  HttpBootIp6DxeDriverBindingSupported,
    2525  HttpBootIp6DxeDriverBindingStart,
     
    3030};
    3131
    32 
    33 
    3432/**
    3533  Check whether UNDI protocol supports IPv6.
     
    4442EFI_STATUS
    4543HttpBootCheckIpv6Support (
    46   IN  HTTP_BOOT_PRIVATE_DATA       *Private,
    47   OUT BOOLEAN                      *Ipv6Support
     44  IN  HTTP_BOOT_PRIVATE_DATA  *Private,
     45  OUT BOOLEAN                 *Ipv6Support
    4846  )
    4947{
    50   EFI_HANDLE                       Handle;
    51   EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;
    52   EFI_STATUS                       Status;
    53   EFI_GUID                         *InfoTypesBuffer;
    54   UINTN                            InfoTypeBufferCount;
    55   UINTN                            TypeIndex;
    56   BOOLEAN                          Supported;
    57   VOID                             *InfoBlock;
    58   UINTN                            InfoBlockSize;
     48  EFI_HANDLE                        Handle;
     49  EFI_ADAPTER_INFORMATION_PROTOCOL  *Aip;
     50  EFI_STATUS                        Status;
     51  EFI_GUID                          *InfoTypesBuffer;
     52  UINTN                             InfoTypeBufferCount;
     53  UINTN                             TypeIndex;
     54  BOOLEAN                           Supported;
     55  VOID                              *InfoBlock;
     56  UINTN                             InfoBlockSize;
    5957
    6058  ASSERT (Private != NULL && Ipv6Support != NULL);
     
    8078                  Handle,
    8179                  &gEfiAdapterInformationProtocolGuid,
    82                   (VOID *) &Aip
    83                   );
    84   if (EFI_ERROR (Status) || Aip == NULL) {
     80                  (VOID *)&Aip
     81                  );
     82  if (EFI_ERROR (Status) || (Aip == NULL)) {
    8583    return EFI_NOT_FOUND;
    8684  }
     
    8886  InfoTypesBuffer     = NULL;
    8987  InfoTypeBufferCount = 0;
    90   Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);
    91   if (EFI_ERROR (Status) || InfoTypesBuffer == NULL) {
     88  Status              = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);
     89  if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL)) {
    9290    FreePool (InfoTypesBuffer);
    9391    return EFI_NOT_FOUND;
     
    112110  InfoBlock     = NULL;
    113111  InfoBlockSize = 0;
    114   Status = Aip->GetInformation (Aip, &gEfiAdapterInfoUndiIpv6SupportGuid, &InfoBlock, &InfoBlockSize);
    115   if (EFI_ERROR (Status) || InfoBlock == NULL) {
     112  Status        = Aip->GetInformation (Aip, &gEfiAdapterInfoUndiIpv6SupportGuid, &InfoBlock, &InfoBlockSize);
     113  if (EFI_ERROR (Status) || (InfoBlock == NULL)) {
    116114    FreePool (InfoBlock);
    117115    return EFI_NOT_FOUND;
    118116  }
    119117
    120   *Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
     118  *Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *)InfoBlock)->Ipv6Support;
    121119  FreePool (InfoBlock);
    122120
     
    156154  }
    157155
    158   if (Private->Ip6Nic == NULL && Private->HttpCreated) {
     156  if ((Private->Ip6Nic == NULL) && Private->HttpCreated) {
    159157    HttpIoDestroyIo (&Private->HttpIo);
    160158    Private->HttpCreated = FALSE;
     
    162160
    163161  if (Private->Ip4Nic != NULL) {
    164 
    165162    gBS->CloseProtocol (
    166163           Private->Controller,
     
    181178    Private->Ip4Nic = NULL;
    182179  }
    183 
    184180}
    185181
     
    232228  }
    233229
    234   if (Private->Ip4Nic == NULL && Private->HttpCreated) {
    235     HttpIoDestroyIo(&Private->HttpIo);
     230  if ((Private->Ip4Nic == NULL) && Private->HttpCreated) {
     231    HttpIoDestroyIo (&Private->HttpIo);
    236232    Private->HttpCreated = FALSE;
    237233  }
    238234
    239235  if (Private->Ip6Nic != NULL) {
    240 
    241236    gBS->CloseProtocol (
    242237           Private->Controller,
     
    309304  )
    310305{
    311   EFI_STATUS                    Status;
     306  EFI_STATUS  Status;
    312307
    313308  //
     
    349344  return Status;
    350345}
    351 
    352346
    353347/**
     
    394388  )
    395389{
    396   EFI_STATUS                 Status;
    397   HTTP_BOOT_PRIVATE_DATA     *Private;
    398   EFI_DEV_PATH               *Node;
    399   EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
    400   UINT32                     *Id;
    401   BOOLEAN                    FirstStart;
     390  EFI_STATUS                Status;
     391  HTTP_BOOT_PRIVATE_DATA    *Private;
     392  EFI_DEV_PATH              *Node;
     393  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
     394  UINT32                    *Id;
     395  BOOLEAN                   FirstStart;
    402396
    403397  FirstStart = FALSE;
     
    406400                  ControllerHandle,
    407401                  &gEfiCallerIdGuid,
    408                   (VOID **) &Id,
     402                  (VOID **)&Id,
    409403                  This->DriverBindingHandle,
    410404                  ControllerHandle,
     
    413407
    414408  if (!EFI_ERROR (Status)) {
    415     Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID(Id);
     409    Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
    416410  } else {
    417411    FirstStart = TRUE;
     
    424418      return EFI_OUT_OF_RESOURCES;
    425419    }
    426     Private->Signature = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
     420
     421    Private->Signature  = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
    427422    Private->Controller = ControllerHandle;
    428423    InitializeListHead (&Private->CacheList);
     
    433428                    ControllerHandle,
    434429                    &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
    435                     (VOID **) &Private->Nii,
     430                    (VOID **)&Private->Nii,
    436431                    This->DriverBindingHandle,
    437432                    ControllerHandle,
     
    448443                    ControllerHandle,
    449444                    &gEfiDevicePathProtocolGuid,
    450                     (VOID **) &Private->ParentDevicePath,
     445                    (VOID **)&Private->ParentDevicePath,
    451446                    This->DriverBindingHandle,
    452447                    ControllerHandle,
     
    478473      goto ON_ERROR;
    479474    }
    480 
    481475  }
    482476
     
    493487    goto ON_ERROR;
    494488  }
     489
    495490  Private->Ip4Nic->Private     = Private;
    496491  Private->Ip4Nic->ImageHandle = This->DriverBindingHandle;
     
    513508                  Private->Dhcp4Child,
    514509                  &gEfiDhcp4ProtocolGuid,
    515                   (VOID **) &Private->Dhcp4,
     510                  (VOID **)&Private->Dhcp4,
    516511                  This->DriverBindingHandle,
    517512                  ControllerHandle,
     
    528523                  ControllerHandle,
    529524                  &gEfiIp4Config2ProtocolGuid,
    530                   (VOID **) &Private->Ip4Config2,
     525                  (VOID **)&Private->Ip4Config2,
    531526                  This->DriverBindingHandle,
    532527                  ControllerHandle,
     
    545540    goto ON_ERROR;
    546541  }
    547   Node->Ipv4.Header.Type = MESSAGING_DEVICE_PATH;
     542
     543  Node->Ipv4.Header.Type    = MESSAGING_DEVICE_PATH;
    548544  Node->Ipv4.Header.SubType = MSG_IPv4_DP;
    549545  SetDevicePathNodeLength (Node, sizeof (IPv4_DEVICE_PATH));
    550546  Node->Ipv4.StaticIpAddress = FALSE;
    551   DevicePath = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);
     547  DevicePath                 = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)Node);
    552548  FreePool (Node);
    553549  if (DevicePath == NULL) {
     
    564560    goto ON_ERROR;
    565561  }
    566   Node->DevPath.Type = MESSAGING_DEVICE_PATH;
     562
     563  Node->DevPath.Type    = MESSAGING_DEVICE_PATH;
    567564  Node->DevPath.SubType = MSG_URI_DP;
    568565  SetDevicePathNodeLength (Node, sizeof (EFI_DEVICE_PATH_PROTOCOL));
    569   Private->Ip4Nic->DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);
     566  Private->Ip4Nic->DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)Node);
    570567  FreePool (Node);
    571568  FreePool (DevicePath);
     
    598595                  ControllerHandle,
    599596                  &gEfiCallerIdGuid,
    600                   (VOID **) &Id,
     597                  (VOID **)&Id,
    601598                  This->DriverBindingHandle,
    602599                  Private->Ip4Nic->Controller,
     
    629626  return Status;
    630627}
    631 
    632628
    633629/**
     
    666662  )
    667663{
    668   EFI_STATUS                      Status;
    669   EFI_LOAD_FILE_PROTOCOL          *LoadFile;
    670   HTTP_BOOT_PRIVATE_DATA          *Private;
    671   EFI_HANDLE                      NicHandle;
    672   UINT32                          *Id;
     664  EFI_STATUS              Status;
     665  EFI_LOAD_FILE_PROTOCOL  *LoadFile;
     666  HTTP_BOOT_PRIVATE_DATA  *Private;
     667  EFI_HANDLE              NicHandle;
     668  UINT32                  *Id;
    673669
    674670  //
     
    678674                  ControllerHandle,
    679675                  &gEfiLoadFileProtocolGuid,
    680                   (VOID **) &LoadFile,
     676                  (VOID **)&LoadFile,
    681677                  This->DriverBindingHandle,
    682678                  ControllerHandle,
     
    698694                    NicHandle,
    699695                    &gEfiCallerIdGuid,
    700                     (VOID **) &Id,
     696                    (VOID **)&Id,
    701697                    This->DriverBindingHandle,
    702698                    ControllerHandle,
     
    706702      return Status;
    707703    }
     704
    708705    Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
    709706  } else {
    710     Private = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
     707    Private   = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
    711708    NicHandle = Private->Controller;
    712709  }
     
    716713  //
    717714  Status = HttpBootStop (Private);
    718   if (Status != EFI_SUCCESS && Status != EFI_NOT_STARTED) {
     715  if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_STARTED)) {
    719716    return Status;
    720717  }
     
    725722  HttpBootDestroyIp4Children (This, Private);
    726723
    727   if (Private->Ip4Nic == NULL && Private->Ip6Nic == NULL) {
     724  if ((Private->Ip4Nic == NULL) && (Private->Ip6Nic == NULL)) {
    728725    //
    729726    // Release the cached data.
     
    742739           );
    743740    FreePool (Private);
    744 
    745741  }
    746742
     
    798794  )
    799795{
    800   EFI_STATUS                    Status;
     796  EFI_STATUS  Status;
    801797
    802798  //
     
    837833
    838834  return Status;
    839 
    840835}
    841836
     
    883878  )
    884879{
    885   EFI_STATUS                 Status;
    886   HTTP_BOOT_PRIVATE_DATA     *Private;
    887   EFI_DEV_PATH               *Node;
    888   EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
    889   UINT32                     *Id;
    890   BOOLEAN                    Ipv6Available;
    891   BOOLEAN                    FirstStart;
     880  EFI_STATUS                Status;
     881  HTTP_BOOT_PRIVATE_DATA    *Private;
     882  EFI_DEV_PATH              *Node;
     883  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
     884  UINT32                    *Id;
     885  BOOLEAN                   Ipv6Available;
     886  BOOLEAN                   FirstStart;
    892887
    893888  FirstStart = FALSE;
     
    896891                  ControllerHandle,
    897892                  &gEfiCallerIdGuid,
    898                   (VOID **) &Id,
     893                  (VOID **)&Id,
    899894                  This->DriverBindingHandle,
    900895                  ControllerHandle,
     
    903898
    904899  if (!EFI_ERROR (Status)) {
    905     Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID(Id);
     900    Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
    906901  } else {
    907902    FirstStart = TRUE;
     
    914909      return EFI_OUT_OF_RESOURCES;
    915910    }
    916     Private->Signature = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
     911
     912    Private->Signature  = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
    917913    Private->Controller = ControllerHandle;
    918914    InitializeListHead (&Private->CacheList);
     
    923919                    ControllerHandle,
    924920                    &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
    925                     (VOID **) &Private->Nii,
     921                    (VOID **)&Private->Nii,
    926922                    This->DriverBindingHandle,
    927923                    ControllerHandle,
     
    938934                    ControllerHandle,
    939935                    &gEfiDevicePathProtocolGuid,
    940                     (VOID **) &Private->ParentDevicePath,
     936                    (VOID **)&Private->ParentDevicePath,
    941937                    This->DriverBindingHandle,
    942938                    ControllerHandle,
     
    968964      goto ON_ERROR;
    969965    }
    970 
    971966  }
    972967
     
    1000995    goto ON_ERROR;
    1001996  }
     997
    1002998  Private->Ip6Nic->Private     = Private;
    1003999  Private->Ip6Nic->ImageHandle = This->DriverBindingHandle;
     
    10191015                  Private->Dhcp6Child,
    10201016                  &gEfiDhcp6ProtocolGuid,
    1021                   (VOID **) &Private->Dhcp6,
     1017                  (VOID **)&Private->Dhcp6,
    10221018                  This->DriverBindingHandle,
    10231019                  ControllerHandle,
     
    10321028  //
    10331029  Status = NetLibCreateServiceChild (
    1034               ControllerHandle,
    1035               This->DriverBindingHandle,
    1036               &gEfiIp6ServiceBindingProtocolGuid,
    1037               &Private->Ip6Child
    1038               );
     1030             ControllerHandle,
     1031             This->DriverBindingHandle,
     1032             &gEfiIp6ServiceBindingProtocolGuid,
     1033             &Private->Ip6Child
     1034             );
    10391035  if (EFI_ERROR (Status)) {
    10401036    goto ON_ERROR;
     
    10441040                  Private->Ip6Child,
    10451041                  &gEfiIp6ProtocolGuid,
    1046                   (VOID **) &Private->Ip6,
     1042                  (VOID **)&Private->Ip6,
    10471043                  This->DriverBindingHandle,
    10481044                  ControllerHandle,
     
    10591055                  ControllerHandle,
    10601056                  &gEfiIp6ConfigProtocolGuid,
    1061                   (VOID **) &Private->Ip6Config,
     1057                  (VOID **)&Private->Ip6Config,
    10621058                  This->DriverBindingHandle,
    10631059                  ControllerHandle,
     
    10761072    goto ON_ERROR;
    10771073  }
    1078   Node->Ipv6.Header.Type = MESSAGING_DEVICE_PATH;
     1074
     1075  Node->Ipv6.Header.Type    = MESSAGING_DEVICE_PATH;
    10791076  Node->Ipv6.Header.SubType = MSG_IPv6_DP;
    1080   Node->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;
     1077  Node->Ipv6.PrefixLength   = IP6_PREFIX_LENGTH;
    10811078  SetDevicePathNodeLength (Node, sizeof (IPv6_DEVICE_PATH));
    1082   DevicePath = AppendDevicePathNode(Private->ParentDevicePath, (EFI_DEVICE_PATH*) Node);
    1083   FreePool(Node);
     1079  DevicePath = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH *)Node);
     1080  FreePool (Node);
    10841081  if (DevicePath == NULL) {
    10851082    Status = EFI_OUT_OF_RESOURCES;
     
    10951092    goto ON_ERROR;
    10961093  }
    1097   Node->DevPath.Type = MESSAGING_DEVICE_PATH;
     1094
     1095  Node->DevPath.Type    = MESSAGING_DEVICE_PATH;
    10981096  Node->DevPath.SubType = MSG_URI_DP;
    10991097  SetDevicePathNodeLength (Node, sizeof (EFI_DEVICE_PATH_PROTOCOL));
    1100   Private->Ip6Nic->DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);
     1098  Private->Ip6Nic->DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)Node);
    11011099  FreePool (Node);
    11021100  FreePool (DevicePath);
     
    11291127                  ControllerHandle,
    11301128                  &gEfiCallerIdGuid,
    1131                   (VOID **) &Id,
     1129                  (VOID **)&Id,
    11321130                  This->DriverBindingHandle,
    11331131                  Private->Ip6Nic->Controller,
     
    11501148    }
    11511149
    1152     HttpBootDestroyIp6Children(This, Private);
     1150    HttpBootDestroyIp6Children (This, Private);
    11531151    HttpBootConfigFormUnload (Private);
    11541152
     
    11961194  )
    11971195{
    1198   EFI_STATUS                      Status;
    1199   EFI_LOAD_FILE_PROTOCOL          *LoadFile;
    1200   HTTP_BOOT_PRIVATE_DATA          *Private;
    1201   EFI_HANDLE                      NicHandle;
    1202   UINT32                          *Id;
     1196  EFI_STATUS              Status;
     1197  EFI_LOAD_FILE_PROTOCOL  *LoadFile;
     1198  HTTP_BOOT_PRIVATE_DATA  *Private;
     1199  EFI_HANDLE              NicHandle;
     1200  UINT32                  *Id;
    12031201
    12041202  //
     
    12081206                  ControllerHandle,
    12091207                  &gEfiLoadFileProtocolGuid,
    1210                   (VOID **) &LoadFile,
     1208                  (VOID **)&LoadFile,
    12111209                  This->DriverBindingHandle,
    12121210                  ControllerHandle,
     
    12281226                    NicHandle,
    12291227                    &gEfiCallerIdGuid,
    1230                     (VOID **) &Id,
     1228                    (VOID **)&Id,
    12311229                    This->DriverBindingHandle,
    12321230                    ControllerHandle,
     
    12361234      return Status;
    12371235    }
     1236
    12381237    Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
    12391238  } else {
    1240     Private = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
     1239    Private   = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
    12411240    NicHandle = Private->Controller;
    12421241  }
     
    12461245  //
    12471246  Status = HttpBootStop (Private);
    1248   if (Status != EFI_SUCCESS && Status != EFI_NOT_STARTED) {
     1247  if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_STARTED)) {
    12491248    return Status;
    12501249  }
     
    12551254  HttpBootDestroyIp6Children (This, Private);
    12561255
    1257   if (Private->Ip4Nic == NULL && Private->Ip6Nic == NULL) {
     1256  if ((Private->Ip4Nic == NULL) && (Private->Ip6Nic == NULL)) {
    12581257    //
    12591258    // Release the cached data.
     
    12721271           );
    12731272    FreePool (Private);
    1274 
    12751273  }
    12761274
    12771275  return EFI_SUCCESS;
    12781276}
     1277
    12791278/**
    12801279  This is the declaration of an EFI image entry point. This entry point is
     
    12961295  )
    12971296{
    1298   EFI_STATUS   Status;
     1297  EFI_STATUS  Status;
    12991298
    13001299  //
     
    13221321             );
    13231322  if (EFI_ERROR (Status)) {
    1324     EfiLibUninstallDriverBindingComponentName2(
     1323    EfiLibUninstallDriverBindingComponentName2 (
    13251324      &gHttpBootIp4DxeDriverBinding,
    13261325      &gHttpBootDxeComponentName,
     
    13281327      );
    13291328  }
     1329
    13301330  return Status;
    13311331}
    1332 
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