ReactOS  0.4.15-dev-489-g75a0787
efilter.c File Reference
#include "ndissys.h"
Include dependency graph for efilter.c:

Go to the source code of this file.

Functions

BOOLEAN NTAPI EthCreateFilter (IN UINT MaximumMulticastAddresses, IN PUCHAR AdapterAddress, OUT PETH_FILTER *Filter)
 
VOID EXPORT EthDeleteFilter (IN PETH_FILTER Filter)
 
VOID EXPORT EthFilterDprIndicateReceive (IN PETH_FILTER Filter, IN NDIS_HANDLE MacReceiveContext, IN PCHAR Address, IN PVOID HeaderBuffer, IN UINT HeaderBufferSize, IN PVOID LookaheadBuffer, IN UINT LookaheadBufferSize, IN UINT PacketSize)
 
VOID EXPORT EthFilterDprIndicateReceiveComplete (IN PETH_FILTER Filter)
 

Function Documentation

◆ EthCreateFilter()

BOOLEAN NTAPI EthCreateFilter ( IN UINT  MaximumMulticastAddresses,
IN PUCHAR  AdapterAddress,
OUT PETH_FILTER Filter 
)

Definition at line 16 of file efilter.c.

34 {
35  PETHI_FILTER NewFilter;
36 
37  NewFilter = ExAllocatePool(NonPagedPool, sizeof(ETHI_FILTER));
38  if (NewFilter != NULL)
39  {
40  RtlZeroMemory(NewFilter, sizeof(ETHI_FILTER));
41  NewFilter->MaxMulticastAddresses = MaximumMulticastAddresses;
42  RtlCopyMemory(NewFilter->AdapterAddress, AdapterAddress, ETH_LENGTH_OF_ADDRESS);
43  *Filter = (PETH_FILTER)NewFilter;
44  return TRUE;
45  }
46  else
47  {
48  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
49  *Filter = NULL;
50  return FALSE;
51  }
52 }
UCHAR AdapterAddress[ETH_LENGTH_OF_ADDRESS]
Definition: efilter.h:35
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
smooth NULL
Definition: ftsmooth.c:416
struct _X_FILTER * PETH_FILTER
Definition: ndis.h:2266
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
UINT MaxMulticastAddresses
Definition: efilter.h:33

Referenced by NdisIPnPStartDevice().

◆ EthDeleteFilter()

VOID EXPORT EthDeleteFilter ( IN PETH_FILTER  Filter)

Definition at line 57 of file efilter.c.

59 {
61 }
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by NdisIPnPStopDevice().

◆ EthFilterDprIndicateReceive()

VOID EXPORT EthFilterDprIndicateReceive ( IN PETH_FILTER  Filter,
IN NDIS_HANDLE  MacReceiveContext,
IN PCHAR  Address,
IN PVOID  HeaderBuffer,
IN UINT  HeaderBufferSize,
IN PVOID  LookaheadBuffer,
IN UINT  LookaheadBufferSize,
IN UINT  PacketSize 
)

Definition at line 69 of file efilter.c.

90 {
91  /* Not sure if this is a valid thing to do, but we do arrive here early
92  * in the boot process with Filter NULL. We need to investigate whether
93  * this should be handled or not allowed. */
94  if( !Filter ) {
95  NDIS_DbgPrint(MIN_TRACE, ("Filter is NULL\n"));
96  return;
97  }
99  MacReceiveContext,
100  HeaderBuffer,
101  HeaderBufferSize,
102  LookaheadBuffer,
103  LookaheadBufferSize,
104  PacketSize);
105 }
VOID MiniIndicateData(PLOGICAL_ADAPTER Adapter, NDIS_HANDLE MacReceiveContext, PVOID HeaderBuffer, UINT HeaderBufferSize, PVOID LookaheadBuffer, UINT LookaheadBufferSize, UINT PacketSize)
Definition: miniport.c:175
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
_In_ USHORT PacketSize
Definition: iofuncs.h:1056
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define MIN_TRACE
Definition: debug.h:14

Referenced by NdisIPnPStartDevice().

◆ EthFilterDprIndicateReceiveComplete()

VOID EXPORT EthFilterDprIndicateReceiveComplete ( IN PETH_FILTER  Filter)

Definition at line 113 of file efilter.c.

120 {
121  PLIST_ENTRY CurrentEntry;
122  PLOGICAL_ADAPTER Adapter;
123  PADAPTER_BINDING AdapterBinding;
124 
125  NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
126 
127  if( !Filter ) {
128  NDIS_DbgPrint(MIN_TRACE, ("Filter is NULL\n"));
129  return;
130  }
131 
132  Adapter = (PLOGICAL_ADAPTER)((PETHI_FILTER)Filter)->Miniport;
133 
134  NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
136  {
137  CurrentEntry = Adapter->ProtocolListHead.Flink;
138 
139  while (CurrentEntry != &Adapter->ProtocolListHead)
140  {
141  AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry);
142 
143  (*AdapterBinding->ProtocolBinding->Chars.ReceiveCompleteHandler)(
144  AdapterBinding->NdisOpenBlock.ProtocolBindingContext);
145 
146  CurrentEntry = CurrentEntry->Flink;
147  }
148  }
150 }
NDIS_OPEN_BLOCK NdisOpenBlock
Definition: protocol.h:22
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:192
#define DEBUG_MINIPORT
Definition: debug.h:17
RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler
Definition: ndis.h:1892
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PPROTOCOL_BINDING ProtocolBinding
Definition: protocol.h:28
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:215
LIST_ENTRY ProtocolListHead
Definition: miniport.h:94
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
Definition: typedefs.h:118
#define MAX_TRACE
Definition: debug.h:16
KSPIN_LOCK Lock
Definition: ndis.h:2520
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define MIN_TRACE
Definition: debug.h:14
NDIS_PROTOCOL_CHARACTERISTICS Chars
Definition: protocol.h:13

Referenced by NdisIPnPStartDevice().