]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpDriver.c
NetworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpDriver.c
index 0bde012ebbb0b4d844e00024c3bf09ff60873847..7c64d421511977c24c6b143d74cc2dbcde3ffefb 100644 (file)
@@ -1,16 +1,10 @@
 /** @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 - 2018, 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
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -45,7 +39,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
@@ -55,7 +48,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
@@ -72,11 +64,10 @@ 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
-  \r
+\r
   *ServiceData = HttpService;\r
   return EFI_SUCCESS;\r
 }\r
@@ -94,8 +85,8 @@ HttpCleanService (
   IN HTTP_SERVICE     *HttpService,\r
   IN BOOLEAN          UsingIpv6\r
   )\r
-{ \r
-  \r
+{\r
+\r
   if (HttpService == NULL) {\r
     return ;\r
   }\r
@@ -104,17 +95,17 @@ HttpCleanService (
       gBS->CloseProtocol (\r
              HttpService->Tcp4ChildHandle,\r
              &gEfiTcp4ProtocolGuid,\r
-             HttpService->ImageHandle,\r
+             HttpService->Ip4DriverBindingHandle,\r
              HttpService->ControllerHandle\r
              );\r
-    \r
+\r
       NetLibDestroyServiceChild (\r
         HttpService->ControllerHandle,\r
-        HttpService->ImageHandle,\r
+        HttpService->Ip4DriverBindingHandle,\r
         &gEfiTcp4ServiceBindingProtocolGuid,\r
         HttpService->Tcp4ChildHandle\r
         );\r
-      \r
+\r
       HttpService->Tcp4ChildHandle = NULL;\r
     }\r
   } else {\r
@@ -122,21 +113,21 @@ HttpCleanService (
       gBS->CloseProtocol (\r
              HttpService->Tcp6ChildHandle,\r
              &gEfiTcp6ProtocolGuid,\r
-             HttpService->ImageHandle,\r
+             HttpService->Ip6DriverBindingHandle,\r
              HttpService->ControllerHandle\r
              );\r
-    \r
+\r
       NetLibDestroyServiceChild (\r
         HttpService->ControllerHandle,\r
-        HttpService->ImageHandle,\r
+        HttpService->Ip6DriverBindingHandle,\r
         &gEfiTcp6ServiceBindingProtocolGuid,\r
         HttpService->Tcp6ChildHandle\r
         );\r
-      \r
+\r
       HttpService->Tcp6ChildHandle = NULL;\r
     }\r
   }\r
-  \r
+\r
 }\r
 \r
 /**\r
@@ -155,11 +146,11 @@ HttpUtilitiesInstalledCallback (
   )\r
 {\r
   gBS->LocateProtocol (\r
-         &gEfiHttpUtilitiesProtocolGuid, \r
-         NULL, \r
+         &gEfiHttpUtilitiesProtocolGuid,\r
+         NULL,\r
          (VOID **) &mHttpUtilities\r
          );\r
\r
+\r
   //\r
   // Close the event if Http utilities protocol is loacted.\r
   //\r
@@ -186,13 +177,13 @@ HttpDxeDriverEntryPoint (
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-{ \r
+{\r
   EFI_STATUS     Status;\r
   VOID           *Registration;\r
 \r
   gBS->LocateProtocol (\r
-         &gEfiHttpUtilitiesProtocolGuid, \r
-         NULL, \r
+         &gEfiHttpUtilitiesProtocolGuid,\r
+         NULL,\r
          (VOID **) &mHttpUtilities\r
          );\r
 \r
@@ -233,23 +224,18 @@ HttpDxeDriverEntryPoint (
              &gHttpDxeComponentName2\r
              );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-           ImageHandle,\r
-           &gEfiDriverBindingProtocolGuid,\r
-           &gHttpDxeIp4DriverBinding,\r
-           &gEfiComponentName2ProtocolGuid,\r
-           &gHttpDxeComponentName2,\r
-           &gEfiComponentNameProtocolGuid,\r
-           &gHttpDxeComponentName,\r
-           NULL\r
-           );\r
+    EfiLibUninstallDriverBindingComponentName2 (\r
+      &gHttpDxeIp4DriverBinding,\r
+      &gHttpDxeComponentName,\r
+      &gHttpDxeComponentName2\r
+      );\r
   }\r
   return Status;\r
 }\r
 \r
 /**\r
   Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
-  \r
+\r
   @param[in]    Entry           The entry to be removed.\r
   @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
 \r
@@ -295,7 +281,7 @@ HttpDestroyChildEntryInHandleBuffer (
   @param[in]  RemainingDevicePath Optional parameter used to pick a specific child\r
                                   device to be started.\r
   @param[in]  IpVersion           IP_VERSION_4 or IP_VERSION_6.\r
-  \r
+\r
   @retval EFI_SUCCESS         This driver supports this device.\r
   @retval EFI_UNSUPPORTED     This driver does not support this device.\r
 \r
@@ -382,13 +368,13 @@ 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
-    \r
+\r
     ASSERT (HttpService != NULL);\r
-      \r
+\r
     //\r
     // Install the HttpServiceBinding Protocol onto Controller\r
     //\r
@@ -398,14 +384,15 @@ HttpDxeStart (
                     &HttpService->ServiceBinding,\r
                     NULL\r
                     );\r
-    \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto ON_ERROR;\r
     }\r
   }\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
@@ -416,11 +403,11 @@ HttpDxeStart (
                  &gEfiTcp4ServiceBindingProtocolGuid,\r
                  &HttpService->Tcp4ChildHandle\r
                  );\r
-      \r
+\r
       if (EFI_ERROR (Status)) {\r
         goto ON_ERROR;\r
       }\r
-      \r
+\r
       Status = gBS->OpenProtocol (\r
                       HttpService->Tcp4ChildHandle,\r
                       &gEfiTcp4ProtocolGuid,\r
@@ -429,18 +416,19 @@ HttpDxeStart (
                       ControllerHandle,\r
                       EFI_OPEN_PROTOCOL_BY_DRIVER\r
                       );\r
-                      \r
+\r
       if (EFI_ERROR (Status)) {\r
         goto ON_ERROR;\r
       }\r
-      \r
+\r
     } else {\r
       return EFI_ALREADY_STARTED;\r
     }\r
 \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
@@ -451,11 +439,11 @@ HttpDxeStart (
                  &gEfiTcp6ServiceBindingProtocolGuid,\r
                  &HttpService->Tcp6ChildHandle\r
                  );\r
-      \r
+\r
       if (EFI_ERROR (Status)) {\r
         goto ON_ERROR;\r
       }\r
-      \r
+\r
       Status = gBS->OpenProtocol (\r
                       HttpService->Tcp6ChildHandle,\r
                       &gEfiTcp6ProtocolGuid,\r
@@ -464,11 +452,11 @@ HttpDxeStart (
                       ControllerHandle,\r
                       EFI_OPEN_PROTOCOL_BY_DRIVER\r
                       );\r
-                      \r
+\r
       if (EFI_ERROR (Status)) {\r
         goto ON_ERROR;\r
       }\r
-      \r
+\r
     } else {\r
       return EFI_ALREADY_STARTED;\r
     }\r
@@ -476,16 +464,16 @@ HttpDxeStart (
   }\r
 \r
   return EFI_SUCCESS;\r
-  \r
+\r
 ON_ERROR:\r
-    \r
+\r
   if (HttpService != NULL) {\r
     HttpCleanService (HttpService, UsingIpv6);\r
     if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {\r
       FreePool (HttpService);\r
     }\r
   }\r
-      \r
+\r
   return Status;\r
 \r
 \r
@@ -552,9 +540,9 @@ HttpDxeStop (
                   );\r
 \r
   if (!EFI_ERROR (Status)) {\r
-    \r
+\r
     HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);\r
-    \r
+\r
     if (NumberOfChildren != 0) {\r
       //\r
       // Destroy the HTTP child instance in ChildHandleBuffer.\r
@@ -570,9 +558,9 @@ HttpDxeStop (
                  NULL\r
                  );\r
     } else {\r
-    \r
+\r
       HttpCleanService (HttpService, UsingIpv6);\r
-      \r
+\r
       if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {\r
         gBS->UninstallProtocolInterface (\r
                NicHandle,\r
@@ -582,41 +570,41 @@ HttpDxeStop (
         FreePool (HttpService);\r
       }\r
       Status = EFI_SUCCESS;\r
-    }  \r
+    }\r
   }\r
-  \r
+\r
   return Status;\r
 \r
 }\r
 \r
 /**\r
-  Tests to see if this driver supports a given controller. If a child device is provided, \r
+  Tests to see if this driver supports a given controller. If a child device is provided,\r
   it further tests to see if this driver supports creating a handle for the specified child device.\r
 \r
-  This function checks to see if the driver specified by This supports the device specified by \r
-  ControllerHandle. Drivers will typically use the device path attached to \r
-  ControllerHandle and/or the services from the bus I/O abstraction attached to \r
-  ControllerHandle to determine if the driver supports ControllerHandle. This function \r
-  may be called many times during platform initialization. In order to reduce boot times, the tests \r
-  performed by this function must be very small, and take as little time as possible to execute. This \r
-  function must not change the state of any hardware devices, and this function must be aware that the \r
-  device specified by ControllerHandle may already be managed by the same driver or a \r
-  different driver. This function must match its calls to AllocatePages() with FreePages(), \r
-  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().  \r
-  Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
-  already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+  This function checks to see if the driver specified by This supports the device specified by\r
+  ControllerHandle. Drivers will typically use the device path attached to\r
+  ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+  ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+  may be called many times during platform initialization. In order to reduce boot times, the tests\r
+  performed by this function must be very small, and take as little time as possible to execute. This\r
+  function must not change the state of any hardware devices, and this function must be aware that the\r
+  device specified by ControllerHandle may already be managed by the same driver or a\r
+  different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+  Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+  already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
   to guarantee the state of ControllerHandle is not modified by this function.\r
 \r
   @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle     The handle of the controller to test. This handle \r
-                                   must support a protocol interface that supplies \r
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle\r
+                                   must support a protocol interface that supplies\r
                                    an I/O abstraction to the driver.\r
-  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
-                                   parameter is ignored by device drivers, and is optional for bus \r
-                                   drivers. For bus drivers, if this parameter is not NULL, then \r
-                                   the bus driver must determine if the bus controller specified \r
-                                   by ControllerHandle and the child controller specified \r
-                                   by RemainingDevicePath are both supported by this \r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This\r
+                                   parameter is ignored by device drivers, and is optional for bus\r
+                                   drivers. For bus drivers, if this parameter is not NULL, then\r
+                                   the bus driver must determine if the bus controller specified\r
+                                   by ControllerHandle and the child controller specified\r
+                                   by RemainingDevicePath are both supported by this\r
                                    bus driver.\r
 \r
   @retval EFI_SUCCESS              The device specified by ControllerHandle and\r
@@ -651,28 +639,28 @@ HttpDxeIp4DriverBindingSupported (
   Starts a device controller or a bus controller.\r
 \r
   The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
-  As a result, much of the error checking on the parameters to Start() has been moved into this \r
-  common boot service. It is legal to call Start() from other locations, \r
+  As a result, much of the error checking on the parameters to Start() has been moved into this\r
+  common boot service. It is legal to call Start() from other locations,\r
   but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
   1. ControllerHandle must be a valid EFI_HANDLE.\r
   2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
      EFI_DEVICE_PATH_PROTOCOL.\r
   3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
-     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.  \r
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
 \r
   @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
-                                   must support a protocol interface that supplies \r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle\r
+                                   must support a protocol interface that supplies\r
                                    an I/O abstraction to the driver.\r
-  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
-                                   parameter is ignored by device drivers, and is optional for bus \r
-                                   drivers. For a bus driver, if this parameter is NULL, then handles \r
-                                   for all the children of Controller are created by this driver.  \r
-                                   If this parameter is not NULL and the first Device Path Node is \r
-                                   not the End of Device Path Node, then only the handle for the \r
-                                   child device specified by the first Device Path Node of \r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This\r
+                                   parameter is ignored by device drivers, and is optional for bus\r
+                                   drivers. For a bus driver, if this parameter is NULL, then handles\r
+                                   for all the children of Controller are created by this driver.\r
+                                   If this parameter is not NULL and the first Device Path Node is\r
+                                   not the End of Device Path Node, then only the handle for the\r
+                                   child device specified by the first Device Path Node of\r
                                    RemainingDevicePath is created by this driver.\r
-                                   If the first Device Path Node of RemainingDevicePath is \r
+                                   If the first Device Path Node of RemainingDevicePath is\r
                                    the End of Device Path Node, no child handle is created by this\r
                                    driver.\r
 \r
@@ -701,10 +689,10 @@ HttpDxeIp4DriverBindingStart (
 \r
 /**\r
   Stops a device controller or a bus controller.\r
-  \r
-  The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
-  As a result, much of the error checking on the parameters to Stop() has been moved \r
-  into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+  As a result, much of the error checking on the parameters to Stop() has been moved\r
+  into this common boot service. It is legal to call Stop() from other locations,\r
   but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
   1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
      same driver's Start() function.\r
@@ -712,13 +700,13 @@ HttpDxeIp4DriverBindingStart (
      EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
      Start() function, and the Start() function must have called OpenProtocol() on\r
      ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
-  \r
+\r
   @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
-                                support a bus specific I/O protocol for the driver \r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must\r
+                                support a bus specific I/O protocol for the driver\r
                                 to use to stop the device.\r
   @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
-  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL\r
                                 if NumberOfChildren is 0.\r
 \r
   @retval EFI_SUCCESS           The device was stopped.\r
@@ -744,33 +732,33 @@ HttpDxeIp4DriverBindingStop (
 }\r
 \r
 /**\r
-  Tests to see if this driver supports a given controller. If a child device is provided, \r
+  Tests to see if this driver supports a given controller. If a child device is provided,\r
   it further tests to see if this driver supports creating a handle for the specified child device.\r
 \r
-  This function checks to see if the driver specified by This supports the device specified by \r
-  ControllerHandle. Drivers will typically use the device path attached to \r
-  ControllerHandle and/or the services from the bus I/O abstraction attached to \r
-  ControllerHandle to determine if the driver supports ControllerHandle. This function \r
-  may be called many times during platform initialization. In order to reduce boot times, the tests \r
-  performed by this function must be very small, and take as little time as possible to execute. This \r
-  function must not change the state of any hardware devices, and this function must be aware that the \r
-  device specified by ControllerHandle may already be managed by the same driver or a \r
-  different driver. This function must match its calls to AllocatePages() with FreePages(), \r
-  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().  \r
-  Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
-  already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+  This function checks to see if the driver specified by This supports the device specified by\r
+  ControllerHandle. Drivers will typically use the device path attached to\r
+  ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+  ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+  may be called many times during platform initialization. In order to reduce boot times, the tests\r
+  performed by this function must be very small, and take as little time as possible to execute. This\r
+  function must not change the state of any hardware devices, and this function must be aware that the\r
+  device specified by ControllerHandle may already be managed by the same driver or a\r
+  different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+  Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+  already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
   to guarantee the state of ControllerHandle is not modified by this function.\r
 \r
   @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle     The handle of the controller to test. This handle \r
-                                   must support a protocol interface that supplies \r
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle\r
+                                   must support a protocol interface that supplies\r
                                    an I/O abstraction to the driver.\r
-  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
-                                   parameter is ignored by device drivers, and is optional for bus \r
-                                   drivers. For bus drivers, if this parameter is not NULL, then \r
-                                   the bus driver must determine if the bus controller specified \r
-                                   by ControllerHandle and the child controller specified \r
-                                   by RemainingDevicePath are both supported by this \r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This\r
+                                   parameter is ignored by device drivers, and is optional for bus\r
+                                   drivers. For bus drivers, if this parameter is not NULL, then\r
+                                   the bus driver must determine if the bus controller specified\r
+                                   by ControllerHandle and the child controller specified\r
+                                   by RemainingDevicePath are both supported by this\r
                                    bus driver.\r
 \r
   @retval EFI_SUCCESS              The device specified by ControllerHandle and\r
@@ -792,7 +780,7 @@ HttpDxeIp6DriverBindingSupported (
   IN EFI_HANDLE                   ControllerHandle,\r
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
   )\r
-{  \r
+{\r
   return HttpDxeSupported (\r
            This,\r
            ControllerHandle,\r
@@ -806,28 +794,28 @@ HttpDxeIp6DriverBindingSupported (
   Starts a device controller or a bus controller.\r
 \r
   The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
-  As a result, much of the error checking on the parameters to Start() has been moved into this \r
-  common boot service. It is legal to call Start() from other locations, \r
+  As a result, much of the error checking on the parameters to Start() has been moved into this\r
+  common boot service. It is legal to call Start() from other locations,\r
   but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
   1. ControllerHandle must be a valid EFI_HANDLE.\r
   2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
      EFI_DEVICE_PATH_PROTOCOL.\r
   3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
-     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.  \r
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
 \r
   @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
-                                   must support a protocol interface that supplies \r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle\r
+                                   must support a protocol interface that supplies\r
                                    an I/O abstraction to the driver.\r
-  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
-                                   parameter is ignored by device drivers, and is optional for bus \r
-                                   drivers. For a bus driver, if this parameter is NULL, then handles \r
-                                   for all the children of Controller are created by this driver.  \r
-                                   If this parameter is not NULL and the first Device Path Node is \r
-                                   not the End of Device Path Node, then only the handle for the \r
-                                   child device specified by the first Device Path Node of \r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This\r
+                                   parameter is ignored by device drivers, and is optional for bus\r
+                                   drivers. For a bus driver, if this parameter is NULL, then handles\r
+                                   for all the children of Controller are created by this driver.\r
+                                   If this parameter is not NULL and the first Device Path Node is\r
+                                   not the End of Device Path Node, then only the handle for the\r
+                                   child device specified by the first Device Path Node of\r
                                    RemainingDevicePath is created by this driver.\r
-                                   If the first Device Path Node of RemainingDevicePath is \r
+                                   If the first Device Path Node of RemainingDevicePath is\r
                                    the End of Device Path Node, no child handle is created by this\r
                                    driver.\r
 \r
@@ -856,10 +844,10 @@ HttpDxeIp6DriverBindingStart (
 \r
 /**\r
   Stops a device controller or a bus controller.\r
-  \r
-  The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
-  As a result, much of the error checking on the parameters to Stop() has been moved \r
-  into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+  As a result, much of the error checking on the parameters to Stop() has been moved\r
+  into this common boot service. It is legal to call Stop() from other locations,\r
   but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
   1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
      same driver's Start() function.\r
@@ -867,13 +855,13 @@ HttpDxeIp6DriverBindingStart (
      EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
      Start() function, and the Start() function must have called OpenProtocol() on\r
      ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
-  \r
+\r
   @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
-                                support a bus specific I/O protocol for the driver \r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must\r
+                                support a bus specific I/O protocol for the driver\r
                                 to use to stop the device.\r
   @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
-  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL\r
                                 if NumberOfChildren is 0.\r
 \r
   @retval EFI_SUCCESS           The device was stopped.\r
@@ -911,7 +899,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
@@ -937,7 +925,7 @@ HttpServiceBindingCreateChild (
   if (HttpInstance == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   HttpInstance->Signature = HTTP_PROTOCOL_SIGNATURE;\r
   HttpInstance->Service   = HttpService;\r
   HttpInstance->Method = HttpMethodMax;\r
@@ -973,9 +961,9 @@ HttpServiceBindingCreateChild (
   gBS->RestoreTPL (OldTpl);\r
 \r
   return EFI_SUCCESS;\r
-  \r
+\r
 ON_ERROR:\r
\r
+\r
   NetMapClean (&HttpInstance->TxTokens);\r
   NetMapClean (&HttpInstance->RxTokens);\r
   FreePool (HttpInstance);\r
@@ -1011,7 +999,7 @@ HttpServiceBindingDestroyChild (
   EFI_HTTP_PROTOCOL        *Http;\r
   EFI_STATUS                Status;\r
   EFI_TPL                   OldTpl;\r
-  \r
+\r
   if ((This == NULL) || (ChildHandle == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1028,7 +1016,7 @@ HttpServiceBindingDestroyChild (
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (Http);\r
   if (HttpInstance->Service != HttpService) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -1053,16 +1041,16 @@ HttpServiceBindingDestroyChild (
     HttpInstance->InDestroy = FALSE;\r
     return Status;\r
   }\r
-  \r
+\r
   HttpCleanProtocol (HttpInstance);\r
-  \r
+\r
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
+\r
   RemoveEntryList (&HttpInstance->Link);\r
   HttpService->ChildrenNumber--;\r
 \r
   gBS->RestoreTPL (OldTpl);\r
-  \r
+\r
   FreePool (HttpInstance);\r
   return EFI_SUCCESS;\r
 }\r