18 HTTP_BOOT_DXE_VERSION,
27 HTTP_BOOT_DXE_VERSION,
45 OUT BOOLEAN *Ipv6Support
52 UINTN InfoTypeBufferCount;
58 ASSERT (Private !=
NULL && Ipv6Support !=
NULL);
63 if (Private->Nii !=
NULL) {
64 *Ipv6Support = Private->Nii->Ipv6Supported;
77 Status =
gBS->HandleProtocol (
79 &gEfiAdapterInformationProtocolGuid,
82 if (EFI_ERROR (Status) || (Aip ==
NULL)) {
86 InfoTypesBuffer =
NULL;
87 InfoTypeBufferCount = 0;
88 Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);
89 if (EFI_ERROR (Status) || (InfoTypesBuffer ==
NULL)) {
95 for (TypeIndex = 0; TypeIndex < InfoTypeBufferCount; TypeIndex++) {
96 if (
CompareGuid (&InfoTypesBuffer[TypeIndex], &gEfiAdapterInfoUndiIpv6SupportGuid)) {
104 return EFI_NOT_FOUND;
112 Status = Aip->GetInformation (Aip, &gEfiAdapterInfoUndiIpv6SupportGuid, &InfoBlock, &InfoBlockSize);
113 if (EFI_ERROR (Status) || (InfoBlock ==
NULL)) {
115 return EFI_NOT_FOUND;
137 ASSERT (This !=
NULL);
138 ASSERT (Private !=
NULL);
140 if (Private->Dhcp4Child !=
NULL) {
143 &gEfiDhcp4ProtocolGuid,
144 This->DriverBindingHandle,
150 This->DriverBindingHandle,
151 &gEfiDhcp4ServiceBindingProtocolGuid,
156 if ((Private->Ip6Nic ==
NULL) && Private->HttpCreated) {
158 Private->HttpCreated =
FALSE;
161 if (Private->Ip4Nic !=
NULL) {
165 This->DriverBindingHandle,
166 Private->Ip4Nic->Controller
169 gBS->UninstallMultipleProtocolInterfaces (
170 Private->Ip4Nic->Controller,
171 &gEfiLoadFileProtocolGuid,
172 &Private->Ip4Nic->LoadFile,
173 &gEfiDevicePathProtocolGuid,
174 Private->Ip4Nic->DevicePath,
178 Private->Ip4Nic =
NULL;
195 ASSERT (This !=
NULL);
196 ASSERT (Private !=
NULL);
198 if (Private->Ip6Child !=
NULL) {
201 &gEfiIp6ProtocolGuid,
202 This->DriverBindingHandle,
208 This->DriverBindingHandle,
209 &gEfiIp6ServiceBindingProtocolGuid,
214 if (Private->Dhcp6Child !=
NULL) {
217 &gEfiDhcp6ProtocolGuid,
218 This->DriverBindingHandle,
224 This->DriverBindingHandle,
225 &gEfiDhcp6ServiceBindingProtocolGuid,
230 if ((Private->Ip4Nic ==
NULL) && Private->HttpCreated) {
232 Private->HttpCreated =
FALSE;
235 if (Private->Ip6Nic !=
NULL) {
239 This->DriverBindingHandle,
240 Private->Ip6Nic->Controller
243 gBS->UninstallMultipleProtocolInterfaces (
244 Private->Ip6Nic->Controller,
245 &gEfiLoadFileProtocolGuid,
246 &Private->Ip6Nic->LoadFile,
247 &gEfiDevicePathProtocolGuid,
248 Private->Ip6Nic->DevicePath,
252 Private->Ip6Nic =
NULL;
311 Status =
gBS->OpenProtocol (
313 &gEfiDhcp4ServiceBindingProtocolGuid,
315 This->DriverBindingHandle,
317 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
319 if (EFI_ERROR (Status)) {
323 Status =
gBS->OpenProtocol (
325 &gEfiHttpServiceBindingProtocolGuid,
327 This->DriverBindingHandle,
329 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
331 if (EFI_ERROR (Status)) {
335 Status =
gBS->OpenProtocol (
337 &gEfiDevicePathProtocolGuid,
339 This->DriverBindingHandle,
341 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
399 Status =
gBS->OpenProtocol (
403 This->DriverBindingHandle,
405 EFI_OPEN_PROTOCOL_GET_PROTOCOL
408 if (!EFI_ERROR (Status)) {
409 Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
417 if (Private ==
NULL) {
418 return EFI_OUT_OF_RESOURCES;
421 Private->Signature = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
422 Private->Controller = ControllerHandle;
427 Status =
gBS->OpenProtocol (
429 &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
430 (VOID **)&Private->Nii,
431 This->DriverBindingHandle,
433 EFI_OPEN_PROTOCOL_GET_PROTOCOL
435 if (EFI_ERROR (Status)) {
442 Status =
gBS->OpenProtocol (
444 &gEfiDevicePathProtocolGuid,
445 (VOID **)&Private->ParentDevicePath,
446 This->DriverBindingHandle,
448 EFI_OPEN_PROTOCOL_GET_PROTOCOL
450 if (EFI_ERROR (Status)) {
458 if (EFI_ERROR (Status)) {
466 Status =
gBS->InstallProtocolInterface (
472 if (EFI_ERROR (Status)) {
477 if (Private->Ip4Nic !=
NULL) {
485 if (Private->Ip4Nic ==
NULL) {
486 Status = EFI_OUT_OF_RESOURCES;
490 Private->Ip4Nic->Private = Private;
491 Private->Ip4Nic->ImageHandle = This->DriverBindingHandle;
492 Private->Ip4Nic->Signature = HTTP_BOOT_VIRTUAL_NIC_SIGNATURE;
499 This->DriverBindingHandle,
500 &gEfiDhcp4ServiceBindingProtocolGuid,
503 if (EFI_ERROR (Status)) {
507 Status =
gBS->OpenProtocol (
509 &gEfiDhcp4ProtocolGuid,
510 (VOID **)&Private->Dhcp4,
511 This->DriverBindingHandle,
513 EFI_OPEN_PROTOCOL_BY_DRIVER
515 if (EFI_ERROR (Status)) {
522 Status =
gBS->OpenProtocol (
524 &gEfiIp4Config2ProtocolGuid,
525 (VOID **)&Private->Ip4Config2,
526 This->DriverBindingHandle,
528 EFI_OPEN_PROTOCOL_GET_PROTOCOL
530 if (EFI_ERROR (Status)) {
539 Status = EFI_OUT_OF_RESOURCES;
549 if (DevicePath ==
NULL) {
550 Status = EFI_OUT_OF_RESOURCES;
559 Status = EFI_OUT_OF_RESOURCES;
569 if (Private->Ip4Nic->DevicePath ==
NULL) {
570 Status = EFI_OUT_OF_RESOURCES;
578 Status =
gBS->InstallMultipleProtocolInterfaces (
579 &Private->Ip4Nic->Controller,
580 &gEfiLoadFileProtocolGuid,
581 &Private->Ip4Nic->LoadFile,
582 &gEfiDevicePathProtocolGuid,
583 Private->Ip4Nic->DevicePath,
586 if (EFI_ERROR (Status)) {
594 Status =
gBS->OpenProtocol (
598 This->DriverBindingHandle,
599 Private->Ip4Nic->Controller,
600 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
602 if (EFI_ERROR (Status)) {
609 if (Private !=
NULL) {
611 gBS->UninstallProtocolInterface (
673 Status =
gBS->OpenProtocol (
675 &gEfiLoadFileProtocolGuid,
677 This->DriverBindingHandle,
679 EFI_OPEN_PROTOCOL_GET_PROTOCOL
681 if (EFI_ERROR (Status)) {
686 if (NicHandle ==
NULL) {
693 Status =
gBS->OpenProtocol (
697 This->DriverBindingHandle,
699 EFI_OPEN_PROTOCOL_GET_PROTOCOL
701 if (EFI_ERROR (Status)) {
705 Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
707 Private = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
708 NicHandle = Private->Controller;
715 if ((Status !=
EFI_SUCCESS) && (Status != EFI_NOT_STARTED)) {
724 if ((Private->Ip4Nic ==
NULL) && (Private->Ip6Nic ==
NULL)) {
735 gBS->UninstallProtocolInterface (
801 Status =
gBS->OpenProtocol (
803 &gEfiDhcp6ServiceBindingProtocolGuid,
805 This->DriverBindingHandle,
807 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
809 if (EFI_ERROR (Status)) {
813 Status =
gBS->OpenProtocol (
815 &gEfiHttpServiceBindingProtocolGuid,
817 This->DriverBindingHandle,
819 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
821 if (EFI_ERROR (Status)) {
825 Status =
gBS->OpenProtocol (
827 &gEfiDevicePathProtocolGuid,
829 This->DriverBindingHandle,
831 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
885 BOOLEAN Ipv6Available;
890 Status =
gBS->OpenProtocol (
894 This->DriverBindingHandle,
896 EFI_OPEN_PROTOCOL_GET_PROTOCOL
899 if (!EFI_ERROR (Status)) {
900 Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
908 if (Private ==
NULL) {
909 return EFI_OUT_OF_RESOURCES;
912 Private->Signature = HTTP_BOOT_PRIVATE_DATA_SIGNATURE;
913 Private->Controller = ControllerHandle;
918 Status =
gBS->OpenProtocol (
920 &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
921 (VOID **)&Private->Nii,
922 This->DriverBindingHandle,
924 EFI_OPEN_PROTOCOL_GET_PROTOCOL
926 if (EFI_ERROR (Status)) {
933 Status =
gBS->OpenProtocol (
935 &gEfiDevicePathProtocolGuid,
936 (VOID **)&Private->ParentDevicePath,
937 This->DriverBindingHandle,
939 EFI_OPEN_PROTOCOL_GET_PROTOCOL
941 if (EFI_ERROR (Status)) {
949 if (EFI_ERROR (Status)) {
957 Status =
gBS->InstallProtocolInterface (
963 if (EFI_ERROR (Status)) {
972 if (EFI_ERROR (Status)) {
977 Ipv6Available =
TRUE;
980 if (!Ipv6Available) {
981 Status = EFI_UNSUPPORTED;
985 if (Private->Ip6Nic !=
NULL) {
993 if (Private->Ip6Nic ==
NULL) {
994 Status = EFI_OUT_OF_RESOURCES;
998 Private->Ip6Nic->Private = Private;
999 Private->Ip6Nic->ImageHandle = This->DriverBindingHandle;
1000 Private->Ip6Nic->Signature = HTTP_BOOT_VIRTUAL_NIC_SIGNATURE;
1006 This->DriverBindingHandle,
1007 &gEfiDhcp6ServiceBindingProtocolGuid,
1008 &Private->Dhcp6Child
1010 if (EFI_ERROR (Status)) {
1014 Status =
gBS->OpenProtocol (
1015 Private->Dhcp6Child,
1016 &gEfiDhcp6ProtocolGuid,
1017 (VOID **)&Private->Dhcp6,
1018 This->DriverBindingHandle,
1020 EFI_OPEN_PROTOCOL_BY_DRIVER
1022 if (EFI_ERROR (Status)) {
1031 This->DriverBindingHandle,
1032 &gEfiIp6ServiceBindingProtocolGuid,
1035 if (EFI_ERROR (Status)) {
1039 Status =
gBS->OpenProtocol (
1041 &gEfiIp6ProtocolGuid,
1042 (VOID **)&Private->Ip6,
1043 This->DriverBindingHandle,
1045 EFI_OPEN_PROTOCOL_BY_DRIVER
1047 if (EFI_ERROR (Status)) {
1054 Status =
gBS->OpenProtocol (
1056 &gEfiIp6ConfigProtocolGuid,
1057 (VOID **)&Private->Ip6Config,
1058 This->DriverBindingHandle,
1060 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1062 if (EFI_ERROR (Status)) {
1071 Status = EFI_OUT_OF_RESOURCES;
1081 if (DevicePath ==
NULL) {
1082 Status = EFI_OUT_OF_RESOURCES;
1091 Status = EFI_OUT_OF_RESOURCES;
1101 if (Private->Ip6Nic->DevicePath ==
NULL) {
1102 Status = EFI_OUT_OF_RESOURCES;
1110 Status =
gBS->InstallMultipleProtocolInterfaces (
1111 &Private->Ip6Nic->Controller,
1112 &gEfiLoadFileProtocolGuid,
1113 &Private->Ip6Nic->LoadFile,
1114 &gEfiDevicePathProtocolGuid,
1115 Private->Ip6Nic->DevicePath,
1118 if (EFI_ERROR (Status)) {
1126 Status =
gBS->OpenProtocol (
1130 This->DriverBindingHandle,
1131 Private->Ip6Nic->Controller,
1132 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
1134 if (EFI_ERROR (Status)) {
1141 if (Private !=
NULL) {
1143 gBS->UninstallProtocolInterface (
1205 Status =
gBS->OpenProtocol (
1207 &gEfiLoadFileProtocolGuid,
1209 This->DriverBindingHandle,
1211 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1213 if (EFI_ERROR (Status)) {
1218 if (NicHandle ==
NULL) {
1225 Status =
gBS->OpenProtocol (
1229 This->DriverBindingHandle,
1231 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1233 if (EFI_ERROR (Status)) {
1237 Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID (Id);
1239 Private = HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE (LoadFile);
1240 NicHandle = Private->Controller;
1247 if ((Status !=
EFI_SUCCESS) && (Status != EFI_NOT_STARTED)) {
1256 if ((Private->Ip4Nic ==
NULL) && (Private->Ip6Nic ==
NULL)) {
1267 gBS->UninstallProtocolInterface (
1310 if (EFI_ERROR (Status)) {
1317 &gHttpBootIp6DxeDriverBinding,
1322 if (EFI_ERROR (Status)) {
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
#define MESSAGING_DEVICE_PATH
UINT16 EFIAPI SetDevicePathNodeLength(IN OUT VOID *Node, IN UINTN Length)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID HttpBootFreeCacheList(IN HTTP_BOOT_PRIVATE_DATA *Private)
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2
EFI_STATUS HttpBootConfigFormInit(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootConfigFormUnload(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootCheckIpv6Support(IN HTTP_BOOT_PRIVATE_DATA *Private, OUT BOOLEAN *Ipv6Support)
EFI_STATUS EFIAPI HttpBootIp6DxeDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
VOID HttpBootDestroyIp4Children(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS EFIAPI HttpBootIp4DxeDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
VOID HttpBootDestroyIp6Children(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS EFIAPI HttpBootIp4DxeDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI HttpBootIp6DxeDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI HttpBootIp4DxeDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI HttpBootDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_DRIVER_BINDING_PROTOCOL gHttpBootIp4DxeDriverBinding
EFI_STATUS EFIAPI HttpBootIp6DxeDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile
EFI_STATUS HttpBootStop(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_HANDLE HttpBootGetNicByIp4Children(IN EFI_HANDLE ControllerHandle)
EFI_HANDLE HttpBootGetNicByIp6Children(IN EFI_HANDLE ControllerHandle)
VOID HttpIoDestroyIo(IN HTTP_IO *HttpIo)
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
EFI_HANDLE EFIAPI NetLibGetSnpHandle(IN EFI_HANDLE ServiceHandle, OUT EFI_SIMPLE_NETWORK_PROTOCOL **Snp OPTIONAL)
EFI_STATUS EFIAPI EfiLibUninstallDriverBindingComponentName2(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)