]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg: Update Http driver to use DPC mechanism.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.c
index 9b06e24bed0ecd4b814dec481c2dc621ded44b6c..8fbd45411064df8c787efd3de2182aca44b00764 100644 (file)
@@ -38,20 +38,18 @@ HttpCommonNotify (
 /**\r
   The notify function associated with TxToken for Tcp4->Transmit().\r
 \r
-  @param[in]  Event   The event signaled.\r
   @param[in]  Context The context.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-HttpTcpTransmitNotify (\r
-  IN EFI_EVENT  Event,\r
+HttpTcpTransmitNotifyDpc (\r
   IN VOID       *Context\r
   )\r
 {\r
   HTTP_TOKEN_WRAP          *Wrap;\r
 \r
-  if ((Event == NULL) || (Context == NULL)) {\r
+  if (Context == NULL) {\r
     return ;\r
   }\r
 \r
@@ -79,17 +77,36 @@ HttpTcpTransmitNotify (
 \r
 }\r
 \r
+/**\r
+  Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK.\r
+\r
+  @param  Event                 The receive event delivered to TCP for transmit.\r
+  @param  Context               Context for the callback.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HttpTcpTransmitNotify (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+  //\r
+  // Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK\r
+  //\r
+  QueueDpc (TPL_CALLBACK, HttpTcpTransmitNotifyDpc, Context);\r
+}\r
+\r
+\r
 /**\r
   The notify function associated with RxToken for Tcp4->Receive ().\r
 \r
-  @param[in]  Event   The event signaled.\r
   @param[in]  Context The context.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
-HttpTcpReceiveNotify (\r
-  IN EFI_EVENT  Event,\r
+HttpTcpReceiveNotifyDpc (\r
   IN VOID       *Context\r
   )\r
 {\r
@@ -99,7 +116,7 @@ HttpTcpReceiveNotify (
   EFI_STATUS               Status;\r
   HTTP_PROTOCOL            *HttpInstance;\r
 \r
-  if ((Event == NULL) || (Context == NULL)) {\r
+  if (Context == NULL) {\r
     return ;\r
   }\r
 \r
@@ -173,6 +190,27 @@ HttpTcpReceiveNotify (
   FreePool (Wrap);\r
 }\r
 \r
+/**\r
+  Request HttpTcpReceiveNotifyDpc as a DPC at TPL_CALLBACK.\r
+\r
+  @param  Event                 The receive event delivered to TCP for receive.\r
+  @param  Context               Context for the callback.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HttpTcpReceiveNotify (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+  //\r
+  // Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK\r
+  //\r
+  QueueDpc (TPL_CALLBACK, HttpTcpReceiveNotifyDpc, Context);\r
+}\r
+\r
+\r
 /**\r
   Create events for the TCP4 connection token and TCP4 close token.\r
 \r