summaryrefslogtreecommitdiff
path: root/Nt32Pkg/SnpNt32Dxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-15 01:59:02 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-15 01:59:02 +0000
commite90e87777cfefa3569b74bcd877ae2a391d96e7f (patch)
treed478ff91276c2cecc6afaeadb7681a3a9bee7f42 /Nt32Pkg/SnpNt32Dxe
parente733f54213dfefb616bdd53a33a34b6a8568787a (diff)
downloadedk2-platforms-e90e87777cfefa3569b74bcd877ae2a391d96e7f.tar.xz
Use Mde library and definition instead of some native definitions in NetLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4695 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/SnpNt32Dxe')
-rw-r--r--Nt32Pkg/SnpNt32Dxe/SnpNt32.c54
-rw-r--r--Nt32Pkg/SnpNt32Dxe/SnpNt32.h6
2 files changed, 30 insertions, 30 deletions
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
index 89cc20deff..965452660e 100644
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
+++ b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
@@ -75,7 +75,7 @@ SnpNt32DriverBindingSupported (
{
SNPNT32_GLOBAL_DATA *GlobalData;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
SNPNT32_INSTANCE_DATA *Instance;
GlobalData = &gSnpNt32GlobalData;
@@ -268,7 +268,7 @@ SnpNt32ReceiveFilters (
GlobalData = Instance->GlobalData;
- if (EFI_ERROR (NET_TRYLOCK (&GlobalData->Lock))) {
+ if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
return EFI_ACCESS_DENIED;
}
@@ -279,7 +279,7 @@ SnpNt32ReceiveFilters (
McastFilter
);
- NET_UNLOCK (&GlobalData->Lock);
+ EfiReleaseLock (&GlobalData->Lock);
if (ReturnValue <= 0) {
return EFI_DEVICE_ERROR;
@@ -459,7 +459,7 @@ SnpNt32Transmit (
SrcAddr = &Instance->Mode.CurrentAddress;
}
- if (EFI_ERROR (NET_TRYLOCK (&GlobalData->Lock))) {
+ if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
return EFI_ACCESS_DENIED;
}
@@ -473,7 +473,7 @@ SnpNt32Transmit (
Protocol
);
- NET_UNLOCK (&GlobalData->Lock);
+ EfiReleaseLock (&GlobalData->Lock);
if (ReturnValue < 0) {
return EFI_DEVICE_ERROR;
@@ -526,7 +526,7 @@ SnpNt32Receive (
ASSERT (GlobalData->NtNetUtilityTable.Receive != NULL);
- if (EFI_ERROR (NET_TRYLOCK (&GlobalData->Lock))) {
+ if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
return EFI_ACCESS_DENIED;
}
@@ -536,7 +536,7 @@ SnpNt32Receive (
Buffer
);
- NET_UNLOCK (&GlobalData->Lock);
+ EfiReleaseLock (&GlobalData->Lock);
if (ReturnValue < 0) {
if (ReturnValue == -100) {
@@ -553,13 +553,13 @@ SnpNt32Receive (
}
if (SourceAddr != NULL) {
- NetZeroMem (SourceAddr, sizeof (EFI_MAC_ADDRESS));
- NetCopyMem (SourceAddr, ((UINT8 *) Buffer) + 6, 6);
+ ZeroMem (SourceAddr, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (SourceAddr, ((UINT8 *) Buffer) + 6, 6);
}
if (DestinationAddr != NULL) {
- NetZeroMem (DestinationAddr, sizeof (EFI_MAC_ADDRESS));
- NetCopyMem (DestinationAddr, ((UINT8 *) Buffer), 6);
+ ZeroMem (DestinationAddr, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (DestinationAddr, ((UINT8 *) Buffer), 6);
}
if (Protocol != NULL) {
@@ -652,7 +652,7 @@ SnpNt32InitializeGlobalData (
BOOLEAN NetUtilityLibInitDone;
NT_NET_INTERFACE_INFO NetInterfaceInfoBuffer[MAX_INTERFACE_INFO_NUMBER];
SNPNT32_INSTANCE_DATA *Instance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINT32 InterfaceCount;
ASSERT (This != NULL);
@@ -660,8 +660,8 @@ SnpNt32InitializeGlobalData (
NetUtilityLibInitDone = FALSE;
InterfaceCount = MAX_INTERFACE_INFO_NUMBER;
- NetListInit (&This->InstanceList);
- NET_LOCK_INIT (&This->Lock);
+ InitializeListHead (&This->InstanceList);
+ EfiInitializeLock (&This->Lock, TPL_CALLBACK);
//
// Get the WinNT thunk
@@ -755,7 +755,7 @@ SnpNt32InitializeGlobalData (
//
for (Index = 0; Index < InterfaceCount; Index++) {
- Instance = NetAllocatePool (sizeof (SNPNT32_INSTANCE_DATA));
+ Instance = AllocatePool (sizeof (SNPNT32_INSTANCE_DATA));
if (NULL == Instance) {
Status = EFI_OUT_OF_RESOURCES;
@@ -764,7 +764,7 @@ SnpNt32InitializeGlobalData (
//
// Copy the content from a template
//
- NetCopyMem (Instance, &gSnpNt32InstanceTemplate, sizeof (SNPNT32_INSTANCE_DATA));
+ CopyMem (Instance, &gSnpNt32InstanceTemplate, sizeof (SNPNT32_INSTANCE_DATA));
//
// Set the interface information.
@@ -776,29 +776,29 @@ SnpNt32InitializeGlobalData (
Status = This->InitializeInstanceData (This, Instance);
if (EFI_ERROR (Status)) {
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
goto ErrorReturn;
}
//
// Insert this instance into the instance list
//
- NetListInsertTail (&This->InstanceList, &Instance->Entry);
+ InsertTailList (&This->InstanceList, &Instance->Entry);
}
return EFI_SUCCESS;
ErrorReturn:
- while (!NetListIsEmpty (&This->InstanceList)) {
+ while (!IsListEmpty (&This->InstanceList)) {
Entry = This->InstanceList.ForwardLink;
Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
This->CloseInstance (This, Instance);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
if (NetUtilityLibInitDone) {
@@ -857,13 +857,13 @@ SnpNt32InitializeInstanceData (
//
// Create a fake device path for the instance
//
- NetZeroMem (&Node, sizeof (Node));
+ ZeroMem (&Node, sizeof (Node));
Node.DevPath.Type = MESSAGING_DEVICE_PATH;
Node.DevPath.SubType = MSG_MAC_ADDR_DP;
SetDevicePathNodeLength (&Node.DevPath, sizeof (MAC_ADDR_DEVICE_PATH));
- NetCopyMem (
+ CopyMem (
&Node.MacAddr.MacAddress,
&Instance->Mode.CurrentAddress,
sizeof (EFI_MAC_ADDRESS)
@@ -952,7 +952,7 @@ SnpNt32Unload (
{
EFI_STATUS Status;
SNPNT32_GLOBAL_DATA *This;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
SNPNT32_INSTANCE_DATA *Instance;
This = &gSnpNt32GlobalData;
@@ -963,7 +963,7 @@ SnpNt32Unload (
return Status;
}
- while (!NetListIsEmpty (&This->InstanceList)) {
+ while (!IsListEmpty (&This->InstanceList)) {
//
// Walkthrough the interfaces and remove all the SNP instance
//
@@ -971,10 +971,10 @@ SnpNt32Unload (
Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
This->CloseInstance (This, Instance);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
if (This->NtNetUtilityTable.Finalize != NULL) {
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
index 1ca5a34719..7769bbf295 100644
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
+++ b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
@@ -145,14 +145,14 @@ typedef struct _SNPNT32_GLOBAL_DATA {
//
// List for all the fake SNP instance
//
- NET_LIST_ENTRY InstanceList;
+ LIST_ENTRY InstanceList;
EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
HMODULE NetworkLibraryHandle;
NT_NET_UTILITY_TABLE NtNetUtilityTable;
- NET_LOCK Lock;
+ EFI_LOCK Lock;
//
// Private functions
@@ -173,7 +173,7 @@ typedef struct _SNPNT32_INSTANCE_DATA {
//
// List entry use for linking with other instance
//
- NET_LIST_ENTRY Entry;
+ LIST_ENTRY Entry;
SNPNT32_GLOBAL_DATA *GlobalData;