summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c')
-rw-r--r--MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c109
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.