summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/MnpDxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 09:40:22 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 09:40:22 +0000
commite48e37fce2611df7a52aff271835ff72ee396d9b (patch)
treef6427ba11251479c615da9b5a3e38aa8c7b0f943 /MdeModulePkg/Universal/Network/MnpDxe
parentbb8ffffd1c0ff0ee697c26d377fd9767097cc02b (diff)
downloadedk2-platforms-e48e37fce2611df7a52aff271835ff72ee396d9b.tar.xz
Use Mde library and definition instead of some native definitions in NetLib, to simply network library.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4693 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/MnpDxe')
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c114
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDebug.h28
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c50
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h6
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf1
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.msa1
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpImpl.h15
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c69
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c38
9 files changed, 147 insertions, 175 deletions
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c
index c2bb839e6b..d03be7fc03 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c
@@ -142,7 +142,7 @@ MnpAddFreeNbuf (
Nbuf = NetbufAlloc (MnpServiceData->BufferLength + MnpServiceData->PaddingSize);
if (Nbuf == NULL) {
- MNP_DEBUG_ERROR (("MnpAddFreeNbuf: NetBufAlloc failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpAddFreeNbuf: NetBufAlloc failed.\n"));
Status = EFI_OUT_OF_RESOURCES;
break;
}
@@ -188,7 +188,7 @@ MnpAllocNbuf (
FreeNbufQue = &MnpServiceData->FreeNbufQue;
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
//
// Check whether there are available buffers, or else try to add some.
@@ -197,8 +197,9 @@ MnpAllocNbuf (
if ((MnpServiceData->NbufCnt + MNP_NET_BUFFER_INCREASEMENT) > MNP_MAX_NET_BUFFER_NUM) {
- MNP_DEBUG_ERROR (
- ("MnpAllocNbuf: The maximum NET_BUF size is reached for MNP driver instance %p.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpAllocNbuf: The maximum NET_BUF size is reached for MNP driver instance %p.\n",
MnpServiceData)
);
@@ -209,8 +210,9 @@ MnpAllocNbuf (
Status = MnpAddFreeNbuf (MnpServiceData, MNP_NET_BUFFER_INCREASEMENT);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpAllocNbuf: Failed to add NET_BUFs into the FreeNbufQue, %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpAllocNbuf: Failed to add NET_BUFs into the FreeNbufQue, %r.\n",
Status)
);
//
@@ -230,7 +232,7 @@ MnpAllocNbuf (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Nbuf;
}
@@ -256,7 +258,7 @@ MnpFreeNbuf (
NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
ASSERT (Nbuf->RefCnt > 1);
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
NET_PUT_REF (Nbuf);
@@ -268,7 +270,7 @@ MnpFreeNbuf (
NetbufQueAppend (&MnpServiceData->FreeNbufQue, Nbuf);
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
@@ -327,8 +329,8 @@ MnpInitializeServiceData (
//
// Initialize the lists.
//
- NetListInit (&MnpServiceData->GroupAddressList);
- NetListInit (&MnpServiceData->ChildrenList);
+ InitializeListHead (&MnpServiceData->GroupAddressList);
+ InitializeListHead (&MnpServiceData->ChildrenList);
//
// Get the buffer length used to allocate NET_BUF to hold data received
@@ -337,7 +339,7 @@ MnpInitializeServiceData (
MnpServiceData->BufferLength = MnpServiceData->Mtu + SnpMode->MediaHeaderSize + NET_ETHER_FCS_SIZE;
//
- // Make sure the protocol headers immediately following the media header
+ // Make sure the protocol headers immediately following the media header
// 4-byte aligned
//
MnpServiceData->PaddingSize = (4 - SnpMode->MediaHeaderSize) & 0x3;
@@ -349,7 +351,7 @@ MnpInitializeServiceData (
Status = MnpAddFreeNbuf (MnpServiceData, MNP_INIT_NET_BUFFER_NUM);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpInitializeServiceData: MnpAddFreeNbuf failed, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "MnpInitializeServiceData: MnpAddFreeNbuf failed, %r.\n", Status));
goto ERROR;
}
//
@@ -365,10 +367,10 @@ MnpInitializeServiceData (
//
// Allocate buffer pool for tx.
//
- MnpServiceData->TxBuf = NetAllocatePool (MnpServiceData->Mtu + SnpMode->MediaHeaderSize);
+ MnpServiceData->TxBuf = AllocatePool (MnpServiceData->Mtu + SnpMode->MediaHeaderSize);
if (MnpServiceData->TxBuf == NULL) {
- MNP_DEBUG_ERROR (("MnpInitializeServiceData: NetAllocatePool failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpInitializeServiceData: AllocatePool failed.\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ERROR;
@@ -379,14 +381,14 @@ MnpInitializeServiceData (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_LOCK,
+ TPL_CALLBACK,
MnpSystemPoll,
MnpServiceData,
&MnpServiceData->PollTimer
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpInitializeServiceData: CreateEvent for poll timer failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpInitializeServiceData: CreateEvent for poll timer failed.\n"));
goto ERROR;
}
@@ -395,14 +397,14 @@ MnpInitializeServiceData (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
MnpCheckPacketTimeout,
MnpServiceData,
&MnpServiceData->TimeoutCheckTimer
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpInitializeServiceData: CreateEvent for packet timeout check failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpInitializeServiceData: CreateEvent for packet timeout check failed.\n"));
goto ERROR;
}
@@ -411,14 +413,14 @@ MnpInitializeServiceData (
//
Status = gBS->CreateEvent (
EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
NULL,
NULL,
&MnpServiceData->TxTimeoutEvent
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpInitializeServiceData: CreateEvent for tx timeout event failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpInitializeServiceData: CreateEvent for tx timeout event failed.\n"));
}
ERROR:
@@ -439,7 +441,7 @@ ERROR:
if (MnpServiceData->TxBuf != NULL) {
- NetFreePool (MnpServiceData->TxBuf);
+ gBS->FreePool (MnpServiceData->TxBuf);
}
if (MnpServiceData->RxNbufCache != NULL) {
@@ -475,7 +477,7 @@ MnpFlushServiceData (
//
// The GroupAddressList must be empty.
//
- ASSERT (NetListIsEmpty (&MnpServiceData->GroupAddressList));
+ ASSERT (IsListEmpty (&MnpServiceData->GroupAddressList));
//
// Close the event.
@@ -487,7 +489,7 @@ MnpFlushServiceData (
//
// Free the tx buffer.
//
- NetFreePool (MnpServiceData->TxBuf);
+ gBS->FreePool (MnpServiceData->TxBuf);
//
// Free the RxNbufCache.
@@ -502,9 +504,9 @@ MnpFlushServiceData (
DEBUG_CODE (
- if (MnpServiceData->NbufCnt != 0) {
+ if (MnpServiceData->NbufCnt != 0) {
- MNP_DEBUG_WARN (("MnpFlushServiceData: Memory leak, MnpServiceData->NbufCnt != 0.\n"));
+ DEBUG ((EFI_D_WARN, "MnpFlushServiceData: Memory leak, MnpServiceData->NbufCnt != 0.\n"));
}
);
}
@@ -547,9 +549,9 @@ MnpInitializeInstanceData (
//
// Initialize the lists.
//
- NetListInit (&Instance->GroupCtrlBlkList);
- NetListInit (&Instance->RcvdPacketQueue);
- NetListInit (&Instance->RxDeliveredPacketQueue);
+ InitializeListHead (&Instance->GroupCtrlBlkList);
+ InitializeListHead (&Instance->RcvdPacketQueue);
+ InitializeListHead (&Instance->RxDeliveredPacketQueue);
//
// Initialize the RxToken Map.
@@ -769,7 +771,7 @@ MnpStart (
Status = MnpStartSnp (MnpServiceData->Snp);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpStart: MnpStartSnp failed, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "MnpStart: MnpStartSnp failed, %r.\n", Status));
goto ErrorExit;
}
@@ -783,8 +785,9 @@ MnpStart (
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpStart, gBS->SetTimer for TimeoutCheckTimer %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpStart, gBS->SetTimer for TimeoutCheckTimer %r.\n",
Status)
);
goto ErrorExit;
@@ -802,7 +805,7 @@ MnpStart (
Status = gBS->SetTimer (MnpServiceData->PollTimer, TimerOpType, MNP_SYS_POLL_INTERVAL);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpStart: gBS->SetTimer for PollTimer failed, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "MnpStart: gBS->SetTimer for PollTimer failed, %r.\n", Status));
goto ErrorExit;
}
@@ -902,9 +905,9 @@ MnpFlushRcvdDataQueue (
NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
- while (!NetListIsEmpty (&Instance->RcvdPacketQueue)) {
+ while (!IsListEmpty (&Instance->RcvdPacketQueue)) {
//
// Remove all the Wraps.
//
@@ -919,7 +922,7 @@ MnpFlushRcvdDataQueue (
ASSERT (Instance->RcvdPacketQueueSize == 0);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
@@ -1086,7 +1089,7 @@ MnpConfigReceiveFilters (
UINT32 EnableFilterBits;
UINT32 DisableFilterBits;
BOOLEAN ResetMCastFilters;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINT32 Index;
MNP_GROUP_ADDRESS *GroupAddress;
@@ -1138,10 +1141,10 @@ MnpConfigReceiveFilters (
// Allocate pool for the mulicast addresses.
//
MCastFilterCnt = MnpServiceData->GroupAddressCount;
- MCastFilter = NetAllocatePool (sizeof (EFI_MAC_ADDRESS) * MCastFilterCnt);
+ MCastFilter = AllocatePool (sizeof (EFI_MAC_ADDRESS) * MCastFilterCnt);
if (MCastFilter == NULL) {
- MNP_DEBUG_ERROR (("MnpConfigReceiveFilters: Failed to allocate memory resource for MCastFilter.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpConfigReceiveFilters: Failed to allocate memory resource for MCastFilter.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -1202,8 +1205,9 @@ MnpConfigReceiveFilters (
DEBUG_CODE (
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpConfigReceiveFilters: Snp->ReceiveFilters failed, %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpConfigReceiveFilters: Snp->ReceiveFilters failed, %r.\n",
Status)
);
}
@@ -1213,7 +1217,7 @@ MnpConfigReceiveFilters (
//
// Free the buffer used to hold the group addresses.
//
- NetFreePool (MCastFilter);
+ gBS->FreePool (MCastFilter);
}
return Status;
@@ -1258,17 +1262,17 @@ MnpGroupOpAddCtrlBlk (
//
// Allocate a new GroupAddress to be added into MNP's GroupAddressList.
//
- GroupAddress = NetAllocatePool (sizeof (MNP_GROUP_ADDRESS));
+ GroupAddress = AllocatePool (sizeof (MNP_GROUP_ADDRESS));
if (GroupAddress == NULL) {
- MNP_DEBUG_ERROR (("MnpGroupOpFormCtrlBlk: Failed to allocate memory resource.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpGroupOpFormCtrlBlk: Failed to allocate memory resource.\n"));
return EFI_OUT_OF_RESOURCES;
}
CopyMem (&GroupAddress->Address, MacAddress, sizeof (GroupAddress->Address));
GroupAddress->RefCnt = 0;
- NetListInsertTail (
+ InsertTailList (
&MnpServiceData->GroupAddressList,
&GroupAddress->AddrEntry
);
@@ -1284,7 +1288,7 @@ MnpGroupOpAddCtrlBlk (
// Add the CtrlBlk into the instance's GroupCtrlBlkList.
//
CtrlBlk->GroupAddress = GroupAddress;
- NetListInsertTail (&Instance->GroupCtrlBlkList, &CtrlBlk->CtrlBlkEntry);
+ InsertTailList (&Instance->GroupCtrlBlkList, &CtrlBlk->CtrlBlkEntry);
return EFI_SUCCESS;
}
@@ -1319,8 +1323,8 @@ MnpGroupOpDelCtrlBlk (
// Remove and free the CtrlBlk.
//
GroupAddress = CtrlBlk->GroupAddress;
- NetListRemoveEntry (&CtrlBlk->CtrlBlkEntry);
- NetFreePool (CtrlBlk);
+ RemoveEntryList (&CtrlBlk->CtrlBlkEntry);
+ gBS->FreePool (CtrlBlk);
ASSERT (GroupAddress->RefCnt > 0);
@@ -1334,8 +1338,8 @@ MnpGroupOpDelCtrlBlk (
// Free this GroupAddress entry if no instance uses it.
//
MnpServiceData->GroupAddressCount--;
- NetListRemoveEntry (&GroupAddress->AddrEntry);
- NetFreePool (GroupAddress);
+ RemoveEntryList (&GroupAddress->AddrEntry);
+ gBS->FreePool (GroupAddress);
return TRUE;
}
@@ -1367,8 +1371,8 @@ MnpGroupOp (
)
{
MNP_SERVICE_DATA *MnpServiceData;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
MNP_GROUP_ADDRESS *GroupAddress;
EFI_SIMPLE_NETWORK_MODE *SnpMode;
MNP_GROUP_CONTROL_BLOCK *NewCtrlBlk;
@@ -1392,10 +1396,10 @@ MnpGroupOp (
//
// Allocate memory for the control block.
//
- NewCtrlBlk = NetAllocatePool (sizeof (MNP_GROUP_CONTROL_BLOCK));
+ NewCtrlBlk = AllocatePool (sizeof (MNP_GROUP_CONTROL_BLOCK));
if (NewCtrlBlk == NULL) {
- MNP_DEBUG_ERROR (("MnpGroupOp: Failed to allocate memory resource.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpGroupOp: Failed to allocate memory resource.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -1404,7 +1408,7 @@ MnpGroupOp (
// Check whether the MacAddress is already joined by other instances.
//
GroupAddress = NET_LIST_USER_STRUCT (Entry, MNP_GROUP_ADDRESS, AddrEntry);
- if (0 == NetCompareMem (
+ if (0 == CompareMem (
MacAddress,
&GroupAddress->Address,
SnpMode->HwAddressSize
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDebug.h b/MdeModulePkg/Universal/Network/MnpDxe/MnpDebug.h
deleted file mode 100644
index 063c05b74c..0000000000
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDebug.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/** @file
-
-Copyright (c) 2005 - 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- MnpDebug.h
-
-Abstract:
-
-
-**/
-
-#ifndef _MNP_DEBUG_H_
-#define _MNP_DEBUG_H_
-
-#define MNP_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE ("Mnp", PrintArg)
-#define MNP_DEBUG_WARN(PrintArg) NET_DEBUG_WARNING ("Mnp", PrintArg)
-#define MNP_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR ("Mnp", PrintArg)
-
-#endif
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
index 946ace1f66..fe6b63beac 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
@@ -19,7 +19,6 @@ Abstract:
**/
#include "MnpDriver.h"
-#include "MnpDebug.h"
#include "MnpImpl.h"
@@ -116,10 +115,9 @@ MnpDriverBindingStart (
MnpInitialized = FALSE;
- MnpServiceData = NetAllocateZeroPool (sizeof (MNP_SERVICE_DATA));
+ MnpServiceData = AllocateZeroPool (sizeof (MNP_SERVICE_DATA));
if (MnpServiceData == NULL) {
- MNP_DEBUG_ERROR (("MnpDriverBindingStart(): Failed to allocate the "
- L"Mnp Service Data.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpDriverBindingStart(): Failed to allocate the Mnp Service Data.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -130,8 +128,7 @@ MnpDriverBindingStart (
Status = MnpInitializeServiceData (MnpServiceData, This->DriverBindingHandle, ControllerHandle);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpDriverBindingStart: MnpInitializeServiceData "
- L"failed, %r.\n",Status));
+ DEBUG ((EFI_D_ERROR, "MnpDriverBindingStart: MnpInitializeServiceData failed, %r.\n",Status));
goto ErrorExit;
}
@@ -168,7 +165,7 @@ ErrorExit:
ControllerHandle
);
- NetFreePool (MnpServiceData);
+ gBS->FreePool (MnpServiceData);
}
return Status;
@@ -215,8 +212,9 @@ MnpDriverBindingStop (
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpDriverBindingStop: Locate MNP Service Binding Protocol failed, %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpDriverBindingStop: Locate MNP Service Binding Protocol failed, %r.\n",
Status)
);
return EFI_DEVICE_ERROR;
@@ -250,9 +248,9 @@ MnpDriverBindingStop (
//
MnpFlushServiceData (MnpServiceData);
- NetFreePool (MnpServiceData);
+ gBS->FreePool (MnpServiceData);
} else {
- while (!NetListIsEmpty (&MnpServiceData->ChildrenList)) {
+ while (!IsListEmpty (&MnpServiceData->ChildrenList)) {
//
// Don't use NetListRemoveHead here, the remove opreration will be done
// in ServiceBindingDestroyChild.
@@ -310,10 +308,10 @@ MnpServiceBindingCreateChild (
//
// Allocate buffer for the new instance.
//
- Instance = NetAllocateZeroPool (sizeof (MNP_INSTANCE_DATA));
+ Instance = AllocateZeroPool (sizeof (MNP_INSTANCE_DATA));
if (Instance == NULL) {
- MNP_DEBUG_ERROR (("MnpServiceBindingCreateChild: Faild to allocate memory for the new instance.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpServiceBindingCreateChild: Faild to allocate memory for the new instance.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -330,8 +328,9 @@ MnpServiceBindingCreateChild (
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpServiceBindingCreateChild: Failed to install the MNP protocol, %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpServiceBindingCreateChild: Failed to install the MNP protocol, %r.\n",
Status)
);
goto ErrorExit;
@@ -357,12 +356,12 @@ MnpServiceBindingCreateChild (
//
// Add the child instance into ChildrenList.
//
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- NetListInsertTail (&MnpServiceData->ChildrenList, &Instance->InstEntry);
+ InsertTailList (&MnpServiceData->ChildrenList, &Instance->InstEntry);
MnpServiceData->ChildrenNumber++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
ErrorExit:
@@ -377,7 +376,7 @@ ErrorExit:
);
}
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
return Status;
@@ -472,8 +471,9 @@ MnpServiceBindingDestroyChild (
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (
- ("MnpServiceBindingDestroyChild: Failed to uninstall the ManagedNetwork protocol, %r.\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "MnpServiceBindingDestroyChild: Failed to uninstall the ManagedNetwork protocol, %r.\n",
Status)
);
@@ -481,7 +481,7 @@ MnpServiceBindingDestroyChild (
return Status;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Reset the configuration.
@@ -501,12 +501,12 @@ MnpServiceBindingDestroyChild (
//
// Remove this instance from the ChildrenList.
//
- NetListRemoveEntry (&Instance->InstEntry);
+ RemoveEntryList (&Instance->InstEntry);
MnpServiceData->ChildrenNumber--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
index 732c56b299..050b9e0fec 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
@@ -35,8 +35,6 @@ Abstract:
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
-#include "MnpDebug.h"
-
//
// Required Global Variables
//
@@ -56,11 +54,11 @@ typedef struct _MNP_SERVICE_DATA {
UINT32 Mtu;
- NET_LIST_ENTRY ChildrenList;
+ LIST_ENTRY ChildrenList;
UINTN ChildrenNumber;
UINTN ConfiguredChildrenNumber;
- NET_LIST_ENTRY GroupAddressList;
+ LIST_ENTRY GroupAddressList;
UINT32 GroupAddressCount;
EFI_EVENT TxTimeoutEvent;
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf b/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
index 1eef0e54dd..4c46c1e671 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
@@ -33,7 +33,6 @@
#
[Sources.common]
- MnpDebug.h
MnpMain.c
MnpIo.c
MnpDriver.h
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.msa b/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.msa
index 718e1b9a7b..71bdcfdb09 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.msa
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.msa
@@ -43,7 +43,6 @@
<Filename>MnpDriver.h</Filename>
<Filename>MnpIo.c</Filename>
<Filename>MnpMain.c</Filename>
- <Filename>MnpDebug.h</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpImpl.h b/MdeModulePkg/Universal/Network/MnpDxe/MnpImpl.h
index 880414231c..436dbeb674 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpImpl.h
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpImpl.h
@@ -22,7 +22,6 @@ Abstract:
#define _MNP_IMPL_H_
#include "MnpDriver.h"
-#include "MnpDebug.h"
#define NET_ETHER_FCS_SIZE 4
@@ -58,19 +57,19 @@ typedef struct _MNP_INSTANCE_DATA {
EFI_HANDLE Handle;
- NET_LIST_ENTRY InstEntry;
+ LIST_ENTRY InstEntry;
EFI_MANAGED_NETWORK_PROTOCOL ManagedNetwork;
BOOLEAN Configured;
BOOLEAN Destroyed;
- NET_LIST_ENTRY GroupCtrlBlkList;
+ LIST_ENTRY GroupCtrlBlkList;
NET_MAP RxTokenMap;
- NET_LIST_ENTRY RxDeliveredPacketQueue;
- NET_LIST_ENTRY RcvdPacketQueue;
+ LIST_ENTRY RxDeliveredPacketQueue;
+ LIST_ENTRY RcvdPacketQueue;
UINTN RcvdPacketQueueSize;
EFI_MANAGED_NETWORK_CONFIG_DATA ConfigData;
@@ -79,18 +78,18 @@ typedef struct _MNP_INSTANCE_DATA {
} MNP_INSTANCE_DATA;
typedef struct _MNP_GROUP_ADDRESS {
- NET_LIST_ENTRY AddrEntry;
+ LIST_ENTRY AddrEntry;
EFI_MAC_ADDRESS Address;
INTN RefCnt;
} MNP_GROUP_ADDRESS;
typedef struct _MNP_GROUP_CONTROL_BLOCK {
- NET_LIST_ENTRY CtrlBlkEntry;
+ LIST_ENTRY CtrlBlkEntry;
MNP_GROUP_ADDRESS *GroupAddress;
} MNP_GROUP_CONTROL_BLOCK;
typedef struct _MNP_RXDATA_WRAP {
- NET_LIST_ENTRY WrapEntry;
+ LIST_ENTRY WrapEntry;
MNP_INSTANCE_DATA *Instance;
EFI_MANAGED_NETWORK_RECEIVE_DATA RxData;
NET_BUF *Nbuf;
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
index ed8bf78282..d9df1d45b2 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
@@ -58,7 +58,7 @@ MnpIsValidTxToken (
// The token is invalid if the Event is NULL, or the TxData is NULL, or
// the fragment count is zero.
//
- MNP_DEBUG_WARN (("MnpIsValidTxToken: Invalid Token.\n"));
+ DEBUG ((EFI_D_WARN, "MnpIsValidTxToken: Invalid Token.\n"));
return FALSE;
}
@@ -67,7 +67,7 @@ MnpIsValidTxToken (
// The token is invalid if the HeaderLength isn't zero while the DestinationAddress
// is NULL (The destination address is already put into the packet).
//
- MNP_DEBUG_WARN (("MnpIsValidTxToken: DestinationAddress isn't NULL, HeaderLength must be 0.\n"));
+ DEBUG ((EFI_D_WARN, "MnpIsValidTxToken: DestinationAddress isn't NULL, HeaderLength must be 0.\n"));
return FALSE;
}
@@ -79,7 +79,7 @@ MnpIsValidTxToken (
//
// The token is invalid if any FragmentLength is zero or any FragmentBuffer is NULL.
//
- MNP_DEBUG_WARN (("MnpIsValidTxToken: Invalid FragmentLength or FragmentBuffer.\n"));
+ DEBUG ((EFI_D_WARN, "MnpIsValidTxToken: Invalid FragmentLength or FragmentBuffer.\n"));
return FALSE;
}
@@ -98,7 +98,7 @@ MnpIsValidTxToken (
// The length calculated from the fragment information doesn't equal to the
// sum of the DataLength and the HeaderLength.
//
- MNP_DEBUG_WARN (("MnpIsValidTxData: Invalid Datalength compared with the sum of fragment length.\n"));
+ DEBUG ((EFI_D_WARN, "MnpIsValidTxData: Invalid Datalength compared with the sum of fragment length.\n"));
return FALSE;
}
@@ -106,7 +106,7 @@ MnpIsValidTxToken (
//
// The total length is larger than the MTU.
//
- MNP_DEBUG_WARN (("MnpIsValidTxData: TxData->DataLength exceeds Mtu.\n"));
+ DEBUG ((EFI_D_WARN, "MnpIsValidTxData: TxData->DataLength exceeds Mtu.\n"));
return FALSE;
}
@@ -169,7 +169,7 @@ MnpBuildTxPacket (
//
// Copy the data.
//
- NetCopyMem (
+ CopyMem (
DstPos,
TxData->FragmentTable[Index].FragmentBuffer,
TxData->FragmentTable[Index].FragmentLength
@@ -329,7 +329,7 @@ MnpInstanceDeliverPacket (
MnpServiceData = Instance->MnpServiceData;
NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
- if (NetMapIsEmpty (&Instance->RxTokenMap) || NetListIsEmpty (&Instance->RcvdPacketQueue)) {
+ if (NetMapIsEmpty (&Instance->RxTokenMap) || IsListEmpty (&Instance->RcvdPacketQueue)) {
//
// No pending received data or no available receive token, return.
//
@@ -346,7 +346,7 @@ MnpInstanceDeliverPacket (
//
DupNbuf = MnpAllocNbuf (MnpServiceData);
if (DupNbuf == NULL) {
- MNP_DEBUG_WARN (("MnpDeliverPacket: Failed to allocate a free Nbuf.\n"));
+ DEBUG ((EFI_D_WARN, "MnpDeliverPacket: Failed to allocate a free Nbuf.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -379,7 +379,7 @@ MnpInstanceDeliverPacket (
//
// Insert this RxDataWrap into the delivered queue.
//
- NetListInsertTail (&Instance->RxDeliveredPacketQueue, &RxDataWrap->WrapEntry);
+ InsertTailList (&Instance->RxDeliveredPacketQueue, &RxDataWrap->WrapEntry);
//
// Get the receive token from the RxTokenMap.
@@ -411,7 +411,7 @@ MnpDeliverPacket (
IN MNP_SERVICE_DATA *MnpServiceData
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
MNP_INSTANCE_DATA *Instance;
NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
@@ -472,9 +472,9 @@ MnpRecycleRxData (
//
// Remove this Wrap entry from the list.
//
- NetListRemoveEntry (&RxDataWrap->WrapEntry);
+ RemoveEntryList (&RxDataWrap->WrapEntry);
- NetFreePool (RxDataWrap);
+ gBS->FreePool (RxDataWrap);
}
@@ -505,7 +505,7 @@ MnpQueueRcvdPacket (
//
if (Instance->RcvdPacketQueueSize == MNP_MAX_RCVD_PACKET_QUE_SIZE) {
- MNP_DEBUG_WARN (("MnpQueueRcvdPacket: Drop one packet bcz queue size limit reached.\n"));
+ DEBUG ((EFI_D_WARN, "MnpQueueRcvdPacket: Drop one packet bcz queue size limit reached.\n"));
//
// Get the oldest packet.
@@ -531,7 +531,7 @@ MnpQueueRcvdPacket (
//
// Insert this Wrap into the instance queue.
//
- NetListInsertTail (&Instance->RcvdPacketQueue, &RxDataWrap->WrapEntry);
+ InsertTailList (&Instance->RcvdPacketQueue, &RxDataWrap->WrapEntry);
Instance->RcvdPacketQueueSize++;
}
@@ -560,7 +560,7 @@ MnpMatchPacket (
)
{
EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
MNP_GROUP_CONTROL_BLOCK *GroupCtrlBlk;
NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
@@ -644,7 +644,7 @@ MnpAnalysePacket (
{
EFI_SIMPLE_NETWORK_MODE *SnpMode;
UINT8 *BufPtr;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
SnpMode = MnpServiceData->Snp->Mode;
@@ -707,7 +707,7 @@ MnpAnalysePacket (
}
}
- NetZeroMem (&RxData->Timestamp, sizeof (EFI_TIME));
+ ZeroMem (&RxData->Timestamp, sizeof (EFI_TIME));
//
// Fill the common parts of RxData.
@@ -742,9 +742,9 @@ MnpWrapRxData (
//
// Allocate memory.
//
- RxDataWrap = NetAllocatePool (sizeof (MNP_RXDATA_WRAP));
+ RxDataWrap = AllocatePool (sizeof (MNP_RXDATA_WRAP));
if (RxDataWrap == NULL) {
- MNP_DEBUG_ERROR (("MnpDispatchPacket: Failed to allocate a MNP_RXDATA_WRAP.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpDispatchPacket: Failed to allocate a MNP_RXDATA_WRAP.\n"));
return NULL;
}
@@ -760,15 +760,15 @@ MnpWrapRxData (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_RECYCLE,
+ TPL_NOTIFY,
MnpRecycleRxData,
RxDataWrap,
&RxDataWrap->RxData.RecycleEvent
);
if (EFI_ERROR (Status)) {
- MNP_DEBUG_ERROR (("MnpDispatchPacket: gBS->CreateEvent failed, %r.\n", Status));
- NetFreePool (RxDataWrap);
+ DEBUG ((EFI_D_ERROR, "MnpDispatchPacket: gBS->CreateEvent failed, %r.\n", Status));
+ gBS->FreePool (RxDataWrap);
return NULL;
}
@@ -794,7 +794,7 @@ MnpEnqueuePacket (
IN NET_BUF *Nbuf
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
MNP_INSTANCE_DATA *Instance;
EFI_MANAGED_NETWORK_RECEIVE_DATA RxData;
UINT8 PktAttr;
@@ -889,7 +889,7 @@ MnpReceivePacket (
return EFI_NOT_STARTED;
}
- if (NetListIsEmpty (&MnpServiceData->ChildrenList)) {
+ if (IsListEmpty (&MnpServiceData->ChildrenList)) {
//
// There is no child, no need to receive packets.
//
@@ -929,7 +929,7 @@ MnpReceivePacket (
DEBUG_CODE (
if (Status != EFI_NOT_READY) {
- MNP_DEBUG_ERROR (("MnpReceivePacket: Snp->Receive() = %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "MnpReceivePacket: Snp->Receive() = %r.\n", Status));
}
);
@@ -941,8 +941,9 @@ MnpReceivePacket (
//
if ((HeaderSize != Snp->Mode->MediaHeaderSize) || (BufLen < HeaderSize)) {
- MNP_DEBUG_WARN (
- ("MnpReceivePacket: Size error, HL:TL = %d:%d.\n",
+ DEBUG (
+ (EFI_D_WARN,
+ "MnpReceivePacket: Size error, HL:TL = %d:%d.\n",
HeaderSize,
BufLen)
);
@@ -973,7 +974,7 @@ MnpReceivePacket (
Nbuf = MnpAllocNbuf (MnpServiceData);
MnpServiceData->RxNbufCache = Nbuf;
if (Nbuf == NULL) {
- MNP_DEBUG_ERROR (("MnpReceivePacket: Alloc packet for receiving cache failed.\n"));
+ DEBUG ((EFI_D_ERROR, "MnpReceivePacket: Alloc packet for receiving cache failed.\n"));
return EFI_DEVICE_ERROR;
}
@@ -1024,9 +1025,9 @@ MnpCheckPacketTimeout (
)
{
MNP_SERVICE_DATA *MnpServiceData;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *RxEntry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *RxEntry;
+ LIST_ENTRY *NextEntry;
MNP_INSTANCE_DATA *Instance;
MNP_RXDATA_WRAP *RxDataWrap;
EFI_TPL OldTpl;
@@ -1047,7 +1048,7 @@ MnpCheckPacketTimeout (
continue;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
NET_LIST_FOR_EACH_SAFE (RxEntry, NextEntry, &Instance->RcvdPacketQueue) {
@@ -1060,13 +1061,13 @@ MnpCheckPacketTimeout (
//
// Drop the timeout packet.
//
- MNP_DEBUG_WARN (("MnpCheckPacketTimeout: Received packet timeout.\n"));
+ DEBUG ((EFI_D_WARN, "MnpCheckPacketTimeout: Received packet timeout.\n"));
MnpRecycleRxData (NULL, RxDataWrap);
Instance->RcvdPacketQueueSize--;
}
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
}
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
index b6d93921b2..95a4b675bb 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
@@ -62,7 +62,7 @@ MnpGetModeData (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (MnpConfigData != NULL) {
//
@@ -85,7 +85,7 @@ MnpGetModeData (
Status = EFI_SUCCESS;
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -133,7 +133,7 @@ MnpConfigure (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if ((MnpConfigData == NULL) && (!Instance->Configured)) {
//
@@ -149,7 +149,7 @@ MnpConfigure (
Status = MnpConfigureInstance (Instance, MnpConfigData);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -210,7 +210,7 @@ MnpMcastIpToMac (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
@@ -247,7 +247,7 @@ MnpMcastIpToMac (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -285,7 +285,7 @@ MnpGroups (
EFI_SIMPLE_NETWORK_MODE *SnpMode;
MNP_GROUP_CONTROL_BLOCK *GroupCtrlBlk;
MNP_GROUP_ADDRESS *GroupAddress;
- NET_LIST_ENTRY *ListEntry;
+ LIST_ENTRY *ListEntry;
BOOLEAN AddressExist;
EFI_TPL OldTpl;
EFI_STATUS Status;
@@ -300,7 +300,7 @@ MnpGroups (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
SnpMode = Instance->MnpServiceData->Snp->Mode;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
@@ -334,7 +334,7 @@ MnpGroups (
CtrlBlkEntry
);
GroupAddress = GroupCtrlBlk->GroupAddress;
- if (0 == NetCompareMem (
+ if (0 == CompareMem (
MacAddress,
&GroupAddress->Address,
SnpMode->HwAddressSize
@@ -364,7 +364,7 @@ MnpGroups (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
- } else if (NetListIsEmpty (&Instance->GroupCtrlBlkList)) {
+ } else if (IsListEmpty (&Instance->GroupCtrlBlkList)) {
//
// The MacAddress is NULL and there is no configured multicast mac address,
// just return.
@@ -378,7 +378,7 @@ MnpGroups (
Status = MnpGroupOp (Instance, JoinFlag, MacAddress, GroupCtrlBlk);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -427,7 +427,7 @@ MnpTransmit (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
@@ -457,7 +457,7 @@ MnpTransmit (
Status = MnpSyncSendPacket (MnpServiceData, PktBuf, PktLen, Token);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -504,7 +504,7 @@ MnpReceive (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
@@ -539,7 +539,7 @@ MnpReceive (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -583,7 +583,7 @@ MnpCancel (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
@@ -607,7 +607,7 @@ MnpCancel (
NetLibDispatchDpc ();
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -646,7 +646,7 @@ MnpPoll (
Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (!Instance->Configured) {
Status = EFI_NOT_STARTED;
@@ -661,7 +661,7 @@ MnpPoll (
NetLibDispatchDpc ();
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}