56 ASSERT (ServiceData !=
NULL);
60 if (HttpService ==
NULL) {
61 return EFI_OUT_OF_RESOURCES;
64 HttpService->Signature = HTTP_SERVICE_SIGNATURE;
67 HttpService->ControllerHandle = Controller;
68 HttpService->ChildrenNumber = 0;
71 *ServiceData = HttpService;
89 if (HttpService ==
NULL) {
94 if (HttpService->Tcp4ChildHandle !=
NULL) {
96 HttpService->Tcp4ChildHandle,
97 &gEfiTcp4ProtocolGuid,
98 HttpService->Ip4DriverBindingHandle,
99 HttpService->ControllerHandle
103 HttpService->ControllerHandle,
104 HttpService->Ip4DriverBindingHandle,
105 &gEfiTcp4ServiceBindingProtocolGuid,
106 HttpService->Tcp4ChildHandle
109 HttpService->Tcp4ChildHandle =
NULL;
112 if (HttpService->Tcp6ChildHandle !=
NULL) {
114 HttpService->Tcp6ChildHandle,
115 &gEfiTcp6ProtocolGuid,
116 HttpService->Ip6DriverBindingHandle,
117 HttpService->ControllerHandle
121 HttpService->ControllerHandle,
122 HttpService->Ip6DriverBindingHandle,
123 &gEfiTcp6ServiceBindingProtocolGuid,
124 HttpService->Tcp6ChildHandle
127 HttpService->Tcp6ChildHandle =
NULL;
147 gBS->LocateProtocol (
148 &gEfiHttpUtilitiesProtocolGuid,
150 (VOID **)&mHttpUtilities
156 if ((mHttpUtilities !=
NULL) && (Event !=
NULL)) {
157 gBS->CloseEvent (Event);
183 gBS->LocateProtocol (
184 &gEfiHttpUtilitiesProtocolGuid,
186 (VOID **)&mHttpUtilities
189 if (mHttpUtilities ==
NULL) {
194 &gEfiHttpUtilitiesProtocolGuid,
213 if (EFI_ERROR (Status)) {
220 &gHttpDxeIp6DriverBinding,
225 if (EFI_ERROR (Status)) {
256 UINTN NumberOfChildren;
259 if ((Entry ==
NULL) || (Context ==
NULL)) {
260 return EFI_INVALID_PARAMETER;
263 HttpInstance = NET_LIST_USER_STRUCT_S (Entry,
HTTP_PROTOCOL, Link, HTTP_PROTOCOL_SIGNATURE);
272 return ServiceBinding->DestroyChild (ServiceBinding, HttpInstance->Handle);
299 EFI_GUID *TcpServiceBindingProtocolGuid;
301 if (IpVersion == IP_VERSION_4) {
302 TcpServiceBindingProtocolGuid = &gEfiTcp4ServiceBindingProtocolGuid;
304 TcpServiceBindingProtocolGuid = &gEfiTcp6ServiceBindingProtocolGuid;
307 Status =
gBS->OpenProtocol (
309 TcpServiceBindingProtocolGuid,
311 This->DriverBindingHandle,
313 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
316 if (EFI_ERROR (Status)) {
317 return EFI_UNSUPPORTED;
359 Status =
gBS->OpenProtocol (
361 &gEfiHttpServiceBindingProtocolGuid,
362 (VOID **)&ServiceBinding,
363 This->DriverBindingHandle,
365 EFI_OPEN_PROTOCOL_GET_PROTOCOL
368 if (!EFI_ERROR (Status)) {
369 HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);
372 if (EFI_ERROR (Status)) {
376 ASSERT (HttpService !=
NULL);
381 Status =
gBS->InstallMultipleProtocolInterfaces (
383 &gEfiHttpServiceBindingProtocolGuid,
384 &HttpService->ServiceBinding,
388 if (EFI_ERROR (Status)) {
393 if (IpVersion == IP_VERSION_4) {
394 HttpService->Ip4DriverBindingHandle = This->DriverBindingHandle;
396 if (HttpService->Tcp4ChildHandle ==
NULL) {
402 This->DriverBindingHandle,
403 &gEfiTcp4ServiceBindingProtocolGuid,
404 &HttpService->Tcp4ChildHandle
407 if (EFI_ERROR (Status)) {
411 Status =
gBS->OpenProtocol (
412 HttpService->Tcp4ChildHandle,
413 &gEfiTcp4ProtocolGuid,
415 This->DriverBindingHandle,
417 EFI_OPEN_PROTOCOL_BY_DRIVER
420 if (EFI_ERROR (Status)) {
424 return EFI_ALREADY_STARTED;
428 HttpService->Ip6DriverBindingHandle = This->DriverBindingHandle;
430 if (HttpService->Tcp6ChildHandle ==
NULL) {
436 This->DriverBindingHandle,
437 &gEfiTcp6ServiceBindingProtocolGuid,
438 &HttpService->Tcp6ChildHandle
441 if (EFI_ERROR (Status)) {
445 Status =
gBS->OpenProtocol (
446 HttpService->Tcp6ChildHandle,
447 &gEfiTcp6ProtocolGuid,
449 This->DriverBindingHandle,
451 EFI_OPEN_PROTOCOL_BY_DRIVER
454 if (EFI_ERROR (Status)) {
458 return EFI_ALREADY_STARTED;
466 if (HttpService !=
NULL) {
468 Status =
gBS->UninstallMultipleProtocolInterfaces (
470 &gEfiHttpServiceBindingProtocolGuid,
471 &HttpService->ServiceBinding,
474 if (!EFI_ERROR (Status)) {
475 if ((HttpService->Tcp4ChildHandle ==
NULL) && (HttpService->Tcp6ChildHandle ==
NULL)) {
523 if (IpVersion == IP_VERSION_4) {
531 if (NicHandle ==
NULL) {
535 Status =
gBS->OpenProtocol (
537 &gEfiHttpServiceBindingProtocolGuid,
538 (VOID **)&ServiceBinding,
539 This->DriverBindingHandle,
541 EFI_OPEN_PROTOCOL_GET_PROTOCOL
544 if (!EFI_ERROR (Status)) {
545 HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);
547 if (NumberOfChildren != 0) {
551 List = &HttpService->ChildrenList;
552 Context.ServiceBinding = ServiceBinding;
553 Context.NumberOfChildren = NumberOfChildren;
554 Context.ChildHandleBuffer = ChildHandleBuffer;
564 if ((HttpService->Tcp4ChildHandle ==
NULL) && (HttpService->Tcp6ChildHandle ==
NULL)) {
565 gBS->UninstallProtocolInterface (
567 &gEfiHttpServiceBindingProtocolGuid,
919 if ((This ==
NULL) || (ChildHandle ==
NULL)) {
920 return EFI_INVALID_PARAMETER;
923 HttpService = HTTP_SERVICE_FROM_PROTOCOL (This);
925 if (HttpInstance ==
NULL) {
926 return EFI_OUT_OF_RESOURCES;
929 HttpInstance->Signature = HTTP_PROTOCOL_SIGNATURE;
930 HttpInstance->Service = HttpService;
931 HttpInstance->Method = HttpMethodMax;
933 CopyMem (&HttpInstance->Http, &mEfiHttpTemplate, sizeof (HttpInstance->Http));
940 Status =
gBS->InstallMultipleProtocolInterfaces (
942 &gEfiHttpProtocolGuid,
947 if (EFI_ERROR (Status)) {
951 HttpInstance->Handle = *ChildHandle;
956 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
959 HttpService->ChildrenNumber++;
961 gBS->RestoreTPL (OldTpl);
1003 if ((This ==
NULL) || (ChildHandle ==
NULL)) {
1004 return EFI_INVALID_PARAMETER;
1007 HttpService = HTTP_SERVICE_FROM_PROTOCOL (This);
1008 Status =
gBS->OpenProtocol (
1010 &gEfiHttpProtocolGuid,
1014 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1016 if (EFI_ERROR (Status)) {
1017 return EFI_UNSUPPORTED;
1020 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (Http);
1021 if (HttpInstance->Service != HttpService) {
1022 return EFI_INVALID_PARAMETER;
1025 if (HttpInstance->InDestroy) {
1029 HttpInstance->InDestroy =
TRUE;
1034 Status =
gBS->UninstallProtocolInterface (
1036 &gEfiHttpProtocolGuid,
1040 if (EFI_ERROR (Status)) {
1041 HttpInstance->InDestroy =
FALSE;
1047 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1050 HttpService->ChildrenNumber--;
1052 gBS->RestoreTPL (OldTpl);
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
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 AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI HttpDxeSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN UINT8 IpVersion)
EFI_STATUS EFIAPI HttpDxeStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer, IN UINT8 IpVersion)
EFI_STATUS EFIAPI HttpDxeIp4DriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI HttpDxeStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN UINT8 IpVersion)
VOID EFIAPI HttpUtilitiesInstalledCallback(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI HttpDxeIp6DriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI HttpDestroyChildEntryInHandleBuffer(IN LIST_ENTRY *Entry, IN VOID *Context)
EFI_STATUS EFIAPI HttpServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
VOID HttpCleanService(IN HTTP_SERVICE *HttpService, IN BOOLEAN UsingIpv6)
EFI_STATUS HttpCreateService(IN EFI_HANDLE Controller, OUT HTTP_SERVICE **ServiceData)
EFI_STATUS EFIAPI HttpDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI HttpDxeIp4DriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_DRIVER_BINDING_PROTOCOL gHttpDxeIp4DriverBinding
EFI_STATUS EFIAPI HttpDxeIp6DriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI HttpDxeIp6DriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI HttpServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI HttpDxeIp4DriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
VOID HttpCleanProtocol(IN HTTP_PROTOCOL *HttpInstance)
VOID EFIAPI NetMapClean(IN OUT NET_MAP *Map)
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)
VOID EFIAPI NetMapInit(IN OUT NET_MAP *Map)
BOOLEAN EFIAPI NetIsInHandleBuffer(IN EFI_HANDLE Handle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_HANDLE EFIAPI NetLibGetNicHandle(IN EFI_HANDLE Controller, IN EFI_GUID *ProtocolGuid)
EFI_STATUS EFIAPI NetDestroyLinkList(IN LIST_ENTRY *List, IN NET_DESTROY_LINK_LIST_CALLBACK CallBack, IN VOID *Context OPTIONAL, OUT UINTN *ListLength OPTIONAL)
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2
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_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
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)