diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-20 05:42:23 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-20 05:42:23 +0000 |
commit | 36ee91ca3661d3d020a7841aacbf858d885c4728 (patch) | |
tree | 418e7a4d4a84d86a78d4b260acab20877be5bd45 /MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | |
parent | 04e12c21476db29e8f92030ed00122fa4e1e56cc (diff) | |
download | edk2-platforms-36ee91ca3661d3d020a7841aacbf858d885c4728.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c')
-rw-r--r-- | MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 109 |
1 files changed, 96 insertions, 13 deletions
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index 608bdd297e..279ada7b11 100644 --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c @@ -74,6 +74,13 @@ STATIC ICMP_ERROR_INFO mIcmpErrMap[10] = { STATIC
VOID
EFIAPI
+IpIoTransmitHandlerDpc (
+ IN VOID *Context
+ );
+
+STATIC
+VOID
+EFIAPI
IpIoTransmitHandler (
IN EFI_EVENT Event,
IN VOID *Context
@@ -430,7 +437,7 @@ IpIoCreateSndEntry ( //
// Set the fields of OverrideData
//
- NetCopyMem (OverrideData, Override, sizeof (*OverrideData));
+ CopyMem (OverrideData, Override, sizeof (*OverrideData));
}
//
@@ -523,7 +530,6 @@ IpIoDestroySndEntry ( /**
Notify function for IP transmit token.
- @param Event The event signaled.
@param Context The context passed in by the event notifier.
@return None.
@@ -532,8 +538,7 @@ IpIoDestroySndEntry ( STATIC
VOID
EFIAPI
-IpIoTransmitHandler (
- IN EFI_EVENT Event,
+IpIoTransmitHandlerDpc (
IN VOID *Context
)
{
@@ -556,11 +561,34 @@ IpIoTransmitHandler ( IpIoDestroySndEntry (SndEntry);
}
+/**
+ Notify function for IP transmit token.
+
+ @param Event The event signaled.
+ @param Context The context passed in by the event notifier.
+
+ @return None.
+
+**/
+
+STATIC
+VOID
+EFIAPI
+IpIoTransmitHandler (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ //
+ // Request IpIoTransmitHandlerDpc as a DPC at TPL_CALLBACK
+ //
+ NetLibQueueDpc (TPL_CALLBACK, IpIoTransmitHandlerDpc, Context);
+}
+
/**
The dummy handler for the dummy IP receive token.
- @param Evt The event signaled.
@param Context The context passed in by the event notifier.
@return None.
@@ -569,20 +597,22 @@ IpIoTransmitHandler ( STATIC
VOID
EFIAPI
-IpIoDummyHandler (
- IN EFI_EVENT Event,
+IpIoDummyHandlerDpc (
IN VOID *Context
)
{
IP_IO_IP_INFO *IpInfo;
EFI_IP4_COMPLETION_TOKEN *DummyToken;
- ASSERT (Event && Context);
-
IpInfo = (IP_IO_IP_INFO *) Context;
DummyToken = &(IpInfo->DummyRcvToken);
- if (EFI_SUCCESS == DummyToken->Status) {
+ if (EFI_ABORTED == DummyToken->Status) {
+ //
+ // The reception is actively aborted by the consumer, directly return.
+ //
+ return;
+ } else if (EFI_SUCCESS == DummyToken->Status) {
ASSERT (DummyToken->Packet.RxData);
gBS->SignalEvent (DummyToken->Packet.RxData->RecycleSignal);
@@ -593,8 +623,7 @@ IpIoDummyHandler ( /**
- Notify function for the IP receive token, used to process
- the received IP packets.
+ Request IpIoDummyHandlerDpc as a DPC at TPL_CALLBACK.
@param Event The event signaled.
@param Context The context passed in by the event notifier.
@@ -605,11 +634,34 @@ IpIoDummyHandler ( STATIC
VOID
EFIAPI
-IpIoListenHandler (
+IpIoDummyHandler (
IN EFI_EVENT Event,
IN VOID *Context
)
{
+ //
+ // Request IpIoDummyHandlerDpc as a DPC at TPL_CALLBACK
+ //
+ NetLibQueueDpc (TPL_CALLBACK, IpIoDummyHandlerDpc, Context);
+}
+
+
+/**
+ Notify function for the IP receive token, used to process
+ the received IP packets.
+
+ @param Context The context passed in by the event notifier.
+
+ @return None.
+
+**/
+STATIC
+VOID
+EFIAPI
+IpIoListenHandlerDpc (
+ IN VOID *Context
+ )
+{
IP_IO *IpIo;
EFI_STATUS Status;
EFI_IP4_RECEIVE_DATA *RxData;
@@ -623,6 +675,13 @@ IpIoListenHandler ( Status = IpIo->RcvToken.Status;
RxData = IpIo->RcvToken.Packet.RxData;
+ if (EFI_ABORTED == Status) {
+ //
+ // The reception is actively aborted by the consumer, directly return.
+ //
+ return;
+ }
+
if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL == RxData)) {
//
// Only process the normal packets and the icmp error packets, if RxData is NULL
@@ -690,6 +749,30 @@ Resume: /**
+ Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK
+
+ @param Event The event signaled.
+ @param Context The context passed in by the event notifier.
+
+ @return None.
+
+**/
+STATIC
+VOID
+EFIAPI
+IpIoListenHandler (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ //
+ // Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK
+ //
+ NetLibQueueDpc (TPL_CALLBACK, IpIoListenHandlerDpc, Context);
+}
+
+
+/**
Create a new IP_IO instance.
@param Image The image handle of an IP_IO consumer protocol.
|