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:
vanjeff
2007-11-20 05:42:23 +00:00
parent 04e12c2147
commit 36ee91ca36
48 changed files with 1835 additions and 543 deletions

View File

@@ -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;