]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpDriver.c
NetworkPkg: Convert files to CRLF line ending
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpDriver.c
index 2518f4e707b608e1726999d3b84f04ca93add447..5727526273c3e54151f073ebcfda3d672c2350a7 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   The driver binding and service binding protocol for HttpDxe driver.\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -44,7 +45,6 @@ EFI_DRIVER_BINDING_PROTOCOL gHttpDxeIp6DriverBinding = {
 \r
   @param[in]  Controller         The controller that has TCP4 service binding\r
                                  installed.\r
-  @param[in]  ImageHandle        The HTTP driver's image handle.\r
   @param[out] ServiceData        Point to HTTP driver private instance.\r
 \r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate some resources.\r
@@ -54,7 +54,6 @@ EFI_DRIVER_BINDING_PROTOCOL gHttpDxeIp6DriverBinding = {
 EFI_STATUS\r
 HttpCreateService (\r
   IN  EFI_HANDLE            Controller,\r
-  IN  EFI_HANDLE            ImageHandle,\r
   OUT HTTP_SERVICE          **ServiceData\r
   )\r
 {\r
@@ -71,7 +70,6 @@ HttpCreateService (
   HttpService->Signature = HTTP_SERVICE_SIGNATURE;\r
   HttpService->ServiceBinding.CreateChild = HttpServiceBindingCreateChild;\r
   HttpService->ServiceBinding.DestroyChild = HttpServiceBindingDestroyChild;\r
-  HttpService->ImageHandle = ImageHandle;\r
   HttpService->ControllerHandle = Controller;\r
   HttpService->ChildrenNumber = 0;\r
   InitializeListHead (&HttpService->ChildrenList);\r
@@ -103,13 +101,13 @@ HttpCleanService (
       gBS->CloseProtocol (\r
              HttpService->Tcp4ChildHandle,\r
              &gEfiTcp4ProtocolGuid,\r
-             HttpService->ImageHandle,\r
+             HttpService->Ip4DriverBindingHandle,\r
              HttpService->ControllerHandle\r
              );\r
     \r
       NetLibDestroyServiceChild (\r
         HttpService->ControllerHandle,\r
-        HttpService->ImageHandle,\r
+        HttpService->Ip4DriverBindingHandle,\r
         &gEfiTcp4ServiceBindingProtocolGuid,\r
         HttpService->Tcp4ChildHandle\r
         );\r
@@ -121,13 +119,13 @@ HttpCleanService (
       gBS->CloseProtocol (\r
              HttpService->Tcp6ChildHandle,\r
              &gEfiTcp6ProtocolGuid,\r
-             HttpService->ImageHandle,\r
+             HttpService->Ip6DriverBindingHandle,\r
              HttpService->ControllerHandle\r
              );\r
     \r
       NetLibDestroyServiceChild (\r
         HttpService->ControllerHandle,\r
-        HttpService->ImageHandle,\r
+        HttpService->Ip6DriverBindingHandle,\r
         &gEfiTcp6ServiceBindingProtocolGuid,\r
         HttpService->Tcp6ChildHandle\r
         );\r
@@ -381,7 +379,7 @@ HttpDxeStart (
   if (!EFI_ERROR (Status)) {\r
     HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);\r
   } else {\r
-    Status = HttpCreateService (ControllerHandle, This->DriverBindingHandle, &HttpService);\r
+    Status = HttpCreateService (ControllerHandle, &HttpService);\r
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
@@ -404,7 +402,8 @@ HttpDxeStart (
   }\r
 \r
   if (IpVersion == IP_VERSION_4) {\r
-    \r
+    HttpService->Ip4DriverBindingHandle = This->DriverBindingHandle;\r
+\r
     if (HttpService->Tcp4ChildHandle == NULL) {\r
       //\r
       // Create a TCP4 child instance, but do not configure it. This will establish the parent-child relationship.\r
@@ -439,7 +438,8 @@ HttpDxeStart (
 \r
   } else {\r
     UsingIpv6 = TRUE;\r
-    \r
+    HttpService->Ip6DriverBindingHandle = This->DriverBindingHandle;\r
+\r
     if (HttpService->Tcp6ChildHandle == NULL) {\r
       //\r
       // Create a TCP6 child instance, but do not configure it. This will establish the parent-child relationship.\r
@@ -910,7 +910,7 @@ HttpDxeIp6DriverBindingStop (
 \r
   @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
   @retval EFI_INVALID_PARAMETER This is NULL, or ChildHandle is NULL.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough resources availabe to create\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to create\r
                                 the child.\r
   @retval other                 The child handle was not created.\r
 \r
@@ -939,6 +939,8 @@ HttpServiceBindingCreateChild (
   \r
   HttpInstance->Signature = HTTP_PROTOCOL_SIGNATURE;\r
   HttpInstance->Service   = HttpService;\r
+  HttpInstance->Method = HttpMethodMax;\r
+\r
   CopyMem (&HttpInstance->Http, &mEfiHttpTemplate, sizeof (HttpInstance->Http));\r
   NetMapInit (&HttpInstance->TxTokens);\r
   NetMapInit (&HttpInstance->RxTokens);\r