summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Include/Library/IpIoLib.h10
-rw-r--r--MdeModulePkg/Include/Library/NetLib.h174
-rw-r--r--MdeModulePkg/Include/Library/UdpIoLib.h6
-rw-r--r--MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c76
-rw-r--r--MdeModulePkg/Library/DxeNetLib/DxeNetLib.c106
-rw-r--r--MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf2
-rw-r--r--MdeModulePkg/Library/DxeNetLib/NetBuffer.c92
-rw-r--r--MdeModulePkg/Library/DxeNetLib/NetDebug.c536
-rw-r--r--MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c50
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpDebug.h30
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c56
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h1
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf1
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.msa1
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c167
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h21
-rw-r--r--MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c56
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c48
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c84
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h4
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c60
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c26
-rw-r--r--MdeModulePkg/Universal/Network/DpcDxe/Dpc.c4
-rw-r--r--MdeModulePkg/Universal/Network/DpcDxe/Dpc.h2
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c16
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c72
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h2
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c42
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c2
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c22
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c26
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h6
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c16
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c168
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h10
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c22
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/Md5.c14
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c56
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c14
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c20
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c18
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c60
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c2
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c94
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h14
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c28
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h4
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c124
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h14
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c88
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h6
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c6
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c2
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c76
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h8
-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
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c50
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c64
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h6
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c4
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c12
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c32
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h10
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c10
-rw-r--r--MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c10
-rw-r--r--MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c8
-rw-r--r--MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_udp.c8
-rw-r--r--MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4InitSelect.c14
-rw-r--r--MdeModulePkg/Universal/Network/PxeDhcp4Dxe/Support.c25
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c119
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h3
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c104
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h16
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c34
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c40
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h2
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h2
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c108
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c8
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c6
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h4
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c69
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c8
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c40
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h10
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c16
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c28
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c88
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h12
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c50
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c89
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c8
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c66
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c4
102 files changed, 1697 insertions, 2477 deletions
diff --git a/MdeModulePkg/Include/Library/IpIoLib.h b/MdeModulePkg/Include/Library/IpIoLib.h
index 682036f252..3e9bde9b2c 100644
--- a/MdeModulePkg/Include/Library/IpIoLib.h
+++ b/MdeModulePkg/Include/Library/IpIoLib.h
@@ -107,11 +107,11 @@ typedef struct _IP_IO {
//
// the node used to link this IpIo to the active IpIo list.
//
- NET_LIST_ENTRY Entry;
+ LIST_ENTRY Entry;
// the list used to maintain the IP instance for different sending purpose.
//
- NET_LIST_ENTRY IpList;
+ LIST_ENTRY IpList;
//
// the ip instance consumed by this IP IO
@@ -135,7 +135,7 @@ typedef struct _IP_IO {
//
// list entry used to link the token passed to IP_IO
//
- NET_LIST_ENTRY PendingSndList;
+ LIST_ENTRY PendingSndList;
//
// User interface used to get notify from IP_IO
@@ -155,7 +155,7 @@ typedef struct _IP_IO_OPEN_DATA {
} IP_IO_OPEN_DATA;
typedef struct _IP_IO_SEND_ENTRY {
- NET_LIST_ENTRY Entry;
+ LIST_ENTRY Entry;
IP_IO *IpIo;
VOID *Context;
VOID *NotifyData;
@@ -169,7 +169,7 @@ typedef EFI_IP4_OVERRIDE_DATA IP_IO_OVERRIDE;
typedef struct _IP_IO_IP_INFO {
IP4_ADDR Addr;
IP4_ADDR SubnetMask;
- NET_LIST_ENTRY Entry;
+ LIST_ENTRY Entry;
EFI_HANDLE ChildHandle;
EFI_IP4_PROTOCOL *Ip;
EFI_IP4_COMPLETION_TOKEN DummyRcvToken;
diff --git a/MdeModulePkg/Include/Library/NetLib.h b/MdeModulePkg/Include/Library/NetLib.h
index e621c24c8d..2399b74f3c 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -32,8 +32,6 @@ Abstract:
#include <Protocol/DriverDiagnostics.h>
#include <Protocol/Dpc.h>
-#define EFI_NET_LITTLE_ENDIAN
-
typedef UINT32 IP4_ADDR;
typedef UINT32 TCP_SEQNO;
typedef UINT16 TCP_PORTNO;
@@ -77,13 +75,8 @@ typedef struct {
// directly. This is why there is an internal representation.
//
typedef struct {
-#ifdef EFI_NET_LITTLE_ENDIAN
UINT8 HeadLen : 4;
UINT8 Ver : 4;
-#else
- UINT8 Ver : 4;
- UINT8 HeadLen : 4;
-#endif
UINT8 Tos;
UINT16 TotalLen;
UINT16 Id;
@@ -138,13 +131,8 @@ typedef struct {
TCP_PORTNO DstPort;
TCP_SEQNO Seq;
TCP_SEQNO Ack;
-#ifdef EFI_NET_LITTLE_ENDIAN
UINT8 Res : 4;
UINT8 HeadLen : 4;
-#else
- UINT8 HeadLen : 4;
- UINT8 Res : 4;
-#endif
UINT8 Flag;
UINT16 Wnd;
UINT16 Checksum;
@@ -154,12 +142,11 @@ typedef struct {
#pragma pack()
#define NET_MAC_EQUAL(pMac1, pMac2, Len) \
- (NetCompareMem ((pMac1), (pMac2), Len) == 0)
+ (CompareMem ((pMac1), (pMac2), Len) == 0)
#define NET_MAC_IS_MULTICAST(Mac, BMac, Len) \
(((*((UINT8 *) Mac) & 0x01) == 0x01) && (!NET_MAC_EQUAL (Mac, BMac, Len)))
-#ifdef EFI_NET_LITTLE_ENDIAN
#define NTOHL(x) (UINT32)((((UINT32) (x) & 0xff) << 24) | \
(((UINT32) (x) & 0xff00) << 8) | \
(((UINT32) (x) & 0xff0000) >> 8) | \
@@ -171,12 +158,6 @@ typedef struct {
(((UINT16) (x) & 0xff00) >> 8))
#define HTONS(x) NTOHS(x)
-#else
-#define NTOHL(x) (UINT32)(x)
-#define HTONL(x) (UINT32)(x)
-#define NTOHS(x) (UINT16)(x)
-#define HTONS(x) (UINT16)(x)
-#endif
//
// Test the IP's attribute, All the IPs are in host byte order.
@@ -191,7 +172,7 @@ typedef struct {
//
#define EFI_IP4(EfiIpAddr) (*(IP4_ADDR *) ((EfiIpAddr).Addr))
#define EFI_NTOHL(EfiIp) (NTOHL (EFI_IP4 ((EfiIp))))
-#define EFI_IP4_EQUAL(Ip1, Ip2) (NetCompareMem ((Ip1), (Ip2), sizeof (EFI_IPv4_ADDRESS)) == 0)
+#define EFI_IP4_EQUAL(Ip1, Ip2) (CompareMem ((Ip1), (Ip2), sizeof (EFI_IPv4_ADDRESS)) == 0)
INTN
NetGetMaskLength (
@@ -220,33 +201,22 @@ extern EFI_IPv4_ADDRESS mZeroIp4Addr;
#define NET_IS_UPPER_CASE_CHAR(Ch) (('A' <= (Ch)) && ((Ch) <= 'Z'))
//
-// Wrap functions to ease the impact of EFI library changes.
-//
-#define NetAllocateZeroPool AllocateZeroPool
-#define NetAllocatePool AllocatePool
-#define NetFreePool gBS->FreePool
-#define NetCopyMem CopyMem
-#define NetSetMem SetMem
-#define NetZeroMem(Dest, Len) SetMem ((Dest), (Len), 0)
-#define NetCompareMem CompareMem
-
-//
// Lock primitives: the stack implements its lock primitives according
// to the standard EFI enviornment. It will NOT consider multiprocessor.
//
-#define NET_TPL_LOCK TPL_CALLBACK
-#define NET_TPL_EVENT TPL_NOTIFY
-#define NET_TPL_RECYCLE TPL_NOTIFY
-#define NET_TPL_TIMER NET_TPL_LOCK
+//#define NET_TPL_LOCK TPL_CALLBACK
+//#define NET_TPL_EVENT TPL_NOTIFY
+//#define NET_TPL_RECYCLE TPL_NOTIFY
+//#define NET_TPL_TIMER NET_TPL_LOCK
-#define NET_LOCK EFI_LOCK
-#define NET_LOCK_INIT(x) EfiInitializeLock (x, NET_TPL_LOCK)
-#define NET_RECYCLE_LOCK_INIT(x) EfiInitializeLock (x, NET_TPL_RECYCLE)
-#define NET_TRYLOCK(x) EfiAcquireLockOrFail (x)
-#define NET_UNLOCK(x) EfiReleaseLock (x)
+//#define NET_LOCK EFI_LOCK
+//#define NET_LOCK_INIT(x) EfiInitializeLock (x, NET_TPL_LOCK)
+//#define NET_RECYCLE_LOCK_INIT(x) EfiInitializeLock (x, NET_TPL_RECYCLE)
+//#define NET_TRYLOCK(x) EfiAcquireLockOrFail (x)
+//#define NET_UNLOCK(x) EfiReleaseLock (x)
-#define NET_RAISE_TPL(x) (gBS->RaiseTPL (x))
-#define NET_RESTORE_TPL(x) (gBS->RestoreTPL (x))
+//#define NET_RAISE_TPL(x) (gBS->RaiseTPL (x))
+//#define NET_RESTORE_TPL(x) (gBS->RestoreTPL (x))
#define TICKS_PER_MS 10000U
#define TICKS_PER_SECOND 10000000U
@@ -275,12 +245,12 @@ NetRandomInitSeed (
// Double linked list entry functions, this extends the
// EFI list functions.
//
-typedef LIST_ENTRY NET_LIST_ENTRY;
+//typedef LIST_ENTRY LIST_ENTRY;
-#define NetListInit(Head) InitializeListHead(Head)
-#define NetListInsertHead(Head, Entry) InsertHeadList((Head), (Entry))
-#define NetListInsertTail(Head, Entry) InsertTailList((Head), (Entry))
-#define NetListIsEmpty(List) IsListEmpty(List)
+//#define NetListInit(Head) InitializeListHead(Head)
+//#define NetListInsertHead(Head, Entry) InsertHeadList((Head), (Entry))
+//#define NetListInsertTail(Head, Entry) InsertTailList((Head), (Entry))
+//#define NetListIsEmpty(List) IsListEmpty(List)
#define NET_LIST_USER_STRUCT(Entry, Type, Field) \
_CR(Entry, Type, Field)
@@ -315,28 +285,28 @@ typedef LIST_ENTRY NET_LIST_ENTRY;
#define NET_LIST_TAIL(ListHead, Type, Field) \
NET_LIST_USER_STRUCT((ListHead)->BackLink, Type, Field)
-#define NetListRemoveEntry(Entry) RemoveEntryList (Entry)
+//#define NetListRemoveEntry(Entry) RemoveEntryList (Entry)
-NET_LIST_ENTRY*
+LIST_ENTRY*
NetListRemoveHead (
- NET_LIST_ENTRY *Head
+ LIST_ENTRY *Head
);
-NET_LIST_ENTRY*
+LIST_ENTRY*
NetListRemoveTail (
- NET_LIST_ENTRY *Head
+ LIST_ENTRY *Head
);
VOID
NetListInsertAfter (
- IN NET_LIST_ENTRY *PrevEntry,
- IN NET_LIST_ENTRY *NewEntry
+ IN LIST_ENTRY *PrevEntry,
+ IN LIST_ENTRY *NewEntry
);
VOID
NetListInsertBefore (
- IN NET_LIST_ENTRY *PostEntry,
- IN NET_LIST_ENTRY *NewEntry
+ IN LIST_ENTRY *PostEntry,
+ IN LIST_ENTRY *NewEntry
);
@@ -345,14 +315,14 @@ NetListInsertBefore (
// tokens. The drivers can share code to manage those objects.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
VOID *Key;
VOID *Value;
} NET_MAP_ITEM;
typedef struct {
- NET_LIST_ENTRY Used;
- NET_LIST_ENTRY Recycled;
+ LIST_ENTRY Used;
+ LIST_ENTRY Recycled;
UINTN Count;
} NET_MAP;
@@ -570,7 +540,7 @@ typedef struct {
typedef struct {
UINT32 Signature;
INTN RefCnt;
- NET_LIST_ENTRY List; // The List this NET_BUF is on
+ LIST_ENTRY List; // The List this NET_BUF is on
IP4_HEAD *Ip; // Network layer header, for fast access
TCP_HEAD *Tcp; // Transport layer header, for fast access
@@ -591,9 +561,9 @@ typedef struct {
typedef struct {
UINT32 Signature;
INTN RefCnt;
- NET_LIST_ENTRY List; // The List this buffer queue is on
+ LIST_ENTRY List; // The List this buffer queue is on
- NET_LIST_ENTRY BufList; // list of queued buffers
+ LIST_ENTRY BufList; // list of queued buffers
UINT32 BufSize; // total length of DATA in the buffers
UINT32 BufNum; // total number of buffers on the chain
} NET_BUF_QUEUE;
@@ -725,7 +695,7 @@ NetbufBuildExt (
NET_BUF *
NetbufFromBufList (
- IN NET_LIST_ENTRY *BufList,
+ IN LIST_ENTRY *BufList,
IN UINT32 HeadSpace,
IN UINT32 HeaderLen,
IN NET_VECTOR_EXT_FREE ExtFree,
@@ -734,7 +704,7 @@ NetbufFromBufList (
VOID
NetbufFreeList (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
);
VOID
@@ -807,78 +777,4 @@ NetPseudoHeadChecksum (
IN UINT16 Len
);
-//
-// The debug level definition. This value is also used as the
-// syslog's servity level. Don't change it.
-//
-enum {
- NETDEBUG_LEVEL_TRACE = 5,
- NETDEBUG_LEVEL_WARNING = 4,
- NETDEBUG_LEVEL_ERROR = 3,
-};
-
-#ifdef EFI_NETWORK_STACK_DEBUG
-
-//
-// The debug output expects the ASCII format string, Use %a to print ASCII
-// string, and %s to print UNICODE string. PrintArg must be enclosed in ().
-// For example: NET_DEBUG_TRACE ("Tcp", ("State transit to %a\n", Name));
-//
-#define NET_DEBUG_TRACE(Module, PrintArg) \
- NetDebugOutput ( \
- NETDEBUG_LEVEL_TRACE, \
- Module, \
- __FILE__, \
- __LINE__, \
- NetDebugASPrint PrintArg \
- )
-
-#define NET_DEBUG_WARNING(Module, PrintArg) \
- NetDebugOutput ( \
- NETDEBUG_LEVEL_WARNING, \
- Module, \
- __FILE__, \
- __LINE__, \
- NetDebugASPrint PrintArg \
- )
-
-#define NET_DEBUG_ERROR(Module, PrintArg) \
- NetDebugOutput ( \
- NETDEBUG_LEVEL_ERROR, \
- Module, \
- __FILE__, \
- __LINE__, \
- NetDebugASPrint PrintArg \
- )
-
-#else
-#define NET_DEBUG_TRACE(Module, PrintString)
-#define NET_DEBUG_WARNING(Module, PrintString)
-#define NET_DEBUG_ERROR(Module, PrintString)
-#endif
-
-UINT8 *
-NetDebugASPrint (
- UINT8 *Format,
- ...
- );
-
-EFI_STATUS
-NetDebugOutput (
- UINT32 Level,
- UINT8 *Module,
- UINT8 *File,
- UINT32 Line,
- UINT8 *Message
- );
-
-//
-// Network debug message is sent out as syslog.
-//
-enum {
- NET_SYSLOG_FACILITY = 16, // Syslog local facility local use
- NET_SYSLOG_PACKET_LEN = 512,
- NET_DEBUG_MSG_LEN = 470, // 512 - (ether+ip+udp head length)
- NET_SYSLOG_TX_TIMEOUT = 500 *1000 *10, // 500ms
-};
#endif
diff --git a/MdeModulePkg/Include/Library/UdpIoLib.h b/MdeModulePkg/Include/Library/UdpIoLib.h
index c6059f18e3..1b4a759345 100644
--- a/MdeModulePkg/Include/Library/UdpIoLib.h
+++ b/MdeModulePkg/Include/Library/UdpIoLib.h
@@ -85,7 +85,7 @@ typedef struct {
//
typedef struct {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
UDP_IO_PORT *UdpIo;
UDP_IO_CALLBACK CallBack;
@@ -101,7 +101,7 @@ typedef struct {
struct _UDP_IO_PORT {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
//
@@ -115,7 +115,7 @@ struct _UDP_IO_PORT {
EFI_UDP4_CONFIG_DATA UdpConfig;
EFI_SIMPLE_NETWORK_MODE SnpMode;
- NET_LIST_ENTRY SentDatagram;
+ LIST_ENTRY SentDatagram;
UDP_RX_TOKEN *RecvRequest;
};
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
index 2dd6e60bb5..4674d7d028 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
@@ -36,7 +36,7 @@ Abstract:
#define ICMP_ERRLEN(IpHdr) \
(sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)
-NET_LIST_ENTRY mActiveIpIoList = {
+LIST_ENTRY mActiveIpIoList = {
&mActiveIpIoList,
&mActiveIpIoList
};
@@ -388,7 +388,7 @@ IpIoCreateSndEntry (
//
// Allocate resource for SndEntry
//
- SndEntry = NetAllocatePool (sizeof (IP_IO_SEND_ENTRY));
+ SndEntry = AllocatePool (sizeof (IP_IO_SEND_ENTRY));
if (NULL == SndEntry) {
return NULL;
}
@@ -396,14 +396,14 @@ IpIoCreateSndEntry (
//
// Allocate resource for SndToken
//
- SndToken = NetAllocatePool (sizeof (EFI_IP4_COMPLETION_TOKEN));
+ SndToken = AllocatePool (sizeof (EFI_IP4_COMPLETION_TOKEN));
if (NULL == SndToken) {
goto ReleaseSndEntry;
}
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
IpIoTransmitHandler,
SndEntry,
&(SndToken->Event)
@@ -415,7 +415,7 @@ IpIoCreateSndEntry (
//
// Allocate resource for TxData
//
- TxData = NetAllocatePool (
+ TxData = AllocatePool (
sizeof (EFI_IP4_TRANSMIT_DATA) +
sizeof (EFI_IP4_FRAGMENT_DATA) * (Pkt->BlockOpNum - 1)
);
@@ -430,7 +430,7 @@ IpIoCreateSndEntry (
OverrideData = NULL;
if (NULL != Override) {
- OverrideData = NetAllocatePool (sizeof (EFI_IP4_OVERRIDE_DATA));
+ OverrideData = AllocatePool (sizeof (EFI_IP4_OVERRIDE_DATA));
if (NULL == OverrideData) {
goto ReleaseResource;
}
@@ -443,7 +443,7 @@ IpIoCreateSndEntry (
//
// Set the fields of TxData
//
- NetCopyMem (&TxData->DestinationAddress, &Dest, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&TxData->DestinationAddress, &Dest, sizeof (EFI_IPv4_ADDRESS));
TxData->OverrideData = OverrideData;
TxData->OptionsLength = 0;
TxData->OptionsBuffer = NULL;
@@ -474,21 +474,21 @@ IpIoCreateSndEntry (
SndEntry->SndToken = SndToken;
- NetListInsertTail (&IpIo->PendingSndList, &SndEntry->Entry);
+ InsertTailList (&IpIo->PendingSndList, &SndEntry->Entry);
return SndEntry;
ReleaseResource:
- NetFreePool (TxData);
+ gBS->FreePool (TxData);
ReleaseEvent:
gBS->CloseEvent (SndToken->Event);
ReleaseSndToken:
- NetFreePool (SndToken);
+ gBS->FreePool (SndToken);
ReleaseSndEntry:
- NetFreePool (SndEntry);
+ gBS->FreePool (SndEntry);
return NULL;
}
@@ -513,17 +513,17 @@ IpIoDestroySndEntry (
TxData = SndEntry->SndToken->Packet.TxData;
if (NULL != TxData->OverrideData) {
- NetFreePool (TxData->OverrideData);
+ gBS->FreePool (TxData->OverrideData);
}
- NetFreePool (TxData);
+ gBS->FreePool (TxData);
NetbufFree (SndEntry->Pkt);
gBS->CloseEvent (SndEntry->SndToken->Event);
- NetFreePool (SndEntry->SndToken);
- NetListRemoveEntry (&SndEntry->Entry);
+ gBS->FreePool (SndEntry->SndToken);
+ RemoveEntryList (&SndEntry->Entry);
- NetFreePool (SndEntry);
+ gBS->FreePool (SndEntry);
}
@@ -791,19 +791,19 @@ IpIoCreate (
EFI_STATUS Status;
IP_IO *IpIo;
- IpIo = NetAllocateZeroPool (sizeof (IP_IO));
+ IpIo = AllocateZeroPool (sizeof (IP_IO));
if (NULL == IpIo) {
return NULL;
}
- NetListInit (&(IpIo->PendingSndList));
- NetListInit (&(IpIo->IpList));
+ InitializeListHead (&(IpIo->PendingSndList));
+ InitializeListHead (&(IpIo->IpList));
IpIo->Controller = Controller;
IpIo->Image = Image;
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
IpIoListenHandler,
IpIo,
&(IpIo->RcvToken.Event)
@@ -833,7 +833,7 @@ ReleaseIpIo:
gBS->CloseEvent (IpIo->RcvToken.Event);
}
- NetFreePool (IpIo);
+ gBS->FreePool (IpIo);
return NULL;
}
@@ -902,7 +902,7 @@ IpIoOpen (
}
IpIo->IsConfigured = TRUE;
- NetListInsertTail (&mActiveIpIoList, &IpIo->Entry);
+ InsertTailList (&mActiveIpIoList, &IpIo->Entry);
ErrorExit:
@@ -935,7 +935,7 @@ IpIoStop (
//
// Remove the IpIo from the active IpIo list.
//
- NetListRemoveEntry (&IpIo->Entry);
+ RemoveEntryList (&IpIo->Entry);
Ip = IpIo->Ip;
@@ -953,7 +953,7 @@ IpIoStop (
// Detroy the Ip List used by IpIo
//
- while (!NetListIsEmpty (&(IpIo->IpList))) {
+ while (!IsListEmpty (&(IpIo->IpList))) {
IpInfo = NET_LIST_HEAD (&(IpIo->IpList), IP_IO_IP_INFO, Entry);
IpIoRemoveIp (IpIo, IpInfo);
@@ -962,7 +962,7 @@ IpIoStop (
//
// All pending snd tokens should be flushed by reseting the IP instances.
//
- ASSERT (NetListIsEmpty (&IpIo->PendingSndList));
+ ASSERT (IsListEmpty (&IpIo->PendingSndList));
//
// Close the receive event.
@@ -998,7 +998,7 @@ IpIoDestroy (
//
IpIoCloseProtocolDestroyIpChild (IpIo->Controller, IpIo->Image, IpIo->ChildHandle);
- NetFreePool (IpIo);
+ gBS->FreePool (IpIo);
return EFI_SUCCESS;
}
@@ -1077,7 +1077,7 @@ IpIoCancelTxToken (
IN VOID *Packet
)
{
- NET_LIST_ENTRY *Node;
+ LIST_ENTRY *Node;
IP_IO_SEND_ENTRY *SndEntry;
EFI_IP4_PROTOCOL *Ip;
@@ -1118,7 +1118,7 @@ IpIoAddIp (
ASSERT (IpIo);
- IpInfo = NetAllocatePool (sizeof (IP_IO_IP_INFO));
+ IpInfo = AllocatePool (sizeof (IP_IO_IP_INFO));
if (IpInfo == NULL) {
return IpInfo;
}
@@ -1127,7 +1127,7 @@ IpIoAddIp (
// Init this IpInfo, set the Addr and SubnetMask to 0 before we configure the IP
// instance.
//
- NetListInit (&IpInfo->Entry);
+ InitializeListHead (&IpInfo->Entry);
IpInfo->ChildHandle = NULL;
IpInfo->Addr = 0;
IpInfo->SubnetMask = 0;
@@ -1151,7 +1151,7 @@ IpIoAddIp (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
IpIoDummyHandler,
IpInfo,
&IpInfo->DummyRcvToken.Event
@@ -1163,7 +1163,7 @@ IpIoAddIp (
//
// Link this IpInfo into the IpIo.
//
- NetListInsertTail (&IpIo->IpList, &IpInfo->Entry);
+ InsertTailList (&IpIo->IpList, &IpInfo->Entry);
return IpInfo;
@@ -1177,7 +1177,7 @@ ReleaseIpChild:
ReleaseIpInfo:
- NetFreePool (IpInfo);
+ gBS->FreePool (IpInfo);
return NULL;
}
@@ -1236,8 +1236,8 @@ IpIoConfigIp (
Ip4ConfigData->SubnetMask = Ip4ModeData.ConfigData.SubnetMask;
}
- NetCopyMem (&IpInfo->Addr, &Ip4ConfigData->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&IpInfo->SubnetMask, &Ip4ConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&IpInfo->Addr, &Ip4ConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&IpInfo->SubnetMask, &Ip4ConfigData->SubnetMask, sizeof (IP4_ADDR));
Status = Ip->Receive (Ip, &IpInfo->DummyRcvToken);
if (EFI_ERROR (Status)) {
@@ -1283,7 +1283,7 @@ IpIoRemoveIp (
return;
}
- NetListRemoveEntry (&IpInfo->Entry);
+ RemoveEntryList (&IpInfo->Entry);
IpInfo->Ip->Configure (IpInfo->Ip, NULL);
@@ -1291,7 +1291,7 @@ IpIoRemoveIp (
gBS->CloseEvent (IpInfo->DummyRcvToken.Event);
- NetFreePool (IpInfo);
+ gBS->FreePool (IpInfo);
}
@@ -1312,9 +1312,9 @@ IpIoFindSender (
IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *IpIoEntry;
+ LIST_ENTRY *IpIoEntry;
IP_IO *IpIoPtr;
- NET_LIST_ENTRY *IpInfoEntry;
+ LIST_ENTRY *IpInfoEntry;
IP_IO_IP_INFO *IpInfo;
NET_LIST_FOR_EACH (IpIoEntry, &mActiveIpIoList) {
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index ee8b6797e5..b813db37cc 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -255,7 +255,7 @@ NetGetUint32 (
{
UINT32 Value;
- NetCopyMem (&Value, Buf, sizeof (UINT32));
+ CopyMem (&Value, Buf, sizeof (UINT32));
return NTOHL (Value);
}
@@ -277,7 +277,7 @@ NetPutUint32 (
)
{
Data = HTONL (Data);
- NetCopyMem (Buf, &Data, sizeof (UINT32));
+ CopyMem (Buf, &Data, sizeof (UINT32));
}
@@ -289,16 +289,16 @@ NetPutUint32 (
@return The entry that is removed from the list, NULL if the list is empty.
**/
-NET_LIST_ENTRY *
+LIST_ENTRY *
NetListRemoveHead (
- NET_LIST_ENTRY *Head
+ LIST_ENTRY *Head
)
{
- NET_LIST_ENTRY *First;
+ LIST_ENTRY *First;
ASSERT (Head != NULL);
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
return NULL;
}
@@ -307,8 +307,8 @@ NetListRemoveHead (
First->ForwardLink->BackLink = Head;
DEBUG_CODE (
- First->ForwardLink = (LIST_ENTRY *) NULL;
- First->BackLink = (LIST_ENTRY *) NULL;
+ First->ForwardLink = (LIST_ENTRY *) NULL;
+ First->BackLink = (LIST_ENTRY *) NULL;
);
return First;
@@ -323,16 +323,16 @@ NetListRemoveHead (
@return The entry that is removed from the list, NULL if the list is empty.
**/
-NET_LIST_ENTRY *
+LIST_ENTRY *
NetListRemoveTail (
- NET_LIST_ENTRY *Head
+ LIST_ENTRY *Head
)
{
- NET_LIST_ENTRY *Last;
+ LIST_ENTRY *Last;
ASSERT (Head != NULL);
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
return NULL;
}
@@ -341,8 +341,8 @@ NetListRemoveTail (
Last->BackLink->ForwardLink = Head;
DEBUG_CODE (
- Last->ForwardLink = (LIST_ENTRY *) NULL;
- Last->BackLink = (LIST_ENTRY *) NULL;
+ Last->ForwardLink = (LIST_ENTRY *) NULL;
+ Last->BackLink = (LIST_ENTRY *) NULL;
);
return Last;
@@ -360,8 +360,8 @@ NetListRemoveTail (
**/
VOID
NetListInsertAfter (
- IN NET_LIST_ENTRY *PrevEntry,
- IN NET_LIST_ENTRY *NewEntry
+ IN LIST_ENTRY *PrevEntry,
+ IN LIST_ENTRY *NewEntry
)
{
NewEntry->BackLink = PrevEntry;
@@ -382,8 +382,8 @@ NetListInsertAfter (
**/
VOID
NetListInsertBefore (
- IN NET_LIST_ENTRY *PostEntry,
- IN NET_LIST_ENTRY *NewEntry
+ IN LIST_ENTRY *PostEntry,
+ IN LIST_ENTRY *NewEntry
)
{
NewEntry->ForwardLink = PostEntry;
@@ -408,8 +408,8 @@ NetMapInit (
{
ASSERT (Map != NULL);
- NetListInit (&Map->Used);
- NetListInit (&Map->Recycled);
+ InitializeListHead (&Map->Used);
+ InitializeListHead (&Map->Recycled);
Map->Count = 0;
}
@@ -428,30 +428,30 @@ NetMapClean (
)
{
NET_MAP_ITEM *Item;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
ASSERT (Map != NULL);
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Map->Used) {
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);
- NetListRemoveEntry (&Item->Link);
+ RemoveEntryList (&Item->Link);
Map->Count--;
- NetFreePool (Item);
+ gBS->FreePool (Item);
}
- ASSERT ((Map->Count == 0) && NetListIsEmpty (&Map->Used));
+ ASSERT ((Map->Count == 0) && IsListEmpty (&Map->Used));
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Map->Recycled) {
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);
- NetListRemoveEntry (&Item->Link);
- NetFreePool (Item);
+ RemoveEntryList (&Item->Link);
+ gBS->FreePool (Item);
}
- ASSERT (NetListIsEmpty (&Map->Recycled));
+ ASSERT (IsListEmpty (&Map->Recycled));
}
@@ -506,16 +506,16 @@ NetMapAllocItem (
)
{
NET_MAP_ITEM *Item;
- NET_LIST_ENTRY *Head;
+ LIST_ENTRY *Head;
UINTN Index;
ASSERT (Map != NULL);
Head = &Map->Recycled;
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
for (Index = 0; Index < NET_MAP_INCREAMENT; Index++) {
- Item = NetAllocatePool (sizeof (NET_MAP_ITEM));
+ Item = AllocatePool (sizeof (NET_MAP_ITEM));
if (Item == NULL) {
if (Index == 0) {
@@ -525,7 +525,7 @@ NetMapAllocItem (
break;
}
- NetListInsertHead (Head, &Item->Link);
+ InsertHeadList (Head, &Item->Link);
}
}
@@ -566,7 +566,7 @@ NetMapInsertHead (
Item->Key = Key;
Item->Value = Value;
- NetListInsertHead (&Map->Used, &Item->Link);
+ InsertHeadList (&Map->Used, &Item->Link);
Map->Count++;
return EFI_SUCCESS;
@@ -603,7 +603,7 @@ NetMapInsertTail (
Item->Key = Key;
Item->Value = Value;
- NetListInsertTail (&Map->Used, &Item->Link);
+ InsertTailList (&Map->Used, &Item->Link);
Map->Count++;
@@ -627,7 +627,7 @@ NetItemInMap (
IN NET_MAP_ITEM *Item
)
{
- NET_LIST_ENTRY *ListEntry;
+ LIST_ENTRY *ListEntry;
NET_LIST_FOR_EACH (ListEntry, &Map->Used) {
if (ListEntry == &Item->Link) {
@@ -654,7 +654,7 @@ NetMapFindKey (
IN VOID *Key
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_MAP_ITEM *Item;
ASSERT (Map != NULL);
@@ -691,9 +691,9 @@ NetMapRemoveItem (
ASSERT ((Map != NULL) && (Item != NULL));
ASSERT (NetItemInMap (Map, Item));
- NetListRemoveEntry (&Item->Link);
+ RemoveEntryList (&Item->Link);
Map->Count--;
- NetListInsertHead (&Map->Recycled, &Item->Link);
+ InsertHeadList (&Map->Recycled, &Item->Link);
if (Value != NULL) {
*Value = Item->Value;
@@ -724,12 +724,12 @@ NetMapRemoveHead (
// Often, it indicates a programming error to remove
// the first entry in an empty list
//
- ASSERT (Map && !NetListIsEmpty (&Map->Used));
+ ASSERT (Map && !IsListEmpty (&Map->Used));
Item = NET_LIST_HEAD (&Map->Used, NET_MAP_ITEM, Link);
- NetListRemoveEntry (&Item->Link);
+ RemoveEntryList (&Item->Link);
Map->Count--;
- NetListInsertHead (&Map->Recycled, &Item->Link);
+ InsertHeadList (&Map->Recycled, &Item->Link);
if (Value != NULL) {
*Value = Item->Value;
@@ -760,12 +760,12 @@ NetMapRemoveTail (
// Often, it indicates a programming error to remove
// the last entry in an empty list
//
- ASSERT (Map && !NetListIsEmpty (&Map->Used));
+ ASSERT (Map && !IsListEmpty (&Map->Used));
Item = NET_LIST_TAIL (&Map->Used, NET_MAP_ITEM, Link);
- NetListRemoveEntry (&Item->Link);
+ RemoveEntryList (&Item->Link);
Map->Count--;
- NetListInsertHead (&Map->Recycled, &Item->Link);
+ InsertHeadList (&Map->Recycled, &Item->Link);
if (Value != NULL) {
*Value = Item->Value;
@@ -796,9 +796,9 @@ NetMapIterate (
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
- NET_LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
+ LIST_ENTRY *Head;
NET_MAP_ITEM *Item;
EFI_STATUS Result;
@@ -806,7 +806,7 @@ NetMapIterate (
Head = &Map->Used;
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
return EFI_SUCCESS;
}
@@ -1088,7 +1088,7 @@ NetLibGetMacString (
// It takes 2 unicode characters to represent a 1 byte binary buffer.
// Plus one unicode character for the null-terminator.
//
- MacAddress = NetAllocatePool ((2 * Mode->HwAddressSize + 1) * sizeof (CHAR16));
+ MacAddress = AllocatePool ((2 * Mode->HwAddressSize + 1) * sizeof (CHAR16));
if (MacAddress == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1146,7 +1146,7 @@ NetLibDefaultAddressIsStatic (
return TRUE;
}
- ConfigInfo = NetAllocatePool (Len);
+ ConfigInfo = AllocatePool (Len);
if (ConfigInfo == NULL) {
return TRUE;
}
@@ -1161,7 +1161,7 @@ NetLibDefaultAddressIsStatic (
ON_EXIT:
- NetFreePool (ConfigInfo);
+ gBS->FreePool (ConfigInfo);
return IsStatic;
}
@@ -1196,8 +1196,8 @@ NetLibCreateIPv4DPathNode (
Node->Header.SubType = MSG_IPv4_DP;
SetDevicePathNodeLength (&Node->Header, 19);
- NetCopyMem (&Node->LocalIpAddress, &LocalIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Node->RemoteIpAddress, &RemoteIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Node->LocalIpAddress, &LocalIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Node->RemoteIpAddress, &RemoteIp, sizeof (EFI_IPv4_ADDRESS));
Node->LocalPort = LocalPort;
Node->RemotePort = RemotePort;
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
index 3ce822d831..78fad5b5f3 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
@@ -36,7 +36,7 @@
[Sources.common]
DxeNetLib.c
NetBuffer.c
- NetDebug.c
+
[Packages]
MdePkg/MdePkg.dec
diff --git a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c
index a9de17f7e2..d1dbd0aee5 100644
--- a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c
+++ b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c
@@ -56,7 +56,7 @@ NetbufAllocStruct (
//
// Allocate three memory blocks.
//
- Nbuf = NetAllocateZeroPool (NET_BUF_SIZE (BlockOpNum));
+ Nbuf = AllocateZeroPool (NET_BUF_SIZE (BlockOpNum));
if (Nbuf == NULL) {
return NULL;
@@ -65,10 +65,10 @@ NetbufAllocStruct (
Nbuf->Signature = NET_BUF_SIGNATURE;
Nbuf->RefCnt = 1;
Nbuf->BlockOpNum = BlockOpNum;
- NetListInit (&Nbuf->List);
+ InitializeListHead (&Nbuf->List);
if (BlockNum != 0) {
- Vector = NetAllocateZeroPool (NET_VECTOR_SIZE (BlockNum));
+ Vector = AllocateZeroPool (NET_VECTOR_SIZE (BlockNum));
if (Vector == NULL) {
goto FreeNbuf;
@@ -84,7 +84,7 @@ NetbufAllocStruct (
FreeNbuf:
- NetFreePool (Nbuf);
+ gBS->FreePool (Nbuf);
return NULL;
}
@@ -116,7 +116,7 @@ NetbufAlloc (
return NULL;
}
- Bulk = NetAllocatePool (Len);
+ Bulk = AllocatePool (Len);
if (Bulk == NULL) {
goto FreeNBuf;
@@ -138,7 +138,7 @@ NetbufAlloc (
return Nbuf;
FreeNBuf:
- NetFreePool (Nbuf);
+ gBS->FreePool (Nbuf);
return NULL;
}
@@ -175,7 +175,7 @@ NetbufFreeVector (
// first block since it is allocated by us
//
if (Vector->Flag & NET_VECTOR_OWN_FIRST) {
- NetFreePool (Vector->Block[0].Bulk);
+ gBS->FreePool (Vector->Block[0].Bulk);
}
Vector->Free (Vector->Arg);
@@ -185,11 +185,11 @@ NetbufFreeVector (
// Free each memory block associated with the Vector
//
for (Index = 0; Index < Vector->BlockNum; Index++) {
- NetFreePool (Vector->Block[Index].Bulk);
+ gBS->FreePool (Vector->Block[Index].Bulk);
}
}
- NetFreePool (Vector);
+ gBS->FreePool (Vector);
}
@@ -217,7 +217,7 @@ NetbufFree (
// all the sharing of Nbuf increse Vector's RefCnt by one
//
NetbufFreeVector (Nbuf->Vector);
- NetFreePool (Nbuf);
+ gBS->FreePool (Nbuf);
}
}
@@ -239,7 +239,7 @@ NetbufClone (
NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
- Clone = NetAllocatePool (NET_BUF_SIZE (Nbuf->BlockOpNum));
+ Clone = AllocatePool (NET_BUF_SIZE (Nbuf->BlockOpNum));
if (Clone == NULL) {
return NULL;
@@ -247,19 +247,19 @@ NetbufClone (
Clone->Signature = NET_BUF_SIGNATURE;
Clone->RefCnt = 1;
- NetListInit (&Clone->List);
+ InitializeListHead (&Clone->List);
Clone->Ip = Nbuf->Ip;
Clone->Tcp = Nbuf->Tcp;
- NetCopyMem (Clone->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
+ CopyMem (Clone->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
NET_GET_REF (Nbuf->Vector);
Clone->Vector = Nbuf->Vector;
Clone->BlockOpNum = Nbuf->BlockOpNum;
Clone->TotalSize = Nbuf->TotalSize;
- NetCopyMem (Clone->BlockOp, Nbuf->BlockOp, sizeof (NET_BLOCK_OP) * Nbuf->BlockOpNum);
+ CopyMem (Clone->BlockOp, Nbuf->BlockOp, sizeof (NET_BLOCK_OP) * Nbuf->BlockOpNum);
return Clone;
}
@@ -300,7 +300,7 @@ NetbufDuplicate (
// Don't set the IP and TCP head point, since it is most
// like that they are pointing to the memory of Nbuf.
//
- NetCopyMem (Duplicate->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
+ CopyMem (Duplicate->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
NetbufReserve (Duplicate, HeadSpace);
Dst = NetbufAllocSpace (Duplicate, Nbuf->TotalSize, NET_BUF_TAIL);
@@ -320,11 +320,11 @@ NetbufDuplicate (
**/
VOID
NetbufFreeList (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
NET_BUF *Nbuf;
Entry = Head->ForwardLink;
@@ -333,11 +333,11 @@ NetbufFreeList (
Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Nbuf);
}
- ASSERT (NetListIsEmpty (Head));
+ ASSERT (IsListEmpty (Head));
}
@@ -609,7 +609,7 @@ NetbufGetFragment (
return NULL;
}
- FirstBulk = NetAllocatePool (HeadSpace);
+ FirstBulk = AllocatePool (HeadSpace);
if (FirstBulk == NULL) {
goto FreeChild;
@@ -653,7 +653,7 @@ NetbufGetFragment (
CurBlockOp++
);
- for (Index = First + 1; Index <= Last - 1 ; Index++) {
+ for (Index = First + 1; Index < Last; Index++) {
NetbufSetBlockOp (
Child,
BlockOp[Index].Head,
@@ -671,12 +671,12 @@ NetbufGetFragment (
);
}
- NetCopyMem (Child->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
+ CopyMem (Child->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA);
return Child;
FreeChild:
- NetFreePool (Child);
+ gBS->FreePool (Child);
return NULL;
}
@@ -751,7 +751,7 @@ NetbufFromExt (
//
if ((HeadSpace != 0) || (HeadLen != 0)) {
FirstBlockLen = HeadLen + HeadSpace;
- FirstBlock = NetAllocatePool (FirstBlockLen);
+ FirstBlock = AllocatePool (FirstBlockLen);
if (FirstBlock == NULL) {
return NULL;
@@ -771,7 +771,7 @@ NetbufFromExt (
for (Index = 0; Index < ExtNum; Index++) {
if (Len >= ExtFragment[Index].Len) {
- NetCopyMem (Header, ExtFragment[Index].Bulk, ExtFragment[Index].Len);
+ CopyMem (Header, ExtFragment[Index].Bulk, ExtFragment[Index].Len);
Copied += ExtFragment[Index].Len;
Len -= ExtFragment[Index].Len;
@@ -789,7 +789,7 @@ NetbufFromExt (
}
} else {
- NetCopyMem (Header, ExtFragment[Index].Bulk, Len);
+ CopyMem (Header, ExtFragment[Index].Bulk, Len);
Copied += Len;
TotalLen += Len;
@@ -851,7 +851,7 @@ NetbufFromExt (
return Nbuf;
FreeFirstBlock:
- NetFreePool (FirstBlock);
+ gBS->FreePool (FirstBlock);
return NULL;
}
@@ -916,7 +916,7 @@ NetbufBuildExt (
**/
NET_BUF *
NetbufFromBufList (
- IN NET_LIST_ENTRY *BufList,
+ IN LIST_ENTRY *BufList,
IN UINT32 HeadSpace,
IN UINT32 HeaderLen,
IN NET_VECTOR_EXT_FREE ExtFree,
@@ -925,7 +925,7 @@ NetbufFromBufList (
{
NET_FRAGMENT *Fragment;
UINT32 FragmentNum;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_BUF *Nbuf;
UINT32 Index;
UINT32 Current;
@@ -944,7 +944,7 @@ NetbufFromBufList (
//
//Allocate and copy block points
//
- Fragment = NetAllocatePool (sizeof (NET_FRAGMENT) * FragmentNum);
+ Fragment = AllocatePool (sizeof (NET_FRAGMENT) * FragmentNum);
if (Fragment == NULL) {
return NULL;
@@ -966,7 +966,7 @@ NetbufFromBufList (
}
Nbuf = NetbufFromExt (Fragment, Current, HeadSpace, HeaderLen, ExtFree, Arg);
- NetFreePool (Fragment);
+ gBS->FreePool (Fragment);
return Nbuf;
}
@@ -1261,11 +1261,11 @@ NetbufCopy (
Left = BlockOp[Index].Size - Skip;
if (Len <= Left) {
- NetCopyMem (Dest, BlockOp[Index].Head + Skip, Len);
+ CopyMem (Dest, BlockOp[Index].Head + Skip, Len);
return Len;
}
- NetCopyMem (Dest, BlockOp[Index].Head + Skip, Left);
+ CopyMem (Dest, BlockOp[Index].Head + Skip, Left);
Dest += Left;
Len -= Left;
@@ -1278,11 +1278,11 @@ NetbufCopy (
Len -= BlockOp[Index].Size;
Copied += BlockOp[Index].Size;
- NetCopyMem (Dest, BlockOp[Index].Head, BlockOp[Index].Size);
+ CopyMem (Dest, BlockOp[Index].Head, BlockOp[Index].Size);
Dest += BlockOp[Index].Size;
} else {
Copied += Len;
- NetCopyMem (Dest, BlockOp[Index].Head, Len);
+ CopyMem (Dest, BlockOp[Index].Head, Len);
break;
}
}
@@ -1306,9 +1306,9 @@ NetbufQueInit (
{
NbufQue->Signature = NET_QUE_SIGNATURE;
NbufQue->RefCnt = 1;
- NetListInit (&NbufQue->List);
+ InitializeListHead (&NbufQue->List);
- NetListInit (&NbufQue->BufList);
+ InitializeListHead (&NbufQue->BufList);
NbufQue->BufSize = 0;
NbufQue->BufNum = 0;
}
@@ -1329,7 +1329,7 @@ NetbufQueAlloc (
{
NET_BUF_QUEUE *NbufQue;
- NbufQue = NetAllocatePool (sizeof (NET_BUF_QUEUE));
+ NbufQue = AllocatePool (sizeof (NET_BUF_QUEUE));
if (NbufQue == NULL) {
return NULL;
}
@@ -1359,7 +1359,7 @@ NetbufQueFree (
if (NbufQue->RefCnt == 0) {
NetbufQueFlush (NbufQue);
- NetFreePool (NbufQue);
+ gBS->FreePool (NbufQue);
}
}
@@ -1382,7 +1382,7 @@ NetbufQueAppend (
NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE);
NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
- NetListInsertTail (&NbufQue->BufList, &Nbuf->List);
+ InsertTailList (&NbufQue->BufList, &Nbuf->List);
NbufQue->BufSize += Nbuf->TotalSize;
NbufQue->BufNum++;
@@ -1440,7 +1440,7 @@ NetbufQueCopy (
IN UINT8 *Dest
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_BUF *Nbuf;
UINT32 Skip;
UINT32 Left;
@@ -1533,8 +1533,8 @@ NetbufQueTrim (
IN UINT32 Len
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
NET_BUF *Nbuf;
UINT32 Trimmed;
@@ -1558,7 +1558,7 @@ NetbufQueTrim (
Trimmed += Nbuf->TotalSize;
Len -= Nbuf->TotalSize;
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Nbuf);
NbufQue->BufNum--;
@@ -1748,7 +1748,7 @@ NetPseudoHeadChecksum (
//
// Zero the memory to relieve align problems
//
- NetZeroMem (&Hdr, sizeof (Hdr));
+ ZeroMem (&Hdr, sizeof (Hdr));
Hdr.SrcIp = Src;
Hdr.DstIp = Dst;
diff --git a/MdeModulePkg/Library/DxeNetLib/NetDebug.c b/MdeModulePkg/Library/DxeNetLib/NetDebug.c
deleted file mode 100644
index e182b741f5..0000000000
--- a/MdeModulePkg/Library/DxeNetLib/NetDebug.c
+++ /dev/null
@@ -1,536 +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:
-
- NetDebug.c
-
-Abstract:
-
- Network debug facility. The debug information is wrapped in
- SYSLOG packets, then sent over SNP. This debug facility can't
- be used by SNP. Apply caution when used in MNP and non-network
- module because SNP is most likely not "thread safe". We assume
- that the SNP supports the EHTERNET.
-
-
-**/
-
-
-#include <PiDxe.h>
-
-#include <Protocol/SimpleNetwork.h>
-
-#include <Library/BaseLib.h>
-#include <Library/NetLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PrintLib.h>
-
-
-//
-// Any error level digitally larger than mNetDebugLevelMax
-// will be silently discarded.
-//
-UINTN mNetDebugLevelMax = NETDEBUG_LEVEL_ERROR;
-UINT32 mSyslogPacketSeq = 0xDEADBEEF;
-
-//
-// You can change mSyslogDstMac mSyslogDstIp and mSyslogSrcIp
-// here to direct the syslog packets to the syslog deamon. The
-// default is broadcast to both the ethernet and IP.
-//
-UINT8 mSyslogDstMac [NET_ETHER_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-UINT32 mSyslogDstIp = 0xffffffff;
-UINT32 mSyslogSrcIp = 0;
-
-CHAR8 *
-MonthName[] = {
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec"
-};
-
-
-/**
- Locate the handles that support SNP, then open one of them
- to send the syslog packets. The caller isn't required to close
- the SNP after use because the SNP is opened by HandleProtocol.
-
- None
-
- @return The point to SNP if one is properly openned. Otherwise NULL
-
-**/
-EFI_SIMPLE_NETWORK_PROTOCOL *
-SyslogLocateSnp (
- VOID
- )
-{
- EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
- EFI_STATUS Status;
- EFI_HANDLE *Handles;
- UINTN HandleCount;
- UINTN Index;
-
- //
- // Locate the handles which has SNP installed.
- //
- Handles = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimpleNetworkProtocolGuid,
- NULL,
- &HandleCount,
- &Handles
- );
-
- if (EFI_ERROR (Status) || (HandleCount == 0)) {
- return NULL;
- }
-
- //
- // Try to open one of the ethernet SNP protocol to send packet
- //
- Snp = NULL;
-
- for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->HandleProtocol (
- Handles[Index],
- &gEfiSimpleNetworkProtocolGuid,
- (VOID **) &Snp
- );
-
- if ((Status == EFI_SUCCESS) && (Snp != NULL) &&
- (Snp->Mode->IfType == NET_IFTYPE_ETHERNET) &&
- (Snp->Mode->MaxPacketSize >= NET_SYSLOG_PACKET_LEN)) {
-
- break;
- }
-
- Snp = NULL;
- }
-
- gBS->FreePool (Handles);
- return Snp;
-}
-
-
-/**
- Transmit a syslog packet synchronously through SNP. The Packet
- already has the ethernet header prepended. This function should
- fill in the source MAC because it will try to locate a SNP each
- time it is called to avoid the problem if SNP is unloaded.
- This code snip is copied from MNP.
-
- @param Packet The Syslog packet
- @param Length The length of the packet
-
- @retval EFI_DEVICE_ERROR Failed to locate a usable SNP protocol
- @retval EFI_TIMEOUT Timeout happened to send the packet.
- @retval EFI_SUCCESS Packet is sent.
-
-**/
-EFI_STATUS
-SyslogSendPacket (
- IN UINT8 *Packet,
- IN UINT32 Length
- )
-{
- EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
- ETHER_HEAD *Ether;
- EFI_STATUS Status;
- EFI_EVENT TimeoutEvent;
- UINT8 *TxBuf;
-
- Snp = SyslogLocateSnp ();
-
- if (Snp == NULL) {
- return EFI_DEVICE_ERROR;
- }
-
- Ether = (ETHER_HEAD *) Packet;
- CopyMem (Ether->SrcMac, Snp->Mode->CurrentAddress.Addr, NET_ETHER_ADDR_LEN);
-
- //
- // Start the timeout event.
- //
- Status = gBS->CreateEvent (
- EVT_TIMER,
- TPL_NOTIFY,
- NULL,
- NULL,
- &TimeoutEvent
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->SetTimer (TimeoutEvent, TimerRelative, NET_SYSLOG_TX_TIMEOUT);
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- for (;;) {
- //
- // Transmit the packet through SNP.
- //
- Status = Snp->Transmit (Snp, 0, Length, Packet, NULL, NULL, NULL);
-
- if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_READY)) {
- Status = EFI_DEVICE_ERROR;
- break;
- }
-
- //
- // If Status is EFI_SUCCESS, the packet is put in the transmit queue.
- // if Status is EFI_NOT_READY, the transmit engine of the network
- // interface is busy. Both need to sync SNP.
- //
- TxBuf = NULL;
-
- do {
- //
- // Get the recycled transmit buffer status.
- //
- Snp->GetStatus (Snp, NULL, (VOID **) &TxBuf);
-
- if (!EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) {
- Status = EFI_TIMEOUT;
- break;
- }
-
- } while (TxBuf == NULL);
-
- if ((Status == EFI_SUCCESS) || (Status == EFI_TIMEOUT)) {
- break;
- }
-
- //
- // Status is EFI_NOT_READY. Restart the timer event and
- // call Snp->Transmit again.
- //
- gBS->SetTimer (TimeoutEvent, TimerRelative, NET_SYSLOG_TX_TIMEOUT);
- }
-
- gBS->SetTimer (TimeoutEvent, TimerCancel, 0);
-
-ON_EXIT:
- gBS->CloseEvent (TimeoutEvent);
- return Status;
-}
-
-
-/**
- Compute checksum for a bulk of data. This code is copied from the
- Netbuffer library.
-
- @param Bulk Pointer to the data.
- @param Len Length of the data, in bytes.
-
- @retval UINT16 The computed checksum.
-
-**/
-UINT16
-SyslogChecksum (
- IN UINT8 *Bulk,
- IN UINT32 Len
- )
-{
- register UINT32 Sum;
-
- Sum = 0;
-
- while (Len > 1) {
- Sum += *(UINT16 *) Bulk;
- Bulk += 2;
- Len -= 2;
- }
-
- //
- // Add left-over byte, if any
- //
- if (Len > 0) {
- Sum += *(UINT8 *) Bulk;
- }
-
- //
- // Fold 32-bit sum to 16 bits
- //
- while (Sum >> 16) {
- Sum = (Sum & 0xffff) + (Sum >> 16);
- }
-
- return (UINT16) ~Sum;
-}
-
-
-/**
- Build a syslog packet, including the Ethernet/Ip/Udp headers
- and user's message.
-
- @param Buf The buffer to put the packet data
- @param BufLen The lenght of the Buf
- @param Level Syslog servity level
- @param Module The module that generates the log
- @param File The file that contains the current log
- @param Line The line of code in the File that contains the
- current log
- @param Message The log message
-
- @return The length of the syslog packet built.
-
-**/
-UINT32
-SyslogBuildPacket (
- UINT8 *Buf,
- UINT32 BufLen,
- UINT32 Level,
- UINT8 *Module,
- UINT8 *File,
- UINT32 Line,
- UINT8 *Message
- )
-{
- ETHER_HEAD *Ether;
- IP4_HEAD *Ip4;
- EFI_UDP4_HEADER *Udp4;
- EFI_TIME Time;
- UINT32 Pri;
- UINT32 Len;
-
- //
- // Fill in the Ethernet header. Leave alone the source MAC.
- // SyslogSendPacket will fill in the address for us.
- //
- Ether = (ETHER_HEAD *) Buf;
- CopyMem (Ether->DstMac, mSyslogDstMac, NET_ETHER_ADDR_LEN);
- ZeroMem (Ether->SrcMac, NET_ETHER_ADDR_LEN);
-
- Ether->EtherType = HTONS (0x0800); // IP protocol
-
- Buf += sizeof (ETHER_HEAD);
- BufLen -= sizeof (ETHER_HEAD);
-
- //
- // Fill in the IP header
- //
- Ip4 = (IP4_HEAD *) Buf;
- Ip4->HeadLen = 5;
- Ip4->Ver = 4;
- Ip4->Tos = 0;
- Ip4->TotalLen = 0;
- Ip4->Id = (UINT16) mSyslogPacketSeq;
- Ip4->Fragment = 0;
- Ip4->Ttl = 16;
- Ip4->Protocol = 0x11;
- Ip4->Checksum = 0;
- Ip4->Src = mSyslogSrcIp;
- Ip4->Dst = mSyslogDstIp;
-
- Buf += sizeof (IP4_HEAD);
- BufLen -= sizeof (IP4_HEAD);
-
- //
- // Fill in the UDP header, Udp checksum is optional. Leave it zero.
- //
- Udp4 = (EFI_UDP4_HEADER*) Buf;
- Udp4->SrcPort = HTONS (514);
- Udp4->DstPort = HTONS (514);
- Udp4->Length = 0;
- Udp4->Checksum = 0;
-
- Buf += sizeof (EFI_UDP4_HEADER);
- BufLen -= sizeof (EFI_UDP4_HEADER);
-
- //
- // Build the syslog message body with <PRI> Timestamp machine module Message
- //
- Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7);
- gRT->GetTime (&Time, NULL);
-
- //
- // Use %a to format the ASCII strings, %s to format UNICODE strings
- //
- Len = 0;
- Len += (UINT32) AsciiSPrint (
- (CHAR8 *) Buf,
- BufLen,
- "<%d> %a %d %d:%d:%d ",
- Pri,
- MonthName [Time.Month-1],
- Time.Day,
- Time.Hour,
- Time.Minute,
- Time.Second
- );
- Len--;
-
- Len += (UINT32) AsciiSPrint (
- (CHAR8 *) (Buf + Len),
- BufLen - Len,
- "Tiano %a: %a (Line: %d File: %a)",
- Module,
- Message,
- Line,
- File
- );
- Len--;
-
- //
- // OK, patch the IP length/checksum and UDP length fields.
- //
- Len += sizeof (EFI_UDP4_HEADER);
- Udp4->Length = HTONS ((UINT16) Len);
-
- Len += sizeof (IP4_HEAD);
- Ip4->TotalLen = HTONS ((UINT16) Len);
- Ip4->Checksum = SyslogChecksum ((UINT8 *) Ip4, sizeof (IP4_HEAD));
-
- return Len + sizeof (ETHER_HEAD);
-}
-
-
-/**
- Allocate a buffer, then format the message to it. This is a
- help function for the NET_DEBUG_XXX macros. The PrintArg of
- these macros treats the variable length print parameters as a
- single parameter, and pass it to the NetDebugASPrint. For
- example, NET_DEBUG_TRACE ("Tcp", ("State transit to %a\n", Name))
- if extracted to:
- NetDebugOutput (
- NETDEBUG_LEVEL_TRACE,
- "Tcp",
- __FILE__,
- __LINE__,
- NetDebugASPrint ("State transit to %a\n", Name)
- )
- This is exactly what we want.
-
- @param Format The ASCII format string.
- @param ... The variable length parameter whose format is
- determined by the Format string.
-
- @return The buffer containing the formatted message, or NULL if failed to
- @return allocate memory.
-
-**/
-UINT8 *
-NetDebugASPrint (
- UINT8 *Format,
- ...
- )
-{
- VA_LIST Marker;
- UINT8 *Buf;
-
- Buf = AllocatePool (NET_DEBUG_MSG_LEN);
-
- if (Buf == NULL) {
- return NULL;
- }
-
- VA_START (Marker, Format);
- AsciiVSPrint ((CHAR8 *) Buf, NET_DEBUG_MSG_LEN, (CHAR8 *) Format, Marker);
- VA_END (Marker);
-
- return Buf;
-}
-
-
-/**
- Output a debug message to syslog. This function will locate a
- instance of SNP then send the message through it. Because it
- isn't open the SNP BY_DRIVER, apply caution when using it.
-
- @param Level The servity level of the message.
- @param Module The Moudle that generates the log.
- @param File The file that contains the log.
- @param Line The exact line that contains the log.
- @param Message The user message to log.
-
- @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the packet
- @retval EFI_SUCCESS The log is discard because that it is more verbose
- than the mNetDebugLevelMax. Or, it has been sent
- out.
-
-**/
-EFI_STATUS
-NetDebugOutput (
- UINT32 Level,
- UINT8 *Module,
- UINT8 *File,
- UINT32 Line,
- UINT8 *Message
- )
-{
- UINT8 *Packet;
- UINT32 Len;
- EFI_STATUS Status;
-
- //
- // Check whether the message should be sent out
- //
- if (Message == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (Level > mNetDebugLevelMax) {
- Status = EFI_SUCCESS;
- goto ON_EXIT;
- }
-
- //
- // Allocate a maxium of 1024 bytes, the caller should ensure
- // that the message plus the ethernet/ip/udp header is shorter
- // than this
- //
- Packet = AllocatePool (NET_SYSLOG_PACKET_LEN);
-
- if (Packet == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
-
- //
- // Build the message: Ethernet header + IP header + Udp Header + user data
- //
- Len = SyslogBuildPacket (
- Packet,
- NET_SYSLOG_PACKET_LEN,
- Level,
- Module,
- File,
- Line,
- Message
- );
-
- mSyslogPacketSeq++;
- Status = SyslogSendPacket (Packet, Len);
- gBS->FreePool (Packet);
-
-ON_EXIT:
- gBS->FreePool (Message);
- return Status;
-}
diff --git a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
index c939124f8b..864da9b986 100644
--- a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
+++ b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
@@ -87,7 +87,7 @@ UdpIoWrapTx (
UINT32 Count;
IP4_ADDR Ip;
- Token = NetAllocatePool (sizeof (UDP_TX_TOKEN) +
+ Token = AllocatePool (sizeof (UDP_TX_TOKEN) +
sizeof (EFI_UDP4_FRAGMENT_DATA) * (Packet->BlockOpNum - 1));
if (Token == NULL) {
@@ -95,7 +95,7 @@ UdpIoWrapTx (
}
Token->Signature = UDP_IO_TX_SIGNATURE;
- NetListInit (&Token->Link);
+ InitializeListHead (&Token->Link);
Token->UdpIo = UdpIo;
Token->CallBack = CallBack;
@@ -107,14 +107,14 @@ UdpIoWrapTx (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
UdpIoOnDgramSent,
Token,
&UdpToken->Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -126,10 +126,10 @@ UdpIoWrapTx (
if (EndPoint != NULL) {
Ip = HTONL (EndPoint->LocalAddr);
- NetCopyMem (&Token->UdpSession.SourceAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token->UdpSession.SourceAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (EndPoint->RemoteAddr);
- NetCopyMem (&Token->UdpSession.DestinationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token->UdpSession.DestinationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Token->UdpSession.SourcePort = EndPoint->LocalPort;
Token->UdpSession.DestinationPort = EndPoint->RemotePort;
@@ -138,7 +138,7 @@ UdpIoWrapTx (
if (Gateway != 0) {
Ip = HTONL (Gateway);
- NetCopyMem (&Token->Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token->Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));
UdpTxData->GatewayAddress = &Token->Gateway;
}
@@ -166,7 +166,7 @@ UdpIoFreeTxToken (
)
{
gBS->CloseEvent (Token->UdpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -192,7 +192,7 @@ UdpIoCreateRxToken (
UDP_RX_TOKEN *Token;
EFI_STATUS Status;
- Token = NetAllocatePool (sizeof (UDP_RX_TOKEN));
+ Token = AllocatePool (sizeof (UDP_RX_TOKEN));
if (Token == NULL) {
return NULL;
@@ -209,14 +209,14 @@ UdpIoCreateRxToken (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
UdpIoOnDgramRcvd,
Token,
&Token->UdpToken.Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -238,7 +238,7 @@ UdpIoFreeRxToken (
)
{
gBS->CloseEvent (Token->UdpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -268,20 +268,20 @@ UdpIoCreatePort (
ASSERT (Configure != NULL);
- UdpIo = NetAllocatePool (sizeof (UDP_IO_PORT));
+ UdpIo = AllocatePool (sizeof (UDP_IO_PORT));
if (UdpIo == NULL) {
return NULL;
}
UdpIo->Signature = UDP_IO_SIGNATURE;
- NetListInit (&UdpIo->Link);
+ InitializeListHead (&UdpIo->Link);
UdpIo->RefCnt = 1;
UdpIo->Controller = Controller;
UdpIo->Image = Image;
- NetListInit (&UdpIo->SentDatagram);
+ InitializeListHead (&UdpIo->SentDatagram);
UdpIo->RecvRequest = NULL;
UdpIo->UdpHandle = NULL;
@@ -336,7 +336,7 @@ FREE_CHILD:
);
FREE_MEM:
- NetFreePool (UdpIo);
+ gBS->FreePool (UdpIo);
return NULL;
}
@@ -363,8 +363,8 @@ UdpIoCancelDgrams (
IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
UDP_TX_TOKEN *Token;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &UdpIo->SentDatagram) {
@@ -425,10 +425,10 @@ UdpIoFreePort (
);
if (!IsListEmpty(&UdpIo->Link)) {
- NetListRemoveEntry (&UdpIo->Link);
+ RemoveEntryList (&UdpIo->Link);
}
- NetFreePool (UdpIo);
+ gBS->FreePool (UdpIo);
return EFI_SUCCESS;
}
@@ -485,7 +485,7 @@ UdpIoOnDgramSentDpc (
Token = (UDP_TX_TOKEN *) Context;
ASSERT (Token->Signature == UDP_IO_TX_SIGNATURE);
- NetListRemoveEntry (&Token->Link);
+ RemoveEntryList (&Token->Link);
Token->CallBack (Token->Packet, NULL, Token->UdpToken.Status, Token->Context);
UdpIoFreeTxToken (Token);
@@ -554,10 +554,10 @@ UdpIoSendDatagram (
// Insert the tx token into SendDatagram list before transmitting it. Remove
// it from the list if the returned status is not EFI_SUCCESS.
//
- NetListInsertHead (&UdpIo->SentDatagram, &Token->Link);
+ InsertHeadList (&UdpIo->SentDatagram, &Token->Link);
Status = UdpIo->Udp->Transmit (UdpIo->Udp, &Token->UdpToken);
if (EFI_ERROR (Status)) {
- NetListRemoveEntry (&Token->Link);
+ RemoveEntryList (&Token->Link);
UdpIoFreeTxToken (Token);
return Status;
}
@@ -708,8 +708,8 @@ UdpIoOnDgramRcvdDpc (
Points.LocalPort = UdpSession->DestinationPort;
Points.RemotePort = UdpSession->SourcePort;
- NetCopyMem (&Points.LocalAddr, &UdpSession->DestinationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Points.RemoteAddr, &UdpSession->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&Points.LocalAddr, &UdpSession->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Points.RemoteAddr, &UdpSession->SourceAddress, sizeof (IP4_ADDR));
Points.LocalAddr = NTOHL (Points.LocalAddr);
Points.RemoteAddr = NTOHL (Points.RemoteAddr);
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDebug.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpDebug.h
deleted file mode 100644
index fb69b07351..0000000000
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDebug.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/** @file
-
-Copyright (c) 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:
-
- ArpDebug.h
-
-Abstract:
-
-
-**/
-
-#ifndef _ARP_DEBUG_H_
-#define _ARP_DEBUG_H_
-
-
-#define ARP_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE ("Arp", PrintArg)
-#define ARP_DEBUG_WARN(PrintArg) NET_DEBUG_WARNING ("Arp", PrintArg)
-#define ARP_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR ("Arp", PrintArg)
-
-#endif
-
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
index aa99ff5b51..c33ce4d98a 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2007, 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
@@ -142,7 +142,7 @@ ArpCreateService (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
ArpOnFrameRcvd,
ArpService,
&ArpService->RxToken.Event
@@ -156,7 +156,7 @@ ArpCreateService (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
ArpTimerHandler,
ArpService,
&ArpService->PeriodicTimer
@@ -180,10 +180,10 @@ ArpCreateService (
//
// Init the lists.
//
- NetListInit (&ArpService->ChildrenList);
- NetListInit (&ArpService->PendingRequestTable);
- NetListInit (&ArpService->DeniedCacheTable);
- NetListInit (&ArpService->ResolvedCacheTable);
+ InitializeListHead (&ArpService->ChildrenList);
+ InitializeListHead (&ArpService->PendingRequestTable);
+ InitializeListHead (&ArpService->DeniedCacheTable);
+ InitializeListHead (&ArpService->ResolvedCacheTable);
ERROR_EXIT:
@@ -332,7 +332,7 @@ ArpDriverBindingStart (
//
// Allocate a zero pool for ArpService.
//
- ArpService = NetAllocateZeroPool (sizeof(ARP_SERVICE_DATA));
+ ArpService = AllocateZeroPool (sizeof(ARP_SERVICE_DATA));
if (ArpService == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -374,7 +374,7 @@ ERROR:
// On error, clean the arp service context data, and free the memory allocated.
//
ArpCleanService (ArpService);
- NetFreePool (ArpService);
+ gBS->FreePool (ArpService);
return Status;
}
@@ -428,7 +428,7 @@ ArpDriverBindingStop (
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("ArpDriverBindingStop: Open ArpSb failed, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "ArpDriverBindingStop: Open ArpSb failed, %r.\n", Status));
return EFI_DEVICE_ERROR;
}
@@ -450,18 +450,18 @@ ArpDriverBindingStop (
//
ArpCleanService (ArpService);
- NetFreePool (ArpService);
+ gBS->FreePool (ArpService);
} else {
- while (!NetListIsEmpty (&ArpService->ChildrenList)) {
+ while (!IsListEmpty (&ArpService->ChildrenList)) {
Instance = NET_LIST_HEAD (&ArpService->ChildrenList, ARP_INSTANCE_DATA, List);
ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
}
- ASSERT (NetListIsEmpty (&ArpService->PendingRequestTable));
- ASSERT (NetListIsEmpty (&ArpService->DeniedCacheTable));
- ASSERT (NetListIsEmpty (&ArpService->ResolvedCacheTable));
+ ASSERT (IsListEmpty (&ArpService->PendingRequestTable));
+ ASSERT (IsListEmpty (&ArpService->DeniedCacheTable));
+ ASSERT (IsListEmpty (&ArpService->ResolvedCacheTable));
}
return EFI_SUCCESS;
@@ -505,9 +505,9 @@ ArpServiceBindingCreateChild (
//
// Allocate memory for the instance context data.
//
- Instance = NetAllocateZeroPool (sizeof(ARP_INSTANCE_DATA));
+ Instance = AllocateZeroPool (sizeof(ARP_INSTANCE_DATA));
if (Instance == NULL) {
- ARP_DEBUG_ERROR (("ArpSBCreateChild: Failed to allocate memory for Instance.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpSBCreateChild: Failed to allocate memory for Instance.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -527,9 +527,9 @@ ArpServiceBindingCreateChild (
NULL
);
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("ArpSBCreateChild: faild to install ARP protocol, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "ArpSBCreateChild: faild to install ARP protocol, %r.\n", Status));
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
@@ -553,15 +553,15 @@ ArpServiceBindingCreateChild (
goto ERROR;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Insert the instance into children list managed by the arp service context data.
//
- NetListInsertTail (&ArpService->ChildrenList, &Instance->List);
+ InsertTailList (&ArpService->ChildrenList, &Instance->List);
ArpService->ChildrenNumber++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
ERROR:
@@ -584,7 +584,7 @@ ERROR:
//
// Free the allocated memory.
//
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
return Status;
@@ -672,14 +672,14 @@ ArpServiceBindingDestroyChild (
NULL
);
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("ArpSBDestroyChild: Failed to uninstall the arp protocol, %r.\n",
+ DEBUG ((EFI_D_ERROR, "ArpSBDestroyChild: Failed to uninstall the arp protocol, %r.\n",
Status));
Instance->Destroyed = FALSE;
return Status;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->Configured) {
//
@@ -696,12 +696,12 @@ ArpServiceBindingDestroyChild (
//
// Remove this instance from the ChildrenList.
//
- NetListRemoveEntry (&Instance->List);
+ RemoveEntryList (&Instance->List);
ArpService->ChildrenNumber--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h
index 457441a5c4..8c938e917d 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h
@@ -33,7 +33,6 @@ Abstract:
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
-#include "ArpDebug.h"
//
// Global variables
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf b/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
index ef954fe61e..8a2266616b 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
@@ -37,7 +37,6 @@
ComponentName.c
ArpImpl.h
ArpImpl.c
- ArpDebug.h
ArpDriver.c
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.msa b/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.msa
index 47286726c8..b790fddb56 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.msa
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.msa
@@ -37,7 +37,6 @@
</LibraryClassDefinitions>
<SourceFiles>
<Filename>ArpDriver.c</Filename>
- <Filename>ArpDebug.h</Filename>
<Filename>ArpImpl.c</Filename>
<Filename>ArpImpl.h</Filename>
<Filename>ComponentName.c</Filename>
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
index 404e6cc9d6..797ebd0ba0 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
@@ -20,7 +20,6 @@ Abstract:
#include "ArpImpl.h"
-#include "ArpDebug.h"
EFI_ARP_PROTOCOL mEfiArpProtocolTemplate = {
ArpConfigure,
@@ -59,7 +58,7 @@ ArpInitInstance (
Instance->Configured = FALSE;
Instance->Destroyed = FALSE;
- NetListInit (&Instance->List);
+ InitializeListHead (&Instance->List);
}
@@ -85,7 +84,7 @@ ArpOnFrameRcvdDpc (
ARP_HEAD *Head;
ARP_ADDRESS ArpAddress;
ARP_CACHE_ENTRY *CacheEntry;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ARP_INSTANCE_DATA *Instance;
EFI_ARP_CONFIG_DATA *ConfigData;
NET_ARP_ADDRESS SenderAddress[2];
@@ -186,7 +185,7 @@ ArpOnFrameRcvdDpc (
// The protocol type is matched for the received arp packet.
//
ProtoMatched = TRUE;
- if (0 == NetCompareMem (
+ if (0 == CompareMem (
(VOID *)ArpAddress.TargetProtoAddr,
ConfigData->StationAddress,
ConfigData->SwAddressLength
@@ -257,7 +256,7 @@ ArpOnFrameRcvdDpc (
}
if (!IsListEmpty (&CacheEntry->List)) {
- NetListRemoveEntry (&CacheEntry->List);
+ RemoveEntryList (&CacheEntry->List);
}
//
@@ -277,7 +276,7 @@ ArpOnFrameRcvdDpc (
//
// Add this entry into the ResolvedCacheTable
//
- NetListInsertHead (&ArpService->ResolvedCacheTable, &CacheEntry->List);
+ InsertHeadList (&ArpService->ResolvedCacheTable, &CacheEntry->List);
}
if (Head->OpCode == ARP_OPCODE_REQUEST) {
@@ -304,7 +303,7 @@ RESTART_RECEIVE:
DEBUG_CODE (
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("ArpOnFrameRcvd: ArpService->Mnp->Receive "
+ DEBUG ((EFI_D_ERROR, "ArpOnFrameRcvd: ArpService->Mnp->Receive "
"failed, %r\n.", Status));
}
);
@@ -358,17 +357,17 @@ ArpOnFrameSentDpc (
DEBUG_CODE (
if (EFI_ERROR (TxToken->Status)) {
- ARP_DEBUG_ERROR (("ArpOnFrameSent: TxToken->Status, %r.\n", TxToken->Status));
+ DEBUG ((EFI_D_ERROR, "ArpOnFrameSent: TxToken->Status, %r.\n", TxToken->Status));
}
);
//
// Free the allocated memory and close the event.
//
- NetFreePool (TxData->FragmentTable[0].FragmentBuffer);
- NetFreePool (TxData);
+ gBS->FreePool (TxData->FragmentTable[0].FragmentBuffer);
+ gBS->FreePool (TxData);
gBS->CloseEvent (TxToken->Event);
- NetFreePool (TxToken);
+ gBS->FreePool (TxToken);
}
/**
@@ -413,9 +412,9 @@ ArpTimerHandler (
)
{
ARP_SERVICE_DATA *ArpService;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *NextEntry;
- NET_LIST_ENTRY *ContextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
+ LIST_ENTRY *ContextEntry;
ARP_CACHE_ENTRY *CacheEntry;
USER_REQUEST_CONTEXT *RequestContext;
@@ -439,15 +438,15 @@ ArpTimerHandler (
// Abort this request.
//
ArpAddressResolved (CacheEntry, NULL, NULL);
- ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));
+ ASSERT (IsListEmpty (&CacheEntry->UserRequestList));
- NetListRemoveEntry (&CacheEntry->List);
- NetFreePool (CacheEntry);
+ RemoveEntryList (&CacheEntry->List);
+ gBS->FreePool (CacheEntry);
} else {
//
// resend the ARP request.
//
- ASSERT (!NetListIsEmpty(&CacheEntry->UserRequestList));
+ ASSERT (!IsListEmpty(&CacheEntry->UserRequestList));
ContextEntry = CacheEntry->UserRequestList.ForwardLink;
RequestContext = NET_LIST_USER_STRUCT (ContextEntry, USER_REQUEST_CONTEXT, List);
@@ -470,7 +469,7 @@ ArpTimerHandler (
//
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &ArpService->DeniedCacheTable) {
CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);
- ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));
+ ASSERT (IsListEmpty (&CacheEntry->UserRequestList));
if (CacheEntry->DefaultDecayTime == 0) {
//
@@ -483,8 +482,8 @@ ArpTimerHandler (
//
// Time out, remove it.
//
- NetListRemoveEntry (&CacheEntry->List);
- NetFreePool (CacheEntry);
+ RemoveEntryList (&CacheEntry->List);
+ gBS->FreePool (CacheEntry);
} else {
//
// Update the DecayTime.
@@ -498,7 +497,7 @@ ArpTimerHandler (
//
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &ArpService->ResolvedCacheTable) {
CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);
- ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));
+ ASSERT (IsListEmpty (&CacheEntry->UserRequestList));
if (CacheEntry->DefaultDecayTime == 0) {
//
@@ -511,8 +510,8 @@ ArpTimerHandler (
//
// Time out, remove it.
//
- NetListRemoveEntry (&CacheEntry->List);
- NetFreePool (CacheEntry);
+ RemoveEntryList (&CacheEntry->List);
+ gBS->FreePool (CacheEntry);
} else {
//
// Update the DecayTime.
@@ -548,7 +547,7 @@ ArpMatchAddress (
}
if ((AddressOne->AddressPtr != NULL) &&
- (NetCompareMem (
+ (CompareMem (
AddressOne->AddressPtr,
AddressTwo->AddressPtr,
AddressOne->Length
@@ -578,14 +577,14 @@ ArpMatchAddress (
**/
ARP_CACHE_ENTRY *
ArpFindNextCacheEntryInTable (
- IN NET_LIST_ENTRY *CacheTable,
- IN NET_LIST_ENTRY *StartEntry,
+ IN LIST_ENTRY *CacheTable,
+ IN LIST_ENTRY *StartEntry,
IN FIND_OPTYPE FindOpType,
IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL,
IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ARP_CACHE_ENTRY *CacheEntry;
if (StartEntry == NULL) {
@@ -716,7 +715,7 @@ ArpAllocCacheEntry (
//
// Allocate memory for the cache entry.
//
- CacheEntry = NetAllocatePool (sizeof (ARP_CACHE_ENTRY));
+ CacheEntry = AllocatePool (sizeof (ARP_CACHE_ENTRY));
if (CacheEntry == NULL) {
return NULL;
}
@@ -724,8 +723,8 @@ ArpAllocCacheEntry (
//
// Init the lists.
//
- NetListInit (&CacheEntry->List);
- NetListInit (&CacheEntry->UserRequestList);
+ InitializeListHead (&CacheEntry->List);
+ InitializeListHead (&CacheEntry->UserRequestList);
for (Index = 0; Index < 2; Index++) {
//
@@ -738,7 +737,7 @@ ArpAllocCacheEntry (
//
// Zero the hardware address first.
//
- NetZeroMem (CacheEntry->Addresses[Hardware].AddressPtr, ARP_MAX_HARDWARE_ADDRESS_LEN);
+ ZeroMem (CacheEntry->Addresses[Hardware].AddressPtr, ARP_MAX_HARDWARE_ADDRESS_LEN);
if (Instance != NULL) {
//
@@ -780,8 +779,8 @@ ArpAddressResolved (
IN EFI_EVENT UserEvent OPTIONAL
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
USER_REQUEST_CONTEXT *Context;
UINTN Count;
@@ -798,7 +797,7 @@ ArpAddressResolved (
//
// Copy the address to the user-provided buffer and notify the user.
//
- NetCopyMem (
+ CopyMem (
Context->UserHwAddrBuffer,
CacheEntry->Addresses[Hardware].AddressPtr,
CacheEntry->Addresses[Hardware].Length
@@ -808,8 +807,8 @@ ArpAddressResolved (
//
// Remove this user request and free the context data.
//
- NetListRemoveEntry (&Context->List);
- NetFreePool (Context);
+ RemoveEntryList (&Context->List);
+ gBS->FreePool (Context);
Count++;
}
@@ -863,7 +862,7 @@ ArpFillAddressInCacheEntry (
//
// Copy it if the AddressPtr points to some buffer.
//
- NetCopyMem (
+ CopyMem (
CacheAddress->AddressPtr,
Address[Index]->AddressPtr,
CacheAddress->Length
@@ -872,7 +871,7 @@ ArpFillAddressInCacheEntry (
//
// Zero the corresponding address buffer in the CacheEntry.
//
- NetZeroMem (CacheAddress->AddressPtr, CacheAddress->Length);
+ ZeroMem (CacheAddress->AddressPtr, CacheAddress->Length);
}
}
}
@@ -916,7 +915,7 @@ ArpConfigureInstance (
//
if ((OldConfigData->SwAddressType != ConfigData->SwAddressType) ||
(OldConfigData->SwAddressLength != ConfigData->SwAddressLength) ||
- (NetCompareMem (
+ (CompareMem (
OldConfigData->StationAddress,
ConfigData->StationAddress,
OldConfigData->SwAddressLength
@@ -932,7 +931,7 @@ ArpConfigureInstance (
//
if (ConfigData->SwAddressType == IPv4_ETHER_PROTO_TYPE) {
- NetCopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));
if (!Ip4IsUnicast (NTOHL (Ip), 0)) {
//
@@ -947,9 +946,9 @@ ArpConfigureInstance (
//
CopyMem (OldConfigData, ConfigData, sizeof (*OldConfigData));
- OldConfigData->StationAddress = NetAllocatePool (OldConfigData->SwAddressLength);
+ OldConfigData->StationAddress = AllocatePool (OldConfigData->SwAddressLength);
if (OldConfigData->StationAddress == NULL) {
- ARP_DEBUG_ERROR (("ArpConfigInstance: NetAllocatePool for the StationAddress "
+ DEBUG ((EFI_D_ERROR, "ArpConfigInstance: AllocatePool for the StationAddress "
"failed.\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -957,7 +956,7 @@ ArpConfigureInstance (
//
// Save the StationAddress.
//
- NetCopyMem (
+ CopyMem (
OldConfigData->StationAddress,
ConfigData->StationAddress,
OldConfigData->SwAddressLength
@@ -994,7 +993,7 @@ ArpConfigureInstance (
//
// Free the buffer previously allocated to hold the station address.
//
- NetFreePool (OldConfigData->StationAddress);
+ gBS->FreePool (OldConfigData->StationAddress);
}
Instance->Configured = FALSE;
@@ -1039,9 +1038,9 @@ ArpSendFrame (
//
// Allocate memory for the TxToken.
//
- TxToken = NetAllocatePool (sizeof(EFI_MANAGED_NETWORK_COMPLETION_TOKEN));
+ TxToken = AllocatePool (sizeof(EFI_MANAGED_NETWORK_COMPLETION_TOKEN));
if (TxToken == NULL) {
- ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for TxToken failed.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for TxToken failed.\n"));
return;
}
@@ -1054,22 +1053,22 @@ ArpSendFrame (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
ArpOnFrameSent,
(VOID *)TxToken,
&TxToken->Event
);
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("ArpSendFrame: CreateEvent failed for TxToken->Event.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpSendFrame: CreateEvent failed for TxToken->Event.\n"));
goto CLEAN_EXIT;
}
//
// Allocate memory for the TxData used in the TxToken.
//
- TxData = NetAllocatePool (sizeof(EFI_MANAGED_NETWORK_TRANSMIT_DATA));
+ TxData = AllocatePool (sizeof(EFI_MANAGED_NETWORK_TRANSMIT_DATA));
if (TxData == NULL) {
- ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for TxData failed.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for TxData failed.\n"));
goto CLEAN_EXIT;
}
@@ -1086,9 +1085,9 @@ ArpSendFrame (
//
// Allocate buffer for the arp frame.
//
- Packet = NetAllocatePool (TotalLength);
+ Packet = AllocatePool (TotalLength);
if (Packet == NULL) {
- ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for Packet failed.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for Packet failed.\n"));
}
TmpPtr = Packet;
@@ -1097,9 +1096,9 @@ ArpSendFrame (
// The destination MAC address.
//
if (ArpOpCode == ARP_OPCODE_REQUEST) {
- NetCopyMem (TmpPtr, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);
+ CopyMem (TmpPtr, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);
} else {
- NetCopyMem (
+ CopyMem (
TmpPtr,
CacheEntry->Addresses[Hardware].AddressPtr,
SnpMode->HwAddressSize
@@ -1110,7 +1109,7 @@ ArpSendFrame (
//
// The source MAC address.
//
- NetCopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);
+ CopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);
TmpPtr += SnpMode->HwAddressSize;
//
@@ -1133,19 +1132,19 @@ ArpSendFrame (
//
// The sender hardware address.
//
- NetCopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);
+ CopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);
TmpPtr += SnpMode->HwAddressSize;
//
// The sender protocol address.
//
- NetCopyMem (TmpPtr, ConfigData->StationAddress, ConfigData->SwAddressLength);
+ CopyMem (TmpPtr, ConfigData->StationAddress, ConfigData->SwAddressLength);
TmpPtr += ConfigData->SwAddressLength;
//
// The target hardware address.
//
- NetCopyMem (
+ CopyMem (
TmpPtr,
CacheEntry->Addresses[Hardware].AddressPtr,
SnpMode->HwAddressSize
@@ -1155,7 +1154,7 @@ ArpSendFrame (
//
// The target protocol address.
//
- NetCopyMem (
+ CopyMem (
TmpPtr,
CacheEntry->Addresses[Protocol].AddressPtr,
ConfigData->SwAddressLength
@@ -1185,7 +1184,7 @@ ArpSendFrame (
//
Status = ArpService->Mnp->Transmit (ArpService->Mnp, TxToken);
if (EFI_ERROR (Status)) {
- ARP_DEBUG_ERROR (("Mnp->Transmit failed, %r.\n", Status));
+ DEBUG ((EFI_D_ERROR, "Mnp->Transmit failed, %r.\n", Status));
goto CLEAN_EXIT;
}
@@ -1194,18 +1193,18 @@ ArpSendFrame (
CLEAN_EXIT:
if (Packet != NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
if (TxData != NULL) {
- NetFreePool (TxData);
+ gBS->FreePool (TxData);
}
if (TxToken->Event != NULL) {
gBS->CloseEvent (TxToken->Event);
}
- NetFreePool (TxToken);
+ gBS->FreePool (TxToken);
}
@@ -1228,15 +1227,15 @@ CLEAN_EXIT:
STATIC
UINTN
ArpDeleteCacheEntryInTable (
- IN NET_LIST_ENTRY *CacheTable,
+ IN LIST_ENTRY *CacheTable,
IN BOOLEAN BySwAddress,
IN UINT16 SwAddressType,
IN UINT8 *AddressBuffer OPTIONAL,
IN BOOLEAN Force
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
ARP_CACHE_ENTRY *CacheEntry;
UINTN Count;
@@ -1258,7 +1257,7 @@ ArpDeleteCacheEntryInTable (
// Protocol address type matched. Check the address.
//
if ((AddressBuffer == NULL) ||
- (NetCompareMem (
+ (CompareMem (
AddressBuffer,
CacheEntry->Addresses[Protocol].AddressPtr,
CacheEntry->Addresses[Protocol].Length
@@ -1271,7 +1270,7 @@ ArpDeleteCacheEntryInTable (
}
} else {
if ((AddressBuffer == NULL) ||
- (NetCompareMem (
+ (CompareMem (
AddressBuffer,
CacheEntry->Addresses[Hardware].AddressPtr,
CacheEntry->Addresses[Hardware].Length
@@ -1290,9 +1289,9 @@ MATCHED:
//
// Delete this entry.
//
- NetListRemoveEntry (&CacheEntry->List);
- ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));
- NetFreePool (CacheEntry);
+ RemoveEntryList (&CacheEntry->List);
+ ASSERT (IsListEmpty (&CacheEntry->UserRequestList));
+ gBS->FreePool (CacheEntry);
Count++;
}
@@ -1375,8 +1374,8 @@ ArpCancelRequest (
)
{
ARP_SERVICE_DATA *ArpService;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *NextEntry;
ARP_CACHE_ENTRY *CacheEntry;
UINTN Count;
@@ -1389,7 +1388,7 @@ ArpCancelRequest (
CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);
if ((TargetSwAddress == NULL) ||
- (NetCompareMem (
+ (CompareMem (
TargetSwAddress,
CacheEntry->Addresses[Protocol].AddressPtr,
CacheEntry->Addresses[Protocol].Length
@@ -1400,12 +1399,12 @@ ArpCancelRequest (
//
Count += ArpAddressResolved (CacheEntry, Instance, UserEvent);
- if (NetListIsEmpty (&CacheEntry->UserRequestList)) {
+ if (IsListEmpty (&CacheEntry->UserRequestList)) {
//
// No user requests any more, remove this request cache entry.
//
- NetListRemoveEntry (&CacheEntry->List);
- NetFreePool (CacheEntry);
+ RemoveEntryList (&CacheEntry->List);
+ gBS->FreePool (CacheEntry);
}
}
}
@@ -1452,12 +1451,12 @@ ArpFindCacheEntry (
ARP_SERVICE_DATA *ArpService;
NET_ARP_ADDRESS MatchAddress;
FIND_OPTYPE FindOpType;
- NET_LIST_ENTRY *StartEntry;
+ LIST_ENTRY *StartEntry;
ARP_CACHE_ENTRY *CacheEntry;
NET_MAP FoundEntries;
UINT32 FoundCount;
EFI_ARP_FIND_DATA *FindData;
- NET_LIST_ENTRY *CacheTable;
+ LIST_ENTRY *CacheTable;
ArpService = Instance->ArpService;
@@ -1596,9 +1595,9 @@ ArpFindCacheEntry (
//
// Allocate buffer to copy the found entries.
//
- FindData = NetAllocatePool (FoundCount * (*EntryLength));
+ FindData = AllocatePool (FoundCount * (*EntryLength));
if (FindData == NULL) {
- ARP_DEBUG_ERROR (("ArpFindCacheEntry: Failed to allocate memory.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpFindCacheEntry: Failed to allocate memory.\n"));
Status = EFI_OUT_OF_RESOURCES;
goto CLEAN_EXIT;
}
@@ -1631,7 +1630,7 @@ ArpFindCacheEntry (
//
// Copy the software address.
//
- NetCopyMem (
+ CopyMem (
FindData + 1,
CacheEntry->Addresses[Protocol].AddressPtr,
FindData->SwAddressLength
@@ -1640,7 +1639,7 @@ ArpFindCacheEntry (
//
// Copy the hardware address.
//
- NetCopyMem (
+ CopyMem (
(UINT8 *)(FindData + 1) + FindData->SwAddressLength,
CacheEntry->Addresses[Hardware].AddressPtr,
FindData->HwAddressLength
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h
index 1c5e421a04..1db6d34ab3 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h
@@ -37,7 +37,6 @@ Abstract:
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
-#include "ArpDebug.h"
#define ARP_ETHER_PROTO_TYPE 0x0806
#define IPv4_ETHER_PROTO_TYPE 0x0800
@@ -95,7 +94,7 @@ typedef struct _ARP_INSTANCE_DATA {
ARP_SERVICE_DATA *ArpService;
EFI_HANDLE Handle;
EFI_ARP_PROTOCOL ArpProto;
- NET_LIST_ENTRY List;
+ LIST_ENTRY List;
EFI_ARP_CONFIG_DATA ConfigData;
BOOLEAN Configured;
BOOLEAN Destroyed;
@@ -126,17 +125,17 @@ struct _ARP_SERVICE_DATA {
EFI_SIMPLE_NETWORK_MODE SnpMode;
UINTN ChildrenNumber;
- NET_LIST_ENTRY ChildrenList;
+ LIST_ENTRY ChildrenList;
- NET_LIST_ENTRY PendingRequestTable;
- NET_LIST_ENTRY DeniedCacheTable;
- NET_LIST_ENTRY ResolvedCacheTable;
+ LIST_ENTRY PendingRequestTable;
+ LIST_ENTRY DeniedCacheTable;
+ LIST_ENTRY ResolvedCacheTable;
EFI_EVENT PeriodicTimer;
};
typedef struct _USER_REQUEST_CONTEXT {
- NET_LIST_ENTRY List;
+ LIST_ENTRY List;
ARP_INSTANCE_DATA *Instance;
EFI_EVENT UserRequestEvent;
VOID *UserHwAddrBuffer;
@@ -161,7 +160,7 @@ typedef enum {
} ARP_ADDRESS_TYPE;
typedef struct _ARP_CACHE_ENTRY {
- NET_LIST_ENTRY List;
+ LIST_ENTRY List;
UINT32 RetryCount;
UINT32 DefaultDecayTime;
@@ -170,7 +169,7 @@ typedef struct _ARP_CACHE_ENTRY {
NET_ARP_ADDRESS Addresses[2];
- NET_LIST_ENTRY UserRequestList;
+ LIST_ENTRY UserRequestList;
} ARP_CACHE_ENTRY;
EFI_STATUS
@@ -249,8 +248,8 @@ ArpFindDeniedCacheEntry (
ARP_CACHE_ENTRY *
ArpFindNextCacheEntryInTable (
- IN NET_LIST_ENTRY *CacheTable,
- IN NET_LIST_ENTRY *StartEntry,
+ IN LIST_ENTRY *CacheTable,
+ IN LIST_ENTRY *StartEntry,
IN FIND_OPTYPE FindOpType,
IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL,
IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c
index d760f7c018..46aa19226b 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c
@@ -66,14 +66,14 @@ ArpConfigure (
Instance = ARP_INSTANCE_DATA_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Configure this instance, the ConfigData has already passed the basic checks.
//
Status = ArpConfigureInstance (Instance, ConfigData);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -166,7 +166,7 @@ ArpAdd (
MatchAddress[Protocol].Length = Instance->ConfigData.SwAddressLength;
MatchAddress[Protocol].AddressPtr = TargetSwAddress;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// See whether the entry to add exists. Check the DeinedCacheTable first.
@@ -215,7 +215,7 @@ ArpAdd (
//
// Remove it from the Table.
//
- NetListRemoveEntry (&CacheEntry->List);
+ RemoveEntryList (&CacheEntry->List);
} else {
//
// It's a new entry, allocate memory for the entry.
@@ -223,7 +223,7 @@ ArpAdd (
CacheEntry = ArpAllocCacheEntry (Instance);
if (CacheEntry == NULL) {
- ARP_DEBUG_ERROR (("ArpAdd: Failed to allocate pool for CacheEntry.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpAdd: Failed to allocate pool for CacheEntry.\n"));
Status = EFI_OUT_OF_RESOURCES;
goto UNLOCK_EXIT;
}
@@ -253,14 +253,14 @@ ArpAdd (
// Add this CacheEntry to the corresponding CacheTable.
//
if (DenyFlag) {
- NetListInsertHead (&ArpService->DeniedCacheTable, &CacheEntry->List);
+ InsertHeadList (&ArpService->DeniedCacheTable, &CacheEntry->List);
} else {
- NetListInsertHead (&ArpService->ResolvedCacheTable, &CacheEntry->List);
+ InsertHeadList (&ArpService->ResolvedCacheTable, &CacheEntry->List);
}
UNLOCK_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -321,7 +321,7 @@ ArpFind (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// All the check passed, find the cache entries now.
@@ -336,7 +336,7 @@ ArpFind (
Refresh
);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -381,14 +381,14 @@ ArpDelete (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Delete the specified cache entries.
//
Count = ArpDeleteCacheEntry (Instance, BySwAddress, AddressBuffer, TRUE);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;
}
@@ -426,14 +426,14 @@ ArpFlush (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Delete the dynamic entries from the cache table.
//
Count = ArpDeleteCacheEntry (Instance, FALSE, NULL, FALSE);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;
}
@@ -500,7 +500,7 @@ ArpRequest (
//
// Return the hardware broadcast address.
//
- NetCopyMem (TargetHwAddress, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);
+ CopyMem (TargetHwAddress, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);
goto SIGNAL_USER;
}
@@ -531,9 +531,9 @@ ArpRequest (
//
// Initialize the TargetHwAddrss to a zero address.
//
- NetZeroMem (TargetHwAddress, SnpMode->HwAddressSize);
+ ZeroMem (TargetHwAddress, SnpMode->HwAddressSize);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Check whether the software address is in the denied table.
@@ -558,7 +558,7 @@ ArpRequest (
//
// Resolved, copy the address into the user buffer.
//
- NetCopyMem (
+ CopyMem (
TargetHwAddress,
CacheEntry->Addresses[Hardware].AddressPtr,
CacheEntry->Addresses[Hardware].Length
@@ -575,9 +575,9 @@ ArpRequest (
//
// Create a request context for this arp request.
//
- RequestContext = NetAllocatePool (sizeof(USER_REQUEST_CONTEXT));
+ RequestContext = AllocatePool (sizeof(USER_REQUEST_CONTEXT));
if (RequestContext == NULL) {
- ARP_DEBUG_ERROR (("ArpRequest: Allocate memory for RequestContext failed.\n"));
+ DEBUG ((EFI_D_ERROR, "ArpRequest: Allocate memory for RequestContext failed.\n"));
Status = EFI_OUT_OF_RESOURCES;
goto UNLOCK_EXIT;
@@ -586,7 +586,7 @@ ArpRequest (
RequestContext->Instance = Instance;
RequestContext->UserRequestEvent = ResolvedEvent;
RequestContext->UserHwAddrBuffer = TargetHwAddress;
- NetListInit (&RequestContext->List);
+ InitializeListHead (&RequestContext->List);
//
// Check whether there is a same request.
@@ -608,8 +608,8 @@ ArpRequest (
//
CacheEntry = ArpAllocCacheEntry (Instance);
if (CacheEntry == NULL) {
- ARP_DEBUG_ERROR (("ArpRequest: Allocate memory for CacheEntry failed.\n"));
- NetFreePool (RequestContext);
+ DEBUG ((EFI_D_ERROR, "ArpRequest: Allocate memory for CacheEntry failed.\n"));
+ gBS->FreePool (RequestContext);
Status = EFI_OUT_OF_RESOURCES;
goto UNLOCK_EXIT;
@@ -623,13 +623,13 @@ ArpRequest (
//
// Add this entry into the PendingRequestTable.
//
- NetListInsertTail (&ArpService->PendingRequestTable, &CacheEntry->List);
+ InsertTailList (&ArpService->PendingRequestTable, &CacheEntry->List);
}
//
// Link this request context into the cache entry.
//
- NetListInsertHead (&CacheEntry->UserRequestList, &RequestContext->List);
+ InsertHeadList (&CacheEntry->UserRequestList, &RequestContext->List);
//
// Send out the ARP Request frame.
@@ -639,7 +639,7 @@ ArpRequest (
UNLOCK_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
SIGNAL_USER:
@@ -701,7 +701,7 @@ ArpCancel (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Cancel the specified request.
@@ -714,7 +714,7 @@ ArpCancel (
//
NetLibDispatchDpc ();
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
index 4d78b87ad1..d27810322e 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
@@ -141,9 +141,9 @@ DhcpConfigUdpIo (
UdpConfigData.StationPort = DHCP_CLIENT_PORT;
UdpConfigData.RemotePort = DHCP_SERVER_PORT;
- NetZeroMem (&UdpConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&UdpConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&UdpConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&UdpConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);;
}
@@ -208,7 +208,7 @@ Dhcp4CreateService (
EFI_STATUS Status;
*Service = NULL;
- DhcpSb = NetAllocateZeroPool (sizeof (DHCP_SERVICE));
+ DhcpSb = AllocateZeroPool (sizeof (DHCP_SERVICE));
if (DhcpSb == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -220,7 +220,7 @@ Dhcp4CreateService (
DhcpSb->InDestory = FALSE;
DhcpSb->Controller = Controller;
DhcpSb->Image = ImageHandle;
- NetListInit (&DhcpSb->Children);
+ InitializeListHead (&DhcpSb->Children);
DhcpSb->DhcpState = Dhcp4Stopped;
DhcpSb->Xid = NET_RANDOM (NetRandomInitSeed ());
@@ -229,7 +229,7 @@ Dhcp4CreateService (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
DhcpOnTimerTick,
DhcpSb,
&DhcpSb->Timer
@@ -255,7 +255,7 @@ Dhcp4CreateService (
ON_ERROR:
Dhcp4CloseService (DhcpSb);
- NetFreePool (DhcpSb);
+ gBS->FreePool (DhcpSb);
return Status;
}
@@ -331,7 +331,7 @@ Dhcp4DriverBindingStart (
ON_ERROR:
Dhcp4CloseService (DhcpSb);
- NetFreePool (DhcpSb);
+ gBS->FreePool (DhcpSb);
return Status;
}
@@ -394,7 +394,7 @@ Dhcp4DriverBindingStop (
return EFI_SUCCESS;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (NumberOfChildren == 0) {
@@ -409,13 +409,13 @@ Dhcp4DriverBindingStop (
Dhcp4CloseService (DhcpSb);
- NetFreePool (DhcpSb);
+ gBS->FreePool (DhcpSb);
} else {
//
// Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestoryChild
// may cause other child to be deleted.
//
- while (!NetListIsEmpty (&DhcpSb->Children)) {
+ while (!IsListEmpty (&DhcpSb->Children)) {
Instance = NET_LIST_HEAD (&DhcpSb->Children, DHCP_PROTOCOL, Link);
ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
}
@@ -425,7 +425,7 @@ Dhcp4DriverBindingStop (
}
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -448,7 +448,7 @@ DhcpInitProtocol (
{
Instance->Signature = DHCP_PROTOCOL_SIGNATURE;
CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (Instance->Dhcp4Protocol));
- NetListInit (&Instance->Link);
+ InitializeListHead (&Instance->Link);
Instance->Handle = NULL;
Instance->Service = DhcpSb;
Instance->InDestory = FALSE;
@@ -492,7 +492,7 @@ Dhcp4ServiceBindingCreateChild (
return EFI_INVALID_PARAMETER;
}
- Instance = NetAllocatePool (sizeof (*Instance));
+ Instance = AllocatePool (sizeof (*Instance));
if (Instance == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -512,7 +512,7 @@ Dhcp4ServiceBindingCreateChild (
);
if (EFI_ERROR (Status)) {
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
@@ -537,16 +537,16 @@ Dhcp4ServiceBindingCreateChild (
NULL
);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- NetListInsertTail (&DhcpSb->Children, &Instance->Link);
+ InsertTailList (&DhcpSb->Children, &Instance->Link);
DhcpSb->NumChildren++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -617,7 +617,7 @@ Dhcp4ServiceBindingDestroyChild (
return EFI_SUCCESS;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance->InDestory = TRUE;
//
@@ -642,7 +642,7 @@ Dhcp4ServiceBindingDestroyChild (
if (EFI_ERROR (Status)) {
Instance->InDestory = FALSE;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -650,11 +650,11 @@ Dhcp4ServiceBindingDestroyChild (
DhcpYieldControl (DhcpSb);
}
- NetListRemoveEntry (&Instance->Link);
+ RemoveEntryList (&Instance->Link);
DhcpSb->NumChildren--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
index 50f1a2fbbe..09de4cdaab 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
@@ -58,7 +58,7 @@ EfiDhcp4GetModeData (
Instance = DHCP_INSTANCE_FROM_THIS (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
//
@@ -70,28 +70,28 @@ EfiDhcp4GetModeData (
CopyMem (&Dhcp4ModeData->ClientMacAddress, &DhcpSb->Mac, sizeof (Dhcp4ModeData->ClientMacAddress));
Ip = HTONL (DhcpSb->ClientAddr);
- NetCopyMem (&Dhcp4ModeData->ClientAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Dhcp4ModeData->ClientAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (DhcpSb->Netmask);
- NetCopyMem (&Dhcp4ModeData->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Dhcp4ModeData->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (DhcpSb->ServerAddr);
- NetCopyMem (&Dhcp4ModeData->ServerAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Dhcp4ModeData->ServerAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Para = DhcpSb->Para;
if (Para != NULL) {
Ip = HTONL (Para->Router);
- NetCopyMem (&Dhcp4ModeData->RouterAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Dhcp4ModeData->RouterAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Dhcp4ModeData->LeaseTime = Para->Lease;
} else {
- NetZeroMem (&Dhcp4ModeData->RouterAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Dhcp4ModeData->RouterAddress, sizeof (EFI_IPv4_ADDRESS));
Dhcp4ModeData->LeaseTime = 0xffffffff;
}
Dhcp4ModeData->ReplyPacket = DhcpSb->Selected;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -114,24 +114,24 @@ DhcpCleanConfigure (
UINT32 Index;
if (Config->DiscoverTimeout != NULL) {
- NetFreePool (Config->DiscoverTimeout);
+ gBS->FreePool (Config->DiscoverTimeout);
}
if (Config->RequestTimeout != NULL) {
- NetFreePool (Config->RequestTimeout);
+ gBS->FreePool (Config->RequestTimeout);
}
if (Config->OptionList != NULL) {
for (Index = 0; Index < Config->OptionCount; Index++) {
if (Config->OptionList[Index] != NULL) {
- NetFreePool (Config->OptionList[Index]);
+ gBS->FreePool (Config->OptionList[Index]);
}
}
- NetFreePool (Config->OptionList);
+ gBS->FreePool (Config->OptionList);
}
- NetZeroMem (Config, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (Config, sizeof (EFI_DHCP4_CONFIG_DATA));
}
@@ -167,7 +167,7 @@ DhcpCopyConfigure (
//
if (Src->DiscoverTimeout != NULL) {
Len = Src->DiscoverTryCount * sizeof (UINT32);
- Dst->DiscoverTimeout = NetAllocatePool (Len);
+ Dst->DiscoverTimeout = AllocatePool (Len);
if (Dst->DiscoverTimeout == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -183,7 +183,7 @@ DhcpCopyConfigure (
//
if (Src->RequestTimeout != NULL) {
Len = Src->RequestTryCount * sizeof (UINT32);
- Dst->RequestTimeout = NetAllocatePool (Len);
+ Dst->RequestTimeout = AllocatePool (Len);
if (Dst->RequestTimeout == NULL) {
goto ON_ERROR;
@@ -200,7 +200,7 @@ DhcpCopyConfigure (
//
if (Src->OptionList != NULL) {
Len = Src->OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *);
- Dst->OptionList = NetAllocateZeroPool (Len);
+ Dst->OptionList = AllocateZeroPool (Len);
if (Dst->OptionList == NULL) {
goto ON_ERROR;
@@ -212,13 +212,13 @@ DhcpCopyConfigure (
for (Index = 0; Index < Src->OptionCount; Index++) {
Len = sizeof (EFI_DHCP4_PACKET_OPTION) + MAX (SrcOptions[Index]->Length - 1, 0);
- DstOptions[Index] = NetAllocatePool (Len);
+ DstOptions[Index] = AllocatePool (Len);
if (DstOptions[Index] == NULL) {
goto ON_ERROR;
}
- NetCopyMem (DstOptions[Index], SrcOptions[Index], Len);
+ CopyMem (DstOptions[Index], SrcOptions[Index], Len);
}
}
@@ -253,14 +253,14 @@ DhcpYieldControl (
DhcpSb->ActiveChild = NULL;
if (Config->DiscoverTimeout != NULL) {
- NetFreePool (Config->DiscoverTimeout);
+ gBS->FreePool (Config->DiscoverTimeout);
Config->DiscoverTryCount = 0;
Config->DiscoverTimeout = NULL;
}
if (Config->RequestTimeout != NULL) {
- NetFreePool (Config->RequestTimeout);
+ gBS->FreePool (Config->RequestTimeout);
Config->RequestTryCount = 0;
Config->RequestTimeout = NULL;
@@ -322,7 +322,7 @@ EfiDhcp4Configure (
return EFI_INVALID_PARAMETER;
}
- NetCopyMem (&Ip, &Dhcp4CfgData->ClientAddress, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &Dhcp4CfgData->ClientAddress, sizeof (IP4_ADDR));
if ((Ip != 0) && !Ip4IsUnicast (NTOHL (Ip), 0)) {
@@ -336,7 +336,7 @@ EfiDhcp4Configure (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
Config = &DhcpSb->ActiveConfig;
@@ -390,7 +390,7 @@ EfiDhcp4Configure (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -433,7 +433,7 @@ EfiDhcp4Start (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
if (DhcpSb->DhcpState == Dhcp4Stopped) {
@@ -464,9 +464,9 @@ EfiDhcp4Start (
Instance->CompletionEvent = CompletionEvent;
//
- // Restore the TPL now, don't call poll function at NET_TPL_LOCK.
+ // Restore the TPL now, don't call poll function at TPL_CALLBACK.
//
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
if (CompletionEvent == NULL) {
while (DhcpSb->IoStatus == EFI_ALREADY_STARTED) {
@@ -479,7 +479,7 @@ EfiDhcp4Start (
return EFI_SUCCESS;
ON_ERROR:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -524,7 +524,7 @@ EfiDhcp4RenewRebind (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
if (DhcpSb->DhcpState == Dhcp4Stopped) {
@@ -567,7 +567,7 @@ EfiDhcp4RenewRebind (
DhcpSb->IoStatus = EFI_ALREADY_STARTED;
Instance->RenewRebindEvent = CompletionEvent;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
if (CompletionEvent == NULL) {
while (DhcpSb->IoStatus == EFI_ALREADY_STARTED) {
@@ -580,7 +580,7 @@ EfiDhcp4RenewRebind (
return EFI_SUCCESS;
ON_ERROR:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -623,7 +623,7 @@ EfiDhcp4Release (
}
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
if ((DhcpSb->DhcpState != Dhcp4InitReboot) && (DhcpSb->DhcpState != Dhcp4Bound)) {
@@ -649,7 +649,7 @@ EfiDhcp4Release (
DhcpCleanLease (DhcpSb);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -688,7 +688,7 @@ EfiDhcp4Stop (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
DhcpSb = Instance->Service;
DhcpCleanLease (DhcpSb);
@@ -696,7 +696,7 @@ EfiDhcp4Stop (
DhcpSb->DhcpState = Dhcp4Stopped;
DhcpSb->ServiceState = DHCP_UNCONFIGED;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -779,7 +779,7 @@ Dhcp4InstanceConfigUdpIo (
DhcpSb = Instance->Service;
Token = Instance->Token;
- NetZeroMem (&UdpConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
+ ZeroMem (&UdpConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
UdpConfigData.AcceptBroadcast = TRUE;
UdpConfigData.AllowDuplicatePort = TRUE;
@@ -787,10 +787,10 @@ Dhcp4InstanceConfigUdpIo (
UdpConfigData.DoNotFragment = TRUE;
Ip = HTONL (DhcpSb->ClientAddr);
- NetCopyMem (&UdpConfigData.StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfigData.StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (DhcpSb->Netmask);
- NetCopyMem (&UdpConfigData.SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfigData.SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
if ((Token->ListenPointCount == 0) || (Token->ListenPoints[0].ListenPort == 0)) {
UdpConfigData.StationPort = DHCP_CLIENT_PORT;
@@ -951,7 +951,7 @@ PxeDhcpDone (
Token->ResponseCount = Instance->ResponseQueue.BufNum;
if (Token->ResponseCount != 0) {
- Token->ResponseList = (EFI_DHCP4_PACKET *) NetAllocatePool (Instance->ResponseQueue.BufSize);
+ Token->ResponseList = (EFI_DHCP4_PACKET *) AllocatePool (Instance->ResponseQueue.BufSize);
if (Token->ResponseList == NULL) {
Token->Status = EFI_OUT_OF_RESOURCES;
goto SIGNAL_USER;
@@ -1045,7 +1045,7 @@ EfiDhcp4TransmitReceive (
return EFI_NO_MAPPING;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Save the token and the timeout value.
@@ -1081,7 +1081,7 @@ EfiDhcp4TransmitReceive (
//
// Set the destination address and destination port.
//
- NetCopyMem (&Ip, &Token->RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Ip, &Token->RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
EndPoint.RemoteAddr = NTOHL (Ip);
if (Token->RemotePort == 0) {
@@ -1096,7 +1096,7 @@ EfiDhcp4TransmitReceive (
SubnetMask = DhcpSb->Netmask;
Gateway = 0;
if (!IP4_NET_EQUAL (DhcpSb->ClientAddr, EndPoint.RemoteAddr, SubnetMask)) {
- NetCopyMem (&Gateway, &Token->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Gateway, &Token->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
Gateway = NTOHL (Gateway);
}
@@ -1126,7 +1126,7 @@ ON_ERROR:
Instance->Token = NULL;
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
if (!EFI_ERROR (Status) && (Token->CompletionEvent == NULL)) {
//
@@ -1228,7 +1228,7 @@ EfiDhcp4Parse (
return EFI_BUFFER_TOO_SMALL;
}
- NetZeroMem (PacketOptionList, *OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
+ ZeroMem (PacketOptionList, *OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
Context.Option = PacketOptionList;
Context.OptionCount = *OptionCount;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
index 15b2270e88..9297812e92 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
@@ -67,7 +67,7 @@ enum {
struct _DHCP_PROTOCOL {
UINT32 Signature;
EFI_DHCP4_PROTOCOL Dhcp4Protocol;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
EFI_HANDLE Handle;
DHCP_SERVICE *Service;
@@ -96,7 +96,7 @@ struct _DHCP_SERVICE {
EFI_HANDLE Controller;
EFI_HANDLE Image;
- NET_LIST_ENTRY Children;
+ LIST_ENTRY Children;
UINTN NumChildren;
INTN DhcpState;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
index d021d1c02e..19b897ae0d 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
@@ -358,12 +358,12 @@ DhcpConfigLeaseIoPort (
UdpConfigData.RemotePort = DHCP_SERVER_PORT;
Ip = HTONL (DhcpSb->ClientAddr);
- NetCopyMem (&UdpConfigData.StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfigData.StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (DhcpSb->Netmask);
- NetCopyMem (&UdpConfigData.SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfigData.SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));
Status = UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);
@@ -375,10 +375,10 @@ DhcpConfigLeaseIoPort (
// Add a default route if received from the server.
//
if ((DhcpSb->Para != NULL) && (DhcpSb->Para->Router != 0)) {
- NetZeroMem (&Subnet, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Subnet, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (DhcpSb->Para->Router);
- NetCopyMem (&Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));
UdpIo->Udp->Routes (UdpIo->Udp, FALSE, &Subnet, &Subnet, &Gateway);
}
@@ -465,17 +465,17 @@ DhcpCleanLease (
DhcpSb->ServerAddr = 0;
if (DhcpSb->LastOffer != NULL) {
- NetFreePool (DhcpSb->LastOffer);
+ gBS->FreePool (DhcpSb->LastOffer);
DhcpSb->LastOffer = NULL;
}
if (DhcpSb->Selected != NULL) {
- NetFreePool (DhcpSb->Selected);
+ gBS->FreePool (DhcpSb->Selected);
DhcpSb->Selected = NULL;
}
if (DhcpSb->Para != NULL) {
- NetFreePool (DhcpSb->Para);
+ gBS->FreePool (DhcpSb->Para);
DhcpSb->Para = NULL;
}
@@ -545,10 +545,10 @@ DhcpChooseOffer (
Selected = DhcpSb->LastOffer;
if ((NewPacket != NULL) && !EFI_ERROR (DhcpValidateOptions (NewPacket, NULL))) {
- TempPacket = (EFI_DHCP4_PACKET *) NetAllocatePool (NewPacket->Size);
+ TempPacket = (EFI_DHCP4_PACKET *) AllocatePool (NewPacket->Size);
if (TempPacket != NULL) {
- NetCopyMem (TempPacket, NewPacket, NewPacket->Size);
- NetFreePool (Selected);
+ CopyMem (TempPacket, NewPacket, NewPacket->Size);
+ gBS->FreePool (Selected);
Selected = TempPacket;
}
}
@@ -664,7 +664,7 @@ DhcpHandleSelect (
if (Status == EFI_SUCCESS) {
if (DhcpSb->LastOffer != NULL) {
- NetFreePool (DhcpSb->LastOffer);
+ gBS->FreePool (DhcpSb->LastOffer);
}
DhcpSb->LastOffer = Packet;
@@ -673,7 +673,7 @@ DhcpHandleSelect (
} else if (Status == EFI_NOT_READY) {
if (DhcpSb->LastOffer != NULL) {
- NetFreePool (DhcpSb->LastOffer);
+ gBS->FreePool (DhcpSb->LastOffer);
}
DhcpSb->LastOffer = Packet;
@@ -689,7 +689,7 @@ DhcpHandleSelect (
return EFI_SUCCESS;
ON_EXIT:
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return Status;
}
@@ -775,14 +775,14 @@ DhcpHandleRequest (
DhcpSb->IoStatus = EFI_SUCCESS;
DhcpNotifyUser (DhcpSb, DHCP_NOTIFY_COMPLETION);
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return EFI_SUCCESS;
REJECT:
DhcpSendMessage (DhcpSb, DhcpSb->Selected, DhcpSb->Para, DHCP_MSG_DECLINE, Message);
ON_EXIT:
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return Status;
}
@@ -866,7 +866,7 @@ DhcpHandleRenewRebind (
}
ON_EXIT:
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return Status;
}
@@ -935,7 +935,7 @@ DhcpHandleReboot (
//
// OK, get the parameter from server, record the lease
//
- DhcpSb->Para = NetAllocatePool (sizeof (DHCP_PARAMETER));
+ DhcpSb->Para = AllocatePool (sizeof (DHCP_PARAMETER));
if (DhcpSb->Para == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -956,7 +956,7 @@ DhcpHandleReboot (
return EFI_SUCCESS;
ON_EXIT:
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return Status;
}
@@ -1018,7 +1018,7 @@ DhcpInput (
// Copy the DHCP message to a continuous memory block
//
Len = sizeof (EFI_DHCP4_PACKET) + UdpPacket->TotalSize - sizeof (EFI_DHCP4_HEADER);
- Packet = (EFI_DHCP4_PACKET *) NetAllocatePool (Len);
+ Packet = (EFI_DHCP4_PACKET *) AllocatePool (Len);
if (Packet == NULL) {
goto RESTART;
@@ -1078,7 +1078,7 @@ DhcpInput (
//
// Ignore the packet in INITREBOOT, INIT and BOUND states
//
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
Status = EFI_SUCCESS;
break;
@@ -1093,7 +1093,7 @@ DhcpInput (
}
if (Para != NULL) {
- NetFreePool (Para);
+ gBS->FreePool (Para);
}
Packet = NULL;
@@ -1108,7 +1108,7 @@ RESTART:
NetbufFree (UdpPacket);
if (Packet != NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
Status = UdpIoRecvDatagram (DhcpSb->UdpIo, DhcpInput, DhcpSb, 0);
@@ -1132,7 +1132,7 @@ DhcpReleasePacket (
IN VOID *Arg
)
{
- NetFreePool (Arg);
+ gBS->FreePool (Arg);
}
@@ -1212,7 +1212,7 @@ DhcpSendMessage (
Len += (UINT32)AsciiStrLen ((CHAR8 *) Msg);
}
- Packet = NetAllocatePool (Len);
+ Packet = AllocatePool (Len);
if (Packet == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -1232,7 +1232,7 @@ DhcpSendMessage (
}
Head = &Packet->Dhcp4.Header;
- NetZeroMem (Head, sizeof (EFI_DHCP4_HEADER));
+ ZeroMem (Head, sizeof (EFI_DHCP4_HEADER));
Head->OpCode = BOOTP_REQUEST;
Head->HwType = DhcpSb->HwType;
@@ -1241,7 +1241,7 @@ DhcpSendMessage (
Head->Reserved = HTONS (0x8000); //Server, broadcast the message please.
EFI_IP4 (Head->ClientAddr) = HTONL (DhcpSb->ClientAddr);
- NetCopyMem (Head->ClientHwAddr, DhcpSb->Mac.Addr, DhcpSb->HwLen);
+ CopyMem (Head->ClientHwAddr, DhcpSb->Mac.Addr, DhcpSb->HwLen);
//
// Append the DHCP message type
@@ -1352,12 +1352,12 @@ DhcpSendMessage (
}
if (EFI_ERROR (Status)) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return Status;
}
if (NewPacket != NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
Packet = NewPacket;
}
@@ -1369,7 +1369,7 @@ DhcpSendMessage (
Wrap = NetbufFromExt (&Frag, 1, 0, 0, DhcpReleasePacket, Packet);
if (Wrap == NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
return EFI_OUT_OF_RESOURCES;
}
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c
index cf81199839..04a40074e3 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c
@@ -526,7 +526,7 @@ DhcpFillOption (
Options[Index].Data = Buf + OptCount[Tag].Offset;
}
- NetCopyMem (Buf + OptCount[Tag].Offset, Data, Len);
+ CopyMem (Buf + OptCount[Tag].Offset, Data, Len);
OptCount[Tag].Offset = (UINT16) (OptCount[Tag].Offset + Len);
Options[Index].Len = (UINT16) (Options[Index].Len + Len);
@@ -582,7 +582,7 @@ DhcpParseOption (
// First compute how many options and how long each option is
// with the "Key indexed counting" algorithms.
//
- OptCount = NetAllocateZeroPool (DHCP_MAX_OPTIONS * sizeof (DHCP_OPTION_COUNT));
+ OptCount = AllocateZeroPool (DHCP_MAX_OPTIONS * sizeof (DHCP_OPTION_COUNT));
if (OptCount == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -624,7 +624,7 @@ DhcpParseOption (
// Allocate a buffer to hold the DHCP options, and after that, a
// continuous buffer to put all the options' data.
//
- Options = NetAllocateZeroPool (OptNum * sizeof (DHCP_OPTION) + TotalLen);
+ Options = AllocateZeroPool (OptNum * sizeof (DHCP_OPTION) + TotalLen);
if (Options == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -638,14 +638,14 @@ DhcpParseOption (
Status = DhcpIterateOptions (Packet, DhcpFillOption, &Context);
if (EFI_ERROR (Status)) {
- NetFreePool (Options);
+ gBS->FreePool (Options);
goto ON_EXIT;
}
*OptionPoint = Options;
ON_EXIT:
- NetFreePool (OptCount);
+ gBS->FreePool (OptCount);
return Status;
}
@@ -689,7 +689,7 @@ DhcpValidateOptions (
}
Updated = FALSE;
- NetZeroMem (&Parameter, sizeof (Parameter));
+ ZeroMem (&Parameter, sizeof (Parameter));
for (Index = 0; Index < Count; Index++) {
Option = &AllOption[Index];
@@ -722,7 +722,7 @@ DhcpValidateOptions (
}
if (Updated && (Para != NULL)) {
- if ((*Para = NetAllocatePool (sizeof (DHCP_PARAMETER))) == NULL) {
+ if ((*Para = AllocatePool (sizeof (DHCP_PARAMETER))) == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
@@ -731,7 +731,7 @@ DhcpValidateOptions (
}
ON_EXIT:
- NetFreePool (AllOption);
+ gBS->FreePool (AllOption);
return Status;
}
@@ -767,7 +767,7 @@ DhcpAppendOption (
*(Buf++) = Tag;
*(Buf++) = (UINT8) Len;
- NetCopyMem (Buf, Data + Index * 255, Len);
+ CopyMem (Buf, Data + Index * 255, Len);
Buf += Len;
}
@@ -815,7 +815,7 @@ DhcpBuild (
// Use an array of DHCP_OPTION to mark the existance
// and position of each valid options.
//
- Mark = NetAllocatePool (sizeof (DHCP_OPTION) * DHCP_MAX_OPTIONS);
+ Mark = AllocatePool (sizeof (DHCP_OPTION) * DHCP_MAX_OPTIONS);
if (Mark == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -871,7 +871,7 @@ DhcpBuild (
}
Status = EFI_OUT_OF_RESOURCES;
- Packet = (EFI_DHCP4_PACKET *) NetAllocatePool (Len);
+ Packet = (EFI_DHCP4_PACKET *) AllocatePool (Len);
if (Packet == NULL) {
goto ON_ERROR;
@@ -898,9 +898,9 @@ DhcpBuild (
ON_ERROR:
if (SeedOptions != NULL) {
- NetFreePool (SeedOptions);
+ gBS->FreePool (SeedOptions);
}
- NetFreePool (Mark);
+ gBS->FreePool (Mark);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/DpcDxe/Dpc.c b/MdeModulePkg/Universal/Network/DpcDxe/Dpc.c
index 3f534fcdf1..b6a82612cc 100644
--- a/MdeModulePkg/Universal/Network/DpcDxe/Dpc.c
+++ b/MdeModulePkg/Universal/Network/DpcDxe/Dpc.c
@@ -45,14 +45,14 @@ UINTN mMaxDpcQueueDepth = 0;
// If the free list is empty and a DPC is queued, the free list is grown by allocating
// an additional set of DPC entries.
//
-LIST_ENTRY mDpcEntryFreeList = INITIALIZE_LIST_HEAD_VARIABLE(mDpcEntryFreeList);
+LIST_ENTRY mDpcEntryFreeList = INITIALIZE_LIST_HEAD_VARIABLE(mDpcEntryFreeList);
//
// An array of DPC queues. A DPC queue is allocated for every leval EFI_TPL value.
// As DPCs are queued, they are added to the end of the linked list.
// As DPCs are dispatched, they are removed from the beginning of the linked list.
//
-LIST_ENTRY mDpcQueue[TPL_HIGH_LEVEL + 1];
+LIST_ENTRY mDpcQueue[TPL_HIGH_LEVEL + 1];
/**
Add a Deferred Procedure Call to the end of the DPC queue.
diff --git a/MdeModulePkg/Universal/Network/DpcDxe/Dpc.h b/MdeModulePkg/Universal/Network/DpcDxe/Dpc.h
index d113947272..bf35d1ee72 100644
--- a/MdeModulePkg/Universal/Network/DpcDxe/Dpc.h
+++ b/MdeModulePkg/Universal/Network/DpcDxe/Dpc.h
@@ -34,7 +34,7 @@ Abstract:
// list or on a DPC queue at a specific EFI_TPL.
//
typedef struct {
- LIST_ENTRY ListEntry;
+ LIST_ENTRY ListEntry;
EFI_DPC_PROCEDURE DpcProcedure;
VOID *DpcContext;
} DPC_ENTRY;
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c
index c86aae680b..4dca145318 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c
@@ -85,7 +85,7 @@ IScsiCHAPAuthTarget (
VerifyRsp
);
- if (NetCompareMem (VerifyRsp, TargetResponse, ISCSI_CHAP_RSP_LEN)) {
+ if (CompareMem (VerifyRsp, TargetResponse, ISCSI_CHAP_RSP_LEN)) {
Status = EFI_SECURITY_VIOLATION;
}
@@ -123,7 +123,7 @@ Returns:
CHAR8 *Value;
UINT8 *Data;
UINT32 Len;
- NET_LIST_ENTRY *KeyValueList;
+ LIST_ENTRY *KeyValueList;
UINTN Algorithm;
CHAR8 *Identifier;
CHAR8 *Challenge;
@@ -139,7 +139,7 @@ Returns:
AuthData = &Session->AuthData;
Len = Conn->RspQue.BufSize;
- Data = NetAllocatePool (Len);
+ Data = AllocatePool (Len);
if (Data == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -283,7 +283,7 @@ ON_EXIT:
IScsiFreeKeyValueList (KeyValueList);
- NetFreePool (Data);
+ gBS->FreePool (Data);
return Status;
}
@@ -333,13 +333,13 @@ Returns:
Status = EFI_SUCCESS;
RspLen = 2 * ISCSI_CHAP_RSP_LEN + 3;
- Response = NetAllocatePool (RspLen);
+ Response = AllocatePool (RspLen);
if (Response == NULL) {
return EFI_OUT_OF_RESOURCES;
}
ChallengeLen = 2 * ISCSI_CHAP_RSP_LEN + 3;
- Challenge = NetAllocatePool (ChallengeLen);
+ Challenge = AllocatePool (ChallengeLen);
if (Challenge == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -418,8 +418,8 @@ Returns:
break;
}
- NetFreePool (Response);
- NetFreePool (Challenge);
+ gBS->FreePool (Response);
+ gBS->FreePool (Challenge);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
index 9f3c4fe6f1..92169cb9b2 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
@@ -24,7 +24,7 @@ BOOLEAN mIScsiDeviceListUpdated = FALSE;
UINTN mNumberOfIScsiDevices = 0;
ISCSI_FORM_CALLBACK_INFO *mCallbackInfo;
-NET_LIST_ENTRY mIScsiConfigFormList = {
+LIST_ENTRY mIScsiConfigFormList = {
&mIScsiConfigFormList,
&mIScsiConfigFormList
};
@@ -138,7 +138,7 @@ Returns:
NULL
);
if (Status == EFI_BUFFER_TOO_SMALL) {
- DeviceList = (ISCSI_DEVICE_LIST *) NetAllocatePool (DataSize);
+ DeviceList = (ISCSI_DEVICE_LIST *) AllocatePool (DataSize);
gRT->GetVariable (
L"iSCSIDeviceList",
@@ -168,9 +168,9 @@ Returns:
// Swap the current MAC address entry with the one indexed by
// LastDeviceIndex.
//
- NetCopyMem (&TempMacInfo, CurMacInfo, sizeof (ISCSI_MAC_INFO));
- NetCopyMem (CurMacInfo, &DeviceList->MacInfo[LastDeviceIndex], sizeof (ISCSI_MAC_INFO));
- NetCopyMem (&DeviceList->MacInfo[LastDeviceIndex], &TempMacInfo, sizeof (ISCSI_MAC_INFO));
+ CopyMem (&TempMacInfo, CurMacInfo, sizeof (ISCSI_MAC_INFO));
+ CopyMem (CurMacInfo, &DeviceList->MacInfo[LastDeviceIndex], sizeof (ISCSI_MAC_INFO));
+ CopyMem (&DeviceList->MacInfo[LastDeviceIndex], &TempMacInfo, sizeof (ISCSI_MAC_INFO));
}
LastDeviceIndex++;
@@ -192,16 +192,16 @@ Returns:
gRT->SetVariable (MacString, &mIScsiCHAPAuthInfoGuid, 0, 0, NULL);
}
- NetFreePool (DeviceList);
+ gBS->FreePool (DeviceList);
} else if (Status != EFI_NOT_FOUND) {
- NetFreePool (Handles);
+ gBS->FreePool (Handles);
return Status;
}
//
// Construct the new iSCSI device list.
//
DeviceListSize = sizeof (ISCSI_DEVICE_LIST) + (NumHandles - 1) * sizeof (ISCSI_MAC_INFO);
- DeviceList = (ISCSI_DEVICE_LIST *) NetAllocatePool (DeviceListSize);
+ DeviceList = (ISCSI_DEVICE_LIST *) AllocatePool (DeviceListSize);
DeviceList->NumDevice = (UINT8) NumHandles;
for (Index = 0; Index < NumHandles; Index++) {
@@ -209,7 +209,7 @@ Returns:
Mode = Snp->Mode;
CurMacInfo = &DeviceList->MacInfo[Index];
- NetCopyMem (&CurMacInfo->Mac, &Mode->PermanentAddress, Mode->HwAddressSize);
+ CopyMem (&CurMacInfo->Mac, &Mode->PermanentAddress, Mode->HwAddressSize);
CurMacInfo->Len = (UINT8) Mode->HwAddressSize;
}
@@ -221,7 +221,7 @@ Returns:
DeviceList
);
- NetFreePool (DeviceList);
+ gBS->FreePool (DeviceList);
return Status;
}
@@ -248,7 +248,7 @@ Returns:
--*/
{
UINT32 CurrentIndex;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ISCSI_CONFIG_FORM_ENTRY *ConfigFormEntry;
CurrentIndex = 0;
@@ -402,7 +402,7 @@ IScsiFormExtractConfig (
Results,
Progress
);
- NetFreePool (IfrNvData);
+ gBS->FreePool (IfrNvData);
return Status;
}
@@ -516,7 +516,7 @@ IScsiFormCallback (
PopUpInvalidNotify (L"Invalid IP address!");
Status = EFI_INVALID_PARAMETER;
} else {
- NetCopyMem (&Private->Current->SessionConfigData.LocalIp, &HostIp.v4, sizeof (HostIp.v4));
+ CopyMem (&Private->Current->SessionConfigData.LocalIp, &HostIp.v4, sizeof (HostIp.v4));
}
break;
@@ -528,7 +528,7 @@ IScsiFormCallback (
PopUpInvalidNotify (L"Invalid Subnet Mask!");
Status = EFI_INVALID_PARAMETER;
} else {
- NetCopyMem (&Private->Current->SessionConfigData.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));
+ CopyMem (&Private->Current->SessionConfigData.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));
}
break;
@@ -540,7 +540,7 @@ IScsiFormCallback (
PopUpInvalidNotify (L"Invalid Gateway!");
Status = EFI_INVALID_PARAMETER;
} else {
- NetCopyMem (&Private->Current->SessionConfigData.Gateway, &Gateway.v4, sizeof (Gateway.v4));
+ CopyMem (&Private->Current->SessionConfigData.Gateway, &Gateway.v4, sizeof (Gateway.v4));
}
break;
@@ -552,7 +552,7 @@ IScsiFormCallback (
PopUpInvalidNotify (L"Invalid IP address!");
Status = EFI_INVALID_PARAMETER;
} else {
- NetCopyMem (&Private->Current->SessionConfigData.TargetIp, &HostIp.v4, sizeof (HostIp.v4));
+ CopyMem (&Private->Current->SessionConfigData.TargetIp, &HostIp.v4, sizeof (HostIp.v4));
}
break;
@@ -581,7 +581,7 @@ IScsiFormCallback (
if (EFI_ERROR (Status)) {
PopUpInvalidNotify (L"Invalid LUN string!");
} else {
- NetCopyMem (Private->Current->SessionConfigData.BootLun, &Lun, sizeof (Lun));
+ CopyMem (Private->Current->SessionConfigData.BootLun, &Lun, sizeof (Lun));
}
break;
@@ -625,9 +625,9 @@ IScsiFormCallback (
// deployed.
//
if (!Private->Current->SessionConfigData.InitiatorInfoFromDhcp) {
- NetCopyMem (&HostIp.v4, &Private->Current->SessionConfigData.LocalIp, sizeof (HostIp.v4));
- NetCopyMem (&SubnetMask.v4, &Private->Current->SessionConfigData.SubnetMask, sizeof (SubnetMask.v4));
- NetCopyMem (&Gateway.v4, &Private->Current->SessionConfigData.Gateway, sizeof (Gateway.v4));
+ CopyMem (&HostIp.v4, &Private->Current->SessionConfigData.LocalIp, sizeof (HostIp.v4));
+ CopyMem (&SubnetMask.v4, &Private->Current->SessionConfigData.SubnetMask, sizeof (SubnetMask.v4));
+ CopyMem (&Gateway.v4, &Private->Current->SessionConfigData.Gateway, sizeof (Gateway.v4));
if ((Gateway.Addr[0] != 0)) {
if (SubnetMask.Addr[0] == 0) {
@@ -645,7 +645,7 @@ IScsiFormCallback (
// Validate target configuration if DHCP isn't deployed.
//
if (!Private->Current->SessionConfigData.TargetInfoFromDhcp) {
- NetCopyMem (&HostIp.v4, &Private->Current->SessionConfigData.TargetIp, sizeof (HostIp.v4));
+ CopyMem (&HostIp.v4, &Private->Current->SessionConfigData.TargetIp, sizeof (HostIp.v4));
if (!Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
PopUpInvalidNotify (L"Target IP is invalid!");
Status = EFI_INVALID_PARAMETER;
@@ -718,7 +718,7 @@ IScsiFormCallback (
Status = SetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
}
- NetFreePool (IfrNvData);
+ gBS->FreePool (IfrNvData);
return Status;
}
@@ -749,7 +749,7 @@ Returns:
--*/
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ISCSI_CONFIG_FORM_ENTRY *ConfigFormEntry;
BOOLEAN EntryExisted;
EFI_STATUS Status;
@@ -779,12 +779,12 @@ Returns:
//
// Add a new form.
//
- ConfigFormEntry = (ISCSI_CONFIG_FORM_ENTRY *) NetAllocateZeroPool (sizeof (ISCSI_CONFIG_FORM_ENTRY));
+ ConfigFormEntry = (ISCSI_CONFIG_FORM_ENTRY *) AllocateZeroPool (sizeof (ISCSI_CONFIG_FORM_ENTRY));
if (ConfigFormEntry == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- NetListInit (&ConfigFormEntry->Link);
+ InitializeListHead (&ConfigFormEntry->Link);
ConfigFormEntry->Controller = Controller;
//
@@ -812,7 +812,7 @@ Returns:
&ConfigFormEntry->SessionConfigData
);
if (EFI_ERROR (Status)) {
- NetZeroMem (&ConfigFormEntry->SessionConfigData, sizeof (ConfigFormEntry->SessionConfigData));
+ ZeroMem (&ConfigFormEntry->SessionConfigData, sizeof (ConfigFormEntry->SessionConfigData));
}
//
// Get the CHAP authentication configuration data.
@@ -826,7 +826,7 @@ Returns:
&ConfigFormEntry->AuthConfigData
);
if (EFI_ERROR (Status)) {
- NetZeroMem (&ConfigFormEntry->AuthConfigData, sizeof (ConfigFormEntry->AuthConfigData));
+ ZeroMem (&ConfigFormEntry->AuthConfigData, sizeof (ConfigFormEntry->AuthConfigData));
}
//
// Compose the Port string and create a new STRING_REF.
@@ -840,21 +840,21 @@ Returns:
UnicodeSPrint (PortString, 128, L"Set the iSCSI parameters on port %s", ConfigFormEntry->MacString);
HiiLibNewString (mCallbackInfo->RegisteredHandle, &ConfigFormEntry->PortTitleHelpToken, PortString);
- NetListInsertTail (&mIScsiConfigFormList, &ConfigFormEntry->Link);
+ InsertTailList (&mIScsiConfigFormList, &ConfigFormEntry->Link);
mNumberOfIScsiDevices++;
}
} else {
ASSERT (EntryExisted);
mNumberOfIScsiDevices--;
- NetListRemoveEntry (&ConfigFormEntry->Link);
- NetFreePool (ConfigFormEntry);
+ RemoveEntryList (&ConfigFormEntry->Link);
+ gBS->FreePool (ConfigFormEntry);
}
//
// Allocate space for creation of Buffer
//
UpdateData.BufferSize = 0x1000;
- UpdateData.Data = NetAllocateZeroPool (0x1000);
+ UpdateData.Data = AllocateZeroPool (0x1000);
UpdateData.Offset = 0;
FormIndex = 0;
@@ -882,7 +882,7 @@ Returns:
&UpdateData
);
- NetFreePool (UpdateData.Data);
+ gBS->FreePool (UpdateData.Data);
return EFI_SUCCESS;
}
@@ -918,7 +918,7 @@ Returns:
return Status;
}
- CallbackInfo = (ISCSI_FORM_CALLBACK_INFO *) NetAllocatePool (sizeof (ISCSI_FORM_CALLBACK_INFO));
+ CallbackInfo = (ISCSI_FORM_CALLBACK_INFO *) AllocatePool (sizeof (ISCSI_FORM_CALLBACK_INFO));
if (CallbackInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -967,7 +967,7 @@ Returns:
CallbackInfo->DriverHandle,
&CallbackInfo->RegisteredHandle
);
- NetFreePool (PackageList);
+ gBS->FreePool (PackageList);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1002,7 +1002,7 @@ Returns:
{
ISCSI_CONFIG_FORM_ENTRY *ConfigFormEntry;
- while (!NetListIsEmpty (&mIScsiConfigFormList)) {
+ while (!IsListEmpty (&mIScsiConfigFormList)) {
//
// Uninstall the device forms as the iSCSI driver instance may fail to
// control the controller but still install the device configuration form.
@@ -1032,7 +1032,7 @@ Returns:
);
HiiLibDestroyHiiDriverHandle (mCallbackInfo->DriverHandle);
- NetFreePool (mCallbackInfo);
+ gBS->FreePool (mCallbackInfo);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
index e9311b62fc..c3c664d449 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
@@ -62,7 +62,7 @@ typedef struct _ISCSI_DEVICE_LIST {
#pragma pack()
typedef struct _ISCSI_CONFIG_FORM_ENTRY {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
EFI_HANDLE Controller;
CHAR16 MacString[95];
STRING_REF PortTitleToken;
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
index c7e8e8d661..df4772b8c4 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
@@ -62,7 +62,7 @@ Returns:
//
IScsiRootPathIdLen = (UINT8) AsciiStrLen (ISCSI_ROOT_PATH_ID);
- if ((Length <= IScsiRootPathIdLen) || (NetCompareMem (RootPath, ISCSI_ROOT_PATH_ID, IScsiRootPathIdLen) != 0)) {
+ if ((Length <= IScsiRootPathIdLen) || (CompareMem (RootPath, ISCSI_ROOT_PATH_ID, IScsiRootPathIdLen) != 0)) {
return EFI_NOT_FOUND;
}
//
@@ -71,17 +71,17 @@ Returns:
RootPath += IScsiRootPathIdLen;
Length = (UINT8) (Length - IScsiRootPathIdLen);
- TmpStr = (CHAR8 *) NetAllocatePool (Length + 1);
+ TmpStr = (CHAR8 *) AllocatePool (Length + 1);
if (TmpStr == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- NetCopyMem (TmpStr, RootPath, Length);
+ CopyMem (TmpStr, RootPath, Length);
TmpStr[Length] = '\0';
Index = 0;
FieldIndex = 0;
- NetZeroMem (&Fields[0], sizeof (Fields));
+ ZeroMem (&Fields[0], sizeof (Fields));
//
// Extract the fields in the Root Path option string.
@@ -155,7 +155,7 @@ Returns:
goto ON_EXIT;
}
} else {
- NetZeroMem (ConfigNvData->BootLun, sizeof (ConfigNvData->BootLun));
+ ZeroMem (ConfigNvData->BootLun, sizeof (ConfigNvData->BootLun));
}
//
// Get the target iSCSI Name.
@@ -178,7 +178,7 @@ Returns:
ON_EXIT:
- NetFreePool (TmpStr);
+ gBS->FreePool (TmpStr);
return Status;
}
@@ -233,14 +233,14 @@ Returns:
return EFI_NOT_READY;
}
- OptionList = NetAllocatePool (OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
+ OptionList = AllocatePool (OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
if (OptionList == NULL) {
return EFI_NOT_READY;
}
Status = This->Parse (This, Packet, &OptionCount, OptionList);
if (EFI_ERROR (Status)) {
- NetFreePool (OptionList);
+ gBS->FreePool (OptionList);
return EFI_NOT_READY;
}
@@ -262,7 +262,7 @@ Returns:
Status = EFI_NOT_READY;
}
- NetFreePool (OptionList);
+ gBS->FreePool (OptionList);
return Status;
}
@@ -307,9 +307,9 @@ Returns:
return EFI_NO_MAPPING;
}
- NetCopyMem (&ConfigData->NvData.LocalIp, &Dhcp4ModeData.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&ConfigData->NvData.SubnetMask, &Dhcp4ModeData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&ConfigData->NvData.Gateway, &Dhcp4ModeData.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->NvData.LocalIp, &Dhcp4ModeData.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->NvData.SubnetMask, &Dhcp4ModeData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->NvData.Gateway, &Dhcp4ModeData.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
OptionCount = 0;
OptionList = NULL;
@@ -319,14 +319,14 @@ Returns:
return EFI_DEVICE_ERROR;
}
- OptionList = NetAllocatePool (OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
+ OptionList = AllocatePool (OptionCount * sizeof (EFI_DHCP4_PACKET_OPTION *));
if (OptionList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Status = Dhcp4->Parse (Dhcp4, Dhcp4ModeData.ReplyPacket, &OptionCount, OptionList);
if (EFI_ERROR (Status)) {
- NetFreePool (OptionList);
+ gBS->FreePool (OptionList);
return EFI_DEVICE_ERROR;
}
@@ -343,13 +343,13 @@ Returns:
//
// Primary DNS server address.
//
- NetCopyMem (&ConfigData->PrimaryDns, &OptionList[Index]->Data[0], sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->PrimaryDns, &OptionList[Index]->Data[0], sizeof (EFI_IPv4_ADDRESS));
if (OptionList[Index]->Length > 4) {
//
// Secondary DNS server address
//
- NetCopyMem (&ConfigData->SecondaryDns, &OptionList[Index]->Data[4], sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->SecondaryDns, &OptionList[Index]->Data[4], sizeof (EFI_IPv4_ADDRESS));
}
} else if (OptionList[Index]->OpCode == DHCP4_TAG_SERVER_ID) {
if (OptionList[Index]->Length != 4) {
@@ -357,11 +357,11 @@ Returns:
break;
}
- NetCopyMem (&ConfigData->DhcpServer, &OptionList[Index]->Data[0], sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ConfigData->DhcpServer, &OptionList[Index]->Data[0], sizeof (EFI_IPv4_ADDRESS));
}
}
- NetFreePool (OptionList);
+ gBS->FreePool (OptionList);
return Status;
}
@@ -428,7 +428,7 @@ Returns:
goto ON_EXIT;
}
- ParaList = NetAllocatePool (sizeof (EFI_DHCP4_PACKET_OPTION) + 3);
+ ParaList = AllocatePool (sizeof (EFI_DHCP4_PACKET_OPTION) + 3);
if (ParaList == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -443,7 +443,7 @@ Returns:
ParaList->Data[2] = DHCP4_TAG_DNS;
ParaList->Data[3] = DHCP4_TAG_ROOT_PATH;
- NetZeroMem (&Dhcp4ConfigData, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (&Dhcp4ConfigData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4ConfigData.OptionCount = 1;
Dhcp4ConfigData.OptionList = &ParaList;
@@ -472,7 +472,7 @@ Returns:
ON_EXIT:
if (ParaList != NULL) {
- NetFreePool (ParaList);
+ gBS->FreePool (ParaList);
}
if (Dhcp4 != NULL) {
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index 1602d5bd55..8cc2a5050f 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -362,7 +362,7 @@ Returns:
}
if (DeviceHandleBuffer != NULL) {
- NetFreePool (DeviceHandleBuffer);
+ gBS->FreePool (DeviceHandleBuffer);
}
}
//
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c
index 2729c3b429..697424ad72 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c
@@ -101,17 +101,17 @@ Returns:
Private = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (This);
ConfigNvData = &Private->Session.ConfigData.NvData;
- if ((*Target)[0] == 0 && (NetCompareMem (Lun, ConfigNvData->BootLun, sizeof (UINT64)) == 0)) {
+ if ((*Target)[0] == 0 && (CompareMem (Lun, ConfigNvData->BootLun, sizeof (UINT64)) == 0)) {
//
// Only one <Target, Lun> pair per iSCSI Driver instance.
//
return EFI_NOT_FOUND;
}
- NetSetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
- if (NetCompareMem (*Target, TargetId, TARGET_MAX_BYTES) == 0) {
+ SetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
+ if (CompareMem (*Target, TargetId, TARGET_MAX_BYTES) == 0) {
(*Target)[0] = 0;
- NetCopyMem (Lun, ConfigNvData->BootLun, sizeof (UINT64));
+ CopyMem (Lun, ConfigNvData->BootLun, sizeof (UINT64));
return EFI_SUCCESS;
}
@@ -181,12 +181,12 @@ Returns:
ConfigNvData = &Session->ConfigData.NvData;
AuthConfig = &Session->AuthData.AuthConfig;
- if (NetCompareMem (&Lun, ConfigNvData->BootLun, sizeof (UINT64)) != 0) {
+ if (CompareMem (&Lun, ConfigNvData->BootLun, sizeof (UINT64)) != 0) {
return EFI_NOT_FOUND;
}
DevPathNodeLen = sizeof (ISCSI_DEVICE_PATH) + AsciiStrLen (ConfigNvData->TargetName) + 1;
- Node = NetAllocatePool (DevPathNodeLen);
+ Node = AllocatePool (DevPathNodeLen);
if (Node == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -214,7 +214,7 @@ Returns:
break;
}
- NetCopyMem (&Node->Iscsi.Lun, ConfigNvData->BootLun, sizeof (UINT64));
+ CopyMem (&Node->Iscsi.Lun, ConfigNvData->BootLun, sizeof (UINT64));
Node->Iscsi.TargetPortalGroupTag = Session->TargetPortalGroupTag;
AsciiStrCpy ((CHAR8 *) Node + sizeof (ISCSI_DEVICE_PATH), ConfigNvData->TargetName);
@@ -276,13 +276,13 @@ Returns:
Private = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (This);
ConfigNvData = &Private->Session.ConfigData.NvData;
- NetZeroMem (*Target, TARGET_MAX_BYTES);
+ ZeroMem (*Target, TARGET_MAX_BYTES);
if (AsciiStrCmp (ConfigNvData->TargetName, (CHAR8 *) DevicePath + sizeof (ISCSI_DEVICE_PATH)) != 0) {
return EFI_UNSUPPORTED;
}
- NetCopyMem (Lun, ConfigNvData->BootLun, sizeof (UINT64));
+ CopyMem (Lun, ConfigNvData->BootLun, sizeof (UINT64));
return EFI_SUCCESS;
}
@@ -377,9 +377,9 @@ Returns:
{
UINT8 TargetId[TARGET_MAX_BYTES];
- NetSetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
+ SetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
- if (NetCompareMem (*Target, TargetId, TARGET_MAX_BYTES) == 0) {
+ if (CompareMem (*Target, TargetId, TARGET_MAX_BYTES) == 0) {
(*Target)[0] = 0;
return EFI_SUCCESS;
} else if ((*Target)[0] == 0) {
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index 0c06437de1..cd4be8b3c9 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -42,7 +42,7 @@ Returns:
--*/
{
- NetZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER));
+ ZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER));
Header->Signature = EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE;
Header->Length = IBFT_HEAP_OFFSET;
@@ -85,7 +85,7 @@ Returns:
Control = (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE *) (Table + 1);
- NetZeroMem (Control, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE));
+ ZeroMem (Control, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE));
Control->Header.StructureId = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_ID;
Control->Header.Version = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_VERSION;
@@ -136,7 +136,7 @@ Returns:
//
*Heap -= Len + 1;
- NetCopyMem (*Heap, Data, Len);
+ CopyMem (*Heap, Data, Len);
*(*Heap + Len) = 0;
}
@@ -181,7 +181,7 @@ Returns:
Control->InitiatorOffset = (UINT16) ((UINTN) Initiator - (UINTN) Table);
- NetZeroMem (Initiator, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE));
+ ZeroMem (Initiator, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE));
Initiator->Header.StructureId = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_ID;
Initiator->Header.Version = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_VERSION;
@@ -234,7 +234,7 @@ Returns:
{
UINTN Index;
- NetZeroMem (V6, sizeof (EFI_IPv6_ADDRESS));
+ ZeroMem (V6, sizeof (EFI_IPv6_ADDRESS));
V6->Addr[10] = 0xff;
V6->Addr[11] = 0xff;
@@ -405,7 +405,7 @@ Returns:
//
// Fill the Nic section.
//
- NetZeroMem (Nic, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE));
+ ZeroMem (Nic, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE));
Nic->Header.StructureId = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_ID;
Nic->Header.Version = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_VERSION;
@@ -435,7 +435,7 @@ Returns:
IScsiMapV4ToV6Addr (&SessionConfigData->DhcpServer, &Nic->DhcpServer);
Mac = IScsiGetMacAddress (DriverData->Controller);
- NetCopyMem (Nic->Mac, Mac, sizeof (Nic->Mac));
+ CopyMem (Nic->Mac, Mac, sizeof (Nic->Mac));
//
// Get the PCI location of the Nic.
@@ -448,7 +448,7 @@ Returns:
//
// Fill the Target section.
//
- NetZeroMem (Target, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE));
+ ZeroMem (Target, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE));
Target->Header.StructureId = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_ID;
Target->Header.Version = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_VERSION;
@@ -460,7 +460,7 @@ Returns:
Target->NicIndex = (UINT8) Index;
IScsiMapV4ToV6Addr (&SessionConfigData->NvData.TargetIp, &Target->Ip);
- NetCopyMem (Target->BootLun, SessionConfigData->NvData.BootLun, sizeof (Target->BootLun));
+ CopyMem (Target->BootLun, SessionConfigData->NvData.BootLun, sizeof (Target->BootLun));
//
// Target iSCSI Name, CHAP name/secret, reverse CHAP name/secret.
@@ -572,7 +572,7 @@ Returns:
}
Signature = Table->Signature;
- NetFreePool (Table);
+ gBS->FreePool (Table);
if (Signature == EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE) {
//
@@ -608,7 +608,7 @@ Returns:
//
// Allocate 4k bytes to hold the ACPI table.
//
- Table = NetAllocatePool (IBFT_MAX_SIZE);
+ Table = AllocatePool (IBFT_MAX_SIZE);
if (Table == NULL) {
return ;
}
@@ -623,7 +623,7 @@ Returns:
IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);
IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);
- NetFreePool (HandleBuffer);
+ gBS->FreePool (HandleBuffer);
TableHandle = 0;
@@ -641,5 +641,5 @@ Returns:
AcpiSupport->PublishTables (AcpiSupport, EFI_ACPI_TABLE_VERSION_3_0);
}
- NetFreePool (Table);
+ gBS->FreePool (Table);
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h
index 7019a78c9e..1eb4b4b91b 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h
@@ -57,10 +57,10 @@ struct _ISCSI_SESSION {
UINT32 InitiatorTaskTag;
UINT16 NextCID;
- NET_LIST_ENTRY Conns;
+ LIST_ENTRY Conns;
UINT32 NumConns;
- NET_LIST_ENTRY TcbList;
+ LIST_ENTRY TcbList;
//
// session-wide parameters
@@ -83,7 +83,7 @@ struct _ISCSI_SESSION {
struct _ISCSI_CONNECTION {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
EFI_EVENT TimeoutEvent;
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
index 8dee904bab..1683d88a9e 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
@@ -198,8 +198,8 @@ Returns:
CHAR8 Digit;
UINTN Temp;
- NetZeroMem (Lun, 8);
- NetZeroMem (LunUnitStr, sizeof (LunUnitStr));
+ ZeroMem (Lun, 8);
+ ZeroMem (LunUnitStr, sizeof (LunUnitStr));
Index = 0;
LunUnitStr[0] = Str;
@@ -667,7 +667,7 @@ Returns:
ISCSI_DRIVER_DATA *Private;
EFI_STATUS Status;
- Private = NetAllocateZeroPool (sizeof (ISCSI_DRIVER_DATA));
+ Private = AllocateZeroPool (sizeof (ISCSI_DRIVER_DATA));
if (Private == NULL) {
return NULL;
}
@@ -688,11 +688,11 @@ Returns:
&Private->ExitBootServiceEvent
);
if (EFI_ERROR (Status)) {
- NetFreePool (Private);
+ gBS->FreePool (Private);
return NULL;
}
- NetCopyMem(&Private->IScsiExtScsiPassThru, &gIScsiExtScsiPassThruProtocolTemplate, sizeof(EFI_EXT_SCSI_PASS_THRU_PROTOCOL));
+ CopyMem(&Private->IScsiExtScsiPassThru, &gIScsiExtScsiPassThruProtocolTemplate, sizeof(EFI_EXT_SCSI_PASS_THRU_PROTOCOL));
//
// 0 is designated to the TargetId, so use another value for the AdapterId.
@@ -713,7 +713,7 @@ Returns:
);
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Private->ExitBootServiceEvent);
- NetFreePool (Private);
+ gBS->FreePool (Private);
return NULL;
}
@@ -750,7 +750,7 @@ Returns:
Private->DevicePath
);
- NetFreePool (Private->DevicePath);
+ gBS->FreePool (Private->DevicePath);
}
if (Private->ExtScsiPassThruHandle != NULL) {
@@ -763,7 +763,7 @@ Returns:
gBS->CloseEvent (Private->ExitBootServiceEvent);
- NetFreePool (Private);
+ gBS->FreePool (Private);
}
EFI_STATUS
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
index 93e03b0fef..8607558397 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
@@ -43,7 +43,7 @@ Returns:
--*/
{
- NetListInsertTail (&Session->Conns, &Conn->Link);
+ InsertTailList (&Session->Conns, &Conn->Link);
Conn->Session = Session;
Session->NumConns++;
}
@@ -68,7 +68,7 @@ Returns:
--*/
{
- NetListRemoveEntry (&Conn->Link);
+ RemoveEntryList (&Conn->Link);
Conn->Session->NumConns--;
Conn->Session = NULL;
}
@@ -259,7 +259,7 @@ Returns:
TCP4_IO_CONFIG_DATA Tcp4IoConfig;
EFI_STATUS Status;
- Conn = NetAllocatePool (sizeof (ISCSI_CONNECTION));
+ Conn = AllocatePool (sizeof (ISCSI_CONNECTION));
if (Conn == NULL) {
return NULL;
}
@@ -276,13 +276,13 @@ Returns:
Status = gBS->CreateEvent (
EFI_EVENT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
NULL,
NULL,
&Conn->TimeoutEvent
);
if (EFI_ERROR (Status)) {
- NetFreePool (Conn);
+ gBS->FreePool (Conn);
return NULL;
}
@@ -295,10 +295,10 @@ Returns:
Conn->HeaderDigest = ISCSI_DIGEST_NONE;
Conn->DataDigest = ISCSI_DIGEST_NONE;
- NetCopyMem (&Tcp4IoConfig.LocalIp, &Session->ConfigData.NvData.LocalIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Tcp4IoConfig.SubnetMask, &Session->ConfigData.NvData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Tcp4IoConfig.Gateway, &Session->ConfigData.NvData.Gateway, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Tcp4IoConfig.RemoteIp, &Session->ConfigData.NvData.TargetIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4IoConfig.LocalIp, &Session->ConfigData.NvData.LocalIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4IoConfig.SubnetMask, &Session->ConfigData.NvData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4IoConfig.Gateway, &Session->ConfigData.NvData.Gateway, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4IoConfig.RemoteIp, &Session->ConfigData.NvData.TargetIp, sizeof (EFI_IPv4_ADDRESS));
Tcp4IoConfig.RemotePort = Session->ConfigData.NvData.TargetPort;
@@ -313,7 +313,7 @@ Returns:
);
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Conn->TimeoutEvent);
- NetFreePool (Conn);
+ gBS->FreePool (Conn);
Conn = NULL;
}
@@ -343,7 +343,7 @@ Returns:
Tcp4IoDestroySocket (&Conn->Tcp4Io);
NetbufQueFlush (&Conn->RspQue);
gBS->CloseEvent (Conn->TimeoutEvent);
- NetFreePool (Conn);
+ gBS->FreePool (Conn);
}
EFI_STATUS
@@ -553,7 +553,7 @@ Returns:
//
// Add the key.
//
- NetCopyMem (Data, Key, KeyLen);
+ CopyMem (Data, Key, KeyLen);
Data += KeyLen;
*Data = '=';
@@ -562,7 +562,7 @@ Returns:
//
// Add the value.
//
- NetCopyMem (Data, Value, ValueLen);
+ CopyMem (Data, Value, ValueLen);
Data += ValueLen;
*Data = '\0';
@@ -608,7 +608,7 @@ Returns:
}
LoginReq = (ISCSI_LOGIN_REQUEST *) NetbufAllocSpace (Nbuf, sizeof (ISCSI_LOGIN_REQUEST), NET_BUF_TAIL);
- NetZeroMem (LoginReq, sizeof (ISCSI_LOGIN_REQUEST));
+ ZeroMem (LoginReq, sizeof (ISCSI_LOGIN_REQUEST));
//
// Init the login request pdu
@@ -630,7 +630,7 @@ Returns:
// with their increasing StatSN values.
//
LoginReq->ExpStatSN = HTONL (Conn->ExpStatSN);
- NetCopyMem (LoginReq->ISID, Session->ISID, sizeof (LoginReq->ISID));
+ CopyMem (LoginReq->ISID, Session->ISID, sizeof (LoginReq->ISID));
if (Conn->PartialRspRcvd) {
//
@@ -777,7 +777,7 @@ Returns:
(CurrentStage != Conn->CurrentStage) ||
(!Conn->TransitInitiated && Transit) ||
(Transit && (NextStage != Conn->NextStage)) ||
- (NetCompareMem (Session->ISID, LoginRsp->ISID, sizeof (LoginRsp->ISID)) != 0) ||
+ (CompareMem (Session->ISID, LoginRsp->ISID, sizeof (LoginRsp->ISID)) != 0) ||
(LoginRsp->InitiatorTaskTag != Session->InitiatorTaskTag)
) {
//
@@ -913,7 +913,7 @@ Returns:
--*/
{
- NET_LIST_ENTRY *KeyValueList;
+ LIST_ENTRY *KeyValueList;
CHAR8 *TargetAddress;
CHAR8 *IpStr;
EFI_STATUS Status;
@@ -1011,8 +1011,8 @@ Returns:
{
ASSERT (Arg != NULL);
- NetbufFreeList ((NET_LIST_ENTRY *) Arg);
- NetFreePool (Arg);
+ NetbufFreeList ((LIST_ENTRY *) Arg);
+ gBS->FreePool (Arg);
}
VOID
@@ -1072,7 +1072,7 @@ Returns:
--*/
{
- NET_LIST_ENTRY *NbufList;
+ LIST_ENTRY *NbufList;
UINT32 Len;
NET_BUF *PduHdr;
UINT8 *Header;
@@ -1084,12 +1084,12 @@ Returns:
NET_BUF *DataSeg;
UINT32 PadAndCRC32[2];
- NbufList = NetAllocatePool (sizeof (NET_LIST_ENTRY));
+ NbufList = AllocatePool (sizeof (LIST_ENTRY ));
if (NbufList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- NetListInit (NbufList);
+ InitializeListHead (NbufList);
//
// The header digest will be received together with the PDU header if exists.
@@ -1102,7 +1102,7 @@ Returns:
}
Header = NetbufAllocSpace (PduHdr, Len, NET_BUF_TAIL);
- NetListInsertTail (NbufList, &PduHdr->List);
+ InsertTailList (NbufList, &PduHdr->List);
//
// First step, receive the BHS of the PDU.
@@ -1197,7 +1197,7 @@ Returns:
goto ON_EXIT;
}
- NetListInsertTail (NbufList, &DataSeg->List);
+ InsertTailList (NbufList, &DataSeg->List);
//
// Receive the data segment with the data digest if any.
@@ -1266,7 +1266,7 @@ Returns:
--*/
{
EFI_STATUS Status;
- NET_LIST_ENTRY *KeyValueList;
+ LIST_ENTRY *KeyValueList;
CHAR8 *Data;
UINT32 Len;
ISCSI_SESSION *Session;
@@ -1278,7 +1278,7 @@ Returns:
Session = Conn->Session;
Len = Conn->RspQue.BufSize;
- Data = NetAllocatePool (Len);
+ Data = AllocatePool (Len);
if (Data == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1292,7 +1292,7 @@ Returns:
//
KeyValueList = IScsiBuildKeyValueList (Data, Len);
if (KeyValueList == NULL) {
- NetFreePool (Data);
+ gBS->FreePool (Data);
return Status;
}
//
@@ -1488,7 +1488,7 @@ Returns:
IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_ALIAS);
IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_PORTAL_GROUP_TAG);
- if (NetListIsEmpty (KeyValueList)) {
+ if (IsListEmpty (KeyValueList)) {
//
// Succeed if no more keys in the list.
//
@@ -1499,7 +1499,7 @@ ON_ERROR:
IScsiFreeKeyValueList (KeyValueList);
- NetFreePool (Data);
+ gBS->FreePool (Data);
return Status;
}
@@ -1612,13 +1612,13 @@ Returns:
return EFI_OUT_OF_RESOURCES;
}
- NetZeroMem (Data, PadLen);
+ ZeroMem (Data, PadLen);
}
return EFI_SUCCESS;
}
-NET_LIST_ENTRY *
+LIST_ENTRY *
IScsiBuildKeyValueList (
IN CHAR8 *Data,
IN UINT32 Len
@@ -1640,23 +1640,23 @@ Returns:
--*/
{
- NET_LIST_ENTRY *ListHead;
+ LIST_ENTRY *ListHead;
ISCSI_KEY_VALUE_PAIR *KeyValuePair;
- ListHead = NetAllocatePool (sizeof (NET_LIST_ENTRY));
+ ListHead = AllocatePool (sizeof (LIST_ENTRY ));
if (ListHead == NULL) {
return NULL;
}
- NetListInit (ListHead);
+ InitializeListHead (ListHead);
while (Len > 0) {
- KeyValuePair = NetAllocatePool (sizeof (ISCSI_KEY_VALUE_PAIR));
+ KeyValuePair = AllocatePool (sizeof (ISCSI_KEY_VALUE_PAIR));
if (KeyValuePair == NULL) {
goto ON_ERROR;
}
- NetListInit (&KeyValuePair->List);
+ InitializeListHead (&KeyValuePair->List);
KeyValuePair->Key = Data;
@@ -1671,13 +1671,13 @@ Returns:
Data++;
Len--;
} else {
- NetFreePool (KeyValuePair);
+ gBS->FreePool (KeyValuePair);
goto ON_ERROR;
}
KeyValuePair->Value = Data;
- NetListInsertTail (ListHead, &KeyValuePair->List);;
+ InsertTailList (ListHead, &KeyValuePair->List);;
Data += AsciiStrLen (KeyValuePair->Value) + 1;
Len -= (UINT32) AsciiStrLen (KeyValuePair->Value) + 1;
@@ -1694,7 +1694,7 @@ ON_ERROR:
CHAR8 *
IScsiGetValueByKeyFromList (
- IN NET_LIST_ENTRY *KeyValueList,
+ IN LIST_ENTRY *KeyValueList,
IN CHAR8 *Key
)
/*++
@@ -1715,7 +1715,7 @@ Returns:
--*/
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ISCSI_KEY_VALUE_PAIR *KeyValuePair;
CHAR8 *Value;
@@ -1727,8 +1727,8 @@ Returns:
if (AsciiStrCmp (KeyValuePair->Key, Key) == 0) {
Value = KeyValuePair->Value;
- NetListRemoveEntry (&KeyValuePair->List);
- NetFreePool (KeyValuePair);
+ RemoveEntryList (&KeyValuePair->List);
+ gBS->FreePool (KeyValuePair);
break;
}
}
@@ -1738,7 +1738,7 @@ Returns:
VOID
IScsiFreeKeyValueList (
- IN NET_LIST_ENTRY *KeyValueList
+ IN LIST_ENTRY *KeyValueList
)
/*++
@@ -1756,17 +1756,17 @@ Returns:
--*/
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
ISCSI_KEY_VALUE_PAIR *KeyValuePair;
- while (!NetListIsEmpty (KeyValueList)) {
+ while (!IsListEmpty (KeyValueList)) {
Entry = NetListRemoveHead (KeyValueList);
KeyValuePair = NET_LIST_USER_STRUCT (Entry, ISCSI_KEY_VALUE_PAIR, List);
- NetFreePool (KeyValuePair);
+ gBS->FreePool (KeyValuePair);
}
- NetFreePool (KeyValueList);
+ gBS->FreePool (KeyValueList);
}
EFI_STATUS
@@ -1816,7 +1816,7 @@ Returns:
}
}
- if ((Len < 4) || (NetCompareMem (Name, "iqn.", 4) != 0)) {
+ if ((Len < 4) || (CompareMem (Name, "iqn.", 4) != 0)) {
//
// Only IQN format is accepted now.
//
@@ -1860,19 +1860,19 @@ Returns:
return EFI_NOT_READY;
}
- NewTcb = NetAllocateZeroPool (sizeof (ISCSI_TCB));
+ NewTcb = AllocateZeroPool (sizeof (ISCSI_TCB));
if (NewTcb == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- NetListInit (&NewTcb->Link);
+ InitializeListHead (&NewTcb->Link);
NewTcb->SoFarInOrder = TRUE;
NewTcb->InitiatorTaskTag = Session->InitiatorTaskTag;
NewTcb->CmdSN = Session->CmdSN;
NewTcb->Conn = Conn;
- NetListInsertTail (&Session->TcbList, &NewTcb->Link);
+ InsertTailList (&Session->TcbList, &NewTcb->Link);
//
// Advance the initiator task tag.
@@ -1905,14 +1905,14 @@ Returns:
--*/
{
- NetListRemoveEntry (&Tcb->Link);
+ RemoveEntryList (&Tcb->Link);
- NetFreePool (Tcb);
+ gBS->FreePool (Tcb);
}
ISCSI_TCB *
IScsiFindTcbByITT (
- IN NET_LIST_ENTRY *TcbList,
+ IN LIST_ENTRY *TcbList,
IN UINT32 InitiatorTaskTag
)
/*++
@@ -1933,7 +1933,7 @@ Returns:
--*/
{
ISCSI_TCB *Tcb;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
Tcb = NULL;
@@ -2022,7 +2022,7 @@ Returns:
--*/
{
- NET_LIST_ENTRY *NbufList;
+ LIST_ENTRY *NbufList;
NET_BUF *Pdu;
NET_BUF *PduHeader;
NET_BUF *DataSeg;
@@ -2060,7 +2060,7 @@ Returns:
ScsiCmd = (SCSI_COMMAND *) NetbufAllocSpace (PduHeader, Length, NET_BUF_TAIL);
Header = (ISCSI_ADDITIONAL_HEADER *) (ScsiCmd + 1);
- NetZeroMem (ScsiCmd, Length);
+ ZeroMem (ScsiCmd, Length);
ISCSI_SET_OPCODE (ScsiCmd, ISCSI_OPCODE_SCSI_CMD, 0);
ISCSI_SET_FLAG (ScsiCmd, ISCSI_TASK_ATTR_SIMPLE);
@@ -2097,18 +2097,18 @@ Returns:
}
ScsiCmd->TotalAHSLength = AHSLength;
- NetCopyMem (ScsiCmd->Lun, &Lun, sizeof (ScsiCmd->Lun));
+ CopyMem (ScsiCmd->Lun, &Lun, sizeof (ScsiCmd->Lun));
ScsiCmd->InitiatorTaskTag = NTOHL (Tcb->InitiatorTaskTag);
ScsiCmd->CmdSN = NTOHL (Tcb->CmdSN);
ScsiCmd->ExpStatSN = NTOHL (Tcb->Conn->ExpStatSN);
- NetCopyMem (ScsiCmd->CDB, Packet->Cdb, sizeof (ScsiCmd->CDB));
+ CopyMem (ScsiCmd->CDB, Packet->Cdb, sizeof (ScsiCmd->CDB));
if (Packet->CdbLength > 16) {
Header->Length = NTOHS (Packet->CdbLength - 15);
Header->Type = ISCSI_AHS_TYPE_EXT_CDB;
- NetCopyMem (Header + 1, (UINT8 *) Packet->Cdb + 16, Packet->CdbLength - 16);
+ CopyMem (Header + 1, (UINT8 *) Packet->Cdb + 16, Packet->CdbLength - 16);
}
Pdu = PduHeader;
@@ -2139,7 +2139,7 @@ Returns:
goto ON_EXIT;
}
- NbufList = NetAllocatePool (sizeof (NET_LIST_ENTRY));
+ NbufList = AllocatePool (sizeof (LIST_ENTRY ));
if (NbufList == NULL) {
NetbufFree (PduHeader);
NetbufFree (DataSeg);
@@ -2148,9 +2148,9 @@ Returns:
goto ON_EXIT;
}
- NetListInit (NbufList);
- NetListInsertTail (NbufList, &PduHeader->List);
- NetListInsertTail (NbufList, &DataSeg->List);
+ InitializeListHead (NbufList);
+ InsertTailList (NbufList, &PduHeader->List);
+ InsertTailList (NbufList, &DataSeg->List);
Pdu = NetbufFromBufList (NbufList, 0, 0, IScsiFreeNbufList, NbufList);
if (Pdu == NULL) {
@@ -2205,37 +2205,37 @@ Returns:
--*/
{
- NET_LIST_ENTRY *NbufList;
+ LIST_ENTRY *NbufList;
NET_BUF *PduHdr;
NET_BUF *DataSeg;
NET_BUF *Pdu;
ISCSI_SCSI_DATA_OUT *DataOutHdr;
ISCSI_XFER_CONTEXT *XferContext;
- NbufList = NetAllocatePool (sizeof (NET_LIST_ENTRY));
+ NbufList = AllocatePool (sizeof (LIST_ENTRY ));
if (NbufList == NULL) {
return NULL;
}
- NetListInit (NbufList);
+ InitializeListHead (NbufList);
//
// Allocate memory for the BHS.
//
PduHdr = NetbufAlloc (sizeof (ISCSI_SCSI_DATA_OUT));
if (PduHdr == NULL) {
- NetFreePool (NbufList);
+ gBS->FreePool (NbufList);
return NULL;
}
//
// Insert the BHS into the buffer list.
//
- NetListInsertTail (NbufList, &PduHdr->List);
+ InsertTailList (NbufList, &PduHdr->List);
DataOutHdr = (ISCSI_SCSI_DATA_OUT *) NetbufAllocSpace (PduHdr, sizeof (ISCSI_SCSI_DATA_OUT), NET_BUF_TAIL);
XferContext = &Tcb->XferContext;
- NetZeroMem (DataOutHdr, sizeof (ISCSI_SCSI_DATA_OUT));
+ ZeroMem (DataOutHdr, sizeof (ISCSI_SCSI_DATA_OUT));
//
// Set the flags and fields of the Data Out PDU BHS.
@@ -2250,7 +2250,7 @@ Returns:
DataOutHdr->BufferOffset = HTONL (XferContext->Offset);
if (XferContext->TargetTransferTag != ISCSI_RESERVED_TAG) {
- NetCopyMem (&DataOutHdr->Lun, &Lun, sizeof (DataOutHdr->Lun));
+ CopyMem (&DataOutHdr->Lun, &Lun, sizeof (DataOutHdr->Lun));
}
//
// Build the data segment for this Data Out PDU.
@@ -2264,7 +2264,7 @@ Returns:
// Put the data segment into the buffer list and combine it with the BHS
// into a full Data Out PDU.
//
- NetListInsertTail (NbufList, &DataSeg->List);
+ InsertTailList (NbufList, &DataSeg->List);
Pdu = NetbufFromBufList (NbufList, 0, 0, IScsiFreeNbufList, NbufList);
if (Pdu == NULL) {
IScsiFreeNbufList (NbufList);
@@ -2273,7 +2273,7 @@ Returns:
return Pdu;
}
-NET_LIST_ENTRY *
+LIST_ENTRY *
IScsiGenerateDataOutPduSequence (
IN UINT8 *Data,
IN ISCSI_TCB *Tcb,
@@ -2297,19 +2297,19 @@ Returns:
--*/
{
- NET_LIST_ENTRY *PduList;
+ LIST_ENTRY *PduList;
UINT32 DataSN;
UINT32 DataLen;
NET_BUF *DataOutPdu;
ISCSI_CONNECTION *Conn;
ISCSI_XFER_CONTEXT *XferContext;
- PduList = NetAllocatePool (sizeof (NET_LIST_ENTRY));
+ PduList = AllocatePool (sizeof (LIST_ENTRY ));
if (PduList == NULL) {
return NULL;
}
- NetListInit (PduList);
+ InitializeListHead (PduList);
DataSN = 0;
Conn = Tcb->Conn;
@@ -2334,7 +2334,7 @@ Returns:
goto ON_EXIT;
}
- NetListInsertTail (PduList, &DataOutPdu->List);
+ InsertTailList (PduList, &DataOutPdu->List);
//
// Update the context and DataSN.
@@ -2378,8 +2378,8 @@ Returns:
--*/
{
- NET_LIST_ENTRY *DataOutPduList;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *DataOutPduList;
+ LIST_ENTRY *Entry;
NET_BUF *Pdu;
EFI_STATUS Status;
@@ -2671,7 +2671,7 @@ Returns:
Packet->SenseDataLength = (UINT8) MIN (SenseData->Length, Packet->SenseDataLength);
if (Packet->SenseDataLength != 0) {
- NetCopyMem (Packet->SenseData, &SenseData->Data[0], Packet->SenseDataLength);
+ CopyMem (Packet->SenseData, &SenseData->Data[0], Packet->SenseDataLength);
}
} else {
Packet->SenseDataLength = 0;
@@ -2999,8 +2999,8 @@ Returns:
Session->ISID[4] = (UINT8) Random;
Session->ISID[5] = (UINT8) (Random >> 8);
- NetListInit (&Session->Conns);
- NetListInit (&Session->TcbList);
+ InitializeListHead (&Session->Conns);
+ InitializeListHead (&Session->TcbList);
}
Session->TSIH = 0;
@@ -3051,11 +3051,11 @@ Returns:
return EFI_SUCCESS;
}
- ASSERT (!NetListIsEmpty (&Session->Conns));
+ ASSERT (!IsListEmpty (&Session->Conns));
Private = ISCSI_DRIVER_DATA_FROM_SESSION (Session);
- while (!NetListIsEmpty (&Session->Conns)) {
+ while (!IsListEmpty (&Session->Conns)) {
Conn = NET_LIST_USER_STRUCT_S (
Session->Conns.ForwardLink,
ISCSI_CONNECTION,
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
index d01b635afc..d9325e3d4f 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
@@ -608,7 +608,7 @@ typedef struct _ISCSI_IN_BUFFER_CONTEXT {
} ISCSI_IN_BUFFER_CONTEXT;
typedef struct _ISCSI_TCB {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
BOOLEAN SoFarInOrder;
UINT32 ExpDataSN;
@@ -627,7 +627,7 @@ typedef struct _ISCSI_TCB {
} ISCSI_TCB;
typedef struct _ISCSI_KEY_VALUE_PAIR {
- NET_LIST_ENTRY List;
+ LIST_ENTRY List;
CHAR8 *Key;
CHAR8 *Value;
@@ -736,7 +736,7 @@ IScsiPadSegment (
IN UINT32 Len
);
-NET_LIST_ENTRY *
+LIST_ENTRY *
IScsiBuildKeyValueList (
IN CHAR8 *Data,
IN UINT32 Len
@@ -744,13 +744,13 @@ IScsiBuildKeyValueList (
CHAR8 *
IScsiGetValueByKeyFromList (
- IN NET_LIST_ENTRY *KeyValueList,
+ IN LIST_ENTRY *KeyValueList,
IN CHAR8 *Key
);
VOID
IScsiFreeKeyValueList (
- IN NET_LIST_ENTRY *KeyValueList
+ IN LIST_ENTRY *KeyValueList
);
EFI_STATUS
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
index d43437be2d..06caf72166 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
@@ -144,9 +144,9 @@ Returns:
AccessPoint->RemotePort = ConfigData->RemotePort;
AccessPoint->ActiveFlag = TRUE;
- NetCopyMem (&AccessPoint->StationAddress, &ConfigData->LocalIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&AccessPoint->SubnetMask, &ConfigData->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&AccessPoint->RemoteAddress, &ConfigData->RemoteIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&AccessPoint->StationAddress, &ConfigData->LocalIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&AccessPoint->SubnetMask, &ConfigData->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&AccessPoint->RemoteAddress, &ConfigData->RemoteIp, sizeof (EFI_IPv4_ADDRESS));
//
// Configure the TCP4 protocol.
@@ -170,7 +170,7 @@ Returns:
//
Status = gBS->CreateEvent (
EFI_EVENT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Tcp4IoCommonNotify,
&Tcp4Io->IsConnDone,
&Tcp4Io->ConnToken.CompletionToken.Event
@@ -181,7 +181,7 @@ Returns:
Status = gBS->CreateEvent (
EFI_EVENT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Tcp4IoCommonNotify,
&Tcp4Io->IsTxDone,
&Tcp4Io->TxToken.CompletionToken.Event
@@ -192,7 +192,7 @@ Returns:
Status = gBS->CreateEvent (
EFI_EVENT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Tcp4IoCommonNotify,
&Tcp4Io->IsRxDone,
&Tcp4Io->RxToken.CompletionToken.Event
@@ -203,7 +203,7 @@ Returns:
Status = gBS->CreateEvent (
EFI_EVENT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Tcp4IoCommonNotify,
&Tcp4Io->IsCloseDone,
&Tcp4Io->CloseToken.CompletionToken.Event
@@ -406,7 +406,7 @@ Returns:
EFI_TCP4_PROTOCOL *Tcp4;
EFI_STATUS Status;
- TxData = NetAllocatePool (sizeof (EFI_TCP4_TRANSMIT_DATA) + (Packet->BlockOpNum - 1) * sizeof (EFI_TCP4_FRAGMENT_DATA));
+ TxData = AllocatePool (sizeof (EFI_TCP4_TRANSMIT_DATA) + (Packet->BlockOpNum - 1) * sizeof (EFI_TCP4_FRAGMENT_DATA));
if (TxData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -442,7 +442,7 @@ Returns:
ON_EXIT:
- NetFreePool (TxData);
+ gBS->FreePool (TxData);
return Status;
}
@@ -485,7 +485,7 @@ Returns:
UINT32 CurrentFragment;
FragmentCount = Packet->BlockOpNum;
- Fragment = NetAllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
+ Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
if (Fragment == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -544,7 +544,7 @@ Returns:
ON_EXIT:
- NetFreePool (Fragment);
+ gBS->FreePool (Fragment);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/Md5.c b/MdeModulePkg/Universal/Network/IScsiDxe/Md5.c
index 44aceaeafa..a86144b207 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/Md5.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/Md5.c
@@ -155,7 +155,7 @@ Returns:
//
// Copy MD5 states to S
//
- NetCopyMem (S, Md5Ctx->States, MD5_HASHSIZE);
+ CopyMem (S, Md5Ctx->States, MD5_HASHSIZE);
t = 0;
for (i = 0; i < 4; i++) {
@@ -205,7 +205,7 @@ Returns:
UINTN Limit;
for (Limit = 64 - Md5Ctx->Count; DataLen >= 64 - Md5Ctx->Count; Limit = 64) {
- NetCopyMem (Md5Ctx->M + Md5Ctx->Count, (VOID *)Data, Limit);
+ CopyMem (Md5Ctx->M + Md5Ctx->Count, (VOID *)Data, Limit);
MD5Transform (Md5Ctx);
Md5Ctx->Count = 0;
@@ -213,7 +213,7 @@ Returns:
DataLen -= Limit;
}
- NetCopyMem (Md5Ctx->M + Md5Ctx->Count, (VOID *)Data, DataLen);
+ CopyMem (Md5Ctx->M + Md5Ctx->Count, (VOID *)Data, DataLen);
Md5Ctx->Count += DataLen;
}
@@ -237,7 +237,7 @@ Returns:
--*/
{
- NetZeroMem (Md5Ctx, sizeof (*Md5Ctx));
+ ZeroMem (Md5Ctx, sizeof (*Md5Ctx));
//
// Set magic initialization constants.
@@ -311,8 +311,8 @@ Returns:
//
// Store Hashed value & Zeroize sensitive context information.
//
- NetCopyMem (HashVal, (UINT8 *) Md5Ctx->States, MD5_HASHSIZE);
- NetZeroMem ((UINT8 *)Md5Ctx, sizeof (*Md5Ctx));
+ CopyMem (HashVal, (UINT8 *) Md5Ctx->States, MD5_HASHSIZE);
+ ZeroMem ((UINT8 *)Md5Ctx, sizeof (*Md5Ctx));
return EFI_SUCCESS;
}
@@ -327,7 +327,7 @@ Returns:
Md5Ctx->Length = LShiftU64 (Md5Ctx->Length, 3);
MD5UpdateBlock (Md5Ctx, (CONST UINT8 *) &Md5Ctx->Length, 8);
- NetZeroMem (Md5Ctx->M, sizeof (Md5Ctx->M));
+ ZeroMem (Md5Ctx->M, sizeof (Md5Ctx->M));
Md5Ctx->Length = 0;
Md5Ctx->Status = EFI_ALREADY_STARTED;
return MD5Final (Md5Ctx, HashVal);
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
index 13ed771282..0c5c6bce37 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
@@ -62,7 +62,7 @@ EfiNicIp4ConfigGetName (
Instance = IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG (This);
if (Name != NULL) {
- NetCopyMem (Name, Instance->NicName, IP4_NIC_NAME_LENGTH);
+ CopyMem (Name, Instance->NicName, IP4_NIC_NAME_LENGTH);
}
if (NicAddr != NULL) {
@@ -105,7 +105,7 @@ Ip4ConfigGetNicInfo (
Config = Ip4ConfigFindNicVariable (Variable, NicAddr);
if (Config == NULL) {
- NetFreePool (Variable);
+ gBS->FreePool (Variable);
return NULL;
}
@@ -118,14 +118,14 @@ Ip4ConfigGetNicInfo (
Ip4ConfigWriteVariable (NewVariable);
if (NewVariable != NULL) {
- NetFreePool (NewVariable);
+ gBS->FreePool (NewVariable);
};
- NetFreePool (Config);
+ gBS->FreePool (Config);
Config = NULL;
}
- NetFreePool (Variable);
+ gBS->FreePool (Variable);
return Config;
}
@@ -179,12 +179,12 @@ EfiNicIp4ConfigGetInfo (
Status = EFI_BUFFER_TOO_SMALL;
} else {
Status = EFI_SUCCESS;
- NetCopyMem (NicConfig, Config, Len);
+ CopyMem (NicConfig, Config, Len);
}
*ConfigLen = Len;
- NetFreePool (Config);
+ gBS->FreePool (Config);
return Status;
}
@@ -253,14 +253,14 @@ EfiNicIp4ConfigSetInfo (
Status = Ip4ConfigWriteVariable (NewVariable);
if (NewVariable != NULL) {
- NetFreePool (NewVariable);
+ gBS->FreePool (NewVariable);
}
//
// Variable is NULL when saving the first configure parameter
//
if (Variable != NULL) {
- NetFreePool (Variable);
+ gBS->FreePool (Variable);
}
if (EFI_ERROR (Status)) {
@@ -313,7 +313,7 @@ EfiIp4ConfigStart (
Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State != IP4_CONFIG_STATE_IDLE) {
Status = EFI_ALREADY_STARTED;
@@ -415,7 +415,7 @@ EfiIp4ConfigStart (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_LOCK,
+ TPL_CALLBACK,
Ip4ConfigOnDhcp4Complete,
Instance,
&Instance->Dhcp4Event
@@ -440,7 +440,7 @@ ON_ERROR:
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -473,7 +473,7 @@ EfiIp4ConfigStop (
Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State == IP4_CONFIG_STATE_IDLE) {
Status = EFI_NOT_STARTED;
@@ -488,7 +488,7 @@ EfiIp4ConfigStop (
Ip4ConfigCleanConfig (Instance);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -528,7 +528,7 @@ EfiIp4ConfigGetData (
Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State == IP4_CONFIG_STATE_IDLE) {
Status = EFI_NOT_STARTED;
@@ -554,14 +554,14 @@ EfiIp4ConfigGetData (
if ((*ConfigDataSize < Len) || (ConfigData == NULL)) {
Status = EFI_BUFFER_TOO_SMALL;
} else {
- NetCopyMem (ConfigData, &NicConfig->Ip4Info, Len);
+ CopyMem (ConfigData, &NicConfig->Ip4Info, Len);
}
*ConfigDataSize = Len;
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -619,10 +619,10 @@ Ip4ConfigOnDhcp4Complete (
if (Instance->NicConfig != NULL) {
ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);
Perment = Instance->NicConfig->Perment;
- NetFreePool (Instance->NicConfig);
+ gBS->FreePool (Instance->NicConfig);
}
- Instance->NicConfig = NetAllocatePool (sizeof (NIC_IP4_CONFIG_INFO) + 2* sizeof (EFI_IP4_ROUTE_TABLE));
+ Instance->NicConfig = AllocatePool (sizeof (NIC_IP4_CONFIG_INFO) + 2* sizeof (EFI_IP4_ROUTE_TABLE));
if (Instance->NicConfig == NULL) {
Instance->Result = EFI_OUT_OF_RESOURCES;
@@ -644,14 +644,14 @@ Ip4ConfigOnDhcp4Complete (
//
Ip4Config->RouteTableSize = 1;
- NetCopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));
+ CopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));
Subnet = Ip1 & Ip2;
- NetCopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Ip4Config->RouteTable[0].SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&Ip4Config->RouteTable[0].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Ip4Config->RouteTable[0].SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Ip4Config->RouteTable[0].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Create a route if there is a default router.
@@ -659,9 +659,9 @@ Ip4ConfigOnDhcp4Complete (
if (!EFI_IP4_EQUAL (&Dhcp4Mode.RouterAddress, &mZeroIp4Addr)) {
Ip4Config->RouteTableSize = 2;
- NetZeroMem (&Ip4Config->RouteTable[1].SubnetAddress, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&Ip4Config->RouteTable[1].SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Ip4Config->RouteTable[1].GatewayAddress, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Ip4Config->RouteTable[1].SubnetAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Ip4Config->RouteTable[1].SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Ip4Config->RouteTable[1].GatewayAddress, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
}
Instance->Result = EFI_SUCCESS;
@@ -738,7 +738,7 @@ Ip4ConfigCleanConfig (
)
{
if (Instance->NicConfig != NULL) {
- NetFreePool (Instance->NicConfig);
+ gBS->FreePool (Instance->NicConfig);
Instance->NicConfig = NULL;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
index 081db47d49..7f0149fa00 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
@@ -214,7 +214,7 @@ Ip4ConfigDriverBindingStart (
//
// Allocate an instance then initialize it
//
- Instance = NetAllocatePool (sizeof (IP4_CONFIG_INSTANCE));
+ Instance = AllocatePool (sizeof (IP4_CONFIG_INSTANCE));
if (Instance == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -332,7 +332,7 @@ Ip4ConfigDriverBindingStart (
NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NULL);
} else if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {
- NetZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));
+ ZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));
NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NicConfig);
}
@@ -340,21 +340,21 @@ Ip4ConfigDriverBindingStart (
Ip4ConfigWriteVariable (NewVariable);
if (NewVariable != NULL) {
- NetFreePool (NewVariable);
+ gBS->FreePool (NewVariable);
}
ON_EXIT:
- NetFreePool (Variable);
+ gBS->FreePool (Variable);
if (NicConfig != NULL) {
- NetFreePool (NicConfig);
+ gBS->FreePool (NicConfig);
}
return EFI_SUCCESS;
ON_ERROR:
if (Instance != NULL) {
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
if (Mnp != NULL) {
@@ -511,7 +511,7 @@ Ip4ConfigDriverBindingStop (
Ip4ConfigCleanConfig (Instance);
mIp4ConfigNicList[Instance->NicIndex] = NULL;
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
index d6e617eaa7..dabd13c1db 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
@@ -129,7 +129,7 @@ Ip4ConfigReadVariable (
goto REMOVE_VARIABLE;
}
- Variable = NetAllocatePool (Size);
+ Variable = AllocatePool (Size);
if (Variable == NULL) {
return NULL;
@@ -167,7 +167,7 @@ REMOVE_VARIABLE:
ON_ERROR:
if (Variable != NULL) {
- NetFreePool (Variable);
+ gBS->FreePool (Variable);
}
return NULL;
@@ -234,7 +234,7 @@ Ip4ConfigFindNicVariable (
//
// Copy the data to Temp to avoid the alignment problems
//
- NetCopyMem (&Temp, Cur, sizeof (NIC_IP4_CONFIG_INFO));
+ CopyMem (&Temp, Cur, sizeof (NIC_IP4_CONFIG_INFO));
Len = SIZEOF_NIC_IP4_CONFIG_INFO (&Temp);
//
@@ -242,13 +242,13 @@ Ip4ConfigFindNicVariable (
// a block of memory then copy it out.
//
if (NIC_ADDR_EQUAL (&Temp.NicAddr, NicAddr)) {
- Config = NetAllocatePool (Len);
+ Config = AllocatePool (Len);
if (Config == NULL) {
return NULL;
}
- NetCopyMem (Config, Cur, Len);
+ CopyMem (Config, Cur, Len);
return Config;
}
@@ -311,7 +311,7 @@ Ip4ConfigModifyVariable (
if (Old != NULL) {
TotalLen -= SIZEOF_NIC_IP4_CONFIG_INFO (Old);
- NetFreePool (Old);
+ gBS->FreePool (Old);
}
if (Config != NULL) {
@@ -338,7 +338,7 @@ Ip4ConfigModifyVariable (
ASSERT (TotalLen >= sizeof (IP4_CONFIG_VARIABLE));
- NewVar = NetAllocateZeroPool (TotalLen);
+ NewVar = AllocateZeroPool (TotalLen);
if (NewVar == NULL) {
return NULL;
@@ -352,11 +352,11 @@ Ip4ConfigModifyVariable (
Next = (UINT8 *)&NewVar->ConfigInfo;
for (Index = 0; Index < Count; Index++) {
- NetCopyMem (&Temp, Cur, sizeof (NIC_IP4_CONFIG_INFO));
+ CopyMem (&Temp, Cur, sizeof (NIC_IP4_CONFIG_INFO));
Len = SIZEOF_NIC_IP4_CONFIG_INFO (&Temp);
if (!NIC_ADDR_EQUAL (&Temp.NicAddr, NicAddr)) {
- NetCopyMem (Next, Cur, Len);
+ CopyMem (Next, Cur, Len);
Next += Len;
NewVar->Count++;
}
@@ -372,7 +372,7 @@ Ip4ConfigModifyVariable (
if (Config != NULL) {
Len = SIZEOF_NIC_IP4_CONFIG_INFO (Config);
- NetCopyMem (Next, Config, Len);
+ CopyMem (Next, Config, Len);
NewVar->Count++;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
index ac339bee52..561be165d8 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
@@ -80,7 +80,7 @@ Ip4GetHostCast (
IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Type;
INTN Class;
@@ -146,7 +146,7 @@ Ip4FindInterface (
IN IP4_ADDR Ip
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -176,7 +176,7 @@ Ip4FindNet (
IN IP4_ADDR Ip
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -208,7 +208,7 @@ Ip4FindStationAddress (
IN IP4_ADDR Netmask
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -290,7 +290,7 @@ Ip4SetVariableData (
)
{
UINT32 NumConfiguredInstance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINTN VariableDataSize;
EFI_IP4_VARIABLE_DATA *Ip4VariableData;
EFI_IP4_ADDRESS_PAIR *Ip4AddressPair;
@@ -322,7 +322,7 @@ Ip4SetVariableData (
VariableDataSize += sizeof (EFI_IP4_ADDRESS_PAIR) * (NumConfiguredInstance - 1);
}
- Ip4VariableData = NetAllocatePool (VariableDataSize);
+ Ip4VariableData = AllocatePool (VariableDataSize);
if (Ip4VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -372,7 +372,7 @@ Ip4SetVariableData (
);
}
- NetFreePool (IpSb->MacString);
+ gBS->FreePool (IpSb->MacString);
}
IpSb->MacString = NewMacString;
@@ -387,7 +387,7 @@ Ip4SetVariableData (
ON_ERROR:
- NetFreePool (Ip4VariableData);
+ gBS->FreePool (Ip4VariableData);
return Status;
}
@@ -416,6 +416,6 @@ Ip4ClearVariableData (
NULL
);
- NetFreePool (IpSb->MacString);
+ gBS->FreePool (IpSb->MacString);
IpSb->MacString = NULL;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
index 589eca5208..85cc6afb50 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
@@ -161,7 +161,7 @@ Ip4CreateService (
// empty resources, so if any thing goes wrong when allocating
// resources, Ip4CleanService can be called to clean it up.
//
- IpSb = NetAllocatePool (sizeof (IP4_SERVICE));
+ IpSb = AllocatePool (sizeof (IP4_SERVICE));
if (IpSb == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -174,16 +174,16 @@ Ip4CreateService (
IpSb->InDestory = FALSE;
IpSb->NumChildren = 0;
- NetListInit (&IpSb->Children);
+ InitializeListHead (&IpSb->Children);
- NetListInit (&IpSb->Interfaces);
+ InitializeListHead (&IpSb->Interfaces);
IpSb->DefaultInterface = NULL;
IpSb->DefaultRouteTable = NULL;
Ip4InitAssembleTable (&IpSb->Assemble);
IpSb->IgmpCtrl.Igmpv1QuerySeen = 0;
- NetListInit (&IpSb->IgmpCtrl.Groups);
+ InitializeListHead (&IpSb->IgmpCtrl.Groups);
IpSb->Image = ImageHandle;
IpSb->Controller = Controller;
@@ -202,7 +202,7 @@ Ip4CreateService (
IpSb->MnpConfigData.EnableReceiveTimestamps = FALSE;
IpSb->MnpConfigData.DisableBackgroundPolling = FALSE;
- NetZeroMem (&IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
+ ZeroMem (&IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
IpSb->Timer = NULL;
IpSb->Ip4Config = NULL;
@@ -224,7 +224,7 @@ Ip4CreateService (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
Ip4TimerTicking,
IpSb,
&IpSb->Timer
@@ -283,7 +283,7 @@ Ip4CreateService (
goto ON_ERROR;
}
- NetListInsertHead (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
+ InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
IpSb->MacString = NULL;
@@ -292,7 +292,7 @@ Ip4CreateService (
ON_ERROR:
Ip4CleanService (IpSb);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
return Status;
}
@@ -477,7 +477,7 @@ UNINSTALL_PROTOCOL:
FREE_SERVICE:
Ip4CleanService (IpSb);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
return Status;
}
@@ -555,7 +555,7 @@ Ip4DriverBindingStop (
IpSb = IP4_SERVICE_FROM_PROTOCOL (ServiceBinding);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpSb->Ip4Config && (IpSb->State != IP4_SERVICE_DESTORY)) {
@@ -569,7 +569,7 @@ Ip4DriverBindingStop (
);
if (EFI_ERROR (Status)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -585,7 +585,7 @@ Ip4DriverBindingStop (
gBS->CloseEvent (IpSb->ReconfigEvent);
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -625,15 +625,15 @@ Ip4DriverBindingStop (
IpSb = IP4_SERVICE_FROM_PROTOCOL (ServiceBinding);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpSb->InDestory) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
if (IsArp) {
- while (!NetListIsEmpty (&IpSb->Children)) {
+ while (!IsListEmpty (&IpSb->Children)) {
IpInstance = NET_LIST_HEAD (&IpSb->Children, IP4_PROTOCOL, Link);
ServiceBinding->DestroyChild (ServiceBinding, IpInstance->Handle);
@@ -670,7 +670,7 @@ Ip4DriverBindingStop (
ServiceBinding
);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
} else if (NumberOfChildren == 0) {
IpSb->InDestory = TRUE;
@@ -698,10 +698,10 @@ Ip4DriverBindingStop (
ServiceBinding
);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
} else {
- while (!NetListIsEmpty (&IpSb->Children)) {
+ while (!IsListEmpty (&IpSb->Children)) {
IpInstance = NET_LIST_HEAD (&IpSb->Children, IP4_PROTOCOL, Link);
ServiceBinding->DestroyChild (ServiceBinding, IpInstance->Handle);
@@ -714,7 +714,7 @@ Ip4DriverBindingStop (
ON_ERROR:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -752,7 +752,7 @@ Ip4ServiceBindingCreateChild (
}
IpSb = IP4_SERVICE_FROM_PROTOCOL (This);
- IpInstance = NetAllocatePool (sizeof (IP4_PROTOCOL));
+ IpInstance = AllocatePool (sizeof (IP4_PROTOCOL));
if (IpInstance == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -801,12 +801,12 @@ Ip4ServiceBindingCreateChild (
//
// Insert it into the service binding instance.
//
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- NetListInsertTail (&IpSb->Children, &IpInstance->Link);
+ InsertTailList (&IpSb->Children, &IpInstance->Link);
IpSb->NumChildren++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
ON_ERROR:
@@ -814,7 +814,7 @@ ON_ERROR:
Ip4CleanProtocol (IpInstance);
- NetFreePool (IpInstance);
+ gBS->FreePool (IpInstance);
}
return Status;
@@ -879,7 +879,7 @@ Ip4ServiceBindingDestroyChild (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// A child can be destoried more than once. For example,
@@ -888,7 +888,7 @@ Ip4ServiceBindingDestroyChild (
// the IP child it opens.
//
if (IpInstance->State == IP4_STATE_DESTORY) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -944,17 +944,17 @@ Ip4ServiceBindingDestroyChild (
goto ON_ERROR;
}
- NetListRemoveEntry (&IpInstance->Link);
+ RemoveEntryList (&IpInstance->Link);
IpSb->NumChildren--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (IpInstance);
+ gBS->FreePool (IpInstance);
return EFI_SUCCESS;
ON_ERROR:
IpInstance->State = State;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
index 14188851b4..473449cbcf 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
@@ -108,7 +108,7 @@ Ip4ProcessIcmpRedirect (
IN IP4_ICMP_ERROR_HEAD *Icmp
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_PROTOCOL *Ip4Instance;
IP4_ROUTE_CACHE_ENTRY *CacheEntry;
IP4_INTERFACE *IpIf;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
index a7a230d6fb..d8f88e14b1 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
@@ -114,7 +114,7 @@ Ip4WrapLinkTxToken (
EFI_STATUS Status;
UINT32 Count;
- Token = NetAllocatePool (sizeof (IP4_LINK_TX_TOKEN) + \
+ Token = AllocatePool (sizeof (IP4_LINK_TX_TOKEN) + \
(Packet->BlockOpNum - 1) * sizeof (EFI_MANAGED_NETWORK_FRAGMENT_DATA));
if (Token == NULL) {
@@ -122,7 +122,7 @@ Ip4WrapLinkTxToken (
}
Token->Signature = IP4_FRAME_TX_SIGNATURE;
- NetListInit (&Token->Link);
+ InitializeListHead (&Token->Link);
Token->Interface = Interface;
Token->IpInstance = IpInstance;
@@ -137,14 +137,14 @@ Ip4WrapLinkTxToken (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnFrameSent,
Token,
&MnpToken->Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -184,7 +184,7 @@ Ip4FreeLinkTxToken (
NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE);
gBS->CloseEvent (Token->MnpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -208,28 +208,28 @@ Ip4CreateArpQue (
IP4_ARP_QUE *ArpQue;
EFI_STATUS Status;
- ArpQue = NetAllocatePool (sizeof (IP4_ARP_QUE));
+ ArpQue = AllocatePool (sizeof (IP4_ARP_QUE));
if (ArpQue == NULL) {
return NULL;
}
ArpQue->Signature = IP4_FRAME_ARP_SIGNATURE;
- NetListInit (&ArpQue->Link);
+ InitializeListHead (&ArpQue->Link);
- NetListInit (&ArpQue->Frames);
+ InitializeListHead (&ArpQue->Frames);
ArpQue->Interface = Interface;
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnArpResolved,
ArpQue,
&ArpQue->OnResolved
);
if (EFI_ERROR (Status)) {
- NetFreePool (ArpQue);
+ gBS->FreePool (ArpQue);
return NULL;
}
@@ -265,7 +265,7 @@ Ip4FreeArpQue (
Ip4CancelFrameArp (ArpQue, IoStatus, NULL, NULL);
gBS->CloseEvent (ArpQue->OnResolved);
- NetFreePool (ArpQue);
+ gBS->FreePool (ArpQue);
}
@@ -294,7 +294,7 @@ Ip4CreateLinkRxToken (
IP4_LINK_RX_TOKEN *Token;
EFI_STATUS Status;
- Token = NetAllocatePool (sizeof (IP4_LINK_RX_TOKEN));
+ Token = AllocatePool (sizeof (IP4_LINK_RX_TOKEN));
if (Token == NULL) {
return NULL;
}
@@ -310,14 +310,14 @@ Ip4CreateLinkRxToken (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnFrameReceived,
Token,
&MnpToken->Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -345,7 +345,7 @@ Ip4FreeFrameRxToken (
NET_CHECK_SIGNATURE (Token, IP4_FRAME_RX_SIGNATURE);
gBS->CloseEvent (Token->MnpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -371,15 +371,15 @@ Ip4CancelFrameArp (
IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_LINK_TX_TOKEN *Token;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &ArpQue->Frames) {
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
if ((FrameToCancel == NULL) || FrameToCancel (Token, Context)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token->CallBack (Token->IpInstance, Token->Packet, IoStatus, 0, Token->Context);
Ip4FreeLinkTxToken (Token);
@@ -411,8 +411,8 @@ Ip4CancelFrames (
IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ARP_QUE *ArpQue;
IP4_LINK_TX_TOKEN *Token;
@@ -424,7 +424,7 @@ Ip4CancelFrames (
Ip4CancelFrameArp (ArpQue, IoStatus, FrameToCancel, Context);
- if (NetListIsEmpty (&ArpQue->Frames)) {
+ if (IsListEmpty (&ArpQue->Frames)) {
Interface->Arp->Cancel (Interface->Arp, &ArpQue->Ip, ArpQue->OnResolved);
}
}
@@ -466,14 +466,14 @@ Ip4CreateInterface (
IP4_INTERFACE *Interface;
EFI_SIMPLE_NETWORK_MODE SnpMode;
- Interface = NetAllocatePool (sizeof (IP4_INTERFACE));
+ Interface = AllocatePool (sizeof (IP4_INTERFACE));
if ((Interface == NULL) || (Mnp == NULL)) {
return NULL;
}
Interface->Signature = IP4_INTERFACE_SIGNATURE;
- NetListInit (&Interface->Link);
+ InitializeListHead (&Interface->Link);
Interface->RefCnt = 1;
Interface->Ip = IP4_ALLZERO_ADDRESS;
@@ -486,8 +486,8 @@ Ip4CreateInterface (
Interface->Arp = NULL;
Interface->ArpHandle = NULL;
- NetListInit (&Interface->ArpQues);
- NetListInit (&Interface->SentFrames);
+ InitializeListHead (&Interface->ArpQues);
+ InitializeListHead (&Interface->SentFrames);
Interface->RecvRequest = NULL;
@@ -495,7 +495,7 @@ Ip4CreateInterface (
// Get the interface's Mac address and broadcast mac address from SNP
//
if (EFI_ERROR (Mnp->GetModeData (Mnp, NULL, &SnpMode))) {
- NetFreePool (Interface);
+ gBS->FreePool (Interface);
return NULL;
}
@@ -503,7 +503,7 @@ Ip4CreateInterface (
CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (Interface->BroadcastMac));
Interface->HwaddrLen = SnpMode.HwAddressSize;
- NetListInit (&Interface->IpInstances);
+ InitializeListHead (&Interface->IpInstances);
Interface->PromiscRecv = FALSE;
return Interface;
@@ -677,12 +677,12 @@ Ip4CancelReceive (
IP4_LINK_RX_TOKEN *Token;
if ((Token = Interface->RecvRequest) != NULL) {
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Interface->RecvRequest = NULL;
Interface->Mnp->Cancel (Interface->Mnp, &Token->MnpToken);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
}
@@ -728,9 +728,9 @@ Ip4FreeInterface (
Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);
Ip4CancelReceive (Interface);
- ASSERT (NetListIsEmpty (&Interface->IpInstances));
- ASSERT (NetListIsEmpty (&Interface->ArpQues));
- ASSERT (NetListIsEmpty (&Interface->SentFrames));
+ ASSERT (IsListEmpty (&Interface->IpInstances));
+ ASSERT (IsListEmpty (&Interface->ArpQues));
+ ASSERT (IsListEmpty (&Interface->SentFrames));
if (Interface->Arp != NULL) {
gBS->CloseProtocol (
@@ -748,8 +748,8 @@ Ip4FreeInterface (
);
}
- NetListRemoveEntry (&Interface->Link);
- NetFreePool (Interface);
+ RemoveEntryList (&Interface->Link);
+ gBS->FreePool (Interface);
return EFI_SUCCESS;
}
@@ -773,8 +773,8 @@ Ip4OnArpResolvedDpc (
IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ARP_QUE *ArpQue;
IP4_INTERFACE *Interface;
IP4_LINK_TX_TOKEN *Token;
@@ -783,7 +783,7 @@ Ip4OnArpResolvedDpc (
ArpQue = (IP4_ARP_QUE *) Context;
NET_CHECK_SIGNATURE (ArpQue, IP4_FRAME_ARP_SIGNATURE);
- NetListRemoveEntry (&ArpQue->Link);
+ RemoveEntryList (&ArpQue->Link);
//
// ARP resolve failed for some reason. Release all the frame
@@ -804,7 +804,7 @@ Ip4OnArpResolvedDpc (
Interface = ArpQue->Interface;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &ArpQue->Frames) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (Token->DstMac));
@@ -816,11 +816,11 @@ Ip4OnArpResolvedDpc (
// Status of Mnp->Transmit is not EFI_SUCCESS as in this case the
// FrameSentDpc won't be queued.
//
- NetListInsertTail (&Interface->SentFrames, &Token->Link);
+ InsertTailList (&Interface->SentFrames, &Token->Link);
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
if (EFI_ERROR (Status)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token->CallBack (Token->IpInstance, Token->Packet, Status, 0, Token->Context);
Ip4FreeLinkTxToken (Token);
@@ -884,7 +884,7 @@ Ip4OnFrameSentDpc (
Token = (IP4_LINK_TX_TOKEN *) Context;
NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE);
- NetListRemoveEntry (&Token->Link);
+ RemoveEntryList (&Token->Link);
Token->CallBack (
Token->IpInstance,
@@ -961,7 +961,7 @@ Ip4SendFrame (
)
{
IP4_LINK_TX_TOKEN *Token;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ARP_QUE *ArpQue;
EFI_ARP_PROTOCOL *Arp;
EFI_STATUS Status;
@@ -1034,7 +1034,7 @@ Ip4SendFrame (
// Found a pending ARP request, enqueue the frame then return
//
if (Entry != &Interface->ArpQues) {
- NetListInsertTail (&ArpQue->Frames, &Token->Link);
+ InsertTailList (&ArpQue->Frames, &Token->Link);
return EFI_SUCCESS;
}
@@ -1055,8 +1055,8 @@ Ip4SendFrame (
goto ON_ERROR;
}
- NetListInsertHead (&ArpQue->Frames, &Token->Link);
- NetListInsertHead (&Interface->ArpQues, &ArpQue->Link);
+ InsertHeadList (&ArpQue->Frames, &Token->Link);
+ InsertHeadList (&Interface->ArpQues, &ArpQue->Link);
return EFI_SUCCESS;
SEND_NOW:
@@ -1064,10 +1064,10 @@ SEND_NOW:
// Insert the tx token into the SentFrames list before calling Mnp->Transmit.
// Remove it if the returned status is not EFI_SUCCESS.
//
- NetListInsertTail (&Interface->SentFrames, &Token->Link);
+ InsertTailList (&Interface->SentFrames, &Token->Link);
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
if (EFI_ERROR (Status)) {
- NetListRemoveEntry (&Interface->SentFrames);
+ RemoveEntryList (&Interface->SentFrames);
goto ON_ERROR;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h
index 22db034a0a..e807516408 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h
@@ -79,7 +79,7 @@ typedef struct {
//
typedef struct {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
IP4_INTERFACE *Interface;
@@ -103,9 +103,9 @@ typedef struct {
//
typedef struct {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
- NET_LIST_ENTRY Frames;
+ LIST_ENTRY Frames;
IP4_INTERFACE *Interface;
//
@@ -136,7 +136,7 @@ BOOLEAN
//
struct _IP4_INTERFACE {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
//
@@ -164,8 +164,8 @@ struct _IP4_INTERFACE {
//
// Queues to keep the frames sent and waiting ARP request.
//
- NET_LIST_ENTRY ArpQues;
- NET_LIST_ENTRY SentFrames;
+ LIST_ENTRY ArpQues;
+ LIST_ENTRY SentFrames;
IP4_LINK_RX_TOKEN *RecvRequest;
//
@@ -180,7 +180,7 @@ struct _IP4_INTERFACE {
// together through IpInstances. If any of the instance enables
// promiscuous receive, PromiscRecv is true.
//
- NET_LIST_ENTRY IpInstances;
+ LIST_ENTRY IpInstances;
BOOLEAN PromiscRecv;
};
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c
index 70fbebdc44..4fbabe2f36 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c
@@ -56,7 +56,7 @@ Ip4InitIgmp (
//
// Configure MNP to receive ALL_SYSTEM multicast
//
- Group = NetAllocatePool (sizeof (IGMP_GROUP));
+ Group = AllocatePool (sizeof (IGMP_GROUP));
if (Group == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -81,11 +81,11 @@ Ip4InitIgmp (
goto ON_ERROR;
}
- NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);
+ InsertHeadList (&IgmpCtrl->Groups, &Group->Link);
return EFI_SUCCESS;
ON_ERROR:
- NetFreePool (Group);
+ gBS->FreePool (Group);
return Status;
}
@@ -108,7 +108,7 @@ Ip4FindGroup (
IN IP4_ADDR Address
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
NET_LIST_FOR_EACH (Entry, &IgmpCtrl->Groups) {
@@ -141,7 +141,7 @@ Ip4FindMac (
IN EFI_MAC_ADDRESS *Mac
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
INTN Count;
@@ -298,7 +298,7 @@ Ip4JoinGroup (
// Otherwise, create a new IGMP_GROUP, Get the multicast's MAC address,
// send a report, then direct MNP to receive the multicast.
//
- Group = NetAllocatePool (sizeof (IGMP_GROUP));
+ Group = AllocatePool (sizeof (IGMP_GROUP));
if (Group == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -327,11 +327,11 @@ Ip4JoinGroup (
goto ON_ERROR;
}
- NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);
+ InsertHeadList (&IgmpCtrl->Groups, &Group->Link);
return EFI_SUCCESS;
ON_ERROR:
- NetFreePool (Group);
+ gBS->FreePool (Group);
return Status;
}
@@ -399,8 +399,8 @@ Ip4LeaveGroup (
Ip4SendIgmpMessage (IpSb, IP4_ALLROUTER_ADDRESS, IGMP_LEAVE_GROUP, Group->Address);
}
- NetListRemoveEntry (&Group->Link);
- NetFreePool (Group);
+ RemoveEntryList (&Group->Link);
+ gBS->FreePool (Group);
return EFI_SUCCESS;
}
@@ -428,7 +428,7 @@ Ip4IgmpHandle (
IGMP_HEAD Igmp;
IGMP_GROUP *Group;
IP4_ADDR Address;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IgmpCtrl = &IpSb->IgmpCtrl;
@@ -526,7 +526,7 @@ Ip4IgmpTicking (
)
{
IGMP_SERVICE_DATA *IgmpCtrl;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
IgmpCtrl = &IpSb->IgmpCtrl;
@@ -578,13 +578,13 @@ Ip4CombineGroups (
{
IP4_ADDR *Groups;
- Groups = NetAllocatePool (sizeof (IP4_ADDR) * (Count + 1));
+ Groups = AllocatePool (sizeof (IP4_ADDR) * (Count + 1));
if (Groups == NULL) {
return NULL;
}
- NetCopyMem (Groups, Source, Count * sizeof (IP4_ADDR));
+ CopyMem (Groups, Source, Count * sizeof (IP4_ADDR));
Groups[Count] = Addr;
return Groups;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h
index 0b61874632..8c01d1f629 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h
@@ -38,7 +38,7 @@ typedef struct {
// "idle member" state.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Address;
INTN DelayTime;
@@ -53,7 +53,7 @@ typedef struct {
//
typedef struct {
INTN Igmpv1QuerySeen;
- NET_LIST_ENTRY Groups;
+ LIST_ENTRY Groups;
} IGMP_SERVICE_DATA;
enum {
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index 04ca79578f..d1302acaa3 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -57,7 +57,7 @@ EfiIp4GetModeData (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
IpSb = IpInstance->Service;
@@ -89,10 +89,10 @@ EfiIp4GetModeData (
Config = &Ip4ModeData->ConfigData;
Ip = HTONL (IpInstance->Interface->Ip);
- NetCopyMem (&Config->StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Config->StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (IpInstance->Interface->SubnetMask);
- NetCopyMem (&Config->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Config->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip4ModeData->IsConfigured = IpInstance->Interface->Configured;
@@ -102,7 +102,7 @@ EfiIp4GetModeData (
Status = Ip4BuildEfiRouteTable (IpInstance);
if (EFI_ERROR (Status)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -119,7 +119,7 @@ EfiIp4GetModeData (
CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (*SnpModeData));
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -148,8 +148,8 @@ Ip4ServiceConfigMnp (
IN BOOLEAN Force
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *ProtoEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *ProtoEntry;
IP4_INTERFACE *IpIf;
IP4_PROTOCOL *IpInstance;
BOOLEAN Reconfig;
@@ -271,7 +271,7 @@ Ip4AutoConfigCallBackDpc (
Ip4FreeRouteTable (IpSb->DefaultRouteTable);
IpSb->DefaultInterface = IpIf;
- NetListInsertHead (&IpSb->Interfaces, &IpIf->Link);
+ InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
IpSb->DefaultRouteTable = RouteTable;
Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
@@ -291,7 +291,7 @@ Ip4AutoConfigCallBackDpc (
return ;
}
- Data = NetAllocatePool (Len);
+ Data = AllocatePool (Len);
if (Data == NULL) {
return ;
@@ -355,7 +355,7 @@ Ip4AutoConfigCallBackDpc (
Ip4SetVariableData (IpSb);
ON_EXIT:
- NetFreePool (Data);
+ gBS->FreePool (Data);
}
VOID
@@ -421,7 +421,7 @@ Ip4StartAutoConfig (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_LOCK,
+ TPL_CALLBACK,
Ip4AutoConfigCallBack,
IpSb,
&IpSb->DoneEvent
@@ -433,7 +433,7 @@ Ip4StartAutoConfig (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4AutoConfigCallBack,
IpSb,
&IpSb->ReconfigEvent
@@ -506,21 +506,21 @@ Ip4InitProtocol (
{
ASSERT ((IpSb != NULL) && (IpInstance != NULL));
- NetZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
+ ZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
IpInstance->Signature = IP4_PROTOCOL_SIGNATURE;
CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (IpInstance->Ip4Proto));
IpInstance->State = IP4_STATE_UNCONFIGED;
IpInstance->Service = IpSb;
- NetListInit (&IpInstance->Link);
+ InitializeListHead (&IpInstance->Link);
NetMapInit (&IpInstance->RxTokens);
NetMapInit (&IpInstance->TxTokens);
- NetListInit (&IpInstance->Received);
- NetListInit (&IpInstance->Delivered);
- NetListInit (&IpInstance->AddrLink);
+ InitializeListHead (&IpInstance->Received);
+ InitializeListHead (&IpInstance->Delivered);
+ InitializeListHead (&IpInstance->AddrLink);
- NET_RECYCLE_LOCK_INIT (&IpInstance->RecycleLock);
+ EfiInitializeLock (&IpInstance->RecycleLock, TPL_NOTIFY);
}
@@ -589,8 +589,8 @@ Ip4ConfigProtocol (
//
// Set up the interface.
//
- NetCopyMem (&Ip, &Config->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &Config->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
Ip = NTOHL (Ip);
Netmask = NTOHL (Netmask);
@@ -621,7 +621,7 @@ Ip4ConfigProtocol (
goto ON_ERROR;
}
- NetListInsertTail (&IpSb->Interfaces, &IpIf->Link);
+ InsertTailList (&IpSb->Interfaces, &IpIf->Link);
}
//
@@ -657,7 +657,7 @@ Ip4ConfigProtocol (
}
IpInstance->Interface = IpIf;
- NetListInsertTail (&IpIf->IpInstances, &IpInstance->AddrLink);
+ InsertTailList (&IpIf->IpInstances, &IpInstance->AddrLink);
CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
IpInstance->State = IP4_STATE_CONFIGED;
@@ -707,12 +707,12 @@ Ip4CleanProtocol (
// user forgets to recycle the packets, or because the callback
// hasn't been called. Just leave it alone.
//
- if (!NetListIsEmpty (&IpInstance->Delivered)) {
+ if (!IsListEmpty (&IpInstance->Delivered)) {
;
}
if (IpInstance->Interface != NULL) {
- NetListRemoveEntry (&IpInstance->AddrLink);
+ RemoveEntryList (&IpInstance->AddrLink);
Ip4FreeInterface (IpInstance->Interface, IpInstance);
IpInstance->Interface = NULL;
}
@@ -727,13 +727,13 @@ Ip4CleanProtocol (
}
if (IpInstance->EfiRouteTable != NULL) {
- NetFreePool (IpInstance->EfiRouteTable);
+ gBS->FreePool (IpInstance->EfiRouteTable);
IpInstance->EfiRouteTable = NULL;
IpInstance->EfiRouteCount = 0;
}
if (IpInstance->Groups != NULL) {
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
IpInstance->Groups = NULL;
IpInstance->GroupCount = 0;
}
@@ -845,7 +845,7 @@ EfiIp4Configure (
}
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Validate the configuration first.
@@ -860,8 +860,8 @@ EfiIp4Configure (
}
- NetCopyMem (&IpAddress, &IpConfigData->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&SubnetMask, &IpConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&IpAddress, &IpConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&SubnetMask, &IpConfigData->SubnetMask, sizeof (IP4_ADDR));
IpAddress = NTOHL (IpAddress);
SubnetMask = NTOHL (SubnetMask);
@@ -935,7 +935,7 @@ EfiIp4Configure (
Ip4SetVariableData (IpInstance->Service);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -973,7 +973,7 @@ Ip4Groups (
// host byte order
//
if (JoinFlag) {
- NetCopyMem (&Group, GroupAddress, sizeof (IP4_ADDR));
+ CopyMem (&Group, GroupAddress, sizeof (IP4_ADDR));
for (Index = 0; Index < IpInstance->GroupCount; Index++) {
if (IpInstance->Groups[Index] == Group) {
@@ -988,12 +988,12 @@ Ip4Groups (
}
if (EFI_ERROR (Ip4JoinGroup (IpInstance, NTOHL (Group)))) {
- NetFreePool (Members);
+ gBS->FreePool (Members);
return EFI_DEVICE_ERROR;
}
if (IpInstance->Groups != NULL) {
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
}
IpInstance->Groups = Members;
@@ -1021,7 +1021,7 @@ Ip4Groups (
if (IpInstance->GroupCount == 0) {
ASSERT (Index == 1);
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
IpInstance->Groups = NULL;
}
@@ -1069,7 +1069,7 @@ EfiIp4Groups (
}
if (GroupAddress != NULL) {
- NetCopyMem (&McastIp, GroupAddress, sizeof (IP4_ADDR));
+ CopyMem (&McastIp, GroupAddress, sizeof (IP4_ADDR));
if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
return EFI_INVALID_PARAMETER;
@@ -1077,7 +1077,7 @@ EfiIp4Groups (
}
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1092,7 +1092,7 @@ EfiIp4Groups (
Status = Ip4Groups (IpInstance, JoinFlag, GroupAddress);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1140,7 +1140,7 @@ EfiIp4Routes (
}
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1152,9 +1152,9 @@ EfiIp4Routes (
goto ON_EXIT;
}
- NetCopyMem (&Dest, SubnetAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Netmask, SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&Nexthop, GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Dest, SubnetAddress, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Nexthop, GatewayAddress, sizeof (IP4_ADDR));
Dest = NTOHL (Dest);
Netmask = NTOHL (Netmask);
@@ -1185,7 +1185,7 @@ EfiIp4Routes (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1301,8 +1301,8 @@ Ip4TxTokenValid (
if (TxData->OverrideData) {
Override = TxData->OverrideData;
- NetCopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Gateway, &Override->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&Gateway, &Override->GatewayAddress, sizeof (IP4_ADDR));
Src = NTOHL (Src);
Gateway = NTOHL (Gateway);
@@ -1395,7 +1395,7 @@ Ip4FreeTxToken (
NetLibDispatchDpc ();
}
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -1490,7 +1490,7 @@ EfiIp4Transmit (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
IpSb = IpInstance->Service;
IpIf = IpInstance->Interface;
@@ -1524,7 +1524,7 @@ EfiIp4Transmit (
//
TxData = Token->Packet.TxData;
- NetCopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));
Head.Dst = NTOHL (Head.Dst);
if (TxData->OverrideData) {
@@ -1534,8 +1534,8 @@ EfiIp4Transmit (
Head.Ttl = Override->TimeToLive;
DontFragment = Override->DoNotFragment;
- NetCopyMem (&Head.Src, &Override->SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&GateWay, &Override->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Head.Src, &Override->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&GateWay, &Override->GatewayAddress, sizeof (IP4_ADDR));
Head.Src = NTOHL (Head.Src);
GateWay = NTOHL (GateWay);
@@ -1564,7 +1564,7 @@ EfiIp4Transmit (
// a IP4_TXTOKEN_WRAP and the data in a netbuf
//
Status = EFI_OUT_OF_RESOURCES;
- Wrap = NetAllocatePool (sizeof (IP4_TXTOKEN_WRAP));
+ Wrap = AllocatePool (sizeof (IP4_TXTOKEN_WRAP));
if (Wrap == NULL) {
goto ON_EXIT;
}
@@ -1583,7 +1583,7 @@ EfiIp4Transmit (
);
if (Wrap->Packet == NULL) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
goto ON_EXIT;
}
@@ -1623,7 +1623,7 @@ EfiIp4Transmit (
}
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1665,7 +1665,7 @@ EfiIp4Receive (
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1673,18 +1673,6 @@ EfiIp4Receive (
}
//
- // Current Udp implementation creates an IP child for each Udp child.
- // It initates a asynchronous receive immediately no matter whether
- // there is no mapping or not. Disable this for now.
- //
-#if 0
- if (Config->UseDefaultAddress && IP4_NO_MAPPING (IpInstance)) {
- Status = EFI_NO_MAPPING;
- goto ON_EXIT;
- }
-#endif
-
- //
// Check whether the toke is already on the receive queue.
//
Status = NetMapIterate (&IpInstance->RxTokens, Ip4TokenExist, Token);
@@ -1712,7 +1700,7 @@ EfiIp4Receive (
NetLibDispatchDpc ();
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1931,7 +1919,7 @@ EfiIp4Cancel (
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1946,7 +1934,7 @@ EfiIp4Cancel (
Status = Ip4Cancel (IpInstance, Token);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
index 94b4534de2..fa7eff97f9 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
@@ -103,7 +103,7 @@ typedef struct {
// fragments will be freed at last.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
IP4_PROTOCOL *IpInstance;
NET_BUF *Packet;
EFI_IP4_RECEIVE_DATA RxData;
@@ -117,15 +117,15 @@ struct _IP4_PROTOCOL {
INTN State;
IP4_SERVICE *Service;
- NET_LIST_ENTRY Link; // Link to all the IP protocol from the service
+ LIST_ENTRY Link; // Link to all the IP protocol from the service
//
// User's transmit/receive tokens, and received/deliverd packets
//
NET_MAP RxTokens;
NET_MAP TxTokens; // map between (User's Token, IP4_TXTOKE_WRAP)
- NET_LIST_ENTRY Received; // Received but not delivered packet
- NET_LIST_ENTRY Delivered; // Delivered and to be recycled packets
+ LIST_ENTRY Received; // Received but not delivered packet
+ LIST_ENTRY Delivered; // Delivered and to be recycled packets
EFI_LOCK RecycleLock;
//
@@ -134,7 +134,7 @@ struct _IP4_PROTOCOL {
// is used to communicate the current route info to the upper layer.
//
IP4_INTERFACE *Interface;
- NET_LIST_ENTRY AddrLink; // Ip instances with the same IP address.
+ LIST_ENTRY AddrLink; // Ip instances with the same IP address.
IP4_ROUTE_TABLE *RouteTable;
EFI_IP4_ROUTE_TABLE *EfiRouteTable;
@@ -161,9 +161,9 @@ struct _IP4_SERVICE {
// interface and route table and caches.
//
UINTN NumChildren;
- NET_LIST_ENTRY Children;
+ LIST_ENTRY Children;
- NET_LIST_ENTRY Interfaces;
+ LIST_ENTRY Interfaces;
IP4_INTERFACE *DefaultInterface;
IP4_ROUTE_TABLE *DefaultRouteTable;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
index 06a0110315..9498d056e1 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2005 - 2007, Intel Corporation
+Copyright (c) 2005 - 2007, 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
@@ -49,14 +49,14 @@ Ip4CreateAssembleEntry (
IP4_ASSEMBLE_ENTRY *Assemble;
- Assemble = NetAllocatePool (sizeof (IP4_ASSEMBLE_ENTRY));
+ Assemble = AllocatePool (sizeof (IP4_ASSEMBLE_ENTRY));
if (Assemble == NULL) {
return NULL;
}
- NetListInit (&Assemble->Link);
- NetListInit (&Assemble->Fragments);
+ InitializeListHead (&Assemble->Link);
+ InitializeListHead (&Assemble->Fragments);
Assemble->Dst = Dst;
Assemble->Src = Src;
@@ -86,18 +86,18 @@ Ip4FreeAssembleEntry (
IN IP4_ASSEMBLE_ENTRY *Assemble
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
NET_BUF *Fragment;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Assemble->Fragments) {
Fragment = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Fragment);
}
- NetFreePool (Assemble);
+ gBS->FreePool (Assemble);
}
@@ -118,7 +118,7 @@ Ip4InitAssembleTable (
UINT32 Index;
for (Index = 0; Index < IP4_ASSEMLE_HASH_SIZE; Index++) {
- NetListInit (&Table->Bucket[Index]);
+ InitializeListHead (&Table->Bucket[Index]);
}
}
@@ -137,8 +137,8 @@ Ip4CleanAssembleTable (
IN IP4_ASSEMBLE_TABLE *Table
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ASSEMBLE_ENTRY *Assemble;
UINT32 Index;
@@ -146,7 +146,7 @@ Ip4CleanAssembleTable (
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Table->Bucket[Index]) {
Assemble = NET_LIST_USER_STRUCT (Entry, IP4_ASSEMBLE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeAssembleEntry (Assemble);
}
}
@@ -242,9 +242,9 @@ Ip4Reassemble (
IP4_CLIP_INFO *This;
IP4_CLIP_INFO *Node;
IP4_ASSEMBLE_ENTRY *Assemble;
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Prev;
- NET_LIST_ENTRY *Cur;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Prev;
+ LIST_ENTRY *Cur;
NET_BUF *Fragment;
NET_BUF *NewPacket;
INTN Index;
@@ -284,7 +284,7 @@ Ip4Reassemble (
goto DROP;
}
- NetListInsertHead (&Table->Bucket[Index], &Assemble->Link);
+ InsertHeadList (&Table->Bucket[Index], &Assemble->Link);
}
//
@@ -344,7 +344,7 @@ Ip4Reassemble (
if (Node->End <= This->End) {
Cur = Cur->ForwardLink;
- NetListRemoveEntry (&Fragment->List);
+ RemoveEntryList (&Fragment->List);
Assemble->CurLen -= Node->Length;
NetbufFree (Fragment);
@@ -359,7 +359,7 @@ Ip4Reassemble (
//
if (Node->Start < This->End) {
if (This->Start == Node->Start) {
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
goto DROP;
}
@@ -404,7 +404,7 @@ Ip4Reassemble (
//
if ((Assemble->TotalLen != 0) && (Assemble->CurLen >= Assemble->TotalLen)) {
- NetListRemoveEntry (&Assemble->Link);
+ RemoveEntryList (&Assemble->Link);
//
// If the packet is properly formated, the last fragment's End
@@ -779,7 +779,7 @@ Ip4InstanceEnquePacket (
Info = IP4_GET_CLIP_INFO (Clone);
Info->Life = IP4_US_TO_SEC (IpInstance->ConfigData.ReceiveTimeout);
- NetListInsertTail (&IpInstance->Received, &Clone->List);
+ InsertTailList (&IpInstance->Received, &Clone->List);
return EFI_SUCCESS;
}
@@ -807,15 +807,15 @@ Ip4OnRecyclePacket (
Wrap = (IP4_RXDATA_WRAP *) Context;
- NET_TRYLOCK (&Wrap->IpInstance->RecycleLock);
- NetListRemoveEntry (&Wrap->Link);
- NET_UNLOCK (&Wrap->IpInstance->RecycleLock);
+ EfiAcquireLockOrFail (&Wrap->IpInstance->RecycleLock);
+ RemoveEntryList (&Wrap->Link);
+ EfiReleaseLock (&Wrap->IpInstance->RecycleLock);
ASSERT (!NET_BUF_SHARED (Wrap->Packet));
NetbufFree (Wrap->Packet);
gBS->CloseEvent (Wrap->RxData.RecycleSignal);
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -843,30 +843,30 @@ Ip4WrapRxData (
EFI_IP4_RECEIVE_DATA *RxData;
EFI_STATUS Status;
- Wrap = NetAllocatePool (IP4_RXDATA_WRAP_SIZE (Packet->BlockOpNum));
+ Wrap = AllocatePool (IP4_RXDATA_WRAP_SIZE (Packet->BlockOpNum));
if (Wrap == NULL) {
return NULL;
}
- NetListInit (&Wrap->Link);
+ InitializeListHead (&Wrap->Link);
Wrap->IpInstance = IpInstance;
Wrap->Packet = Packet;
RxData = &Wrap->RxData;
- NetZeroMem (&RxData->TimeStamp, sizeof (EFI_TIME));
+ ZeroMem (&RxData->TimeStamp, sizeof (EFI_TIME));
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_RECYCLE,
+ TPL_NOTIFY,
Ip4OnRecyclePacket,
Wrap,
&RxData->RecycleSignal
);
if (EFI_ERROR (Status)) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
return NULL;
}
@@ -925,7 +925,7 @@ Ip4InstanceDeliverPacket (
//
// Deliver a packet if there are both a packet and a receive token.
//
- while (!NetListIsEmpty (&IpInstance->Received) &&
+ while (!IsListEmpty (&IpInstance->Received) &&
!NetMapIsEmpty (&IpInstance->RxTokens)) {
Packet = NET_LIST_HEAD (&IpInstance->Received, NET_BUF, List);
@@ -940,7 +940,7 @@ Ip4InstanceDeliverPacket (
return EFI_OUT_OF_RESOURCES;
}
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
} else {
//
@@ -960,7 +960,7 @@ Ip4InstanceDeliverPacket (
Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
Dup->Ip = (IP4_HEAD *) Head;
- NetCopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);
+ CopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);
NetbufTrim (Dup, IP4_MAX_HEADLEN, TRUE);
Wrap = Ip4WrapRxData (IpInstance, Dup);
@@ -970,7 +970,7 @@ Ip4InstanceDeliverPacket (
return EFI_OUT_OF_RESOURCES;
}
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
NetbufFree (Packet);
Packet = Dup;
@@ -980,9 +980,9 @@ Ip4InstanceDeliverPacket (
// Insert it into the delivered packet, then get a user's
// receive token, pass the wrapped packet up.
//
- NET_TRYLOCK (&IpInstance->RecycleLock);
- NetListInsertHead (&IpInstance->Delivered, &Wrap->Link);
- NET_UNLOCK (&IpInstance->RecycleLock);
+ EfiAcquireLockOrFail (&IpInstance->RecycleLock);
+ InsertHeadList (&IpInstance->Delivered, &Wrap->Link);
+ EfiReleaseLock (&IpInstance->RecycleLock);
Token = NetMapRemoveHead (&IpInstance->RxTokens, NULL);
Token->Status = IP4_GET_CLIP_INFO (Packet)->Status;
@@ -1017,7 +1017,7 @@ Ip4InterfaceEnquePacket (
{
IP4_PROTOCOL *IpInstance;
IP4_CLIP_INFO *Info;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
INTN Enqueued;
INTN LocalType;
INTN SavedType;
@@ -1103,7 +1103,7 @@ Ip4InterfaceDeliverPacket (
)
{
IP4_PROTOCOL *Ip4Instance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_LIST_FOR_EACH (Entry, &IpIf->IpInstances) {
Ip4Instance = NET_LIST_USER_STRUCT (Entry, IP4_PROTOCOL, AddrLink);
@@ -1139,7 +1139,7 @@ Ip4Demultiplex (
IN NET_BUF *Packet
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Enqueued;
@@ -1193,9 +1193,9 @@ Ip4PacketTimerTicking (
IN IP4_SERVICE *IpSb
)
{
- NET_LIST_ENTRY *InstanceEntry;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *InstanceEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_PROTOCOL *IpInstance;
IP4_ASSEMBLE_ENTRY *Assemble;
NET_BUF *Packet;
@@ -1211,7 +1211,7 @@ Ip4PacketTimerTicking (
Assemble = NET_LIST_USER_STRUCT (Entry, IP4_ASSEMBLE_ENTRY, Link);
if ((Assemble->Life > 0) && (--Assemble->Life == 0)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeAssembleEntry (Assemble);
}
}
@@ -1228,7 +1228,7 @@ Ip4PacketTimerTicking (
Info = IP4_GET_CLIP_INFO (Packet);
if ((Info->Life > 0) && (--Info->Life == 0)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Packet);
}
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
index af8ed1adf3..d44029d085 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
@@ -54,7 +54,7 @@ typedef struct {
// Structure used to assemble IP packets.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
//
// Identity of one IP4 packet. Each fragment of a packet has
@@ -67,7 +67,7 @@ typedef struct {
INTN TotalLen;
INTN CurLen;
- NET_LIST_ENTRY Fragments; // List of all the fragments of this packet
+ LIST_ENTRY Fragments; // List of all the fragments of this packet
IP4_HEAD *Head; // IP head of the first fragment
IP4_CLIP_INFO *Info; // Per packet info of the first fragment
@@ -80,7 +80,7 @@ typedef struct {
// as hash table.
//
typedef struct {
- NET_LIST_ENTRY Bucket[IP4_ASSEMLE_HASH_SIZE];
+ LIST_ENTRY Bucket[IP4_ASSEMLE_HASH_SIZE];
} IP4_ASSEMBLE_TABLE;
#define IP4_GET_CLIP_INFO(Packet) ((IP4_CLIP_INFO *) ((Packet)->ProtoData))
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c
index 322166f657..f3caf6e03d 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c
@@ -181,7 +181,7 @@ Ip4CopyOption (
// don't copy options that is only valid for the first fragment
//
if (FirstFragment || (Type & IP4_OPTION_COPY_MASK)) {
- NetCopyMem (OptBuf + Next, Option + Cur, Len);
+ CopyMem (OptBuf + Next, Option + Cur, Len);
Next += Len;
}
@@ -224,8 +224,8 @@ Ip4CopyOption (
// Copy the option to the Buf, zero the buffer first to pad
// the options with NOP to align to 4 bytes.
//
- NetZeroMem (Buf, Len);
- NetCopyMem (Buf, OptBuf, Next);
+ ZeroMem (Buf, Len);
+ CopyMem (Buf, OptBuf, Next);
*BufLen = Len;
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c
index 8aec74ddce..1a925cf936 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c
@@ -118,7 +118,7 @@ Ip4SelectInterface (
{
IP4_INTERFACE *IpIf;
IP4_INTERFACE *Selected;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
//
// Select the interface the Dst is on if one of the connected
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
index 54d934250f..fed1983515 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
@@ -44,13 +44,13 @@ Ip4CreateRouteEntry (
{
IP4_ROUTE_ENTRY *RtEntry;
- RtEntry = NetAllocatePool (sizeof (IP4_ROUTE_ENTRY));
+ RtEntry = AllocatePool (sizeof (IP4_ROUTE_ENTRY));
if (RtEntry == NULL) {
return NULL;
}
- NetListInit (&RtEntry->Link);
+ InitializeListHead (&RtEntry->Link);
RtEntry->RefCnt = 1;
RtEntry->Dest = Dest;
@@ -79,7 +79,7 @@ Ip4FreeRouteEntry (
ASSERT (RtEntry->RefCnt > 0);
if (--RtEntry->RefCnt == 0) {
- NetFreePool (RtEntry);
+ gBS->FreePool (RtEntry);
}
}
@@ -108,13 +108,13 @@ Ip4CreateRouteCacheEntry (
{
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
- RtCacheEntry = NetAllocatePool (sizeof (IP4_ROUTE_CACHE_ENTRY));
+ RtCacheEntry = AllocatePool (sizeof (IP4_ROUTE_CACHE_ENTRY));
if (RtCacheEntry == NULL) {
return NULL;
}
- NetListInit (&RtCacheEntry->Link);
+ InitializeListHead (&RtCacheEntry->Link);
RtCacheEntry->RefCnt = 1;
RtCacheEntry->Dest = Dst;
@@ -142,7 +142,7 @@ Ip4FreeRouteCacheEntry (
ASSERT (RtCacheEntry->RefCnt > 0);
if (--RtCacheEntry->RefCnt == 0) {
- NetFreePool (RtCacheEntry);
+ gBS->FreePool (RtCacheEntry);
}
}
@@ -163,7 +163,7 @@ Ip4InitRouteCache (
UINT32 Index;
for (Index = 0; Index < IP4_ROUTE_CACHE_HASH; Index++) {
- NetListInit (&(RtCache->CacheBucket[Index]));
+ InitializeListHead (&(RtCache->CacheBucket[Index]));
}
}
@@ -182,8 +182,8 @@ Ip4CleanRouteCache (
IN IP4_ROUTE_CACHE *RtCache
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -191,7 +191,7 @@ Ip4CleanRouteCache (
NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtCache->CacheBucket[Index])) {
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (RtCacheEntry);
}
}
@@ -216,7 +216,7 @@ Ip4CreateRouteTable (
IP4_ROUTE_TABLE *RtTable;
UINT32 Index;
- RtTable = NetAllocatePool (sizeof (IP4_ROUTE_TABLE));
+ RtTable = AllocatePool (sizeof (IP4_ROUTE_TABLE));
if (RtTable == NULL) {
return NULL;
@@ -226,7 +226,7 @@ Ip4CreateRouteTable (
RtTable->TotalNum = 0;
for (Index = 0; Index < IP4_MASK_NUM; Index++) {
- NetListInit (&(RtTable->RouteArea[Index]));
+ InitializeListHead (&(RtTable->RouteArea[Index]));
}
RtTable->Next = NULL;
@@ -250,8 +250,8 @@ Ip4FreeRouteTable (
IN IP4_ROUTE_TABLE *RtTable
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_ENTRY *RtEntry;
UINT32 Index;
@@ -268,14 +268,14 @@ Ip4FreeRouteTable (
NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtTable->RouteArea[Index])) {
RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteEntry (RtEntry);
}
}
Ip4CleanRouteCache (&RtTable->Cache);
- NetFreePool (RtTable);
+ gBS->FreePool (RtTable);
}
@@ -299,8 +299,8 @@ Ip4PurgeRouteCache (
IN UINTN Tag
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -310,7 +310,7 @@ Ip4PurgeRouteCache (
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
if (RtCacheEntry->Tag == Tag) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (RtCacheEntry);
}
}
@@ -340,8 +340,8 @@ Ip4AddRoute (
IN IP4_ADDR Gateway
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
IP4_ROUTE_ENTRY *RtEntry;
//
@@ -374,7 +374,7 @@ Ip4AddRoute (
RtEntry->Flag = IP4_DIRECT_ROUTE;
}
- NetListInsertHead (Head, &RtEntry->Link);
+ InsertHeadList (Head, &RtEntry->Link);
RtTable->TotalNum++;
return EFI_SUCCESS;
@@ -402,9 +402,9 @@ Ip4DelRoute (
IN IP4_ADDR Gateway
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_ENTRY *RtEntry;
Head = &(RtTable->RouteArea[NetGetMaskLength (Netmask)]);
@@ -414,7 +414,7 @@ Ip4DelRoute (
if (IP4_NET_EQUAL (RtEntry->Dest, Dest, Netmask) && (RtEntry->NextHop == Gateway)) {
Ip4PurgeRouteCache (&RtTable->Cache, (UINTN) RtEntry);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteEntry (RtEntry);
RtTable->TotalNum--;
@@ -447,7 +447,7 @@ Ip4FindRouteCache (
IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -489,7 +489,7 @@ Ip4FindRouteEntry (
IN IP4_ADDR Dst
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_ENTRY *RtEntry;
IP4_ROUTE_TABLE *Table;
INTN Index;
@@ -533,9 +533,9 @@ Ip4Route (
IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
IP4_ROUTE_CACHE_ENTRY *Cache;
IP4_ROUTE_ENTRY *RtEntry;
@@ -551,8 +551,8 @@ Ip4Route (
// If found, promote the cache entry to the head of the hash bucket. LRU
//
if (RtCacheEntry != NULL) {
- NetListRemoveEntry (&RtCacheEntry->Link);
- NetListInsertHead (Head, &RtCacheEntry->Link);
+ RemoveEntryList (&RtCacheEntry->Link);
+ InsertHeadList (Head, &RtCacheEntry->Link);
return RtCacheEntry;
}
@@ -588,7 +588,7 @@ Ip4Route (
return NULL;
}
- NetListInsertHead (Head, &RtCacheEntry->Link);
+ InsertHeadList (Head, &RtCacheEntry->Link);
NET_GET_REF (RtCacheEntry);
//
@@ -604,7 +604,7 @@ Ip4Route (
Cache = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (Cache);
}
@@ -628,7 +628,7 @@ Ip4BuildEfiRouteTable (
IN IP4_PROTOCOL *IpInstance
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_TABLE *RtTable;
IP4_ROUTE_ENTRY *RtEntry;
EFI_IP4_ROUTE_TABLE *Table;
@@ -638,7 +638,7 @@ Ip4BuildEfiRouteTable (
RtTable = IpInstance->RouteTable;
if (IpInstance->EfiRouteTable != NULL) {
- NetFreePool (IpInstance->EfiRouteTable);
+ gBS->FreePool (IpInstance->EfiRouteTable);
IpInstance->EfiRouteTable = NULL;
IpInstance->EfiRouteCount = 0;
@@ -654,7 +654,7 @@ Ip4BuildEfiRouteTable (
return EFI_SUCCESS;
}
- Table = NetAllocatePool (sizeof (EFI_IP4_ROUTE_TABLE) * Count);
+ Table = AllocatePool (sizeof (EFI_IP4_ROUTE_TABLE) * Count);
if (Table == NULL) {
return EFI_OUT_OF_RESOURCES;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h
index fdf40ca5bf..44024a2839 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h
@@ -43,7 +43,7 @@ enum {
// enties of the connected network have the flag on.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Dest;
IP4_ADDR Netmask;
@@ -62,7 +62,7 @@ typedef struct {
// to-be-deleted route entry.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Dest;
IP4_ADDR Src;
@@ -78,7 +78,7 @@ typedef struct {
// detach them later.
//
typedef struct {
- NET_LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH];
+ LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH];
} IP4_ROUTE_CACHE;
//
@@ -94,7 +94,7 @@ typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE;
struct _IP4_ROUTE_TABLE {
INTN RefCnt;
UINT32 TotalNum;
- NET_LIST_ENTRY RouteArea[IP4_MASK_NUM];
+ LIST_ENTRY RouteArea[IP4_MASK_NUM];
IP4_ROUTE_TABLE *Next;
IP4_ROUTE_CACHE Cache;
};
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;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
index f6f431de68..5886b94351 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
@@ -151,7 +151,7 @@ Mtftp4CreateService (
EFI_STATUS Status;
*Service = NULL;
- MtftpSb = NetAllocatePool (sizeof (MTFTP4_SERVICE));
+ MtftpSb = AllocatePool (sizeof (MTFTP4_SERVICE));
if (MtftpSb == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -161,7 +161,7 @@ Mtftp4CreateService (
MtftpSb->ServiceBinding = gMtftp4ServiceBindingTemplete;
MtftpSb->InDestory = FALSE;
MtftpSb->ChildrenNum = 0;
- NetListInit (&MtftpSb->Children);
+ InitializeListHead (&MtftpSb->Children);
MtftpSb->Timer = NULL;
MtftpSb->TimerToGetMap = NULL;
@@ -174,14 +174,14 @@ Mtftp4CreateService (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
Mtftp4OnTimerTick,
MtftpSb,
&MtftpSb->Timer
);
if (EFI_ERROR (Status)) {
- NetFreePool (MtftpSb);
+ gBS->FreePool (MtftpSb);
return Status;
}
@@ -191,14 +191,14 @@ Mtftp4CreateService (
//
Status = gBS->CreateEvent (
EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
NULL,
NULL,
&MtftpSb->TimerToGetMap
);
if (EFI_ERROR (Status)) {
gBS->CloseEvent (MtftpSb->Timer);
- NetFreePool (MtftpSb);
+ gBS->FreePool (MtftpSb);
return Status;
}
@@ -207,7 +207,7 @@ Mtftp4CreateService (
if (MtftpSb->ConnectUdp == NULL) {
gBS->CloseEvent (MtftpSb->TimerToGetMap);
gBS->CloseEvent (MtftpSb->Timer);
- NetFreePool (MtftpSb);
+ gBS->FreePool (MtftpSb);
return EFI_DEVICE_ERROR;
}
@@ -306,7 +306,7 @@ Mtftp4DriverBindingStart (
ON_ERROR:
Mtftp4CleanService (MtftpSb);
- NetFreePool (MtftpSb);
+ gBS->FreePool (MtftpSb);
return Status;
}
@@ -370,7 +370,7 @@ Mtftp4DriverBindingStop (
return EFI_SUCCESS;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (NumberOfChildren == 0) {
@@ -384,10 +384,10 @@ Mtftp4DriverBindingStop (
Mtftp4CleanService (MtftpSb);
- NetFreePool (MtftpSb);
+ gBS->FreePool (MtftpSb);
} else {
- while (!NetListIsEmpty (&MtftpSb->Children)) {
+ while (!IsListEmpty (&MtftpSb->Children)) {
Instance = NET_LIST_HEAD (&MtftpSb->Children, MTFTP4_PROTOCOL, Link);
Mtftp4ServiceBindingDestroyChild (ServiceBinding, Instance->Handle);
}
@@ -397,7 +397,7 @@ Mtftp4DriverBindingStop (
}
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -417,16 +417,16 @@ Mtftp4InitProtocol (
IN MTFTP4_PROTOCOL *Instance
)
{
- NetZeroMem (Instance, sizeof (MTFTP4_PROTOCOL));
+ ZeroMem (Instance, sizeof (MTFTP4_PROTOCOL));
Instance->Signature = MTFTP4_PROTOCOL_SIGNATURE;
- NetListInit (&Instance->Link);
+ InitializeListHead (&Instance->Link);
CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4));
Instance->State = MTFTP4_STATE_UNCONFIGED;
Instance->Indestory = FALSE;
Instance->Service = MtftpSb;
- NetListInit (&Instance->Blocks);
+ InitializeListHead (&Instance->Blocks);
}
@@ -458,7 +458,7 @@ Mtftp4ServiceBindingCreateChild (
return EFI_INVALID_PARAMETER;
}
- Instance = NetAllocatePool (sizeof (*Instance));
+ Instance = AllocatePool (sizeof (*Instance));
if (Instance == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -476,7 +476,7 @@ Mtftp4ServiceBindingCreateChild (
);
if (Instance->UnicastPort == NULL) {
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_OUT_OF_RESOURCES;
}
@@ -521,18 +521,18 @@ Mtftp4ServiceBindingCreateChild (
//
// Add it to the parent's child list.
//
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- NetListInsertTail (&MtftpSb->Children, &Instance->Link);
+ InsertTailList (&MtftpSb->Children, &Instance->Link);
MtftpSb->ChildrenNum++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
ON_ERROR:
if (EFI_ERROR (Status)) {
UdpIoFreePort (Instance->UnicastPort);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
}
return Status;
@@ -620,16 +620,16 @@ Mtftp4ServiceBindingDestroyChild (
return Status;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Mtftp4CleanOperation (Instance, EFI_DEVICE_ERROR);
UdpIoFreePort (Instance->UnicastPort);
- NetListRemoveEntry (&Instance->Link);
+ RemoveEntryList (&Instance->Link);
MtftpSb->ChildrenNum--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
index 0bd835b7b9..3c2b4e1019 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
@@ -56,7 +56,7 @@ EfiMtftp4GetModeData (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
CopyMem(&ModeData->ConfigData, &Instance->Config, sizeof (Instance->Config));
@@ -65,7 +65,7 @@ EfiMtftp4GetModeData (
ModeData->UnsupportedOptionCount = 0;
ModeData->UnsupportedOptoins = NULL;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -87,8 +87,8 @@ Mtftp4CleanOperation (
IN EFI_STATUS Result
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
MTFTP4_BLOCK_RANGE *Block;
EFI_MTFTP4_TOKEN *Token;
@@ -122,11 +122,11 @@ Mtftp4CleanOperation (
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Instance->Blocks) {
Block = NET_LIST_USER_STRUCT (Entry, MTFTP4_BLOCK_RANGE, Link);
- NetListRemoveEntry (Entry);
- NetFreePool (Block);
+ RemoveEntryList (Entry);
+ gBS->FreePool (Block);
}
- NetZeroMem (&Instance->RequestOption, sizeof (MTFTP4_OPTION));
+ ZeroMem (&Instance->RequestOption, sizeof (MTFTP4_OPTION));
Instance->Operation = 0;
@@ -183,22 +183,22 @@ EfiMtftp4Configure (
//
// Reset the operation if ConfigData is NULL
//
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Mtftp4CleanOperation (Instance, EFI_ABORTED);
- NetZeroMem (&Instance->Config, sizeof (EFI_MTFTP4_CONFIG_DATA));
+ ZeroMem (&Instance->Config, sizeof (EFI_MTFTP4_CONFIG_DATA));
Instance->State = MTFTP4_STATE_UNCONFIGED;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
} else {
//
// Configure the parameters for new operation.
//
- NetCopyMem (&Ip, &ConfigData->StationIp, sizeof (IP4_ADDR));
- NetCopyMem (&Netmask, &ConfigData->SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&Gateway, &ConfigData->GatewayIp, sizeof (IP4_ADDR));
- NetCopyMem (&ServerIp, &ConfigData->ServerIp, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &ConfigData->StationIp, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, &ConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Gateway, &ConfigData->GatewayIp, sizeof (IP4_ADDR));
+ CopyMem (&ServerIp, &ConfigData->ServerIp, sizeof (IP4_ADDR));
Ip = NTOHL (Ip);
Netmask = NTOHL (Netmask);
@@ -221,17 +221,17 @@ EfiMtftp4Configure (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if ((Instance->State == MTFTP4_STATE_CONFIGED) && (Instance->Operation != 0)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_ACCESS_DENIED;
}
CopyMem(&Instance->Config, ConfigData, sizeof (*ConfigData));;
Instance->State = MTFTP4_STATE_CONFIGED;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
return EFI_SUCCESS;
@@ -287,7 +287,7 @@ Mtftp4GetInfoCheckPacket (
//
// Allocate buffer then copy the packet over. Use gBS->AllocatePool
- // in case NetAllocatePool will implements something tricky.
+ // in case AllocatePool will implements something tricky.
//
Status = gBS->AllocatePool (EfiBootServicesData, PacketLen, (VOID **) State->Packet);
@@ -297,7 +297,7 @@ Mtftp4GetInfoCheckPacket (
}
*(State->PacketLen) = PacketLen;
- NetCopyMem (*(State->Packet), Packet, PacketLen);
+ CopyMem (*(State->Packet), Packet, PacketLen);
return EFI_ABORTED;
}
@@ -456,19 +456,19 @@ Mtftp4OverrideValid (
IP4_ADDR Netmask;
IP4_ADDR Gateway;
- NetCopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));
if (!Ip4IsUnicast (NTOHL (Ip), 0)) {
return FALSE;
}
Config = &Instance->Config;
- NetCopyMem (&Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
+ CopyMem (&Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
Gateway = NTOHL (Gateway);
if (!Config->UseDefaultSetting && (Gateway != 0)) {
- NetCopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&Ip, &Config->StationIp, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &Config->StationIp, sizeof (IP4_ADDR));
Netmask = NTOHL (Netmask);
Ip = NTOHL (Ip);
@@ -577,7 +577,7 @@ Mtftp4ConfigUnicastPort (
UdpConfig.RemotePort = 0;
Ip = HTONL (Instance->ServerIp);
- NetCopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Status = UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfig);
@@ -654,7 +654,7 @@ Mtftp4Start (
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State != MTFTP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -665,7 +665,7 @@ Mtftp4Start (
}
if (EFI_ERROR (Status)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -701,13 +701,13 @@ Mtftp4Start (
Instance->Token = Token;
Instance->BlkSize = MTFTP4_DEFAULT_BLKSIZE;
- NetCopyMem (&Instance->ServerIp, &Config->ServerIp, sizeof (IP4_ADDR));
+ CopyMem (&Instance->ServerIp, &Config->ServerIp, sizeof (IP4_ADDR));
Instance->ServerIp = NTOHL (Instance->ServerIp);
Instance->ListeningPort = Config->InitialServerPort;
Instance->ConnectedPort = 0;
- NetCopyMem (&Instance->Gateway, &Config->GatewayIp, sizeof (IP4_ADDR));
+ CopyMem (&Instance->Gateway, &Config->GatewayIp, sizeof (IP4_ADDR));
Instance->Gateway = NTOHL (Instance->Gateway);
Instance->MaxRetry = Config->TryCount;
@@ -715,8 +715,8 @@ Mtftp4Start (
Instance->Master = TRUE;
if (Override != NULL) {
- NetCopyMem (&Instance->ServerIp, &Override->ServerIp, sizeof (IP4_ADDR));
- NetCopyMem (&Instance->Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
+ CopyMem (&Instance->ServerIp, &Override->ServerIp, sizeof (IP4_ADDR));
+ CopyMem (&Instance->Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
Instance->ServerIp = NTOHL (Instance->ServerIp);
Instance->Gateway = NTOHL (Instance->Gateway);
@@ -756,7 +756,7 @@ Mtftp4Start (
Status = Mtftp4RrqStart (Instance, Operation);
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -779,7 +779,7 @@ Mtftp4Start (
ON_ERROR:
Mtftp4CleanOperation (Instance, Status);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
index c12b1dd007..04ca1a1eb3 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
@@ -71,7 +71,7 @@ struct _MTFTP4_SERVICE {
BOOLEAN InDestory;
UINT16 ChildrenNum;
- NET_LIST_ENTRY Children;
+ LIST_ENTRY Children;
EFI_EVENT Timer; // Ticking timer for all the MTFTP clients
EFI_EVENT TimerToGetMap;
@@ -94,7 +94,7 @@ typedef struct {
struct _MTFTP4_PROTOCOL {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
EFI_MTFTP4_PROTOCOL Mtftp4;
INTN State;
@@ -118,7 +118,7 @@ struct _MTFTP4_PROTOCOL {
//
UINT16 BlkSize;
UINT16 LastBlock;
- NET_LIST_ENTRY Blocks;
+ LIST_ENTRY Blocks;
//
// The server's communication end point: IP and two ports. one for
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c
index 64932ae8a2..f413c76305 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c
@@ -167,7 +167,7 @@ Mtftp4ExtractOptions (
return EFI_SUCCESS;
}
- *OptionList = NetAllocatePool (*OptionCount * sizeof (EFI_MTFTP4_OPTION));
+ *OptionList = AllocatePool (*OptionCount * sizeof (EFI_MTFTP4_OPTION));
if (*OptionList == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -537,6 +537,6 @@ Mtftp4ParseOptionOack (
Status = Mtftp4ParseOption (OptionList, Count, FALSE, MtftpOption);
- NetFreePool (OptionList);
+ gBS->FreePool (OptionList);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
index 7c2114e717..f226ac0085 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
@@ -183,7 +183,7 @@ Mtftp4RrqSaveBlock (
Start = MultU64x32 (Block - 1, Instance->BlkSize);
if (Start + DataLen <= Token->BufferSize) {
- NetCopyMem ((UINT8 *) Token->Buffer + Start, Packet->Data.Data, DataLen);
+ CopyMem ((UINT8 *) Token->Buffer + Start, Packet->Data.Data, DataLen);
//
// Update the file size when received the last block
@@ -404,7 +404,7 @@ Mtftp4RrqConfigMcastPort (
UdpConfig.RemotePort = 0;
Ip = HTONL (Instance->ServerIp);
- NetCopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Status = McastIo->Udp->Configure (McastIo->Udp, &UdpConfig);
@@ -428,7 +428,7 @@ Mtftp4RrqConfigMcastPort (
// join the multicast group
//
Ip = HTONL (Instance->McastIp);
- NetCopyMem (&Group, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Group, &Ip, sizeof (EFI_IPv4_ADDRESS));
return McastIo->Udp->Groups (McastIo->Udp, TRUE, &Group);
}
@@ -479,7 +479,7 @@ Mtftp4RrqHandleOack (
//
// Parse and validate the options from server
//
- NetZeroMem (&Reply, sizeof (MTFTP4_OPTION));
+ ZeroMem (&Reply, sizeof (MTFTP4_OPTION));
Status = Mtftp4ParseOptionOack (Packet, Len, &Reply);
@@ -650,7 +650,7 @@ Mtftp4RrqInput (
Len = UdpPacket->TotalSize;
if (UdpPacket->BlockOpNum > 1) {
- Packet = NetAllocatePool (Len);
+ Packet = AllocatePool (Len);
if (Packet == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -726,7 +726,7 @@ ON_EXIT:
// receive, otherwise end the session.
//
if ((Packet != NULL) && (UdpPacket->BlockOpNum > 1)) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
if (UdpPacket != NULL) {
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
index 7cdbddc32d..b17e31c103 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
@@ -42,13 +42,13 @@ Mtftp4AllocateRange (
{
MTFTP4_BLOCK_RANGE *Range;
- Range = NetAllocatePool (sizeof (MTFTP4_BLOCK_RANGE));
+ Range = AllocatePool (sizeof (MTFTP4_BLOCK_RANGE));
if (Range == NULL) {
return NULL;
}
- NetListInit (&Range->Link);
+ InitializeListHead (&Range->Link);
Range->Start = Start;
Range->End = End;
@@ -78,7 +78,7 @@ Mtftp4AllocateRange (
**/
EFI_STATUS
Mtftp4InitBlockRange (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Start,
IN UINT16 End
)
@@ -91,7 +91,7 @@ Mtftp4InitBlockRange (
return EFI_OUT_OF_RESOURCES;
}
- NetListInsertTail (Head, &Range->Link);
+ InsertTailList (Head, &Range->Link);
return EFI_SUCCESS;
}
@@ -106,12 +106,12 @@ Mtftp4InitBlockRange (
**/
INTN
Mtftp4GetNextBlockNum (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
)
{
MTFTP4_BLOCK_RANGE *Range;
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
return -1;
}
@@ -135,7 +135,7 @@ Mtftp4GetNextBlockNum (
**/
VOID
Mtftp4SetLastBlockNum (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Last
)
{
@@ -145,12 +145,12 @@ Mtftp4SetLastBlockNum (
// Iterate from the tail to head to remove the block number
// after the last.
//
- while (!NetListIsEmpty (Head)) {
+ while (!IsListEmpty (Head)) {
Range = NET_LIST_TAIL (Head, MTFTP4_BLOCK_RANGE, Link);
if (Range->Start > Last) {
- NetListRemoveEntry (&Range->Link);
- NetFreePool (Range);
+ RemoveEntryList (&Range->Link);
+ gBS->FreePool (Range);
continue;
}
@@ -176,13 +176,13 @@ Mtftp4SetLastBlockNum (
**/
EFI_STATUS
Mtftp4RemoveBlockNum (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Num
)
{
MTFTP4_BLOCK_RANGE *Range;
MTFTP4_BLOCK_RANGE *NewRange;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_LIST_FOR_EACH (Entry, Head) {
@@ -219,8 +219,8 @@ Mtftp4RemoveBlockNum (
Range->Start++;
if (Range->Start > Range->End) {
- NetListRemoveEntry (&Range->Link);
- NetFreePool (Range);
+ RemoveEntryList (&Range->Link);
+ gBS->FreePool (Range);
}
return EFI_SUCCESS;
@@ -554,8 +554,8 @@ Mtftp4OnTimerTick (
)
{
MTFTP4_SERVICE *MtftpSb;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
MTFTP4_PROTOCOL *Instance;
EFI_MTFTP4_TOKEN *Token;
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h
index 5e5157be64..ddeeac657a 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h
@@ -29,7 +29,7 @@ Abstract:
// the holes are filled in, then the download or upload has completed.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN Start;
INTN End;
} MTFTP4_BLOCK_RANGE;
@@ -37,25 +37,25 @@ typedef struct {
EFI_STATUS
Mtftp4InitBlockRange (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Start,
IN UINT16 End
);
INTN
Mtftp4GetNextBlockNum (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
);
VOID
Mtftp4SetLastBlockNum (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Last
);
EFI_STATUS
Mtftp4RemoveBlockNum (
- IN NET_LIST_ENTRY *Head,
+ IN LIST_ENTRY *Head,
IN UINT16 Num
);
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
index e61b7b59f8..12b4c4a4a1 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
@@ -131,7 +131,7 @@ Mtftp4WrqSendBlock (
if (DataLen > 0) {
NetbufAllocSpace (UdpPacket, DataLen, FALSE);
- NetCopyMem (Packet->Data.Data, (UINT8 *) Token->Buffer + Start, DataLen);
+ CopyMem (Packet->Data.Data, (UINT8 *) Token->Buffer + Start, DataLen);
}
} else {
@@ -162,7 +162,7 @@ Mtftp4WrqSendBlock (
if (DataLen > 0) {
NetbufAllocSpace (UdpPacket, DataLen, FALSE);
- NetCopyMem (Packet->Data.Data, DataBuf, DataLen);
+ CopyMem (Packet->Data.Data, DataBuf, DataLen);
gBS->FreePool (DataBuf);
}
}
@@ -327,7 +327,7 @@ Mtftp4WrqHandleOack (
//
// Parse and validate the options from server
//
- NetZeroMem (&Reply, sizeof (MTFTP4_OPTION));
+ ZeroMem (&Reply, sizeof (MTFTP4_OPTION));
Status = Mtftp4ParseOptionOack (Packet, Len, &Reply);
if (EFI_ERROR (Status) || !Mtftp4WrqOackValid (&Reply, &Instance->RequestOption)) {
@@ -428,7 +428,7 @@ Mtftp4WrqInput (
Len = UdpPacket->TotalSize;
if (UdpPacket->BlockOpNum > 1) {
- Packet = NetAllocatePool (Len);
+ Packet = AllocatePool (Len);
if (Packet == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -502,7 +502,7 @@ ON_EXIT:
// restart the receive, otherwise end the session.
//
if ((Packet != NULL) && (UdpPacket->BlockOpNum > 1)) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
if (UdpPacket != NULL) {
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c
index a59f189f92..fbdeba5d52 100644
--- a/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c
+++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c
@@ -1201,7 +1201,6 @@ BcStart (
return EFI_ALREADY_STARTED;
}
-#if !SUPPORT_IPV6
//
// Fail if IPv6 is requested and not supported.
//
@@ -1210,7 +1209,6 @@ BcStart (
EfiReleaseLock (&Private->Lock);
return EFI_UNSUPPORTED;
}
-#endif
//
// Setup shortcuts to SNP protocol and data structure.
//
@@ -2174,7 +2172,7 @@ PxeBcDriverStart (
if (EFI_ERROR (Status)) {
goto PxeBcError;
}
-
+
//
// Get the Snp interface
//
@@ -2223,12 +2221,8 @@ PxeBcDriverStart (
// implementation supports IPv6.
//
Private->EfiBc.Mode->Ipv6Supported = SUPPORT_IPV6;
-
-#if SUPPORT_IPV6
- Private->EfiBc.Mode->Ipv6Available = Private->NiiPtr->Ipv6Supported;
-#else
Private->EfiBc.Mode->Ipv6Available = FALSE;
-#endif
+
//
// Set to TRUE by the BC constructor if this BC
// implementation supports BIS.
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c
index d9fa36896d..108c2c987e 100644
--- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c
+++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c
@@ -1127,11 +1127,7 @@ MtftpDownload (
// test of MTFTP server to make sure it handles mulitple opens correctly.
// This code should NOT be enabled normally.
//
-#ifdef SpecialNowaitVersion
-#pragma message ("This is special version for MTFTP regression test")
- if (StartBlock || !LastBlock)
-#endif
- if (((Status = MtftpListen (
+ if (((Status = MtftpListen (
Private,
&BufferSize,
BufferPtrLocal,
@@ -1148,7 +1144,7 @@ MtftpDownload (
//
// failed
//
- }
+ }
//
// if none were received, start block is not reset
//
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_udp.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_udp.c
index eb2951abd8..76594f56d7 100644
--- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_udp.c
+++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_udp.c
@@ -320,14 +320,6 @@ UdpRead (
CopyMem (&TmpDestIp, &Private->EfiBc.Mode->StationIp, sizeof (EFI_IP_ADDRESS));
}
-#if SUPPORT_IPV6
- if (Private->EfiBc.Mode->UsingIpv6) {
- //
- // %%TBD
- //
- }
-#endif
-
for (;;) {
*BufferSizeptr = BufferSize;
diff --git a/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4InitSelect.c b/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4InitSelect.c
index b7849d0a87..f6f5fc754c 100644
--- a/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4InitSelect.c
+++ b/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4InitSelect.c
@@ -330,13 +330,6 @@ PxeDhcp4Init (
return EFI_NOT_READY;
}
-#if 0
- if (!is_good_discover (&This->Data->Discover)) {
- //
- // %%TBD - check discover packet fields
- //
- }
-#endif
//
// Get pointer to our instance data.
//
@@ -475,13 +468,6 @@ PxeDhcp4Select (
return EFI_DEVICE_ERROR;
}
-#if 0
- if (!is_good_discover (&This->Data->Discover)) {
- //
- // %%TBD - check discover packet fields
- //
- }
-#endif
//
// Setup useful variables...
//
diff --git a/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/Support.c b/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/Support.c
index 2e750522ca..1406cbb4ad 100644
--- a/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/Support.c
+++ b/MdeModulePkg/Universal/Network/PxeDhcp4Dxe/Support.c
@@ -883,31 +883,6 @@ Returns:
//
// Wait for packet(s)...
//
-#if 0
- if (!client_ip) {
- Aprint ("client_ip == NULL ");
- } else {
- Aprint (
- "client_ip == %d.%d.%d.%d ",
- client_ip->v4.Addr[0],
- client_ip->v4.Addr[1],
- client_ip->v4.Addr[2],
- client_ip->v4.Addr[3]
- );
- }
-
- if (!ServerIp) {
- Aprint ("ServerIp == NULL\n");
- } else {
- Aprint (
- "ServerIp == %d.%d.%d.%d\n",
- ServerIp->v4.Addr[0],
- ServerIp->v4.Addr[1],
- ServerIp->v4.Addr[2],
- ServerIp->v4.Addr[3]
- );
- }
-#endif
done_flag = FALSE;
got_packet = FALSE;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
index 46c6ba492c..b744f68920 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
@@ -262,7 +262,7 @@ SockProcessTcpSndData (
);
if (NULL == SndData) {
- SOCK_DEBUG_ERROR (("SockKProcessSndData: Failed to"
+ DEBUG ((EFI_D_ERROR, "SockKProcessSndData: Failed to"
" call NetBufferFromExt\n"));
return EFI_OUT_OF_RESOURCES;
@@ -316,7 +316,7 @@ STATIC
VOID
SockFlushPendingToken (
IN SOCKET *Sock,
- IN NET_LIST_ENTRY *PendingTokenList
+ IN LIST_ENTRY *PendingTokenList
)
{
SOCK_TOKEN *SockToken;
@@ -324,7 +324,7 @@ SockFlushPendingToken (
ASSERT (Sock && PendingTokenList);
- while (!NetListIsEmpty (PendingTokenList)) {
+ while (!IsListEmpty (PendingTokenList)) {
SockToken = NET_LIST_HEAD (
PendingTokenList,
SOCK_TOKEN,
@@ -334,8 +334,8 @@ SockFlushPendingToken (
Token = SockToken->Token;
SIGNAL_TOKEN (Token, Sock->SockError);
- NetListRemoveEntry (&(SockToken->TokenList));
- NetFreePool (SockToken);
+ RemoveEntryList (&(SockToken->TokenList));
+ gBS->FreePool (SockToken);
}
}
@@ -392,7 +392,7 @@ SockWakeListenToken (
ASSERT (Parent && SOCK_IS_LISTENING (Parent) && SOCK_IS_CONNECTED (Sock));
- if (!NetListIsEmpty (&Parent->ListenTokenList)) {
+ if (!IsListEmpty (&Parent->ListenTokenList)) {
SockToken = NET_LIST_HEAD (
&Parent->ListenTokenList,
SOCK_TOKEN,
@@ -404,14 +404,13 @@ SockWakeListenToken (
SIGNAL_TOKEN (&(ListenToken->CompletionToken), EFI_SUCCESS);
- NetListRemoveEntry (&SockToken->TokenList);
- NetFreePool (SockToken);
+ RemoveEntryList (&SockToken->TokenList);
+ gBS->FreePool (SockToken);
- NetListRemoveEntry (&Sock->ConnectionList);
+ RemoveEntryList (&Sock->ConnectionList);
Parent->ConnCnt--;
- SOCK_DEBUG_WARN (("SockWakeListenToken: accept a socket,"
- "now conncnt is %d", Parent->ConnCnt));
+ DEBUG ((EFI_D_WARN, "SockWakeListenToken: accept a socket, now conncnt is %d", Parent->ConnCnt));
Sock->Parent = NULL;
}
@@ -443,7 +442,7 @@ SockWakeRcvToken (
ASSERT (RcvdBytes > 0);
- while (RcvdBytes > 0 && !NetListIsEmpty (&Sock->RcvTokenList)) {
+ while (RcvdBytes > 0 && !IsListEmpty (&Sock->RcvTokenList)) {
SockToken = NET_LIST_HEAD (
&Sock->RcvTokenList,
@@ -458,8 +457,8 @@ SockWakeRcvToken (
return ;
}
- NetListRemoveEntry (&(SockToken->TokenList));
- NetFreePool (SockToken);
+ RemoveEntryList (&(SockToken->TokenList));
+ gBS->FreePool (SockToken);
RcvdBytes -= TokenRcvdBytes;
}
}
@@ -495,7 +494,7 @@ SockProcessSndToken (
// socket layer flow control policy
//
while ((FreeSpace >= Sock->SndBuffer.LowWater) &&
- !NetListIsEmpty (&Sock->SndTokenList)) {
+ !IsListEmpty (&Sock->SndTokenList)) {
SockToken = NET_LIST_HEAD (
&(Sock->SndTokenList),
@@ -506,8 +505,8 @@ SockProcessSndToken (
//
// process this token
//
- NetListRemoveEntry (&(SockToken->TokenList));
- NetListInsertTail (
+ RemoveEntryList (&(SockToken->TokenList));
+ InsertTailList (
&(Sock->ProcessingSndTokenList),
&(SockToken->TokenList)
);
@@ -538,9 +537,9 @@ SockProcessSndToken (
OnError:
- NetListRemoveEntry (&SockToken->TokenList);
+ RemoveEntryList (&SockToken->TokenList);
SIGNAL_TOKEN (SockToken->Token, Status);
- NetFreePool (SockToken);
+ gBS->FreePool (SockToken);
}
@@ -568,8 +567,9 @@ SockCreate (
Parent = SockInitData->Parent;
if (Parent && (Parent->ConnCnt == Parent->BackLog)) {
- SOCK_DEBUG_ERROR (
- ("SockCreate: Socket parent has "
+ DEBUG (
+ (EFI_D_ERROR,
+ "SockCreate: Socket parent has "
"reached its connection limit with %d ConnCnt and %d BackLog\n",
Parent->ConnCnt,
Parent->BackLog)
@@ -578,25 +578,25 @@ SockCreate (
return NULL;
}
- Sock = NetAllocateZeroPool (sizeof (SOCKET));
+ Sock = AllocateZeroPool (sizeof (SOCKET));
if (NULL == Sock) {
- SOCK_DEBUG_ERROR (("SockCreate: No resource to create a new socket\n"));
+ DEBUG ((EFI_D_ERROR, "SockCreate: No resource to create a new socket\n"));
return NULL;
}
- NetListInit (&Sock->Link);
- NetListInit (&Sock->ConnectionList);
- NetListInit (&Sock->ListenTokenList);
- NetListInit (&Sock->RcvTokenList);
- NetListInit (&Sock->SndTokenList);
- NetListInit (&Sock->ProcessingSndTokenList);
+ InitializeListHead (&Sock->Link);
+ InitializeListHead (&Sock->ConnectionList);
+ InitializeListHead (&Sock->ListenTokenList);
+ InitializeListHead (&Sock->RcvTokenList);
+ InitializeListHead (&Sock->SndTokenList);
+ InitializeListHead (&Sock->ProcessingSndTokenList);
- NET_LOCK_INIT (&(Sock->Lock));
+ EfiInitializeLock (&(Sock->Lock), TPL_CALLBACK);
Sock->SndBuffer.DataQueue = NetbufQueAlloc ();
if (NULL == Sock->SndBuffer.DataQueue) {
- SOCK_DEBUG_ERROR (("SockCreate: No resource to allocate"
+ DEBUG ((EFI_D_ERROR, "SockCreate: No resource to allocate"
" SndBuffer for new socket\n"));
goto OnError;
@@ -604,7 +604,7 @@ SockCreate (
Sock->RcvBuffer.DataQueue = NetbufQueAlloc ();
if (NULL == Sock->RcvBuffer.DataQueue) {
- SOCK_DEBUG_ERROR (("SockCreate: No resource to allocate "
+ DEBUG ((EFI_D_ERROR, "SockCreate: No resource to allocate "
"RcvBuffer for new socket\n"));
goto OnError;
@@ -631,7 +631,7 @@ SockCreate (
//
// Install protocol on Sock->SockHandle
//
- NetCopyMem (
+ CopyMem (
&(Sock->NetProtocol.TcpProtocol),
SockInitData->Protocol,
sizeof (EFI_TCP4_PROTOCOL)
@@ -640,7 +640,7 @@ SockCreate (
//
// copy the protodata into socket
//
- NetCopyMem (Sock->ProtoReserved, SockInitData->ProtoData, SockInitData->DataSize);
+ CopyMem (Sock->ProtoReserved, SockInitData->ProtoData, SockInitData->DataSize);
Status = gBS->InstallMultipleProtocolInterfaces (
&Sock->SockHandle,
@@ -650,7 +650,7 @@ SockCreate (
);
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockCreate: Install TCP protocol in "
+ DEBUG ((EFI_D_ERROR, "SockCreate: Install TCP protocol in "
"socket failed with %r\n", Status));
goto OnError;
@@ -666,10 +666,13 @@ SockCreate (
//
Parent->ConnCnt++;
- SOCK_DEBUG_WARN (("SockCreate: Create a new socket and"
- "add to parent, now conncnt is %d\n", Parent->ConnCnt));
+ DEBUG (
+ (EFI_D_WARN,
+ "SockCreate: Create a new socket and add to parent, now conncnt is %d\n",
+ Parent->ConnCnt)
+ );
- NetListInsertTail (&Parent->ConnectionList, &Sock->ConnectionList);
+ InsertTailList (&Parent->ConnectionList, &Sock->ConnectionList);
}
if (Sock->CreateCallback != NULL) {
@@ -700,7 +703,7 @@ OnError:
NetbufQueFree (Sock->RcvBuffer.DataQueue);
}
- NetFreePool (Sock);
+ gBS->FreePool (Sock);
return NULL;
}
@@ -751,11 +754,15 @@ SockDestroy (
//
if (Sock->Parent) {
- NetListRemoveEntry (&(Sock->ConnectionList));
+ RemoveEntryList (&(Sock->ConnectionList));
(Sock->Parent->ConnCnt)--;
- SOCK_DEBUG_WARN (("SockDestory: Delete a unaccepted socket from parent"
- "now conncnt is %d\n", Sock->Parent->ConnCnt));
+ DEBUG (
+ (EFI_D_WARN,
+ "SockDestory: Delete a unaccepted socket from parent"
+ "now conncnt is %d\n",
+ Sock->Parent->ConnCnt)
+ );
Sock->Parent = NULL;
}
@@ -780,7 +787,7 @@ SockDestroy (
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockDestroy: Open protocol installed "
+ DEBUG ((EFI_D_ERROR, "SockDestroy: Open protocol installed "
"on socket failed with %r\n", Status));
goto FreeSock;
@@ -798,7 +805,7 @@ SockDestroy (
);
FreeSock:
- NetFreePool (Sock);
+ gBS->FreePool (Sock);
return ;
}
@@ -853,7 +860,7 @@ SockConnFlush (
// Destroy the pending connection, if it is a listening socket
//
if (SOCK_IS_LISTENING (Sock)) {
- while (!NetListIsEmpty (&Sock->ConnectionList)) {
+ while (!IsListEmpty (&Sock->ConnectionList)) {
Child = NET_LIST_HEAD (
&Sock->ConnectionList,
SOCKET,
@@ -924,7 +931,7 @@ SockClone (
ClonedSock = SockCreate (&InitData);
if (NULL == ClonedSock) {
- SOCK_DEBUG_ERROR (("SockClone: no resource to create a cloned sock\n"));
+ DEBUG ((EFI_D_ERROR, "SockClone: no resource to create a cloned sock\n"));
return NULL;
}
@@ -1019,7 +1026,7 @@ SockDataSent (
SOCK_TOKEN *SockToken;
SOCK_COMPLETION_TOKEN *SndToken;
- ASSERT (!NetListIsEmpty (&Sock->ProcessingSndTokenList));
+ ASSERT (!IsListEmpty (&Sock->ProcessingSndTokenList));
ASSERT (Count <= (Sock->SndBuffer.DataQueue)->BufSize);
NetbufQueTrim (Sock->SndBuffer.DataQueue, Count);
@@ -1038,10 +1045,10 @@ SockDataSent (
if (SockToken->RemainDataLen <= Count) {
- NetListRemoveEntry (&(SockToken->TokenList));
+ RemoveEntryList (&(SockToken->TokenList));
SIGNAL_TOKEN (SndToken, EFI_SUCCESS);
Count -= SockToken->RemainDataLen;
- NetFreePool (SockToken);
+ gBS->FreePool (SockToken);
} else {
SockToken->RemainDataLen -= Count;
@@ -1181,7 +1188,7 @@ SockRcvdErr (
{
SOCK_TOKEN *SockToken;
- if (!NetListIsEmpty (&Sock->RcvTokenList)) {
+ if (!IsListEmpty (&Sock->RcvTokenList)) {
SockToken = NET_LIST_HEAD (
&Sock->RcvTokenList,
@@ -1189,11 +1196,11 @@ SockRcvdErr (
TokenList
);
- NetListRemoveEntry (&SockToken->TokenList);
+ RemoveEntryList (&SockToken->TokenList);
SIGNAL_TOKEN (SockToken->Token, Error);
- NetFreePool (SockToken);
+ gBS->FreePool (SockToken);
} else {
SOCK_ERROR (Sock, Error);
@@ -1222,7 +1229,7 @@ SockNoMoreData (
SOCK_NO_MORE_DATA (Sock);
- if (!NetListIsEmpty (&Sock->RcvTokenList)) {
+ if (!IsListEmpty (&Sock->RcvTokenList)) {
ASSERT (0 == GET_RCV_DATASIZE (Sock));
@@ -1252,11 +1259,11 @@ SockBufFirst (
IN SOCK_BUFFER *Sockbuf
)
{
- NET_LIST_ENTRY *NetbufList;
+ LIST_ENTRY *NetbufList;
NetbufList = &(Sockbuf->DataQueue->BufList);
- if (NetListIsEmpty (NetbufList)) {
+ if (IsListEmpty (NetbufList)) {
return NULL;
}
@@ -1280,7 +1287,7 @@ SockBufNext (
IN NET_BUF *SockEntry
)
{
- NET_LIST_ENTRY *NetbufList;
+ LIST_ENTRY *NetbufList;
NetbufList = &(Sockbuf->DataQueue->BufList);
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
index 13feea18fa..4d5456d3cf 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
@@ -23,9 +23,6 @@ Abstract:
#include "Socket.h"
-#define SOCK_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR("Sock", PrintArg)
-#define SOCK_DEBUG_WARN(PrintArg) NET_DEBUG_WARNING("Sock", PrintArg)
-#define SOCK_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE("Sock", PrintArg)
#define SOCK_TRIM_RCV_BUFF(Sock, Len) \
(NetbufQueTrim ((Sock)->RcvBuffer.DataQueue, (Len)))
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
index 5d25124ebd..c3a0b91dea 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
@@ -35,11 +35,11 @@ Abstract:
STATIC
BOOLEAN
SockTokenExistedInList (
- IN NET_LIST_ENTRY *List,
+ IN LIST_ENTRY *List,
IN EFI_EVENT Event
)
{
- NET_LIST_ENTRY *ListEntry;
+ LIST_ENTRY *ListEntry;
SOCK_TOKEN *SockToken;
NET_LIST_FOR_EACH (ListEntry, List) {
@@ -112,17 +112,17 @@ SockTokenExisted (
SOCK_TOKEN *
SockBufferToken (
IN SOCKET *Sock,
- IN NET_LIST_ENTRY *List,
+ IN LIST_ENTRY *List,
IN VOID *Token,
IN UINT32 DataLen
)
{
SOCK_TOKEN *SockToken;
- SockToken = NetAllocatePool (sizeof (SOCK_TOKEN));
+ SockToken = AllocatePool (sizeof (SOCK_TOKEN));
if (NULL == SockToken) {
- SOCK_DEBUG_ERROR (("SockBufferIOToken: No Memory "
+ DEBUG ((EFI_D_ERROR, "SockBufferIOToken: No Memory "
"to allocate SockToken\n"));
return NULL;
@@ -131,7 +131,7 @@ SockBufferToken (
SockToken->Sock = Sock;
SockToken->Token = (SOCK_COMPLETION_TOKEN *) Token;
SockToken->RemainDataLen = DataLen;
- NetListInsertTail (List, &SockToken->TokenList);
+ InsertTailList (List, &SockToken->TokenList);
return SockToken;
}
@@ -161,10 +161,10 @@ SockDestroyChild (
Sock->IsDestroyed = TRUE;
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockDestroyChild: Get the lock to "
+ DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
"access socket failed with %r\n", Status));
return EFI_ACCESS_DENIED;
@@ -177,7 +177,7 @@ SockDestroyChild (
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockDestroyChild: Protocol detach socket"
+ DEBUG ((EFI_D_ERROR, "SockDestroyChild: Protocol detach socket"
" failed with %r\n", Status));
Sock->IsDestroyed = FALSE;
@@ -189,7 +189,7 @@ SockDestroyChild (
Sock->ConfigureState = SO_UNCONFIGURED;
}
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
if (EFI_ERROR (Status)) {
return Status;
@@ -226,16 +226,16 @@ SockCreateChild (
Sock = SockCreate (SockInitData);
if (NULL == Sock) {
- SOCK_DEBUG_ERROR (("SockCreateChild: No resource to "
+ DEBUG ((EFI_D_ERROR, "SockCreateChild: No resource to "
"create a new socket\n"));
return NULL;
}
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockCreateChild: Get the lock to "
+ DEBUG ((EFI_D_ERROR, "SockCreateChild: Get the lock to "
"access socket failed with %r\n", Status));
SockDestroy (Sock);
@@ -248,14 +248,14 @@ SockCreateChild (
Status = Sock->ProtoHandler (Sock, SOCK_ATTACH, NULL);
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockCreateChild: Protocol failed to"
+ DEBUG ((EFI_D_ERROR, "SockCreateChild: Protocol failed to"
" attach a socket with %r\n", Status));
SockDestroy (Sock);
Sock = NULL;
}
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Sock;
}
@@ -280,10 +280,10 @@ SockConfigure (
{
EFI_STATUS Status;
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockConfigure: Get the access for "
+ DEBUG ((EFI_D_ERROR, "SockConfigure: Get the access for "
"socket failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -299,7 +299,7 @@ SockConfigure (
Status = Sock->ProtoHandler (Sock, SOCK_CONFIGURE, ConfigData);
OnExit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -332,10 +332,10 @@ SockConnect (
EFI_STATUS Status;
EFI_EVENT Event;
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockConnect: Get the access for "
+ DEBUG ((EFI_D_ERROR, "SockConnect: Get the access for "
"socket failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -371,7 +371,7 @@ SockConnect (
Status = Sock->ProtoHandler (Sock, SOCK_CONNECT, NULL);
OnExit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -402,17 +402,17 @@ SockAccept (
)
{
EFI_TCP4_LISTEN_TOKEN *ListenToken;
- NET_LIST_ENTRY *ListEntry;
+ LIST_ENTRY *ListEntry;
EFI_STATUS Status;
SOCKET *Socket;
EFI_EVENT Event;
ASSERT (SOCK_STREAM == Sock->Type);
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockAccept: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockAccept: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -456,14 +456,16 @@ SockAccept (
ListenToken->NewChildHandle = Socket->SockHandle;
SIGNAL_TOKEN (&(ListenToken->CompletionToken), EFI_SUCCESS);
- NetListRemoveEntry (ListEntry);
+ RemoveEntryList (ListEntry);
ASSERT (Socket->Parent);
Socket->Parent->ConnCnt--;
- SOCK_DEBUG_WARN (("SockAccept: Accept a socket,"
- "now conncount is %d", Socket->Parent->ConnCnt)
+ DEBUG (
+ (EFI_D_WARN,
+ "SockAccept: Accept a socket, now conncount is %d",
+ Socket->Parent->ConnCnt)
);
Socket->Parent = NULL;
@@ -480,7 +482,7 @@ SockAccept (
}
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -520,10 +522,10 @@ SockSend (
ASSERT (SOCK_STREAM == Sock->Type);
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockSend: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockSend: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -587,7 +589,7 @@ SockSend (
);
if (NULL == SockToken) {
- SOCK_DEBUG_ERROR (("SockSend: Failed to buffer IO token into"
+ DEBUG ((EFI_D_ERROR, "SockSend: Failed to buffer IO token into"
" socket processing SndToken List\n", Status));
Status = EFI_OUT_OF_RESOURCES;
@@ -597,16 +599,16 @@ SockSend (
Status = SockProcessTcpSndData (Sock, TxData);
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockSend: Failed to process "
+ DEBUG ((EFI_D_ERROR, "SockSend: Failed to process "
"Snd Data\n", Status));
- NetListRemoveEntry (&(SockToken->TokenList));
- NetFreePool (SockToken);
+ RemoveEntryList (&(SockToken->TokenList));
+ gBS->FreePool (SockToken);
}
}
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -643,10 +645,10 @@ SockRcv (
ASSERT (SOCK_STREAM == Sock->Type);
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockRcv: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockRcv: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -720,7 +722,7 @@ SockRcv (
}
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -743,10 +745,10 @@ SockFlush (
ASSERT (SOCK_STREAM == Sock->Type);
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockFlush: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockFlush: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -759,7 +761,7 @@ SockFlush (
Status = Sock->ProtoHandler (Sock, SOCK_FLUSH, NULL);
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockFlush: Protocol failed handling"
+ DEBUG ((EFI_D_ERROR, "SockFlush: Protocol failed handling"
" SOCK_FLUSH with %r", Status));
goto Exit;
@@ -772,7 +774,7 @@ SockFlush (
Sock->ConfigureState = SO_UNCONFIGURED;
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -808,9 +810,9 @@ SockClose (
ASSERT (SOCK_STREAM == Sock->Type);
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockClose: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockClose: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -848,7 +850,7 @@ SockClose (
}
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -895,11 +897,11 @@ SockGroup (
{
EFI_STATUS Status;
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockGroup: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockGroup: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -913,7 +915,7 @@ SockGroup (
Status = Sock->ProtoHandler (Sock, SOCK_GROUP, GroupInfo);
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
@@ -941,9 +943,9 @@ SockRoute (
{
EFI_STATUS Status;
- Status = NET_TRYLOCK (&(Sock->Lock));
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
if (EFI_ERROR (Status)) {
- SOCK_DEBUG_ERROR (("SockRoute: Get the access for socket"
+ DEBUG ((EFI_D_ERROR, "SockRoute: Get the access for socket"
" failed with %r", Status));
return EFI_ACCESS_DENIED;
@@ -962,6 +964,6 @@ SockRoute (
Status = Sock->ProtoHandler (Sock, SOCK_ROUTE, RouteInfo);
Exit:
- NET_UNLOCK (&(Sock->Lock));
+ EfiReleaseLock (&(Sock->Lock));
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
index 2e35f5ecd7..95f29a1d75 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
@@ -357,12 +357,12 @@ struct _SOCKET {
EFI_HANDLE DriverBinding; // socket't driver binding protocol
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
SOCK_CONFIGURE_STATE ConfigureState;
SOCK_TYPE Type;
SOCK_STATE State;
UINT16 Flag;
- NET_LOCK Lock; // the lock of socket
+ EFI_LOCK Lock; // the lock of socket
SOCK_BUFFER SndBuffer; // send buffer of application's data
SOCK_BUFFER RcvBuffer; // receive buffer of received data
EFI_STATUS SockError; // the error returned by low layer protocol
@@ -374,14 +374,14 @@ struct _SOCKET {
UINT32 BackLog; // the limit of connection to this socket
UINT32 ConnCnt; // the current count of connections to it
SOCKET *Parent; // listening parent that accept the connection
- NET_LIST_ENTRY ConnectionList; // the connections maintained by this socket
+ LIST_ENTRY ConnectionList; // the connections maintained by this socket
//
// the queue to buffer application's asynchronous token
//
- NET_LIST_ENTRY ListenTokenList;
- NET_LIST_ENTRY RcvTokenList;
- NET_LIST_ENTRY SndTokenList;
- NET_LIST_ENTRY ProcessingSndTokenList;
+ LIST_ENTRY ListenTokenList;
+ LIST_ENTRY RcvTokenList;
+ LIST_ENTRY SndTokenList;
+ LIST_ENTRY ProcessingSndTokenList;
SOCK_COMPLETION_TOKEN *ConnectionToken; // app's token to signal if connected
SOCK_COMPLETION_TOKEN *CloseToken; // app's token to signal if closed
@@ -408,7 +408,7 @@ struct _SOCKET {
// the token structure buffered in socket layer
//
typedef struct _SOCK_TOKEN {
- NET_LIST_ENTRY TokenList; // the entry to add in the token list
+ LIST_ENTRY TokenList; // the entry to add in the token list
SOCK_COMPLETION_TOKEN *Token; // The application's token
UINT32 RemainDataLen; // unprocessed data length
SOCKET *Sock; // the poninter to the socket this token
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index a6a6913333..c6108e2514 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -118,11 +118,11 @@ Tcp4GetMode (
AccessPoint->UseDefaultAddress = Tcb->UseDefaultAddr;
- NetCopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
AccessPoint->SubnetMask = Tcb->SubnetMask;
AccessPoint->StationPort = NTOHS (Tcb->LocalEnd.Port);
- NetCopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
AccessPoint->RemotePort = NTOHS (Tcb->RemoteEnd.Port);
AccessPoint->ActiveFlag = (BOOLEAN) (Tcb->State != TCP_LISTEN);
@@ -203,7 +203,7 @@ Tcp4Bind (
if (mTcp4RandomPort <= TCP4_PORT_KNOWN) {
if (Cycle) {
- TCP4_DEBUG_ERROR (("Tcp4Bind: no port can be allocated "
+ DEBUG ((EFI_D_ERROR, "Tcp4Bind: no port can be allocated "
"for this pcb\n"));
return EFI_OUT_OF_RESOURCES;
@@ -246,7 +246,7 @@ Tcp4FlushPcb (
TcpProto = (TCP4_PROTO_DATA *) Sock->ProtoReserved;
if (SOCK_IS_CONFIGURED (Sock)) {
- NetListRemoveEntry (&Tcb->List);
+ RemoveEntryList (&Tcb->List);
//
// Uninstall the device path protocl.
@@ -256,7 +256,7 @@ Tcp4FlushPcb (
&gEfiDevicePathProtocolGuid,
Sock->DevicePath
);
- NetFreePool (Sock->DevicePath);
+ gBS->FreePool (Sock->DevicePath);
TcpSetVariableData (TcpProto->TcpService);
}
@@ -275,11 +275,11 @@ Tcp4AttachPcb (
TCP4_PROTO_DATA *ProtoData;
IP_IO *IpIo;
- Tcb = NetAllocateZeroPool (sizeof (TCP_CB));
+ Tcb = AllocateZeroPool (sizeof (TCP_CB));
if (Tcb == NULL) {
- TCP4_DEBUG_ERROR (("Tcp4ConfigurePcb: failed to allocate a TCB\n"));
+ DEBUG ((EFI_D_ERROR, "Tcp4ConfigurePcb: failed to allocate a TCB\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -293,13 +293,13 @@ Tcp4AttachPcb (
Tcb->IpInfo = IpIoAddIp (IpIo);
if (Tcb->IpInfo == NULL) {
- NetFreePool (Tcb);
+ gBS->FreePool (Tcb);
return EFI_OUT_OF_RESOURCES;
}
- NetListInit (&Tcb->List);
- NetListInit (&Tcb->SndQue);
- NetListInit (&Tcb->RcvQue);
+ InitializeListHead (&Tcb->List);
+ InitializeListHead (&Tcb->SndQue);
+ InitializeListHead (&Tcb->RcvQue);
Tcb->State = TCP_CLOSED;
Tcb->Sk = Sk;
@@ -326,7 +326,7 @@ Tcp4DetachPcb (
IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo);
- NetFreePool (Tcb);
+ gBS->FreePool (Tcb);
ProtoData->TcpPcb = NULL;
}
@@ -397,7 +397,7 @@ Tcp4ConfigurePcb (
Status = Tcp4Bind (&(CfgData->AccessPoint));
if (EFI_ERROR (Status)) {
- TCP4_DEBUG_ERROR (("Tcp4ConfigurePcb: Bind endpoint failed "
+ DEBUG ((EFI_D_ERROR, "Tcp4ConfigurePcb: Bind endpoint failed "
"with %r\n", Status));
goto OnExit;
@@ -407,8 +407,8 @@ Tcp4ConfigurePcb (
// Initalize the operating information in this Tcb
//
ASSERT (Tcb->State == TCP_CLOSED &&
- NetListIsEmpty (&Tcb->SndQue) &&
- NetListIsEmpty (&Tcb->RcvQue));
+ IsListEmpty (&Tcb->SndQue) &&
+ IsListEmpty (&Tcb->RcvQue));
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_KEEPALIVE);
Tcb->State = TCP_CLOSED;
@@ -440,12 +440,12 @@ Tcp4ConfigurePcb (
Tcb->UseDefaultAddr = CfgData->AccessPoint.UseDefaultAddress;
- NetCopyMem (&Tcb->LocalEnd.Ip, &CfgData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Tcb->LocalEnd.Ip, &CfgData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
Tcb->LocalEnd.Port = HTONS (CfgData->AccessPoint.StationPort);
Tcb->SubnetMask = CfgData->AccessPoint.SubnetMask;
if (CfgData->AccessPoint.ActiveFlag) {
- NetCopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
Tcb->RemoteEnd.Port = HTONS (CfgData->AccessPoint.RemotePort);
} else {
Tcb->RemoteEnd.Ip = 0;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
index 8102b32182..818b4e1662 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
@@ -98,7 +98,7 @@ Tcp4CreateTimer (
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
TcpTicking,
NULL,
&mTcp4Timer.TimerEvent
@@ -283,10 +283,10 @@ Tcp4DriverBindingStart (
TCP4_SERVICE_DATA *TcpServiceData;
IP_IO_OPEN_DATA OpenData;
- TcpServiceData = NetAllocateZeroPool (sizeof (TCP4_SERVICE_DATA));
+ TcpServiceData = AllocateZeroPool (sizeof (TCP4_SERVICE_DATA));
if (NULL == TcpServiceData) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingStart: Have no enough"
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough"
" resource to create a Tcp Servcie Data!\n"));
return EFI_OUT_OF_RESOURCES;
@@ -298,7 +298,7 @@ Tcp4DriverBindingStart (
TcpServiceData->IpIo = IpIoCreate (This->DriverBindingHandle, ControllerHandle);
if (NULL == TcpServiceData->IpIo) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingStart: Have no enough"
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough"
" resource to create an Ip Io!\n"));
Status = EFI_OUT_OF_RESOURCES;
@@ -308,7 +308,7 @@ Tcp4DriverBindingStart (
//
// Configure and start IpIo.
//
- NetZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
+ ZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));
OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP;
@@ -326,7 +326,7 @@ Tcp4DriverBindingStart (
Status = Tcp4CreateTimer ();
if (EFI_ERROR (Status)) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingStart: Create TcpTimer"
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Create TcpTimer"
" Event failed with %r\n", Status));
goto ON_ERROR;
@@ -346,7 +346,7 @@ Tcp4DriverBindingStart (
);
if (EFI_ERROR (Status)) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingStart: Install Tcp4 Service Binding"
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Install Tcp4 Service Binding"
" Protocol failed for %r\n", Status));
Tcp4DestroyTimer ();
@@ -360,7 +360,7 @@ Tcp4DriverBindingStart (
TcpServiceData->Signature = TCP4_DRIVER_SIGNATURE;
TcpServiceData->DriverBindingHandle = This->DriverBindingHandle;
- NetListInit (&TcpServiceData->SocketList);
+ InitializeListHead (&TcpServiceData->SocketList);
TcpSetVariableData (TcpServiceData);
@@ -372,7 +372,7 @@ ON_ERROR:
IpIoDestroy (TcpServiceData->IpIo);
}
- NetFreePool (TcpServiceData);
+ gBS->FreePool (TcpServiceData);
return Status;
}
@@ -426,7 +426,7 @@ Tcp4DriverBindingStop (
);
if (EFI_ERROR (Status)) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingStop: Locate Tcp4 Service "
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStop: Locate Tcp4 Service "
" Binding Protocol failed with %r\n", Status));
return EFI_DEVICE_ERROR;
@@ -463,10 +463,10 @@ Tcp4DriverBindingStop (
//
// Release the TCP service data
//
- NetFreePool (TcpServiceData);
+ gBS->FreePool (TcpServiceData);
} else {
- while (!NetListIsEmpty (&TcpServiceData->SocketList)) {
+ while (!IsListEmpty (&TcpServiceData->SocketList)) {
Sock = NET_LIST_HEAD (&TcpServiceData->SocketList, SOCKET, Link);
ServiceBinding->DestroyChild (ServiceBinding, Sock->SockHandle);
@@ -525,7 +525,7 @@ Tcp4CreateSocketCallback (
//
// Insert this socket into the SocketList.
//
- NetListInsertTail (&TcpServiceData->SocketList, &This->Link);
+ InsertTailList (&TcpServiceData->SocketList, &This->Link);
}
return Status;
@@ -544,7 +544,7 @@ Tcp4DestroySocketCallback (
//
// Remove this node from the list.
//
- NetListRemoveEntry (&This->Link);
+ RemoveEntryList (&This->Link);
//
// Close the device path protocol
@@ -599,7 +599,7 @@ Tcp4ServiceBindingCreateChild (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Status = EFI_SUCCESS;
TcpServiceData = TCP4_FROM_THIS (This);
TcpProto.TcpService = TcpServiceData;
@@ -612,10 +612,10 @@ Tcp4ServiceBindingCreateChild (
mTcp4DefaultSockData.ProtoData = &TcpProto;
mTcp4DefaultSockData.DataSize = sizeof (TCP4_PROTO_DATA);
mTcp4DefaultSockData.DriverBinding = TcpServiceData->DriverBindingHandle;
-
+
Sock = SockCreateChild (&mTcp4DefaultSockData);
if (NULL == Sock) {
- TCP4_DEBUG_ERROR (("Tcp4DriverBindingCreateChild: "
+ DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingCreateChild: "
"No resource to create a Tcp Child\n"));
Status = EFI_OUT_OF_RESOURCES;
@@ -623,7 +623,7 @@ Tcp4ServiceBindingCreateChild (
*ChildHandle = Sock->SockHandle;
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -656,7 +656,7 @@ Tcp4ServiceBindingDestroyChild (
return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// retrieve the Tcp4 protocol from ChildHandle
@@ -681,7 +681,7 @@ Tcp4ServiceBindingDestroyChild (
SockDestroyChild (Sock);
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
index 47ca324017..2636ce708c 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
@@ -41,7 +41,7 @@ typedef struct _TCP4_SERVICE_DATA {
EFI_SERVICE_BINDING_PROTOCOL Tcp4ServiceBinding;
EFI_HANDLE DriverBindingHandle;
CHAR16 *MacString;
- NET_LIST_ENTRY SocketList;
+ LIST_ENTRY SocketList;
} TCP4_SERVICE_DATA;
//
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
index 5bfdf2612d..dbb1008b40 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
@@ -158,7 +158,7 @@ TcpVerifySegment (
INTN
TcpCheckSndQue (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
);
NET_BUF *
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
index 3a3e904c7c..a054a4a56d 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
@@ -84,7 +84,7 @@ TcpFastRecover (
TcpRetransmit (Tcb, Tcb->SndUna);
Tcb->CWnd = Tcb->Ssthresh + 3 * Tcb->SndMss;
- TCP4_DEBUG_TRACE (("TcpFastRecover: enter fast retransmission"
+ DEBUG ((EFI_D_INFO, "TcpFastRecover: enter fast retransmission"
" for TCB %x, recover point is %d\n", Tcb, Tcb->Recover));
return;
}
@@ -103,7 +103,7 @@ TcpFastRecover (
// by TcpToSendData
//
Tcb->CWnd += Tcb->SndMss;
- TCP4_DEBUG_TRACE (("TcpFastRecover: received another"
+ DEBUG ((EFI_D_INFO, "TcpFastRecover: received another"
" duplicated ACK (%d) for TCB %x\n", Seg->Ack, Tcb));
} else {
@@ -123,7 +123,7 @@ TcpFastRecover (
Tcb->CWnd = MIN (Tcb->Ssthresh, FlightSize + Tcb->SndMss);
Tcb->CongestState = TCP_CONGEST_OPEN;
- TCP4_DEBUG_TRACE (("TcpFastRecover: received a full ACK(%d)"
+ DEBUG ((EFI_D_INFO, "TcpFastRecover: received a full ACK(%d)"
" for TCB %x, exit fast recovery\n", Seg->Ack, Tcb));
} else {
@@ -148,7 +148,7 @@ TcpFastRecover (
Tcb->CWnd -= Acked;
- TCP4_DEBUG_TRACE (("TcpFastRecover: received a partial"
+ DEBUG ((EFI_D_INFO, "TcpFastRecover: received a partial"
" ACK(%d) for TCB %x\n", Seg->Ack, Tcb));
}
@@ -185,7 +185,7 @@ TcpFastLossRecover (
Tcb->LossTimes = 0;
Tcb->CongestState = TCP_CONGEST_OPEN;
- TCP4_DEBUG_TRACE (("TcpFastLossRecover: received a "
+ DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "
"full ACK(%d) for TCB %x\n", Seg->Ack, Tcb));
} else {
@@ -195,7 +195,7 @@ TcpFastLossRecover (
// fast retransmit the first unacknowledge field.
//
TcpRetransmit (Tcb, Seg->Ack);
- TCP4_DEBUG_TRACE (("TcpFastLossRecover: received a "
+ DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "
"partial ACK(%d) for TCB %x\n", Seg->Ack, Tcb));
}
}
@@ -256,7 +256,7 @@ TcpComputeRtt (
}
- TCP4_DEBUG_TRACE (("TcpComputeRtt: new RTT for TCB %x"
+ DEBUG ((EFI_D_INFO, "TcpComputeRtt: new RTT for TCB %x"
" computed SRTT: %d RTTVAR: %d RTO: %d\n",
Tcb, Tcb->SRtt, Tcb->RttVar, Tcb->Rto));
@@ -392,7 +392,7 @@ TcpDeliverData (
IN TCP_CB *Tcb
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_BUF *Nbuf;
TCP_SEQNO Seq;
TCP_SEG *Seg;
@@ -404,7 +404,7 @@ TcpDeliverData (
// make sure there is some data queued,
// and TCP is in a proper state
//
- if (NetListIsEmpty (&Tcb->RcvQue) || !TCP_CONNECTED (Tcb->State)) {
+ if (IsListEmpty (&Tcb->RcvQue) || !TCP_CONNECTED (Tcb->State)) {
return 0;
}
@@ -430,7 +430,7 @@ TcpDeliverData (
Seq = Seg->End;
Tcb->RcvNxt = Seq;
- NetListRemoveEntry (&Nbuf->List);
+ RemoveEntryList (&Nbuf->List);
//
// RFC793 Eighth step: process FIN in sequence
@@ -441,15 +441,15 @@ TcpDeliverData (
// The peer sends to us junky data after FIN,
// reset the connection.
//
- if (!NetListIsEmpty (&Tcb->RcvQue)) {
- TCP4_DEBUG_ERROR (("TcpDeliverData: data received after"
+ if (!IsListEmpty (&Tcb->RcvQue)) {
+ DEBUG ((EFI_D_ERROR, "TcpDeliverData: data received after"
" FIN from peer of TCB %x, reset connection\n", Tcb));
NetbufFree (Nbuf);
return -1;
}
- TCP4_DEBUG_TRACE (("TcpDeliverData: processing FIN "
+ DEBUG ((EFI_D_INFO, "TcpDeliverData: processing FIN "
"from peer of TCB %x\n", Tcb));
switch (Tcb->State) {
@@ -480,7 +480,7 @@ TcpDeliverData (
TcpSetTimer (Tcb, TCP_TIMER_2MSL, Tcb->TimeWaitTimeout);
} else {
- TCP4_DEBUG_WARN (("Connection closed immediately "
+ DEBUG ((EFI_D_WARN, "Connection closed immediately "
"because app disables TIME_WAIT timer for %x\n", Tcb));
TcpSendAck (Tcb);
@@ -558,9 +558,9 @@ TcpQueueData (
)
{
TCP_SEG *Seg;
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Prev;
- NET_LIST_ENTRY *Cur;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Prev;
+ LIST_ENTRY *Cur;
NET_BUF *Node;
ASSERT (Tcb && Nbuf && (Nbuf->Tcp == NULL));
@@ -574,9 +574,9 @@ TcpQueueData (
// Fast path to process normal case. That is,
// no out-of-order segments are received.
//
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
- NetListInsertTail (Head, &Nbuf->List);
+ InsertTailList (Head, &Nbuf->List);
return ;
}
@@ -613,7 +613,7 @@ TcpQueueData (
}
}
- NetListInsertHead (Prev, &Nbuf->List);
+ InsertHeadList (Prev, &Nbuf->List);
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
@@ -627,7 +627,7 @@ TcpQueueData (
Cur = Cur->ForwardLink;
- NetListRemoveEntry (&Node->List);
+ RemoveEntryList (&Node->List);
NetbufFree (Node);
continue;
}
@@ -636,7 +636,7 @@ TcpQueueData (
if (TCP_SEQ_LEQ (TCPSEG_NETBUF (Node)->Seq, Seg->Seq)) {
- NetListRemoveEntry (&Nbuf->List);
+ RemoveEntryList (&Nbuf->List);
NetbufFree (Nbuf);
return ;
}
@@ -665,8 +665,8 @@ TcpAdjustSndQue (
IN TCP_SEQNO Ack
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Cur;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Cur;
NET_BUF *Node;
TCP_SEG *Seg;
@@ -687,7 +687,7 @@ TcpAdjustSndQue (
if (TCP_SEQ_LEQ (Seg->End, Ack)) {
Cur = Cur->ForwardLink;
- NetListRemoveEntry (&Node->List);
+ RemoveEntryList (&Node->List);
NetbufFree (Node);
continue;
}
@@ -738,7 +738,7 @@ TcpInput (
if ((Head->HeadLen < 5) || (Len < 0) ||
TcpChecksum (Nbuf, NetPseudoHeadChecksum (Src, Dst, 6, 0))) {
- TCP4_DEBUG_TRACE (("TcpInput: received an mal-formated packet\n"));
+ DEBUG ((EFI_D_INFO, "TcpInput: received an mal-formated packet\n"));
goto DISCARD;
}
@@ -759,7 +759,7 @@ TcpInput (
);
if ((Tcb == NULL) || (Tcb->State == TCP_CLOSED)) {
- TCP4_DEBUG_TRACE (("TcpInput: send reset because no TCB find\n"));
+ DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB find\n"));
Tcb = NULL;
goto SEND_RESET;
@@ -772,7 +772,7 @@ TcpInput (
// (in fact, an illegal option length) is reset.
//
if (TcpParseOption (Nbuf->Tcp, &Option) == -1) {
- TCP4_DEBUG_ERROR (("TcpInput: reset the peer because"
+ DEBUG ((EFI_D_ERROR, "TcpInput: reset the peer because"
" of mal-format option for Tcb %x\n", Tcb));
goto SEND_RESET;
@@ -796,7 +796,7 @@ TcpInput (
// First step: Check RST
//
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_RST)) {
- TCP4_DEBUG_WARN (("TcpInput: discard a reset segment "
+ DEBUG ((EFI_D_WARN, "TcpInput: discard a reset segment "
"for TCB %x in listening\n", Tcb));
goto DISCARD;
@@ -807,7 +807,7 @@ TcpInput (
// Any ACK sent to TCP in LISTEN is reseted.
//
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_ACK)) {
- TCP4_DEBUG_WARN (("TcpInput: send reset because of"
+ DEBUG ((EFI_D_WARN, "TcpInput: send reset because of"
" segment with ACK for TCB %x in listening\n", Tcb));
goto SEND_RESET;
@@ -824,13 +824,13 @@ TcpInput (
Tcb = TcpCloneTcb (Parent);
if (Tcb == NULL) {
- TCP4_DEBUG_ERROR (("TcpInput: discard a segment because"
+ DEBUG ((EFI_D_ERROR, "TcpInput: discard a segment because"
"failed to clone a child for TCB%x\n", Tcb));
goto DISCARD;
}
- TCP4_DEBUG_TRACE (("TcpInput: create a child for TCB %x"
+ DEBUG ((EFI_D_INFO, "TcpInput: create a child for TCB %x"
" in listening\n", Tcb));
//
@@ -859,7 +859,7 @@ TcpInput (
//
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_ACK) && (Seg->Ack != Tcb->Iss + 1)) {
- TCP4_DEBUG_WARN (("TcpInput: send reset because of "
+ DEBUG ((EFI_D_WARN, "TcpInput: send reset because of "
"wrong ACK received for TCB %x in SYN_SENT\n", Tcb));
goto SEND_RESET;
@@ -872,14 +872,14 @@ TcpInput (
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_ACK)) {
- TCP4_DEBUG_WARN (("TcpInput: connection reset by"
+ DEBUG ((EFI_D_WARN, "TcpInput: connection reset by"
" peer for TCB%x in SYN_SENT\n", Tcb));
SOCK_ERROR (Tcb->Sk, EFI_CONNECTION_RESET);
goto DROP_CONNECTION;
} else {
- TCP4_DEBUG_WARN (("TcpInput: discard a reset segment "
+ DEBUG ((EFI_D_WARN, "TcpInput: discard a reset segment "
"because of no ACK for TCB%x in SYN_SENT\n", Tcb));
goto DISCARD;
@@ -922,7 +922,7 @@ TcpInput (
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
- TCP4_DEBUG_TRACE (("TcpInput: connection established"
+ DEBUG ((EFI_D_INFO, "TcpInput: connection established"
" for TCB %x in SYN_SENT\n", Tcb));
goto StepSix;
@@ -937,7 +937,7 @@ TcpInput (
TcpTrimInWnd (Tcb, Nbuf);
- TCP4_DEBUG_WARN (("TcpInput: simultanous open "
+ DEBUG ((EFI_D_WARN, "TcpInput: simultanous open "
"for TCB %x in SYN_SENT\n", Tcb));
goto StepSix;
@@ -955,7 +955,7 @@ TcpInput (
// First step: Check whether SEG.SEQ is acceptable
//
if (!TcpSeqAcceptable (Tcb, Seg)) {
- TCP4_DEBUG_WARN (("TcpInput: sequence acceptance"
+ DEBUG ((EFI_D_WARN, "TcpInput: sequence acceptance"
" test failed for segment of TCB %x\n", Tcb));
if (!TCP_FLG_ON (Seg->Flag, TCP_FLG_RST)) {
@@ -977,7 +977,7 @@ TcpInput (
//
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_RST)) {
- TCP4_DEBUG_WARN (("TcpInput: connection reset for TCB %x\n", Tcb));
+ DEBUG ((EFI_D_WARN, "TcpInput: connection reset for TCB %x\n", Tcb));
if (Tcb->State == TCP_SYN_RCVD) {
@@ -1020,7 +1020,7 @@ TcpInput (
//
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN)) {
- TCP4_DEBUG_WARN (("TcpInput: connection reset "
+ DEBUG ((EFI_D_WARN, "TcpInput: connection reset "
"because received extra SYN for TCB %x\n", Tcb));
SOCK_ERROR (Tcb->Sk, EFI_CONNECTION_RESET);
@@ -1031,7 +1031,7 @@ TcpInput (
// Fifth step: Check the ACK
//
if (!TCP_FLG_ON (Seg->Flag, TCP_FLG_ACK)) {
- TCP4_DEBUG_WARN (("TcpInput: segment discard because"
+ DEBUG ((EFI_D_WARN, "TcpInput: segment discard because"
" of no ACK for connected TCB %x\n", Tcb));
goto DISCARD;
@@ -1052,14 +1052,14 @@ TcpInput (
TcpClearTimer (Tcb, TCP_TIMER_CONNECT);
TcpDeliverData (Tcb);
- TCP4_DEBUG_TRACE (("TcpInput: connection established "
+ DEBUG ((EFI_D_INFO, "TcpInput: connection established "
" for TCB %x in SYN_RCVD\n", Tcb));
//
// Continue the process as ESTABLISHED state
//
} else {
- TCP4_DEBUG_WARN (("TcpInput: send reset because of"
+ DEBUG ((EFI_D_WARN, "TcpInput: send reset because of"
" wrong ACK for TCB %x in SYN_RCVD\n", Tcb));
goto SEND_RESET;
@@ -1068,14 +1068,14 @@ TcpInput (
if (TCP_SEQ_LT (Seg->Ack, Tcb->SndUna)) {
- TCP4_DEBUG_WARN (("TcpInput: ignore the out-of-data"
+ DEBUG ((EFI_D_WARN, "TcpInput: ignore the out-of-data"
" ACK for connected TCB %x\n", Tcb));
goto StepSix;
} else if (TCP_SEQ_GT (Seg->Ack, Tcb->SndNxt)) {
- TCP4_DEBUG_WARN (("TcpInput: discard segment for "
+ DEBUG ((EFI_D_WARN, "TcpInput: discard segment for "
"future ACK for connected TCB %x\n", Tcb));
TcpSendAck (Tcb);
@@ -1186,7 +1186,7 @@ TcpInput (
goto NO_UPDATE;
}
- TCP4_DEBUG_WARN (("TcpInput: peer shrinks the"
+ DEBUG ((EFI_D_WARN, "TcpInput: peer shrinks the"
" window for connected TCB %x\n", Tcb));
if ((Tcb->CongestState == TCP_CONGEST_RECOVER) &&
@@ -1224,7 +1224,7 @@ NO_UPDATE:
if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT) &&
(Tcb->SndUna == Tcb->SndNxt)) {
- TCP4_DEBUG_TRACE (("TcpInput: local FIN is ACKed by"
+ DEBUG ((EFI_D_INFO, "TcpInput: local FIN is ACKed by"
" peer for connected TCB %x\n", Tcb));
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_ACKED);
@@ -1264,7 +1264,7 @@ NO_UPDATE:
TcpSetTimer (Tcb, TCP_TIMER_2MSL, Tcb->TimeWaitTimeout);
} else {
- TCP4_DEBUG_WARN (("Connection closed immediately "
+ DEBUG ((EFI_D_WARN, "Connection closed immediately "
"because app disables TIME_WAIT timer for %x\n", Tcb));
TcpClose (Tcb);
@@ -1290,7 +1290,7 @@ NO_UPDATE:
TcpSetTimer (Tcb, TCP_TIMER_2MSL, Tcb->TimeWaitTimeout);
} else {
- TCP4_DEBUG_WARN (("Connection closed immediately "
+ DEBUG ((EFI_D_WARN, "Connection closed immediately "
"because app disables TIME_WAIT timer for %x\n", Tcb));
TcpClose (Tcb);
@@ -1315,7 +1315,7 @@ StepSix:
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&
!TCP_FIN_RCVD (Tcb->State)) {
- TCP4_DEBUG_TRACE (("TcpInput: received urgent data "
+ DEBUG ((EFI_D_INFO, "TcpInput: received urgent data "
"from peer for connected TCB %x\n", Tcb));
Urg = Seg->Seq + Seg->Urg;
@@ -1338,14 +1338,14 @@ StepSix:
if (TCP_FIN_RCVD (Tcb->State)) {
- TCP4_DEBUG_WARN (("TcpInput: connection reset because"
+ DEBUG ((EFI_D_WARN, "TcpInput: connection reset because"
" data is lost for connected TCB %x\n", Tcb));
goto RESET_THEN_DROP;
}
if (TCP_LOCAL_CLOSED (Tcb->State) && (Nbuf->TotalSize != 0)) {
- TCP4_DEBUG_WARN (("TcpInput: connection reset because"
+ DEBUG ((EFI_D_WARN, "TcpInput: connection reset because"
" data is lost for connected TCB %x\n", Tcb));
goto RESET_THEN_DROP;
@@ -1356,7 +1356,7 @@ StepSix:
goto RESET_THEN_DROP;
}
- if (!NetListIsEmpty (&Tcb->RcvQue)) {
+ if (!IsListEmpty (&Tcb->RcvQue)) {
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
}
}
@@ -1407,7 +1407,7 @@ DISCARD:
//
// Tcb is a child of Parent, and it doesn't survive
//
- TCP4_DEBUG_WARN (("Tcp4Input: Discard a packet\n"));
+ DEBUG ((EFI_D_WARN, "Tcp4Input: Discard a packet\n"));
NetbufFree (Nbuf);
if (Parent && Tcb) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c
index 898d18f611..c468bba380 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c
@@ -88,7 +88,7 @@ TcpSendIpPacket (
IpSender = IpIoFindSender (&IpIo, Src);
if (IpSender == NULL) {
- TCP4_DEBUG_WARN (("TcpSendIpPacket: No appropriate IpSender.\n"));
+ DEBUG ((EFI_D_WARN, "TcpSendIpPacket: No appropriate IpSender.\n"));
return -1;
}
} else {
@@ -103,13 +103,13 @@ TcpSendIpPacket (
Override.TimeToLive = 255;
Override.DoNotFragment = FALSE;
Override.Protocol = EFI_IP_PROTO_TCP;
- NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Override.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));
Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, Dest, &Override);
if (EFI_ERROR (Status)) {
- TCP4_DEBUG_ERROR (("TcpSendIpPacket: return %r error\n", Status));
+ DEBUG ((EFI_D_ERROR, "TcpSendIpPacket: return %r error\n", Status));
return -1;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c
index 24f97eb93b..8fe893e48a 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c
@@ -156,7 +156,7 @@ Tcp4Configure (
//
if (NULL != TcpConfigData) {
- NetCopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
if ((Ip != 0) && !Ip4IsUnicast (NTOHL (Ip), 0)) {
return EFI_INVALID_PARAMETER;
}
@@ -168,8 +168,8 @@ Tcp4Configure (
if (!TcpConfigData->AccessPoint.UseDefaultAddress) {
- NetCopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
return EFI_INVALID_PARAMETER;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
index 3e0b9db498..0f5d17a93f 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
@@ -33,10 +33,6 @@ extern UINT16 mTcp4RandomPort;
// Driver Produced Protocol Prototypes
//
-#define TCP4_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR ("Tcp", PrintArg)
-#define TCP4_DEBUG_WARN(PrintArg) NET_DEBUG_WARNING ("Tcp", PrintArg)
-#define TCP4_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE ("Tcp", PrintArg)
-
//
// Function prototype for the Tcp4 socket request handler
//
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
index 863ebc1ea0..82e3a600db 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
@@ -25,12 +25,12 @@ Abstract:
#include <Library/DevicePathLib.h>
-NET_LIST_ENTRY mTcpRunQue = {
+LIST_ENTRY mTcpRunQue = {
&mTcpRunQue,
&mTcpRunQue
};
-NET_LIST_ENTRY mTcpListenQue = {
+LIST_ENTRY mTcpListenQue = {
&mTcpListenQue,
&mTcpListenQue
};
@@ -193,7 +193,7 @@ TcpLocateListenTcb (
IN TCP_PEER *Remote
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
TCP_CB *Node;
TCP_CB *Match;
INTN Last;
@@ -259,7 +259,7 @@ TcpFindTcbByPeer (
)
{
TCP_PORTNO LocalPort;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
TCP_CB *Tcb;
ASSERT ((Addr != NULL) && (Port != 0));
@@ -314,7 +314,7 @@ TcpLocateTcb (
{
TCP_PEER Local;
TCP_PEER Remote;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
TCP_CB *Tcb;
Local.Port = LocalPort;
@@ -332,8 +332,8 @@ TcpLocateTcb (
if (TCP_PEER_EQUAL (&Remote, &Tcb->RemoteEnd) &&
TCP_PEER_EQUAL (&Local, &Tcb->LocalEnd)) {
- NetListRemoveEntry (&Tcb->List);
- NetListInsertHead (&mTcpRunQue, &Tcb->List);
+ RemoveEntryList (&Tcb->List);
+ InsertHeadList (&mTcpRunQue, &Tcb->List);
return Tcb;
}
@@ -364,8 +364,8 @@ TcpInsertTcb (
IN TCP_CB *Tcb
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Head;
TCP_CB *Node;
TCP4_PROTO_DATA *TcpProto;
@@ -402,7 +402,7 @@ TcpInsertTcb (
}
}
- NetListInsertHead (Head, &Tcb->List);
+ InsertHeadList (Head, &Tcb->List);
TcpProto = (TCP4_PROTO_DATA *) Tcb->Sk->ProtoReserved;
TcpSetVariableData (TcpProto->TcpService);
@@ -426,28 +426,28 @@ TcpCloneTcb (
{
TCP_CB *Clone;
- Clone = NetAllocatePool (sizeof (TCP_CB));
+ Clone = AllocatePool (sizeof (TCP_CB));
if (Clone == NULL) {
return NULL;
}
- NetCopyMem (Clone, Tcb, sizeof (TCP_CB));
+ CopyMem (Clone, Tcb, sizeof (TCP_CB));
//
// Increate the reference count of the shared IpInfo.
//
NET_GET_REF (Tcb->IpInfo);
- NetListInit (&Clone->List);
- NetListInit (&Clone->SndQue);
- NetListInit (&Clone->RcvQue);
+ InitializeListHead (&Clone->List);
+ InitializeListHead (&Clone->SndQue);
+ InitializeListHead (&Clone->RcvQue);
Clone->Sk = SockClone (Tcb->Sk);
if (Clone->Sk == NULL) {
- TCP4_DEBUG_ERROR (("TcpCloneTcb: failed to clone a sock\n"));
- NetFreePool (Clone);
+ DEBUG ((EFI_D_ERROR, "TcpCloneTcb: failed to clone a sock\n"));
+ gBS->FreePool (Clone);
return NULL;
}
@@ -519,8 +519,9 @@ TcpSetState (
IN UINT8 State
)
{
- TCP4_DEBUG_TRACE (
- ("Tcb (%x) state %s --> %s\n",
+ DEBUG (
+ (EFI_D_INFO,
+ "Tcb (%x) state %s --> %s\n",
Tcb,
mTcpStateName[Tcb->State],
mTcpStateName[State])
@@ -722,9 +723,9 @@ TcpOnAppClose (
{
ASSERT (Tcb);
- if (!NetListIsEmpty (&Tcb->RcvQue) || GET_RCV_DATASIZE (Tcb->Sk)) {
+ if (!IsListEmpty (&Tcb->RcvQue) || GET_RCV_DATASIZE (Tcb->Sk)) {
- TCP4_DEBUG_WARN (("TcpOnAppClose: connection reset "
+ DEBUG ((EFI_D_WARN, "TcpOnAppClose: connection reset "
"because data is lost for TCB %x\n", Tcb));
TcpResetConnection (Tcb);
@@ -839,13 +840,13 @@ TcpOnAppConsume (
if (TcpOld < Tcb->RcvMss) {
- TCP4_DEBUG_TRACE (("TcpOnAppConsume: send a window"
+ DEBUG ((EFI_D_INFO, "TcpOnAppConsume: send a window"
" update for a window closed Tcb(%x)\n", Tcb));
TcpSendAck (Tcb);
} else if (Tcb->DelayedAck == 0) {
- TCP4_DEBUG_TRACE (("TcpOnAppConsume: scheduled a delayed"
+ DEBUG ((EFI_D_INFO, "TcpOnAppConsume: scheduled a delayed"
" ACK to update window for Tcb(%x)\n", Tcb));
Tcb->DelayedAck = 1;
@@ -885,7 +886,7 @@ TcpOnAppAbort (
IN TCP_CB *Tcb
)
{
- TCP4_DEBUG_WARN (("TcpOnAppAbort: connection reset "
+ DEBUG ((EFI_D_WARN, "TcpOnAppAbort: connection reset "
"issued by application for TCB %x\n", Tcb));
switch (Tcb->State) {
@@ -917,7 +918,7 @@ TcpSetVariableData (
)
{
UINT32 NumConfiguredInstance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
TCP_CB *TcpPcb;
TCP4_PROTO_DATA *TcpProto;
UINTN VariableDataSize;
@@ -971,7 +972,7 @@ TcpSetVariableData (
VariableDataSize += sizeof (EFI_TCP4_SERVICE_POINT) * (NumConfiguredInstance - 1);
}
- Tcp4VariableData = NetAllocatePool (VariableDataSize);
+ Tcp4VariableData = AllocatePool (VariableDataSize);
if (Tcp4VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -994,9 +995,9 @@ TcpSetVariableData (
// This tcp instance belongs to the Tcp4Service.
//
Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
- NetCopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
- NetCopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
Tcp4ServicePoint++;
@@ -1016,9 +1017,9 @@ TcpSetVariableData (
// This tcp instance belongs to the Tcp4Service.
//
Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
- NetCopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
- NetCopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
Tcp4ServicePoint++;
@@ -1054,7 +1055,7 @@ TcpSetVariableData (
);
}
- NetFreePool (Tcp4Service->MacString);
+ gBS->FreePool (Tcp4Service->MacString);
}
Tcp4Service->MacString = NewMacString;
@@ -1069,7 +1070,7 @@ TcpSetVariableData (
ON_ERROR:
- NetFreePool (Tcp4VariableData);
+ gBS->FreePool (Tcp4VariableData);
return Status;
}
@@ -1098,7 +1099,7 @@ TcpClearVariableData (
NULL
);
- NetFreePool (Tcp4Service->MacString);
+ gBS->FreePool (Tcp4Service->MacString);
Tcp4Service->MacString = NULL;
}
@@ -1159,7 +1160,7 @@ Returns:
Sock->DevicePath
);
if (EFI_ERROR (Status)) {
- NetFreePool (Sock->DevicePath);
+ gBS->FreePool (Sock->DevicePath);
}
return Status;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c
index af1de48b97..4e65707541 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c
@@ -29,7 +29,7 @@ TcpGetUint16 (
)
{
UINT16 Value;
- NetCopyMem (&Value, Buf, sizeof (UINT16));
+ CopyMem (&Value, Buf, sizeof (UINT16));
return NTOHS (Value);
}
@@ -41,7 +41,7 @@ TcpPutUint16 (
)
{
Data = HTONS (Data);
- NetCopyMem (Buf, &Data, sizeof (UINT16));
+ CopyMem (Buf, &Data, sizeof (UINT16));
}
STATIC
@@ -51,7 +51,7 @@ TcpGetUint32 (
)
{
UINT32 Value;
- NetCopyMem (&Value, Buf, sizeof (UINT32));
+ CopyMem (&Value, Buf, sizeof (UINT32));
return NTOHL (Value);
}
@@ -63,7 +63,7 @@ TcpPutUint32 (
)
{
Data = HTONL (Data);
- NetCopyMem (Buf, &Data, sizeof (UINT32));
+ CopyMem (Buf, &Data, sizeof (UINT32));
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
index 707bc3ada3..38694f9bf5 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
@@ -162,10 +162,10 @@ TcpGetMaxSndNxt (
IN TCP_CB *Tcb
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_BUF *Nbuf;
- if (NetListIsEmpty (&Tcb->SndQue)) {
+ if (IsListEmpty (&Tcb->SndQue)) {
return Tcb->SndNxt;
}
@@ -271,8 +271,9 @@ TcpDataToSend (
SetPersistTimer:
if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) {
- TCP4_DEBUG_WARN (
- ("TcpDataToSend: enter persistent state for TCB %x\n",
+ DEBUG (
+ (EFI_D_WARN,
+ "TcpDataToSend: enter persistent state for TCB %x\n",
Tcb)
);
@@ -425,8 +426,8 @@ TcpGetSegmentSndQue (
IN UINT32 Len
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Cur;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Cur;
NET_BUF *Node;
TCP_SEG *Seg;
NET_BUF *Nbuf;
@@ -538,7 +539,7 @@ TcpGetSegmentSndQue (
}
}
- NetCopyMem (TCPSEG_NETBUF (Nbuf), Seg, sizeof (TCP_SEG));
+ CopyMem (TCPSEG_NETBUF (Nbuf), Seg, sizeof (TCP_SEG));
TCPSEG_NETBUF (Nbuf)->Seq = Seq;
TCPSEG_NETBUF (Nbuf)->End = End;
@@ -578,7 +579,7 @@ TcpGetSegmentSock (
Nbuf = NetbufAlloc (Len + TCP_MAX_HEAD);
if (Nbuf == NULL) {
- TCP4_DEBUG_ERROR (("TcpGetSegmentSock: failed to allocate "
+ DEBUG ((EFI_D_ERROR, "TcpGetSegmentSock: failed to allocate "
"a netbuf for TCB %x\n",Tcb));
return NULL;
@@ -603,7 +604,7 @@ TcpGetSegmentSock (
TCPSEG_NETBUF (Nbuf)->Seq = Seq;
TCPSEG_NETBUF (Nbuf)->End = Seq + Len;
- NetListInsertTail (&(Tcb->SndQue), &(Nbuf->List));
+ InsertTailList (&(Tcb->SndQue), &(Nbuf->List));
if (DataGet != 0) {
@@ -679,7 +680,7 @@ TcpRetransmit (
// 3. will not change the boundaries of queued segments.
//
if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
- TCP4_DEBUG_WARN (("TcpRetransmit: retransmission cancelled "
+ DEBUG ((EFI_D_WARN, "TcpRetransmit: retransmission cancelled "
"because send window too small for TCB %x\n", Tcb));
return 0;
@@ -780,8 +781,9 @@ SEND_AGAIN:
Nbuf = TcpGetSegment (Tcb, Seq, Len);
if (Nbuf == NULL) {
- TCP4_DEBUG_ERROR (
- ("TcpToSendData: failed to get a segment for TCB %x\n",
+ DEBUG (
+ (EFI_D_ERROR,
+ "TcpToSendData: failed to get a segment for TCB %x\n",
Tcb)
);
@@ -809,7 +811,7 @@ SEND_AGAIN:
TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2)
) {
- TCP4_DEBUG_TRACE (("TcpToSendData: send FIN "
+ DEBUG ((EFI_D_INFO, "TcpToSendData: send FIN "
"to peer for TCB %x in state %d\n", Tcb, Tcb->State));
End++;
@@ -829,7 +831,7 @@ SEND_AGAIN:
// don't send an empty segment here.
//
if (Seg->End == Seg->Seq) {
- TCP4_DEBUG_WARN (("TcpToSendData: created a empty"
+ DEBUG ((EFI_D_WARN, "TcpToSendData: created a empty"
" segment for TCB %x, free it now\n", Tcb));
NetbufFree (Nbuf);
@@ -886,7 +888,7 @@ SEND_AGAIN:
if ((Tcb->CongestState == TCP_CONGEST_OPEN) &&
!TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) {
- TCP4_DEBUG_TRACE (("TcpToSendData: set RTT measure "
+ DEBUG ((EFI_D_INFO, "TcpToSendData: set RTT measure "
"sequence %d for TCB %x\n", Seq, Tcb));
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);
@@ -1020,7 +1022,7 @@ TcpToSendAck (
return;
}
- TCP4_DEBUG_TRACE (("TcpToSendAck: scheduled a delayed"
+ DEBUG ((EFI_D_INFO, "TcpToSendAck: scheduled a delayed"
" ACK for TCB %x\n", Tcb));
//
@@ -1182,14 +1184,14 @@ TcpVerifySegment (
**/
INTN
TcpCheckSndQue (
- IN NET_LIST_ENTRY *Head
+ IN LIST_ENTRY *Head
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_BUF *Nbuf;
TCP_SEQNO Seq;
- if (NetListIsEmpty (Head)) {
+ if (IsListEmpty (Head)) {
return 1;
}
//
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
index cfefdf2ea3..d0e7fd4c14 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
@@ -166,15 +166,15 @@ typedef struct _TCP_PEER {
// tcp control block, it includes various states
//
struct _TCP_CB {
- NET_LIST_ENTRY List;
+ LIST_ENTRY List;
TCP_CB *Parent;
SOCKET *Sk;
TCP_PEER LocalEnd;
TCP_PEER RemoteEnd;
- NET_LIST_ENTRY SndQue; // retxmission queue
- NET_LIST_ENTRY RcvQue; // reassemble queue
+ LIST_ENTRY SndQue; // retxmission queue
+ LIST_ENTRY RcvQue; // reassemble queue
UINT32 CtrlFlag; // control flags, such as NO_NAGLE
INT32 Error; // soft error status,TCP_CONNECT_RESET...
@@ -271,8 +271,8 @@ struct _TCP_CB {
IP_IO_IP_INFO *IpInfo;
};
-extern NET_LIST_ENTRY mTcpRunQue;
-extern NET_LIST_ENTRY mTcpListenQue;
+extern LIST_ENTRY mTcpRunQue;
+extern LIST_ENTRY mTcpListenQue;
extern TCP_SEQNO mTcpGlobalIss;
extern UINT32 mTcpTick;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
index 7802ba0119..0f728a8ab9 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
@@ -105,7 +105,7 @@ TcpConnectTimeout (
)
{
if (!TCP_CONNECTED (Tcb->State)) {
- TCP4_DEBUG_ERROR (("TcpConnectTimeout: connection closed "
+ DEBUG ((EFI_D_ERROR, "TcpConnectTimeout: connection closed "
"because conenction timer timeout for TCB %x\n", Tcb));
if (EFI_ABORTED == Tcb->Sk->SockError) {
@@ -113,7 +113,7 @@ TcpConnectTimeout (
}
if (TCP_SYN_RCVD == Tcb->State) {
- TCP4_DEBUG_WARN (("TcpConnectTimeout: send reset because "
+ DEBUG ((EFI_D_WARN, "TcpConnectTimeout: send reset because "
"connection timer timeout for TCB %x\n", Tcb));
TcpResetConnection (Tcb);
@@ -141,7 +141,7 @@ TcpRexmitTimeout (
{
UINT32 FlightSize;
- TCP4_DEBUG_WARN (("TcpRexmitTimeout: transmission "
+ DEBUG ((EFI_D_WARN, "TcpRexmitTimeout: transmission "
"timeout for TCB %x\n", Tcb));
//
@@ -159,7 +159,7 @@ TcpRexmitTimeout (
if (Tcb->LossTimes > Tcb->MaxRexmit &&
!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_CONNECT)) {
- TCP4_DEBUG_ERROR (("TcpRexmitTimeout: connection closed "
+ DEBUG ((EFI_D_ERROR, "TcpRexmitTimeout: connection closed "
"because too many timeouts for TCB %x\n", Tcb));
if (EFI_ABORTED == Tcb->Sk->SockError) {
@@ -259,7 +259,7 @@ TcpFinwait2Timeout (
IN TCP_CB *Tcb
)
{
- TCP4_DEBUG_WARN (("TcpFinwait2Timeout: connection closed "
+ DEBUG ((EFI_D_WARN, "TcpFinwait2Timeout: connection closed "
"because FIN_WAIT2 timer timeouts for TCB %x\n", Tcb));
TcpClose (Tcb);
@@ -280,7 +280,7 @@ Tcp2MSLTimeout (
IN TCP_CB *Tcb
)
{
- TCP4_DEBUG_WARN (("Tcp2MSLTimeout: connection closed "
+ DEBUG ((EFI_D_WARN, "Tcp2MSLTimeout: connection closed "
"because TIME_WAIT timer timeouts for TCB %x\n", Tcb));
TcpClose (Tcb);
@@ -505,8 +505,8 @@ TcpTickingDpc (
IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
TCP_CB *Tcb;
INT16 Index;
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
index 7a7c184498..0c54364127 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
@@ -116,14 +116,14 @@ Udp4DriverBindingStart (
//
// Allocate Private Context Data Structure.
//
- Udp4Service = NetAllocatePool (sizeof (UDP4_SERVICE_DATA));
+ Udp4Service = AllocatePool (sizeof (UDP4_SERVICE_DATA));
if (Udp4Service == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Status = Udp4CreateService (Udp4Service, This->DriverBindingHandle, ControllerHandle);
if (EFI_ERROR (Status)) {
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
return Status;
}
@@ -138,7 +138,7 @@ Udp4DriverBindingStart (
);
if (EFI_ERROR (Status)) {
Udp4CleanService (Udp4Service);
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
} else {
Udp4SetVariableData (Udp4Service);
}
@@ -213,10 +213,10 @@ Udp4DriverBindingStop (
Udp4CleanService (Udp4Service);
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
} else {
- while (!NetListIsEmpty (&Udp4Service->ChildrenList)) {
+ while (!IsListEmpty (&Udp4Service->ChildrenList)) {
Instance = NET_LIST_HEAD (&Udp4Service->ChildrenList, UDP4_INSTANCE_DATA, Link);
ServiceBinding->DestroyChild (ServiceBinding, Instance->ChildHandle);
@@ -264,7 +264,7 @@ Udp4ServiceBindingCreateChild (
//
// Allocate the instance private data structure.
//
- Instance = NetAllocateZeroPool (sizeof (UDP4_INSTANCE_DATA));
+ Instance = AllocateZeroPool (sizeof (UDP4_INSTANCE_DATA));
if (Instance == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -310,15 +310,15 @@ Udp4ServiceBindingCreateChild (
goto ON_ERROR;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Link this instance into the service context data and increase the ChildrenNumber.
//
- NetListInsertTail (&Udp4Service->ChildrenList, &Instance->Link);
+ InsertTailList (&Udp4Service->ChildrenList, &Instance->Link);
Udp4Service->ChildrenNumber++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
@@ -339,7 +339,7 @@ ON_ERROR:
Udp4CleanInstance (Instance);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
@@ -440,12 +440,12 @@ Udp4ServiceBindingDestroyChild (
//
IpIoRemoveIp (Udp4Service->IpIo, Instance->IpInfo);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Remove this instance from the service context data's ChildrenList.
//
- NetListRemoveEntry (&Instance->Link);
+ RemoveEntryList (&Instance->Link);
Udp4Service->ChildrenNumber--;
//
@@ -453,9 +453,9 @@ Udp4ServiceBindingDestroyChild (
//
Udp4CleanInstance (Instance);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
index 39924cfa7a..c190a1df80 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
@@ -36,7 +36,7 @@ Udp4CheckTimeout (
STATIC
BOOLEAN
Udp4FindInstanceByPort (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_IPv4_ADDRESS *Address,
IN UINT16 Port
);
@@ -153,7 +153,7 @@ Udp4CreateService (
EFI_STATUS Status;
IP_IO_OPEN_DATA OpenData;
- NetZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA));
+ ZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA));
Udp4Service->Signature = UDP4_SERVICE_DATA_SIGNATURE;
Udp4Service->ServiceBinding = mUdp4ServiceBinding;
@@ -161,7 +161,7 @@ Udp4CreateService (
Udp4Service->ControllerHandle = ControllerHandle;
Udp4Service->ChildrenNumber = 0;
- NetListInit (&Udp4Service->ChildrenList);
+ InitializeListHead (&Udp4Service->ChildrenList);
//
// Create the IpIo for this service context.
@@ -194,7 +194,7 @@ Udp4CreateService (
//
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
Udp4CheckTimeout,
Udp4Service,
&Udp4Service->TimeoutEvent
@@ -279,10 +279,10 @@ Udp4CheckTimeout (
)
{
UDP4_SERVICE_DATA *Udp4Service;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
- NET_LIST_ENTRY *WrapEntry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *WrapEntry;
+ LIST_ENTRY *NextEntry;
UDP4_RXDATA_WRAP *Wrap;
Udp4Service = (UDP4_SERVICE_DATA *) Context;
@@ -344,9 +344,9 @@ Udp4InitInstance (
//
// Init the lists.
//
- NetListInit (&Instance->Link);
- NetListInit (&Instance->RcvdDgramQue);
- NetListInit (&Instance->DeliveredDgramQue);
+ InitializeListHead (&Instance->Link);
+ InitializeListHead (&Instance->RcvdDgramQue);
+ InitializeListHead (&Instance->DeliveredDgramQue);
//
// Init the NET_MAPs.
@@ -400,12 +400,12 @@ Udp4CleanInstance (
STATIC
BOOLEAN
Udp4FindInstanceByPort (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_IPv4_ADDRESS *Address,
IN UINT16 Port
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
EFI_UDP4_CONFIG_DATA *ConfigData;
@@ -457,7 +457,7 @@ Udp4FindInstanceByPort (
**/
EFI_STATUS
Udp4Bind (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_UDP4_CONFIG_DATA *ConfigData
)
{
@@ -701,7 +701,7 @@ Udp4ValidateTxToken (
}
if (TxData->GatewayAddress != NULL) {
- NetCopyMem (&GatewayAddress, TxData->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&GatewayAddress, TxData->GatewayAddress, sizeof (IP4_ADDR));
if (!Ip4IsUnicast (NTOHL (GatewayAddress), 0)) {
//
@@ -716,7 +716,7 @@ Udp4ValidateTxToken (
if (UdpSessionData != NULL) {
- NetCopyMem (&SourceAddress, &UdpSessionData->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&SourceAddress, &UdpSessionData->SourceAddress, sizeof (IP4_ADDR));
if ((SourceAddress != 0) && !Ip4IsUnicast (HTONL (SourceAddress), 0)) {
//
@@ -1069,7 +1069,7 @@ Udp4FlushRcvdDgram (
{
UDP4_RXDATA_WRAP *Wrap;
- while (!NetListIsEmpty (&Instance->RcvdDgramQue)) {
+ while (!IsListEmpty (&Instance->RcvdDgramQue)) {
//
// Iterate all the Wraps in the RcvdDgramQue.
//
@@ -1190,7 +1190,7 @@ Udp4MatchDgram (
return TRUE;
}
- NetCopyMem (&Destination, &Udp4Session->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &Udp4Session->DestinationAddress, sizeof (IP4_ADDR));
if (IP4_IS_LOCAL_BROADCAST (Destination) && ConfigData->AcceptBroadcast) {
//
@@ -1235,7 +1235,7 @@ Udp4RecycleRxDataWrap (
//
// Remove the Wrap from the list it belongs to.
//
- NetListRemoveEntry (&Wrap->Link);
+ RemoveEntryList (&Wrap->Link);
//
// Free the Packet associated with this Wrap.
@@ -1247,7 +1247,7 @@ Udp4RecycleRxDataWrap (
//
gBS->CloseEvent (Wrap->RxData.RecycleSignal);
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -1277,13 +1277,13 @@ Udp4WrapRxData (
//
// Allocate buffer for the Wrap.
//
- Wrap = NetAllocatePool (sizeof (UDP4_RXDATA_WRAP) +
+ Wrap = AllocatePool (sizeof (UDP4_RXDATA_WRAP) +
(Packet->BlockOpNum - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
if (Wrap == NULL) {
return NULL;
}
- NetListInit (&Wrap->Link);
+ InitializeListHead (&Wrap->Link);
CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));
@@ -1292,13 +1292,13 @@ Udp4WrapRxData (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_RECYCLE,
+ TPL_NOTIFY,
Udp4RecycleRxDataWrap,
Wrap,
&Wrap->RxData.RecycleSignal
);
if (EFI_ERROR (Status)) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
return NULL;
}
@@ -1329,7 +1329,7 @@ Udp4EnqueueDgram (
IN EFI_UDP4_RECEIVE_DATA *RxData
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
UDP4_RXDATA_WRAP *Wrap;
UINTN Enqueued;
@@ -1357,7 +1357,7 @@ Udp4EnqueueDgram (
NET_GET_REF (Packet);
- NetListInsertTail (&Instance->RcvdDgramQue, &Wrap->Link);
+ InsertTailList (&Instance->RcvdDgramQue, &Wrap->Link);
Enqueued++;
}
@@ -1386,7 +1386,7 @@ Udp4InstanceDeliverDgram (
EFI_UDP4_RECEIVE_DATA *RxData;
EFI_TPL OldTpl;
- if (!NetListIsEmpty (&Instance->RcvdDgramQue) &&
+ if (!IsListEmpty (&Instance->RcvdDgramQue) &&
!NetMapIsEmpty (&Instance->RxTokens)) {
Wrap = NET_LIST_HEAD (&Instance->RcvdDgramQue, UDP4_RXDATA_WRAP, Link);
@@ -1424,9 +1424,9 @@ Udp4InstanceDeliverDgram (
Token->Status = EFI_SUCCESS;
Token->Packet.RxData = &Wrap->RxData;
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
- NetListInsertTail (&Instance->DeliveredDgramQue, &Wrap->Link);
- NET_RESTORE_TPL (OldTpl);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
+ InsertTailList (&Instance->DeliveredDgramQue, &Wrap->Link);
+ gBS->RestoreTPL (OldTpl);
gBS->SignalEvent (Token->Event);
}
@@ -1447,7 +1447,7 @@ Udp4DeliverDgram (
IN UDP4_SERVICE_DATA *Udp4Service
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
NET_LIST_FOR_EACH (Entry, &Udp4Service->ChildrenList) {
@@ -1524,8 +1524,8 @@ Udp4Demultiplex (
Udp4Session->SourcePort = NTOHS (Udp4Header->SrcPort);
Udp4Session->DestinationPort = NTOHS (Udp4Header->DstPort);
- NetCopyMem (&Udp4Session->SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Udp4Session->DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session->SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session->DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
//
// Trim the UDP header.
@@ -1629,13 +1629,13 @@ Udp4SendPortUnreach (
//
// Copy the IP header of the datagram tragged the error.
//
- NetCopyMem (&IcmpErrHdr->IpHead, IpHdr, EFI_IP4_HEADER_LEN (IpHdr));
+ CopyMem (&IcmpErrHdr->IpHead, IpHdr, EFI_IP4_HEADER_LEN (IpHdr));
//
// Copy the UDP header.
//
Ptr = (UINT8 *) &IcmpErrHdr->IpHead + EFI_IP4_HEADER_LEN (IpHdr);
- NetCopyMem (Ptr, Udp4Header, ICMP_ERROR_PACKET_LENGTH);
+ CopyMem (Ptr, Udp4Header, ICMP_ERROR_PACKET_LENGTH);
//
// Calculate the checksum.
@@ -1650,8 +1650,8 @@ Udp4SendPortUnreach (
Override.TimeToLive = 255;
Override.Protocol = EFI_IP_PROTO_ICMP;
- NetCopyMem (&Override.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Send out this icmp packet.
@@ -1686,13 +1686,13 @@ Udp4IcmpHandler (
{
EFI_UDP4_HEADER *Udp4Header;
EFI_UDP4_SESSION_DATA Udp4Session;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
Udp4Header = (EFI_UDP4_HEADER *) NetbufGetByte (Packet, 0, NULL);
- NetCopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.SourcePort = NTOHS (Udp4Header->DstPort);
Udp4Session.DestinationPort = NTOHS (Udp4Header->SrcPort);
@@ -1815,7 +1815,7 @@ Udp4SetVariableData (
)
{
UINT32 NumConfiguredInstance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINTN VariableDataSize;
EFI_UDP4_VARIABLE_DATA *Udp4VariableData;
EFI_UDP4_SERVICE_POINT *Udp4ServicePoint;
@@ -1852,7 +1852,7 @@ Udp4SetVariableData (
VariableDataSize += sizeof (EFI_UDP4_SERVICE_POINT) * (NumConfiguredInstance - 1);
}
- Udp4VariableData = NetAllocatePool (VariableDataSize);
+ Udp4VariableData = AllocatePool (VariableDataSize);
if (Udp4VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1913,7 +1913,7 @@ Udp4SetVariableData (
);
}
- NetFreePool (Udp4Service->MacString);
+ gBS->FreePool (Udp4Service->MacString);
}
Udp4Service->MacString = NewMacString;
@@ -1928,7 +1928,7 @@ Udp4SetVariableData (
ON_ERROR:
- NetFreePool (Udp4VariableData);
+ gBS->FreePool (Udp4VariableData);
return Status;
}
@@ -1957,6 +1957,6 @@ Udp4ClearVariableData (
NULL
);
- NetFreePool (Udp4Service->MacString);
+ gBS->FreePool (Udp4Service->MacString);
Udp4Service->MacString = NULL;
}
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
index 2cf4a541b4..4ad598da02 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
@@ -71,7 +71,7 @@ typedef struct _UDP4_SERVICE_DATA_ {
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
EFI_HANDLE ImageHandle;
EFI_HANDLE ControllerHandle;
- NET_LIST_ENTRY ChildrenList;
+ LIST_ENTRY ChildrenList;
UINTN ChildrenNumber;
IP_IO *IpIo;
@@ -92,7 +92,7 @@ typedef struct _UDP4_SERVICE_DATA_ {
typedef struct _UDP4_INSTANCE_DATA_ {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
UDP4_SERVICE_DATA *Udp4Service;
EFI_UDP4_PROTOCOL Udp4Proto;
@@ -106,8 +106,8 @@ typedef struct _UDP4_INSTANCE_DATA_ {
NET_MAP McastIps;
- NET_LIST_ENTRY RcvdDgramQue;
- NET_LIST_ENTRY DeliveredDgramQue;
+ LIST_ENTRY RcvdDgramQue;
+ LIST_ENTRY DeliveredDgramQue;
UINT16 HeadSum;
@@ -119,7 +119,7 @@ typedef struct _UDP4_INSTANCE_DATA_ {
} UDP4_INSTANCE_DATA;
typedef struct _UDP4_RXDATA_WRAP_ {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
NET_BUF *Packet;
UINT32 TimeoutTick;
EFI_UDP4_RECEIVE_DATA RxData;
@@ -212,7 +212,7 @@ Udp4CleanInstance (
EFI_STATUS
Udp4Bind (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_UDP4_CONFIG_DATA *ConfigData
);
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
index 9d3b20a8a6..eb013e9150 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
@@ -80,7 +80,7 @@ Udp4GetModeData (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Udp4ConfigData != NULL) {
//
@@ -96,7 +96,7 @@ Udp4GetModeData (
//
Status = Ip->GetModeData (Ip, Ip4ModeData, MnpConfigData, SnpModeData);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -169,13 +169,13 @@ Udp4Configure (
Udp4Service = Instance->Udp4Service;
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (UdpConfigData != NULL) {
- NetCopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));
StationAddress = NTOHL (StationAddress);
SubnetMask = NTOHL (SubnetMask);
@@ -258,8 +258,8 @@ Udp4Configure (
//
// Pre calculate the checksum for the pseudo head, ignore the UDP length first.
//
- NetCopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));
Instance->HeadSum = NetPseudoHeadChecksum (
LocalAddr,
RemoteAddr,
@@ -291,14 +291,14 @@ Udp4Configure (
//
Udp4FlushRcvdDgram (Instance);
- ASSERT (NetListIsEmpty (&Instance->DeliveredDgramQue));
+ ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
}
Udp4SetVariableData (Instance->Udp4Service);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -351,7 +351,7 @@ Udp4Groups (
McastIp = 0;
if (JoinFlag) {
- NetCopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
+ CopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
return EFI_INVALID_PARAMETER;
@@ -370,7 +370,7 @@ Udp4Groups (
Ip = Instance->IpInfo->Ip;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Invoke the Ip instance the Udp4 instance consumes to do the group operation.
@@ -397,7 +397,7 @@ Udp4Groups (
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -543,7 +543,7 @@ Udp4Transmit (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Validate the Token, if the token is invalid return the error code.
@@ -607,7 +607,7 @@ Udp4Transmit (
// UdpSessionData.
//
if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) {
- NetCopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
}
if (UdpSessionData->SourcePort != 0) {
@@ -618,8 +618,8 @@ Udp4Transmit (
Udp4Header->DstPort = HTONS (UdpSessionData->DestinationPort);
}
- NetCopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));
//
// calculate the pseudo head checksum using the overridden parameters.
@@ -634,7 +634,7 @@ Udp4Transmit (
//
// UdpSessionData is NULL, use the address and port information previously configured.
//
- NetCopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));
HeadSum = Instance->HeadSum;
}
@@ -654,9 +654,9 @@ Udp4Transmit (
// Fill the IpIo Override data.
//
if (TxData->GatewayAddress != NULL) {
- NetCopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
} else {
- NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
}
Override.Protocol = EFI_IP_PROTO_UDP;
@@ -697,7 +697,7 @@ FREE_PACKET:
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -755,7 +755,7 @@ Udp4Receive (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp4TokenExist, Token))||
EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp4TokenExist, Token))) {
@@ -795,7 +795,7 @@ Udp4Receive (
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -848,7 +848,7 @@ Udp4Cancel (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Cancle the tokens specified by Token for this instance.
@@ -860,7 +860,7 @@ Udp4Cancel (
//
NetLibDispatchDpc ();
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index b76461a70d..ee17ea358d 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -62,11 +62,11 @@ PxeBcInitSeedPacket (
Header = &Seed->Dhcp4.Header;
- NetZeroMem (Header, sizeof (EFI_DHCP4_HEADER));
+ ZeroMem (Header, sizeof (EFI_DHCP4_HEADER));
Header->OpCode = PXEBC_DHCP4_OPCODE_REQUEST;
Header->HwType = Mode.IfType;
Header->HwAddrLen = (UINT8) Mode.HwAddressSize;
- NetCopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);
+ CopyMem (Header->ClientHwAddr, &Mode.CurrentAddress, Header->HwAddrLen);
Seed->Dhcp4.Magik = PXEBC_DHCP4_MAGIC;
Seed->Dhcp4.Option[0] = PXEBC_DHCP4_TAG_EOP;
@@ -90,7 +90,7 @@ PxeBcCopyEfiDhcp4Packet (
{
ASSERT (Dst->Size >= Src->Length);
- NetCopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length);
+ CopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length);
Dst->Length = Src->Length;
}
@@ -119,7 +119,7 @@ PxeBcCopyProxyOffer (
Offer = &Private->Dhcp4Offers[OfferIndex].Packet.Offer;
PxeBcCopyEfiDhcp4Packet (&Private->ProxyOffer.Packet.Offer, Offer);
- NetCopyMem (&Mode->ProxyOffer, &Offer->Dhcp4, Offer->Length);
+ CopyMem (&Mode->ProxyOffer, &Offer->Dhcp4, Offer->Length);
Mode->ProxyOfferReceived = TRUE;
PxeBcParseCachedDhcpPacket (&Private->ProxyOffer);
@@ -147,8 +147,8 @@ PxeBcParseCachedDhcpPacket (
UINTN Index;
CachedPacket->IsPxeOffer = FALSE;
- NetZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
- NetZeroMem (&CachedPacket->PxeVendorOption, sizeof (CachedPacket->PxeVendorOption));
+ ZeroMem (CachedPacket->Dhcp4Option, sizeof (CachedPacket->Dhcp4Option));
+ ZeroMem (&CachedPacket->PxeVendorOption, sizeof (CachedPacket->PxeVendorOption));
Offer = &CachedPacket->Packet.Offer;
Options = CachedPacket->Dhcp4Option;
@@ -169,7 +169,7 @@ PxeBcParseCachedDhcpPacket (
//
Option = Options[PXEBC_DHCP4_TAG_INDEX_CLASS_ID];
if ((Option != NULL) && (Option->Length >= 9) &&
- (NetCompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) {
+ (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) {
CachedPacket->IsPxeOffer = TRUE;
}
@@ -241,19 +241,6 @@ PxeBcParseCachedDhcpPacket (
// return false since mtftp not supported currently.
//
return FALSE;
-#if 0
- //
- // WFM11A, make sure bootfile is present
- //
- if (CachedPacket->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) {
- //
- // Discard this offer.
- //
- return ;
- }
-
- OfferType = DHCP4_PACKET_TYPE_WFM11A;
-#endif
} else {
//
// If the binl offer with only PXEClient.
@@ -296,7 +283,7 @@ PxeBcTryBinl (
//
// next server ip address is zero, use server id option instead.
//
- NetCopyMem (
+ CopyMem (
&ServerIp.Addr[0],
Private->Dhcp4Offers[Index].Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
sizeof (EFI_IPv4_ADDRESS)
@@ -305,7 +292,7 @@ PxeBcTryBinl (
//
// use next server ip address.
//
- NetCopyMem (&ServerIp.Addr[0], &Offer->Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&ServerIp.Addr[0], &Offer->Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
}
CachedPacket = &Private->ProxyOffer;
@@ -340,7 +327,7 @@ PxeBcTryBinl (
}
Private->PxeBc.Mode->ProxyOfferReceived = TRUE;
- NetCopyMem (&Private->PxeBc.Mode->ProxyOffer, &Reply->Dhcp4, Reply->Length);
+ CopyMem (&Private->PxeBc.Mode->ProxyOffer, &Reply->Dhcp4, Reply->Length);
return TRUE;
}
@@ -511,7 +498,7 @@ PxeBcCheckSelectedOffer (
//
// Copy the dhcp ack.
//
- NetCopyMem (&Mode->DhcpAck, &Ack->Dhcp4, Ack->Length);
+ CopyMem (&Mode->DhcpAck, &Ack->Dhcp4, Ack->Length);
}
return Status;
@@ -789,7 +776,7 @@ PxeBcDhcpCallBack (
);
if (MaxMsgSize != NULL) {
Value = HTONS (PXEBC_DHCP4_MAX_PACKET_SIZE);
- NetCopyMem (MaxMsgSize->Data, &Value, sizeof (Value));
+ CopyMem (MaxMsgSize->Data, &Value, sizeof (Value));
}
if ((Dhcp4Event != Dhcp4SelectOffer) && (Callback != NULL)) {
@@ -814,7 +801,7 @@ PxeBcDhcpCallBack (
//
// Cache the dhcp discover packet, of which some information will be used later.
//
- NetCopyMem (Mode->DhcpDiscover.Raw, &Packet->Dhcp4, Packet->Length);
+ CopyMem (Mode->DhcpDiscover.Raw, &Packet->Dhcp4, Packet->Length);
break;
@@ -901,7 +888,7 @@ PxeBcBuildDhcpOptions (
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE);
OptEnt.MaxMesgSize = (PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *) OptList[Index]->Data;
Value = NTOHS (PXEBC_DHCP4_MAX_PACKET_SIZE);
- NetCopyMem (&OptEnt.MaxMesgSize->Size, &Value, sizeof (UINT16));
+ CopyMem (&OptEnt.MaxMesgSize->Size, &Value, sizeof (UINT16));
Index++;
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
}
@@ -988,7 +975,7 @@ PxeBcBuildDhcpOptions (
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_ARCH);
OptEnt.Arch = (PXEBC_DHCP4_OPTION_ARCH *) OptList[Index]->Data;
Value = HTONS (SYS_ARCH);
- NetCopyMem (&OptEnt.Arch->Type, &Value, sizeof (UINT16));
+ CopyMem (&OptEnt.Arch->Type, &Value, sizeof (UINT16));
Index++;
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
@@ -998,9 +985,9 @@ PxeBcBuildDhcpOptions (
OptList[Index]->OpCode = PXEBC_DHCP4_TAG_CLASS_ID;
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_CLID);
OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;
- NetCopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));
+ CopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));
CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));
- NetCopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
+ CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));
CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));
Index++;
@@ -1080,7 +1067,7 @@ PxeBcDiscvBootService (
// Add vendor option of PXE_BOOT_ITEM
//
VendorOptLen = (sizeof (EFI_DHCP4_PACKET_OPTION) - 1) * 2 + sizeof (PXEBC_OPTION_BOOT_ITEM) + 1;
- OptList[OptCount] = NetAllocatePool (VendorOptLen);
+ OptList[OptCount] = AllocatePool (VendorOptLen);
if (OptList[OptCount] == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1101,7 +1088,7 @@ PxeBcDiscvBootService (
Status = Dhcp4->Build (Dhcp4, &Private->SeedPacket, 0, NULL, OptCount, OptList, &Token.Packet);
if (IsDiscv) {
- NetFreePool (OptList[OptCount - 1]);
+ gBS->FreePool (OptList[OptCount - 1]);
}
if (EFI_ERROR (Status)) {
@@ -1110,24 +1097,24 @@ PxeBcDiscvBootService (
Token.Packet->Dhcp4.Header.Xid = NET_RANDOM (NetRandomInitSeed ());
Token.Packet->Dhcp4.Header.Reserved = (UINT16) ((IsBCast) ? 0xf000 : 0x0);
- NetCopyMem (&Token.Packet->Dhcp4.Header.ClientAddr, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.Packet->Dhcp4.Header.ClientAddr, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
Token.RemotePort = Sport;
if (DestIp == NULL) {
- NetSetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
+ SetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
} else {
- NetCopyMem (&Token.RemoteAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.RemoteAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
}
- NetCopyMem (&Token.GatewayAddress, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Token.GatewayAddress, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
if (!IsBCast) {
Token.ListenPointCount = 1;
Token.ListenPoints = &ListenPoint;
Token.ListenPoints[0].ListenPort = PXEBC_BS_DISCOVER_PORT;
- NetCopyMem (&Token.ListenPoints[0].ListenAddress, &Private->StationIp, sizeof(EFI_IPv4_ADDRESS));
- NetCopyMem (&Token.ListenPoints[0].SubnetMask, &Private->SubnetMask, sizeof(EFI_IPv4_ADDRESS));
+ CopyMem (&Token.ListenPoints[0].ListenAddress, &Private->StationIp, sizeof(EFI_IPv4_ADDRESS));
+ CopyMem (&Token.ListenPoints[0].SubnetMask, &Private->SubnetMask, sizeof(EFI_IPv4_ADDRESS));
}
//
// Send Pxe Discover
@@ -1183,10 +1170,10 @@ PxeBcDiscvBootService (
}
if (IsDiscv) {
- NetCopyMem (&(Mode->PxeDiscover), &(Token.Packet->Dhcp4), Token.Packet->Length);
+ CopyMem (&(Mode->PxeDiscover), &(Token.Packet->Dhcp4), Token.Packet->Length);
Mode->PxeDiscoverValid = TRUE;
- NetCopyMem (Mode->PxeReply.Raw, &Response->Dhcp4, Response->Length);
+ CopyMem (Mode->PxeReply.Raw, &Response->Dhcp4, Response->Length);
Mode->PxeReplyReceived = TRUE;
}
} else {
@@ -1196,12 +1183,12 @@ PxeBcDiscvBootService (
//
// free the responselist
//
- NetFreePool (Token.ResponseList);
+ gBS->FreePool (Token.ResponseList);
}
//
// Free the dhcp packet
//
- NetFreePool (Token.Packet);
+ gBS->FreePool (Token.Packet);
return Status;
}
@@ -1284,17 +1271,17 @@ PxeBcParseVendorOptions (
case PXEBC_VENDOR_TAG_MTFTP_IP:
- NetCopyMem (&VendorOption->MtftpIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->MtftpIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
break;
case PXEBC_VENDOR_TAG_MTFTP_CPORT:
- NetCopyMem (&VendorOption->MtftpCPort, PxeOption->Data, sizeof (VendorOption->MtftpCPort));
+ CopyMem (&VendorOption->MtftpCPort, PxeOption->Data, sizeof (VendorOption->MtftpCPort));
break;
case PXEBC_VENDOR_TAG_MTFTP_SPORT:
- NetCopyMem (&VendorOption->MtftpSPort, PxeOption->Data, sizeof (VendorOption->MtftpSPort));
+ CopyMem (&VendorOption->MtftpSPort, PxeOption->Data, sizeof (VendorOption->MtftpSPort));
break;
case PXEBC_VENDOR_TAG_MTFTP_TIMEOUT:
@@ -1314,7 +1301,7 @@ PxeBcParseVendorOptions (
case PXEBC_VENDOR_TAG_DISCOVER_MCAST:
- NetCopyMem (&VendorOption->DiscoverMcastIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->DiscoverMcastIp, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
break;
case PXEBC_VENDOR_TAG_BOOT_SERVERS:
@@ -1337,9 +1324,9 @@ PxeBcParseVendorOptions (
case PXEBC_VENDOR_TAG_MCAST_ALLOC:
- NetCopyMem (&VendorOption->McastIpBase, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&VendorOption->McastIpBlock, PxeOption->Data + 4, sizeof (VendorOption->McastIpBlock));
- NetCopyMem (&VendorOption->McastIpRange, PxeOption->Data + 6, sizeof (VendorOption->McastIpRange));
+ CopyMem (&VendorOption->McastIpBase, PxeOption->Data, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&VendorOption->McastIpBlock, PxeOption->Data + 4, sizeof (VendorOption->McastIpBlock));
+ CopyMem (&VendorOption->McastIpRange, PxeOption->Data + 6, sizeof (VendorOption->McastIpRange));
break;
case PXEBC_VENDOR_TAG_CREDENTIAL_TYPES:
@@ -1350,8 +1337,8 @@ PxeBcParseVendorOptions (
case PXEBC_VENDOR_TAG_BOOT_ITEM:
- NetCopyMem (&VendorOption->BootSrvType, PxeOption->Data, sizeof (VendorOption->BootSrvType));
- NetCopyMem (&VendorOption->BootSrvLayer, PxeOption->Data + 2, sizeof (VendorOption->BootSrvLayer));
+ CopyMem (&VendorOption->BootSrvType, PxeOption->Data, sizeof (VendorOption->BootSrvType));
+ CopyMem (&VendorOption->BootSrvLayer, PxeOption->Data + 2, sizeof (VendorOption->BootSrvLayer));
break;
}
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
index b947340abc..d6907955a5 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
@@ -141,7 +141,7 @@ PxeBcDriverBindingStart (
UINTN Index;
EFI_STATUS Status;
- Private = NetAllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA));
+ Private = AllocateZeroPool (sizeof (PXEBC_PRIVATE_DATA));
if (Private == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -246,7 +246,7 @@ PxeBcDriverBindingStart (
goto ON_ERROR;
}
- NetZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA));
+ ZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA));
Private->Udp4CfgData.AcceptBroadcast = TRUE;
Private->Udp4CfgData.AcceptPromiscuous = FALSE;
Private->Udp4CfgData.AcceptAnyPort = FALSE;
@@ -322,7 +322,7 @@ ON_ERROR:
);
}
- NetFreePool (Private);
+ gBS->FreePool (Private);
return Status;
}
@@ -433,7 +433,7 @@ PxeBcDriverBindingStop (
Private->Mtftp4Child
);
- NetFreePool (Private);
+ gBS->FreePool (Private);
}
return Status;
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index 8d7b3d03ef..85542f2b2e 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
@@ -193,7 +193,7 @@ EfiPxeBcDhcp (
//
// Set the DHCP4 config data.
//
- NetZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4CfgData.OptionCount = OptCount;
Dhcp4CfgData.OptionList = OptList;
Dhcp4CfgData.Dhcp4Callback = PxeBcDhcpCallBack;
@@ -216,8 +216,8 @@ EfiPxeBcDhcp (
//
Private->NumOffers = 0;
Private->BootpIndex = 0;
- NetZeroMem (Private->ServerCount, sizeof (Private->ServerCount));
- NetZeroMem (Private->ProxyIndex, sizeof (Private->ProxyIndex));
+ ZeroMem (Private->ServerCount, sizeof (Private->ServerCount));
+ ZeroMem (Private->ProxyIndex, sizeof (Private->ProxyIndex));
Status = Dhcp4->Start (Dhcp4, NULL);
if (EFI_ERROR (Status)) {
@@ -241,9 +241,9 @@ EfiPxeBcDhcp (
ASSERT (Dhcp4Mode.State == Dhcp4Bound);
- NetCopyMem (&Private->StationIp, &Dhcp4Mode.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Private->SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Private->GatewayIp, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->StationIp, &Dhcp4Mode.ClientAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->GatewayIp, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Check the selected offer to see whether BINL is required, if no or BINL is
@@ -262,7 +262,7 @@ EfiPxeBcDhcp (
//
// Remove the previously configured option list and callback function
//
- NetZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
+ ZeroMem (&Dhcp4CfgData, sizeof (EFI_DHCP4_CONFIG_DATA));
Dhcp4->Configure (Dhcp4, &Dhcp4CfgData);
Private->AddressIsOk = TRUE;
@@ -385,7 +385,7 @@ EfiPxeBcDiscover (
//
// Get the multicast discover ip address from vendor option.
//
- NetCopyMem (&DefaultInfo.ServerMCastIp.Addr, &VendorOpt->DiscoverMcastIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&DefaultInfo.ServerMCastIp.Addr, &VendorOpt->DiscoverMcastIp, sizeof (EFI_IPv4_ADDRESS));
}
DefaultInfo.IpCnt = 0;
@@ -444,7 +444,7 @@ EfiPxeBcDiscover (
if (BootSvrEntry == NULL) {
Private->ServerIp.Addr[0] = SrvList[Index].IpAddr.Addr[0];
} else {
- NetCopyMem (&Private->ServerIp, &BootSvrEntry->IpAddr[Index], sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &BootSvrEntry->IpAddr[Index], sizeof (EFI_IPv4_ADDRESS));
}
Status = PxeBcDiscvBootService (
@@ -497,7 +497,7 @@ EfiPxeBcDiscover (
}
if (Mode->PxeBisReplyReceived) {
- NetCopyMem (&Private->ServerIp, &Mode->PxeReply.Dhcpv4.BootpSiAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &Mode->PxeReply.Dhcpv4.BootpSiAddr, sizeof (EFI_IPv4_ADDRESS));
}
return Status;
@@ -568,10 +568,10 @@ EfiPxeBcMtftp (
Mtftp4Config.TimeoutValue = PXEBC_MTFTP_TIMEOUT;
Mtftp4Config.TryCount = PXEBC_MTFTP_RETRIES;
- NetCopyMem (&Mtftp4Config.StationIp, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.SubnetMask, &Private->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.GatewayIp, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Mtftp4Config.ServerIp, ServerIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.StationIp, &Private->StationIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.SubnetMask, &Private->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.GatewayIp, &Private->GatewayIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Mtftp4Config.ServerIp, ServerIp, sizeof (EFI_IPv4_ADDRESS));
switch (Operation) {
@@ -769,13 +769,13 @@ EfiPxeBcUdpWrite (
ZeroMem (&Token, sizeof (EFI_UDP4_COMPLETION_TOKEN));
ZeroMem (&Udp4Session, sizeof (EFI_UDP4_SESSION_DATA));
- NetCopyMem (&Udp4Session.DestinationAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.DestinationAddress, DestIp, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.DestinationPort = *DestPort;
- NetCopyMem (&Udp4Session.SourceAddress, SrcIp, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.SourceAddress, SrcIp, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.SourcePort = *SrcPort;
FragCount = (HeaderSize != NULL) ? 2 : 1;
- Udp4TxData = (EFI_UDP4_TRANSMIT_DATA *) NetAllocatePool (sizeof (EFI_UDP4_TRANSMIT_DATA) + (FragCount - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
+ Udp4TxData = (EFI_UDP4_TRANSMIT_DATA *) AllocatePool (sizeof (EFI_UDP4_TRANSMIT_DATA) + (FragCount - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
if (Udp4TxData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -799,7 +799,7 @@ EfiPxeBcUdpWrite (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
PxeBcCommonNotify,
&IsDone,
&Token.Event
@@ -826,7 +826,7 @@ ON_EXIT:
gBS->CloseEvent (Token.Event);
}
- NetFreePool (Udp4TxData);
+ gBS->FreePool (Udp4TxData);
return Status;
}
@@ -928,7 +928,7 @@ EfiPxeBcUdpRead (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
PxeBcCommonNotify,
&IsDone,
&Token.Event
@@ -968,7 +968,7 @@ EfiPxeBcUdpRead (
Matched = TRUE;
if (DestIp != NULL) {
- NetCopyMem (DestIp, &Session->DestinationAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (DestIp, &Session->DestinationAddress, sizeof (EFI_IPv4_ADDRESS));
}
} else {
if (DestIp != NULL) {
@@ -1006,7 +1006,7 @@ EfiPxeBcUdpRead (
if (OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) {
if (SrcIp != NULL) {
- NetCopyMem (SrcIp, &Session->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (SrcIp, &Session->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
}
} else {
@@ -1039,7 +1039,7 @@ EfiPxeBcUdpRead (
if (HeaderSize != NULL) {
CopyLen = MIN (*HeaderSize, RxData->DataLength);
- NetCopyMem (HeaderPtr, RxData->FragmentTable[0].FragmentBuffer, CopyLen);
+ CopyMem (HeaderPtr, RxData->FragmentTable[0].FragmentBuffer, CopyLen);
*HeaderSize = CopyLen;
}
@@ -1049,7 +1049,7 @@ EfiPxeBcUdpRead (
} else {
*BufferSize = RxData->DataLength - CopyLen;
- NetCopyMem (BufferPtr, (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen, *BufferSize);
+ CopyMem (BufferPtr, (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen, *BufferSize);
}
} else {
@@ -1397,27 +1397,27 @@ EfiPxeBcSetPackets (
}
if (NewDhcpDiscover != NULL) {
- NetCopyMem (&Mode->DhcpDiscover, NewDhcpDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->DhcpDiscover, NewDhcpDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewDhcpAck != NULL) {
- NetCopyMem (&Mode->DhcpAck, NewDhcpAck, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->DhcpAck, NewDhcpAck, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewProxyOffer != NULL) {
- NetCopyMem (&Mode->ProxyOffer, NewProxyOffer, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->ProxyOffer, NewProxyOffer, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeDiscover != NULL) {
- NetCopyMem (&Mode->PxeDiscover, NewPxeDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeDiscover, NewPxeDiscover, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeReply != NULL) {
- NetCopyMem (&Mode->PxeReply, NewPxeReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeReply, NewPxeReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
if (NewPxeBisReply != NULL) {
- NetCopyMem (&Mode->PxeBisReply, NewPxeBisReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
+ CopyMem (&Mode->PxeBisReply, NewPxeBisReply, sizeof (EFI_PXE_BASE_CODE_PACKET));
}
return EFI_SUCCESS;
@@ -1623,12 +1623,12 @@ DiscoverBootFile (
Packet = &Private->Dhcp4Ack;
}
- NetCopyMem (&Private->ServerIp, &Packet->Packet.Offer.Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Private->ServerIp, &Packet->Packet.Offer.Dhcp4.Header.ServerAddr, sizeof (EFI_IPv4_ADDRESS));
if (Private->ServerIp.Addr[0] == 0) {
//
// next server ip address is zero, use option 54 instead
//
- NetCopyMem (
+ CopyMem (
&Private->ServerIp,
Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
sizeof (EFI_IPv4_ADDRESS)
@@ -1646,7 +1646,7 @@ DiscoverBootFile (
//
// Already have the bootfile length option, compute the file size
//
- NetCopyMem (&Value, Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN]->Data, sizeof (Value));
+ CopyMem (&Value, Packet->Dhcp4Option[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN]->Data, sizeof (Value));
Value = NTOHS (Value);
*BufferSize = 512 * Value;
Status = EFI_BUFFER_TOO_SMALL;
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c
index 08cdb31f84..495f24120d 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c
@@ -184,12 +184,12 @@ PxeBcTftpGetFileSize (
OptCnt--;
}
- NetFreePool (Option);
+ gBS->FreePool (Option);
ON_ERROR:
if (Packet != NULL) {
- NetFreePool (Packet);
+ gBS->FreePool (Packet);
}
Mtftp4->Configure (Mtftp4, NULL);