]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/HttpBootDxe: Utilize HttpIoLib
authorAbner Chang <abner.chang@hpe.com>
Tue, 3 Nov 2020 05:26:51 +0000 (13:26 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 4 Dec 2020 11:45:07 +0000 (11:45 +0000)
Remove HTTP IO realted funcitons from HttpBootDxe
and use HttpIoLib instead.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
NetworkPkg/HttpBootDxe/HttpBootDxe.h
NetworkPkg/HttpBootDxe/HttpBootDxe.inf
NetworkPkg/HttpBootDxe/HttpBootSupport.c
NetworkPkg/HttpBootDxe/HttpBootSupport.h

index 0b45f9de0bdb0d994261dc11b5a13969749fe2c6..d692c3ad3cd494578256f5887a48bb864ac7469b 100644 (file)
@@ -2,7 +2,7 @@
   UEFI HTTP boot driver's private data structure and interfaces declaration.\r
 \r
 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/DebugLib.h>\r
 #include <Library/NetLib.h>\r
 #include <Library/HttpLib.h>\r
+#include <Library/HttpIoLib.h>\r
 #include <Library/HiiLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/DpcLib.h>\r
index 5beab728ddaefdc7e35e52fc6511d3d840425bc6..a27a5617224de8004c8196250ad69a6eb313db75 100644 (file)
@@ -2,6 +2,7 @@
 #  This modules produce the Load File Protocol for UEFI HTTP boot.\r
 #\r
 #  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  (C) Copyright 2020 Hewlett-Packard Development Company, L.P.<BR>\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 ##\r
@@ -52,6 +53,7 @@
   DebugLib\r
   NetLib\r
   HttpLib\r
+  HttpIoLib\r
   HiiLib\r
   PrintLib\r
   DpcLib\r
index 5b0e054a05ebb81f7f45cba24a42d4de402833d2..93d9dfc4643d224094008de65a1c1dd08d9a5537 100644 (file)
@@ -2,7 +2,7 @@
   Support functions implementation for UEFI HTTP boot driver.\r
 \r
 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -622,435 +622,6 @@ HttpBootSetHeader (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Notify the callback function when an event is triggered.\r
-\r
-  @param[in]  Context         The opaque parameter to the function.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-HttpIoNotifyDpc (\r
-  IN VOID                *Context\r
-  )\r
-{\r
-  *((BOOLEAN *) Context) = TRUE;\r
-}\r
-\r
-/**\r
-  Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK.\r
-\r
-  @param[in]  Event                 The event signaled.\r
-  @param[in]  Context               The opaque parameter to the function.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-HttpIoNotify (\r
-  IN EFI_EVENT              Event,\r
-  IN VOID                   *Context\r
-  )\r
-{\r
-  //\r
-  // Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK\r
-  //\r
-  QueueDpc (TPL_CALLBACK, HttpIoNotifyDpc, Context);\r
-}\r
-\r
-/**\r
-  Create a HTTP_IO to access the HTTP service. It will create and configure\r
-  a HTTP child handle.\r
-\r
-  @param[in]  Image          The handle of the driver image.\r
-  @param[in]  Controller     The handle of the controller.\r
-  @param[in]  IpVersion      IP_VERSION_4 or IP_VERSION_6.\r
-  @param[in]  ConfigData     The HTTP_IO configuration data.\r
-  @param[in]  Callback       Callback function which will be invoked when specified\r
-                             HTTP_IO_CALLBACK_EVENT happened.\r
-  @param[in]  Context        The Context data which will be passed to the Callback function.\r
-  @param[out] HttpIo         The HTTP_IO.\r
-\r
-  @retval EFI_SUCCESS            The HTTP_IO is created and configured.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_UNSUPPORTED        One or more of the control options are not\r
-                                 supported in the implementation.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval Others                 Failed to create the HTTP_IO or configure it.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoCreateIo (\r
-  IN EFI_HANDLE             Image,\r
-  IN EFI_HANDLE             Controller,\r
-  IN UINT8                  IpVersion,\r
-  IN HTTP_IO_CONFIG_DATA    *ConfigData,\r
-  IN HTTP_IO_CALLBACK       Callback,\r
-  IN VOID                   *Context,\r
-  OUT HTTP_IO               *HttpIo\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_HTTP_CONFIG_DATA      HttpConfigData;\r
-  EFI_HTTPv4_ACCESS_POINT   Http4AccessPoint;\r
-  EFI_HTTPv6_ACCESS_POINT   Http6AccessPoint;\r
-  EFI_HTTP_PROTOCOL         *Http;\r
-  EFI_EVENT                 Event;\r
-\r
-  if ((Image == NULL) || (Controller == NULL) || (ConfigData == NULL) || (HttpIo == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (IpVersion != IP_VERSION_4 && IpVersion != IP_VERSION_6) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  ZeroMem (HttpIo, sizeof (HTTP_IO));\r
-\r
-  //\r
-  // Create the HTTP child instance and get the HTTP protocol.\r
-  //\r
-  Status = NetLibCreateServiceChild (\r
-             Controller,\r
-             Image,\r
-             &gEfiHttpServiceBindingProtocolGuid,\r
-             &HttpIo->Handle\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  HttpIo->Handle,\r
-                  &gEfiHttpProtocolGuid,\r
-                  (VOID **) &Http,\r
-                  Image,\r
-                  Controller,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) || (Http == NULL)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Init the configuration data and configure the HTTP child.\r
-  //\r
-  HttpIo->Image       = Image;\r
-  HttpIo->Controller  = Controller;\r
-  HttpIo->IpVersion   = IpVersion;\r
-  HttpIo->Http        = Http;\r
-  HttpIo->Callback    = Callback;\r
-  HttpIo->Context     = Context;\r
-\r
-  ZeroMem (&HttpConfigData, sizeof (EFI_HTTP_CONFIG_DATA));\r
-  HttpConfigData.HttpVersion        = HttpVersion11;\r
-  HttpConfigData.TimeOutMillisec    = ConfigData->Config4.RequestTimeOut;\r
-  if (HttpIo->IpVersion == IP_VERSION_4) {\r
-    HttpConfigData.LocalAddressIsIPv6 = FALSE;\r
-\r
-    Http4AccessPoint.UseDefaultAddress = ConfigData->Config4.UseDefaultAddress;\r
-    Http4AccessPoint.LocalPort         = ConfigData->Config4.LocalPort;\r
-    IP4_COPY_ADDRESS (&Http4AccessPoint.LocalAddress, &ConfigData->Config4.LocalIp);\r
-    IP4_COPY_ADDRESS (&Http4AccessPoint.LocalSubnet, &ConfigData->Config4.SubnetMask);\r
-    HttpConfigData.AccessPoint.IPv4Node = &Http4AccessPoint;\r
-  } else {\r
-    HttpConfigData.LocalAddressIsIPv6 = TRUE;\r
-    Http6AccessPoint.LocalPort        = ConfigData->Config6.LocalPort;\r
-    IP6_COPY_ADDRESS (&Http6AccessPoint.LocalAddress, &ConfigData->Config6.LocalIp);\r
-    HttpConfigData.AccessPoint.IPv6Node = &Http6AccessPoint;\r
-  }\r
-\r
-  Status = Http->Configure (Http, &HttpConfigData);\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Create events for various asynchronous operations.\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_NOTIFY,\r
-                  HttpIoNotify,\r
-                  &HttpIo->IsTxDone,\r
-                  &Event\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-  HttpIo->ReqToken.Event = Event;\r
-  HttpIo->ReqToken.Message = &HttpIo->ReqMessage;\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_NOTIFY,\r
-                  HttpIoNotify,\r
-                  &HttpIo->IsRxDone,\r
-                  &Event\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-  HttpIo->RspToken.Event = Event;\r
-  HttpIo->RspToken.Message = &HttpIo->RspMessage;\r
-\r
-  //\r
-  // Create TimeoutEvent for response\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_TIMER,\r
-                  TPL_CALLBACK,\r
-                  NULL,\r
-                  NULL,\r
-                  &Event\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-  HttpIo->TimeoutEvent = Event;\r
-\r
-  return EFI_SUCCESS;\r
-\r
-ON_ERROR:\r
-  HttpIoDestroyIo (HttpIo);\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Destroy the HTTP_IO and release the resources.\r
-\r
-  @param[in]  HttpIo          The HTTP_IO which wraps the HTTP service to be destroyed.\r
-\r
-**/\r
-VOID\r
-HttpIoDestroyIo (\r
-  IN HTTP_IO                *HttpIo\r
-  )\r
-{\r
-  EFI_HTTP_PROTOCOL         *Http;\r
-  EFI_EVENT                 Event;\r
-\r
-  if (HttpIo == NULL) {\r
-    return;\r
-  }\r
-\r
-  Event = HttpIo->ReqToken.Event;\r
-  if (Event != NULL) {\r
-    gBS->CloseEvent (Event);\r
-  }\r
-\r
-  Event = HttpIo->RspToken.Event;\r
-  if (Event != NULL) {\r
-    gBS->CloseEvent (Event);\r
-  }\r
-\r
-  Event = HttpIo->TimeoutEvent;\r
-  if (Event != NULL) {\r
-    gBS->CloseEvent (Event);\r
-  }\r
-\r
-  Http = HttpIo->Http;\r
-  if (Http != NULL) {\r
-    Http->Configure (Http, NULL);\r
-    gBS->CloseProtocol (\r
-           HttpIo->Handle,\r
-           &gEfiHttpProtocolGuid,\r
-           HttpIo->Image,\r
-           HttpIo->Controller\r
-           );\r
-  }\r
-\r
-  NetLibDestroyServiceChild (\r
-    HttpIo->Controller,\r
-    HttpIo->Image,\r
-    &gEfiHttpServiceBindingProtocolGuid,\r
-    HttpIo->Handle\r
-    );\r
-}\r
-\r
-/**\r
-  Synchronously send a HTTP REQUEST message to the server.\r
-\r
-  @param[in]   HttpIo           The HttpIo wrapping the HTTP service.\r
-  @param[in]   Request          A pointer to storage such data as URL and HTTP method.\r
-  @param[in]   HeaderCount      Number of HTTP header structures in Headers list.\r
-  @param[in]   Headers          Array containing list of HTTP headers.\r
-  @param[in]   BodyLength       Length in bytes of the HTTP body.\r
-  @param[in]   Body             Body associated with the HTTP request.\r
-\r
-  @retval EFI_SUCCESS            The HTTP request is transmitted.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval EFI_DEVICE_ERROR       An unexpected network or system error occurred.\r
-  @retval Others                 Other errors as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoSendRequest (\r
-  IN  HTTP_IO                *HttpIo,\r
-  IN  EFI_HTTP_REQUEST_DATA  *Request,\r
-  IN  UINTN                  HeaderCount,\r
-  IN  EFI_HTTP_HEADER        *Headers,\r
-  IN  UINTN                  BodyLength,\r
-  IN  VOID                   *Body\r
-  )\r
-{\r
-  EFI_STATUS                 Status;\r
-  EFI_HTTP_PROTOCOL          *Http;\r
-\r
-  if (HttpIo == NULL || HttpIo->Http == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  HttpIo->ReqToken.Status  = EFI_NOT_READY;\r
-  HttpIo->ReqToken.Message->Data.Request = Request;\r
-  HttpIo->ReqToken.Message->HeaderCount  = HeaderCount;\r
-  HttpIo->ReqToken.Message->Headers      = Headers;\r
-  HttpIo->ReqToken.Message->BodyLength   = BodyLength;\r
-  HttpIo->ReqToken.Message->Body         = Body;\r
-\r
-  if (HttpIo->Callback != NULL) {\r
-    Status = HttpIo->Callback (\r
-               HttpIoRequest,\r
-               HttpIo->ReqToken.Message,\r
-               HttpIo->Context\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Queue the request token to HTTP instances.\r
-  //\r
-  Http = HttpIo->Http;\r
-  HttpIo->IsTxDone = FALSE;\r
-  Status = Http->Request (\r
-                   Http,\r
-                   &HttpIo->ReqToken\r
-                   );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Poll the network until transmit finish.\r
-  //\r
-  while (!HttpIo->IsTxDone) {\r
-    Http->Poll (Http);\r
-  }\r
-\r
-  return HttpIo->ReqToken.Status;\r
-}\r
-\r
-/**\r
-  Synchronously receive a HTTP RESPONSE message from the server.\r
-\r
-  @param[in]   HttpIo           The HttpIo wrapping the HTTP service.\r
-  @param[in]   RecvMsgHeader    TRUE to receive a new HTTP response (from message header).\r
-                                FALSE to continue receive the previous response message.\r
-  @param[out]  ResponseData     Point to a wrapper of the received response data.\r
-\r
-  @retval EFI_SUCCESS            The HTTP response is received.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval EFI_DEVICE_ERROR       An unexpected network or system error occurred.\r
-  @retval Others                 Other errors as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoRecvResponse (\r
-  IN      HTTP_IO                  *HttpIo,\r
-  IN      BOOLEAN                  RecvMsgHeader,\r
-     OUT  HTTP_IO_RESPONSE_DATA    *ResponseData\r
-  )\r
-{\r
-  EFI_STATUS                 Status;\r
-  EFI_HTTP_PROTOCOL          *Http;\r
-\r
-  if (HttpIo == NULL || HttpIo->Http == NULL || ResponseData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Start the timer, and wait Timeout seconds to receive the header packet.\r
-  //\r
-  Status = gBS->SetTimer (HttpIo->TimeoutEvent, TimerRelative, HTTP_BOOT_RESPONSE_TIMEOUT * TICKS_PER_MS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Queue the response token to HTTP instances.\r
-  //\r
-  HttpIo->RspToken.Status  = EFI_NOT_READY;\r
-  if (RecvMsgHeader) {\r
-    HttpIo->RspToken.Message->Data.Response = &ResponseData->Response;\r
-  } else {\r
-    HttpIo->RspToken.Message->Data.Response = NULL;\r
-  }\r
-  HttpIo->RspToken.Message->HeaderCount   = 0;\r
-  HttpIo->RspToken.Message->Headers       = NULL;\r
-  HttpIo->RspToken.Message->BodyLength    = ResponseData->BodyLength;\r
-  HttpIo->RspToken.Message->Body          = ResponseData->Body;\r
-\r
-  Http = HttpIo->Http;\r
-  HttpIo->IsRxDone = FALSE;\r
-  Status = Http->Response (\r
-                   Http,\r
-                   &HttpIo->RspToken\r
-                   );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->SetTimer (HttpIo->TimeoutEvent, TimerCancel, 0);\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Poll the network until receive finish.\r
-  //\r
-  while (!HttpIo->IsRxDone && ((HttpIo->TimeoutEvent == NULL) || EFI_ERROR (gBS->CheckEvent (HttpIo->TimeoutEvent)))) {\r
-    Http->Poll (Http);\r
-  }\r
-\r
-  gBS->SetTimer (HttpIo->TimeoutEvent, TimerCancel, 0);\r
-\r
-  if (!HttpIo->IsRxDone) {\r
-    //\r
-    // Timeout occurs, cancel the response token.\r
-    //\r
-    Http->Cancel (Http, &HttpIo->RspToken);\r
-\r
-    Status = EFI_TIMEOUT;\r
-\r
-    return Status;\r
-  } else {\r
-    HttpIo->IsRxDone = FALSE;\r
-  }\r
-\r
-  if ((HttpIo->Callback != NULL) &&\r
-      (HttpIo->RspToken.Status == EFI_SUCCESS || HttpIo->RspToken.Status == EFI_HTTP_ERROR)) {\r
-    Status = HttpIo->Callback (\r
-               HttpIoResponse,\r
-               HttpIo->RspToken.Message,\r
-               HttpIo->Context\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Store the received data into the wrapper.\r
-  //\r
-  ResponseData->Status = HttpIo->RspToken.Status;\r
-  ResponseData->HeaderCount = HttpIo->RspToken.Message->HeaderCount;\r
-  ResponseData->Headers     = HttpIo->RspToken.Message->Headers;\r
-  ResponseData->BodyLength  = HttpIo->RspToken.Message->BodyLength;\r
-\r
-  return Status;\r
-}\r
-\r
 /**\r
   This function checks the HTTP(S) URI scheme.\r
 \r
index 81d072ae37342e9b63e01b7772d00e5ea3dcb0d1..1a2d32dd5a548bd2d4d2246bcd604217483d68c2 100644 (file)
@@ -2,6 +2,7 @@
   Support functions declaration for UEFI HTTP boot driver.\r
 \r
 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2020 Hewlett-Packard Development Company, L.P.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -139,102 +140,6 @@ HttpBootSetHeader (
   IN  CHAR8                *FieldValue\r
   );\r
 \r
-///\r
-/// HTTP_IO_CALLBACK_EVENT\r
-///\r
-typedef enum {\r
-  HttpIoRequest,\r
-  HttpIoResponse\r
-} HTTP_IO_CALLBACK_EVENT;\r
-\r
-/**\r
-  HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.\r
-\r
-  @param[in]    EventType      Indicate the Event type that occurs in the current callback.\r
-  @param[in]    Message        HTTP message which will be send to, or just received from HTTP server.\r
-  @param[in]    Context        The Callback Context pointer.\r
-\r
-  @retval EFI_SUCCESS          Tells the HttpIo to continue the HTTP process.\r
-  @retval Others               Tells the HttpIo to abort the current HTTP process.\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI * HTTP_IO_CALLBACK) (\r
-  IN  HTTP_IO_CALLBACK_EVENT    EventType,\r
-  IN  EFI_HTTP_MESSAGE          *Message,\r
-  IN  VOID                      *Context\r
-  );\r
-\r
-//\r
-// HTTP_IO configuration data for IPv4\r
-//\r
-typedef struct {\r
-  EFI_HTTP_VERSION          HttpVersion;\r
-  UINT32                    RequestTimeOut;  // In milliseconds.\r
-  UINT32                    ResponseTimeOut; // In milliseconds.\r
-  BOOLEAN                   UseDefaultAddress;\r
-  EFI_IPv4_ADDRESS          LocalIp;\r
-  EFI_IPv4_ADDRESS          SubnetMask;\r
-  UINT16                    LocalPort;\r
-} HTTP4_IO_CONFIG_DATA;\r
-\r
-//\r
-// HTTP_IO configuration data for IPv6\r
-//\r
-typedef struct {\r
-  EFI_HTTP_VERSION          HttpVersion;\r
-  UINT32                    RequestTimeOut;  // In milliseconds.\r
-  BOOLEAN                   UseDefaultAddress;\r
-  EFI_IPv6_ADDRESS          LocalIp;\r
-  UINT16                    LocalPort;\r
-} HTTP6_IO_CONFIG_DATA;\r
-\r
-\r
-//\r
-// HTTP_IO configuration\r
-//\r
-typedef union {\r
-  HTTP4_IO_CONFIG_DATA       Config4;\r
-  HTTP6_IO_CONFIG_DATA       Config6;\r
-} HTTP_IO_CONFIG_DATA;\r
-\r
-//\r
-// HTTP_IO wrapper of the EFI HTTP service.\r
-//\r
-typedef struct {\r
-  UINT8                     IpVersion;\r
-  EFI_HANDLE                Image;\r
-  EFI_HANDLE                Controller;\r
-  EFI_HANDLE                Handle;\r
-\r
-  EFI_HTTP_PROTOCOL         *Http;\r
-\r
-  HTTP_IO_CALLBACK          Callback;\r
-  VOID                      *Context;\r
-\r
-  EFI_HTTP_TOKEN            ReqToken;\r
-  EFI_HTTP_MESSAGE          ReqMessage;\r
-  EFI_HTTP_TOKEN            RspToken;\r
-  EFI_HTTP_MESSAGE          RspMessage;\r
-\r
-  BOOLEAN                   IsTxDone;\r
-  BOOLEAN                   IsRxDone;\r
-\r
-  EFI_EVENT                 TimeoutEvent;\r
-} HTTP_IO;\r
-\r
-//\r
-// A wrapper structure to hold the received HTTP response data.\r
-//\r
-typedef struct {\r
-  EFI_HTTP_RESPONSE_DATA      Response;\r
-  UINTN                       HeaderCount;\r
-  EFI_HTTP_HEADER             *Headers;\r
-  UINTN                       BodyLength;\r
-  CHAR8                       *Body;\r
-  EFI_STATUS                  Status;\r
-} HTTP_IO_RESPONSE_DATA;\r
-\r
 /**\r
   Retrieve the host address using the EFI_DNS6_PROTOCOL.\r
 \r
@@ -267,98 +172,6 @@ HttpBootCommonNotify (
   IN VOID                *Context\r
   );\r
 \r
-/**\r
-  Create a HTTP_IO to access the HTTP service. It will create and configure\r
-  a HTTP child handle.\r
-\r
-  @param[in]  Image          The handle of the driver image.\r
-  @param[in]  Controller     The handle of the controller.\r
-  @param[in]  IpVersion      IP_VERSION_4 or IP_VERSION_6.\r
-  @param[in]  ConfigData     The HTTP_IO configuration data.\r
-  @param[in]  Callback       Callback function which will be invoked when specified\r
-                             HTTP_IO_CALLBACK_EVENT happened.\r
-  @param[in]  Context        The Context data which will be passed to the Callback function.\r
-  @param[out] HttpIo         The HTTP_IO.\r
-\r
-  @retval EFI_SUCCESS            The HTTP_IO is created and configured.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_UNSUPPORTED        One or more of the control options are not\r
-                                 supported in the implementation.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval Others                 Failed to create the HTTP_IO or configure it.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoCreateIo (\r
-  IN EFI_HANDLE             Image,\r
-  IN EFI_HANDLE             Controller,\r
-  IN UINT8                  IpVersion,\r
-  IN HTTP_IO_CONFIG_DATA    *ConfigData,\r
-  IN HTTP_IO_CALLBACK       Callback,\r
-  IN VOID                   *Context,\r
-  OUT HTTP_IO               *HttpIo\r
-  );\r
-\r
-/**\r
-  Destroy the HTTP_IO and release the resources.\r
-\r
-  @param[in]  HttpIo          The HTTP_IO which wraps the HTTP service to be destroyed.\r
-\r
-**/\r
-VOID\r
-HttpIoDestroyIo (\r
-  IN HTTP_IO                *HttpIo\r
-  );\r
-\r
-/**\r
-  Synchronously send a HTTP REQUEST message to the server.\r
-\r
-  @param[in]   HttpIo           The HttpIo wrapping the HTTP service.\r
-  @param[in]   Request          A pointer to storage such data as URL and HTTP method.\r
-  @param[in]   HeaderCount      Number of HTTP header structures in Headers list.\r
-  @param[in]   Headers          Array containing list of HTTP headers.\r
-  @param[in]   BodyLength       Length in bytes of the HTTP body.\r
-  @param[in]   Body             Body associated with the HTTP request.\r
-\r
-  @retval EFI_SUCCESS            The HTTP request is transmitted.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval EFI_DEVICE_ERROR       An unexpected network or system error occurred.\r
-  @retval Others                 Other errors as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoSendRequest (\r
-  IN  HTTP_IO                *HttpIo,\r
-  IN  EFI_HTTP_REQUEST_DATA  *Request,      OPTIONAL\r
-  IN  UINTN                  HeaderCount,\r
-  IN  EFI_HTTP_HEADER        *Headers,      OPTIONAL\r
-  IN  UINTN                  BodyLength,\r
-  IN  VOID                   *Body          OPTIONAL\r
-  );\r
-\r
-/**\r
-  Synchronously receive a HTTP RESPONSE message from the server.\r
-\r
-  @param[in]   HttpIo           The HttpIo wrapping the HTTP service.\r
-  @param[in]   RecvMsgHeader    TRUE to receive a new HTTP response (from message header).\r
-                                FALSE to continue receive the previous response message.\r
-  @param[out]  ResponseData     Point to a wrapper of the received response data.\r
-\r
-  @retval EFI_SUCCESS            The HTTP response is received.\r
-  @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
-  @retval EFI_DEVICE_ERROR       An unexpected network or system error occurred.\r
-  @retval Others                 Other errors as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-HttpIoRecvResponse (\r
-  IN      HTTP_IO                  *HttpIo,\r
-  IN      BOOLEAN                  RecvMsgHeader,\r
-     OUT  HTTP_IO_RESPONSE_DATA    *ResponseData\r
-  );\r
-\r
 /**\r
   This function checks the HTTP(S) URI scheme.\r
 \r