]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
1. Add DPC protocol and DpcLib library in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / MnpDxe / MnpIo.c
index 3d26ec2a4c8f763c7ec64281c02ffcf1f32ebfce..ed8bf78282d6d5f0ae49cdc2dcb5999aa5dd849a 100644 (file)
@@ -294,6 +294,11 @@ SIGNAL_TOKEN:
   Token->Status = Status;\r
   gBS->SignalEvent (Token->Event);\r
 \r
   Token->Status = Status;\r
   gBS->SignalEvent (Token->Event);\r
 \r
+  //\r
+  // Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
+  //\r
+  NetLibDispatchDpc ();\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -562,12 +567,6 @@ MnpMatchPacket (
 \r
   ConfigData = &Instance->ConfigData;\r
 \r
 \r
   ConfigData = &Instance->ConfigData;\r
 \r
-  if (ConfigData->EnablePromiscuousReceive) {\r
-    //\r
-    // Always match if this instance is configured to be promiscuous.\r
-    //\r
-    return TRUE;\r
-  }\r
   //\r
   // Check the protocol type.\r
   //\r
   //\r
   // Check the protocol type.\r
   //\r
@@ -575,6 +574,13 @@ MnpMatchPacket (
     return FALSE;\r
   }\r
 \r
     return FALSE;\r
   }\r
 \r
+  if (ConfigData->EnablePromiscuousReceive) {\r
+    //\r
+    // Always match if this instance is configured to be promiscuous.\r
+    //\r
+    return TRUE;\r
+  }\r
+\r
   //\r
   // The protocol type is matched, check receive filter, include unicast and broadcast.\r
   //\r
   //\r
   // The protocol type is matched, check receive filter, include unicast and broadcast.\r
   //\r
@@ -987,6 +993,11 @@ MnpReceivePacket (
   //\r
   MnpDeliverPacket (MnpServiceData);\r
 \r
   //\r
   MnpDeliverPacket (MnpServiceData);\r
 \r
+  //\r
+  // Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
+  //\r
+  NetLibDispatchDpc ();\r
+\r
 EXIT:\r
 \r
   ASSERT (Nbuf->TotalSize == MnpServiceData->BufferLength);\r
 EXIT:\r
 \r
   ASSERT (Nbuf->TotalSize == MnpServiceData->BufferLength);\r
@@ -1087,4 +1098,6 @@ MnpSystemPoll (
   // Try to receive packets from Snp.\r
   //\r
   MnpReceivePacket (MnpServiceData);\r
   // Try to receive packets from Snp.\r
   //\r
   MnpReceivePacket (MnpServiceData);\r
+\r
+  NetLibDispatchDpc ();\r
 }\r
 }\r