/**\r
Process the Arp packets received from Mnp, the procedure conforms to RFC826.\r
\r
- @param Event The Event this notify function registered to.\r
@param Context Pointer to the context data registerd to the\r
Event.\r
\r
**/\r
VOID\r
EFIAPI\r
-ArpOnFrameRcvd (\r
- IN EFI_EVENT Event,\r
+ArpOnFrameRcvdDpc (\r
IN VOID *Context\r
)\r
{\r
ArpAddress.TargetHwAddr = ArpAddress.SenderProtoAddr + Head->ProtoAddrLen;\r
ArpAddress.TargetProtoAddr = ArpAddress.TargetHwAddr + Head->HwAddrLen;\r
\r
- if (EFI_ERROR (NET_TRYLOCK (&ArpService->Lock))) {\r
- ARP_DEBUG_ERROR (("ArpOnFrameRcvd: Faild to acquire the CacheTableLock.\n"));\r
- goto RECYCLE_RXDATA;\r
- }\r
-\r
SenderAddress[Hardware].Type = Head->HwType;\r
SenderAddress[Hardware].Length = Head->HwAddrLen;\r
SenderAddress[Hardware].AddressPtr = ArpAddress.SenderHwAddr;\r
// This address (either hardware or protocol address, or both) is configured to\r
// be a deny entry, silently skip the normal process.\r
//\r
- goto UNLOCK_EXIT;\r
+ goto RECYCLE_RXDATA;\r
}\r
\r
ProtoMatched = FALSE;\r
//\r
// Protocol type unmatchable, skip.\r
//\r
- goto UNLOCK_EXIT;\r
+ goto RECYCLE_RXDATA;\r
}\r
\r
//\r
//\r
// This arp packet isn't targeted to us, skip now.\r
//\r
- goto UNLOCK_EXIT;\r
+ goto RECYCLE_RXDATA;\r
}\r
\r
if (!MergeFlag) {\r
//\r
CacheEntry = ArpAllocCacheEntry (NULL);\r
if (CacheEntry == NULL) {\r
- goto UNLOCK_EXIT;\r
+ goto RECYCLE_RXDATA;\r
}\r
}\r
\r
ArpSendFrame (Instance, CacheEntry, ARP_OPCODE_REPLY);\r
}\r
\r
-UNLOCK_EXIT:\r
-\r
- NET_UNLOCK (&ArpService->Lock);\r
-\r
RECYCLE_RXDATA:\r
\r
//\r
);\r
}\r
\r
-\r
/**\r
- Process the already sent arp packets.\r
+ Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.\r
\r
@param Event The Event this notify function registered to.\r
@param Context Pointer to the context data registerd to the\r
**/\r
VOID\r
EFIAPI\r
-ArpOnFrameSent (\r
+ArpOnFrameRcvd (\r
IN EFI_EVENT Event,\r
IN VOID *Context\r
)\r
+{\r
+ //\r
+ // Request ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK\r
+ //\r
+ NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameRcvdDpc, Context);\r
+}\r
+\r
+/**\r
+ Process the already sent arp packets.\r
+\r
+ @param Context Pointer to the context data registerd to the\r
+ Event.\r
+\r
+ @return None.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ArpOnFrameSentDpc (\r
+ IN VOID *Context\r
+ )\r
{\r
EFI_MANAGED_NETWORK_COMPLETION_TOKEN *TxToken;\r
EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;\r
NetFreePool (TxToken);\r
}\r
\r
+/**\r
+ Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK.\r
+\r
+ @param Event The Event this notify function registered to.\r
+ @param Context Pointer to the context data registerd to the\r
+ Event.\r
+\r
+ @return None.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ArpOnFrameSent (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ //\r
+ // Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK\r
+ //\r
+ NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameSentDpc, Context);\r
+}\r
+\r
\r
/**\r
Process the arp cache olding and drive the retrying arp requests.\r
ASSERT (Context != NULL);\r
ArpService = (ARP_SERVICE_DATA *)Context;\r
\r
- if (EFI_ERROR (NET_TRYLOCK (&ArpService->Lock))) {\r
- return;\r
- }\r
-\r
//\r
// Iterate all the pending requests to see whether a retry is needed to send out\r
// or the request finally fails because the retry time reaches the limitation.\r
CacheEntry->DecayTime -= ARP_PERIODIC_TIMER_INTERVAL;\r
}\r
}\r
-\r
- NET_UNLOCK (&ArpService->Lock);\r
}\r
\r
\r
}\r
}\r
\r
+ //\r
+ // Dispatch the DPCs queued by the NotifyFunction of the Context->UserRequestEvent.\r
+ //\r
+ NetLibDispatchDpc ();\r
+\r
return Count;\r
}\r
\r
//\r
// Cancel the arp requests issued by this instance.\r
//\r
- ArpCancelRequest (Instance, NULL, NULL);\r
+ Instance->ArpProto.Cancel (&Instance->ArpProto, NULL, NULL);\r
\r
//\r
// Free the buffer previously allocated to hold the station address.\r