#ifndef _NET_LIB_H_\r
#define _NET_LIB_H_\r
\r
-#include <Protocol/Dpc.h>\r
-\r
typedef UINT32 IP4_ADDR;\r
typedef UINT32 TCP_SEQNO;\r
typedef UINT16 TCP_PORTNO;\r
IN EFI_GUID *ProtocolGuid\r
);\r
\r
-/**\r
- Add a Deferred Procedure Call to the end of the DPC queue.\r
-\r
- @param[in] DpcTpl The EFI_TPL that the DPC should be invoked.\r
- @param[in] DpcProcedure Pointer to the DPC's function.\r
- @param[in] DpcContext Pointer to the DPC's context. Passed to DpcProcedure\r
- when DpcProcedure is invoked.\r
-\r
- @retval EFI_SUCCESS The DPC was queued.\r
- @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL, or DpcProcedure\r
- is NULL.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to\r
- add the DPC to the queue.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-NetLibQueueDpc (\r
- IN EFI_TPL DpcTpl,\r
- IN EFI_DPC_PROCEDURE DpcProcedure,\r
- IN VOID *DpcContext OPTIONAL\r
- );\r
-\r
-/**\r
- Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl\r
- value greater than or equal to the current TPL are invoked in the order that\r
- they were queued. DPCs with higher DpcTpl values are invoked before DPCs with\r
- lower DpcTpl values.\r
-\r
- @retval EFI_SUCCESS One or more DPCs were invoked.\r
- @retval EFI_NOT_FOUND No DPCs were invoked.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-NetLibDispatchDpc (\r
- VOID\r
- );\r
-\r
/**\r
This is the default unload handle for all the network drivers.\r
\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
+#include <Library/DpcLib.h>\r
\r
\r
LIST_ENTRY mActiveIpIoList = {\r
//\r
// Request IpIoTransmitHandlerDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, IpIoTransmitHandlerDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, IpIoTransmitHandlerDpc, Context);\r
}\r
\r
\r
//\r
// Request IpIoDummyHandlerDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, IpIoDummyHandlerDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, IpIoDummyHandlerDpc, Context);\r
}\r
\r
\r
//\r
// Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, IpIoListenHandlerDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, IpIoListenHandlerDpc, Context);\r
}\r
\r
\r
UefiBootServicesTableLib\r
MemoryAllocationLib\r
BaseMemoryLib\r
+ DpcLib\r
#include <Protocol/HiiConfigRouting.h>\r
#include <Protocol/ComponentName.h>\r
#include <Protocol/ComponentName2.h>\r
-#include <Protocol/Dpc.h>\r
\r
#include <Guid/NicIp4ConfigNvData.h>\r
\r
#include <Library/HiiLib.h>\r
#include <Library/PrintLib.h>\r
\r
-EFI_DPC_PROTOCOL *mDpc = NULL;\r
-\r
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mNetLibHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
\r
#define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE\r
gBS->FreePool (OpenBuffer);\r
return Handle;\r
}\r
-\r
-/**\r
- Add a Deferred Procedure Call to the end of the DPC queue.\r
-\r
- @param[in] DpcTpl The EFI_TPL that the DPC should be invoked.\r
- @param[in] DpcProcedure Pointer to the DPC's function.\r
- @param[in] DpcContext Pointer to the DPC's context. Passed to DpcProcedure\r
- when DpcProcedure is invoked.\r
-\r
- @retval EFI_SUCCESS The DPC was queued.\r
- @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL, or DpcProcedure\r
- is NULL.\r
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to\r
- add the DPC to the queue.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-NetLibQueueDpc (\r
- IN EFI_TPL DpcTpl,\r
- IN EFI_DPC_PROCEDURE DpcProcedure,\r
- IN VOID *DpcContext OPTIONAL\r
- )\r
-{\r
- return mDpc->QueueDpc (mDpc, DpcTpl, DpcProcedure, DpcContext);\r
-}\r
-\r
-/**\r
- Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl\r
- value greater than or equal to the current TPL are invoked in the order that\r
- they were queued. DPCs with higher DpcTpl values are invoked before DPCs with\r
- lower DpcTpl values.\r
-\r
- @retval EFI_SUCCESS One or more DPCs were invoked.\r
- @retval EFI_NOT_FOUND No DPCs were invoked.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-NetLibDispatchDpc (\r
- VOID\r
- )\r
-{\r
- return mDpc->DispatchDpc(mDpc);\r
-}\r
-\r
-/**\r
- The constructor function caches the pointer to DPC protocol.\r
-\r
- The constructor function locates DPC protocol from protocol database.\r
- It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.\r
-\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
- @param[in] SystemTable A pointer to the EFI System Table.\r
-\r
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-NetLibConstructor (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- Status = gBS->LocateProtocol (&gEfiDpcProtocolGuid, NULL, (VOID**) &mDpc);\r
- ASSERT_EFI_ERROR (Status);\r
- ASSERT (mDpc != NULL);\r
-\r
- return Status;\r
-}\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = NetLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
- CONSTRUCTOR = NetLibConstructor\r
-\r
#\r
# The following information is for reference only and not required by the build tools.\r
#\r
PrintLib\r
\r
[Guids] \r
- gEfiNicIp4ConfigVariableGuid \r
+ gEfiNicIp4ConfigVariableGuid\r
\r
[Protocols]\r
gEfiSimpleNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
- gEfiDpcProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiComponentNameProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiComponentName2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiHiiConfigRoutingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
-[Depex]\r
- gEfiDpcProtocolGuid\r
-
\ No newline at end of file
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/BaseMemoryLib.h>\r
+#include <Library/DpcLib.h>\r
\r
\r
/**\r
//\r
// Request UdpIoOnDgramSentDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, UdpIoOnDgramSentDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, UdpIoOnDgramSentDpc, Context);\r
}\r
\r
/**\r
//\r
// Request UdpIoOnDgramRcvdDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, UdpIoOnDgramRcvdDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, UdpIoOnDgramRcvdDpc, Context);\r
}\r
\r
/**\r
UefiBootServicesTableLib\r
MemoryAllocationLib\r
BaseMemoryLib\r
+ DpcLib\r
\r
[Protocols]\r
gEfiUdp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
- gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
\ No newline at end of file
+ gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
UefiDriverEntryPoint\r
DebugLib\r
NetLib\r
-\r
+ DpcLib\r
\r
[Protocols]\r
gEfiManagedNetworkServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiArpServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiManagedNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiArpProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
//\r
// Request ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameRcvdDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, ArpOnFrameRcvdDpc, Context);\r
}\r
\r
/**\r
//\r
// Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameSentDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, ArpOnFrameSentDpc, Context);\r
}\r
\r
\r
//\r
// Dispatch the DPCs queued by the NotifyFunction of the Context->UserRequestEvent.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
return Count;\r
}\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
+#include <Library/DpcLib.h>\r
\r
//\r
// Ethernet protocol type definitions.\r
//\r
// Dispatch the DPC queued by the NotifyFunction of ResolvedEvent.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
\r
return Status;\r
// Dispatch the DPCs queued by the NotifyFunction of the events signaled\r
// by ArpCancleRequest.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
gBS->RestoreTPL (OldTpl);\r
\r
//\r
if (Reconfig && (Instance->ReconfigEvent != NULL)) {\r
Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
\r
return Status;\r
gBS->SignalEvent (Instance->DoneEvent);\r
Ip4ConfigCleanDhcp4 (Instance);\r
\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
return ;\r
}\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
return Status;\r
}\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/HiiLib.h>\r
#include <Library/PrintLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#include "NicIp4Variable.h"\r
\r
NetLib\r
HiiLib\r
PrintLib\r
-\r
+ DpcLib\r
\r
[Protocols]\r
gEfiDhcp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
[Guids]\r
gEfiIfrTianoGuid ## CONSUMES ## Guid\r
gEfiNicIp4ConfigVariableGuid ## CONSUMES ## Guid\r
-
\ No newline at end of file
UefiRuntimeServicesTableLib\r
DebugLib\r
NetLib\r
-\r
+ DpcLib\r
\r
[Protocols]\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiManagedNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiArpProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
//\r
// Request Ip4OnArpResolvedDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context);\r
}\r
\r
\r
//\r
// Request Ip4OnFrameSentDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context);\r
}\r
\r
\r
//\r
// Request Ip4OnFrameReceivedDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context);\r
}\r
\r
\r
//\r
// Request Ip4AutoConfigCallBackDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, Ip4AutoConfigCallBackDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, Ip4AutoConfigCallBackDpc, Context);\r
}\r
\r
\r
//\r
// Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
\r
gBS->FreePool (Wrap);\r
// Dispatch the DPC queued by the NotifyFunction of this instane's receive\r
// event.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
// Dispatch the DPCs queued by the NotifyFunction of the canceled rx token's\r
// events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
if (EFI_ERROR (Status)) {\r
if ((Token != NULL) && (Status == EFI_ABORTED)) {\r
return EFI_SUCCESS;\r
#include <Library/NetLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#include "Ip4Common.h"\r
#include "Ip4Driver.h"\r
// Dispatch the DPCs queued by the NotifyFunction of the rx token's events\r
// which are signaled with received data.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
RESTART:\r
Ip4ReceiveFrame (IpSb->DefaultInterface, NULL, Ip4AccpetFrame, IpSb);\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiLib.h>\r
#include <Library/NetLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#include "ComponentName.h"\r
\r
UefiDriverEntryPoint\r
DebugLib\r
NetLib\r
-\r
+ DpcLib\r
\r
[Protocols]\r
gEfiManagedNetworkServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiSimpleNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiManagedNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
//\r
// Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
return EFI_SUCCESS;\r
}\r
//\r
// Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
//\r
// Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
\r
ON_EXIT:\r
//\r
// Dispatch the DPC queued by the NotifyFunction of the cancled token's events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
//\r
// Dispatch the DPC queued by the NotifyFunction of rx token's events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiDriverEntryPoint.h>\r
#include <Library/UefiLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#define SOCK_SND_BUF 0\r
#define SOCK_RCV_BUF 1\r
NetLib\r
IpIoLib\r
DevicePathLib\r
+ DpcLib\r
\r
[Protocols]\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiTcp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiTcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
IN VOID *Context\r
)\r
{\r
- NetLibQueueDpc (TPL_CALLBACK, TcpTickingDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, TcpTickingDpc, Context);\r
}\r
\r
DebugLib\r
IpIoLib\r
NetLib\r
-\r
+ DpcLib\r
\r
[Protocols]\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiUdp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r
//\r
Token->Status = Status;\r
gBS->SignalEvent (Token->Event);\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
}\r
\r
// Dispatch the DPC queued by the NotifyFunction of the rx token's events\r
// which are signaled with received data.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
}\r
\r
\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/TimerLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#include "Udp4Driver.h"\r
\r
//\r
// Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
ON_EXIT:\r
\r
//\r
// Dispatch the DPC queued by the NotifyFunction of the cancelled token's events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
gBS->RestoreTPL (OldTpl);\r
\r
//\r
// Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK\r
//\r
- NetLibQueueDpc (TPL_CALLBACK, IcmpErrorListenHandlerDpc, Context);\r
+ QueueDpc (TPL_CALLBACK, IcmpErrorListenHandlerDpc, Context);\r
}\r
\r
/** \r
// Dispatch the DPCs queued by the NotifyFunction of the canceled rx token's\r
// events.\r
//\r
- NetLibDispatchDpc ();\r
+ DispatchDpc ();\r
\r
Private->Ip4->Configure (Private->Ip4, NULL);\r
\r
#include <Library/UefiLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/NetLib.h>\r
+#include <Library/DpcLib.h>\r
\r
#include "PxeBcDriver.h"\r
#include "PxeArch.h"\r
MemoryAllocationLib\r
DebugLib\r
NetLib\r
-\r
+ DpcLib\r
\r
[Guids]\r
gEfiSmbiosTableGuid # ALWAYS_CONSUMED\r
\r
-\r
-\r
[Protocols]\r
gEfiArpServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiArpProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## SOMETIMES_CONSUMES\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
-\r