1. Add DPC protocol and DpcLib library in MdeModulePkg.
2. Add DpcDxe module and DxeDpcLib module in MdeModulePkg 3. Port network stack module to use DPC. 4. Use MIN, and MAX defined in MdePkg to replace NET_MIN and NET_MAX. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4307 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -180,7 +180,7 @@ Udp4Configure (
|
||||
StationAddress = NTOHL (StationAddress);
|
||||
SubnetMask = NTOHL (SubnetMask);
|
||||
RemoteAddress = NTOHL (RemoteAddress);
|
||||
|
||||
|
||||
|
||||
if (!UdpConfigData->UseDefaultAddress &&
|
||||
(!IP4_IS_VALID_NETMASK (SubnetMask) ||
|
||||
@@ -284,12 +284,14 @@ Udp4Configure (
|
||||
//
|
||||
// Cancel all the user tokens.
|
||||
//
|
||||
Udp4InstanceCancelToken (Instance, NULL);
|
||||
Instance->Udp4Proto.Cancel (&Instance->Udp4Proto, NULL);
|
||||
|
||||
//
|
||||
// Remove the buffered RxData for this instance.
|
||||
//
|
||||
Udp4FlushRxData (&Instance->RcvdDgramQue);
|
||||
Udp4FlushRcvdDgram (Instance);
|
||||
|
||||
////bugbug ASSERT (NetListIsEmpty (&Instance->DeliveredDgramQue));
|
||||
}
|
||||
|
||||
Udp4SetVariableData (Instance->Udp4Service);
|
||||
@@ -772,7 +774,8 @@ Udp4Receive (
|
||||
//
|
||||
Status = NetMapInsertTail (&Instance->RxTokens, Token, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_NOT_READY;
|
||||
Status = EFI_NOT_READY;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -785,6 +788,11 @@ Udp4Receive (
|
||||
//
|
||||
Udp4InstanceDeliverDgram (Instance);
|
||||
|
||||
//
|
||||
// Dispatch the DPC queued by the NotifyFunction of Token->Event.
|
||||
//
|
||||
NetLibDispatchDpc ();
|
||||
|
||||
ON_EXIT:
|
||||
|
||||
NET_RESTORE_TPL (OldTpl);
|
||||
@@ -847,6 +855,11 @@ Udp4Cancel (
|
||||
//
|
||||
Status = Udp4InstanceCancelToken (Instance, Token);
|
||||
|
||||
//
|
||||
// Dispatch the DPC queued by the NotifyFunction of the canceled token's events.
|
||||
//
|
||||
NetLibDispatchDpc ();
|
||||
|
||||
NET_RESTORE_TPL (OldTpl);
|
||||
|
||||
return Status;
|
||||
|
Reference in New Issue
Block a user