ReactOS 0.4.15-dev-7934-g1dc8d80
dc21x4.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS DC21x4 Driver
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Miniport driver entry
5 * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include "dc21x4.h"
11
12#include <debug.h>
13
14/* FUNCTIONS ******************************************************************/
15
20{
21 ULONG i, j, Crc;
22 const UCHAR* Data = Buffer;
23
24 Crc = 0xFFFFFFFF;
25 for (i = 0; i < Size; ++i)
26 {
27 Crc ^= Data[i];
28 for (j = 8; j > 0; j--)
29 {
30 /* CRC-32 polynomial little-endian */
31 Crc = (Crc >> 1) ^ (-(LONG)(Crc & 1) & 0xEDB88320);
32 }
33 }
34
35 return Crc;
36}
37
38static
39VOID
41 _In_ PDC21X4_ADAPTER Adapter)
42{
43 LIST_ENTRY DoneList;
46 PDC_TCB Tcb;
47
48 InitializeListHead(&DoneList);
49
50 NdisAcquireSpinLock(&Adapter->SendLock);
51
52 /* Remove pending transmissions from the transmit ring */
53 for (Tcb = Adapter->LastTcb;
54 Tcb != Adapter->CurrentTcb;
55 Tcb = DC_NEXT_TCB(Adapter, Tcb))
56 {
57 Packet = Tcb->Packet;
58
59 if (!Packet)
60 continue;
61
63
64 DC_RELEASE_TCB(Adapter, Tcb);
65 }
66 Adapter->CurrentTcb = Tcb;
67
68 /* Remove pending transmissions from the internal queue */
69 while (!IsListEmpty(&Adapter->SendQueueList))
70 {
71 Entry = RemoveHeadList(&Adapter->SendQueueList);
72
73 InsertTailList(&DoneList, Entry);
74 }
75
76 NdisReleaseSpinLock(&Adapter->SendLock);
77
78 while (!IsListEmpty(&DoneList))
79 {
80 Entry = RemoveHeadList(&DoneList);
81
82 NdisMSendComplete(Adapter->AdapterHandle,
85 }
86}
87
88static
89VOID
91 _In_ PDC21X4_ADAPTER Adapter)
92{
93 BOOLEAN RxStopped;
94
96
97#if DBG
98 NdisAcquireSpinLock(&Adapter->ReceiveLock);
99 if (Adapter->RcbFree != Adapter->RcbCount)
100 {
101 INFO("RX packets: %u/%u\n", Adapter->RcbFree, Adapter->RcbCount);
102 }
103 NdisReleaseSpinLock(&Adapter->ReceiveLock);
104#endif
105
106 while (TRUE)
107 {
108 NdisAcquireSpinLock(&Adapter->ReceiveLock);
109
110 RxStopped = (Adapter->RcbFree == Adapter->RcbCount);
111
112 NdisReleaseSpinLock(&Adapter->ReceiveLock);
113
114 if (RxStopped)
115 break;
116
117 NdisMSleep(10);
118 }
119}
120
121DECLSPEC_NOINLINE /* Called from pageable code */
122VOID
124 _In_ PDC21X4_ADAPTER Adapter,
125 _In_ BOOLEAN WaitForPackets)
126{
128
129 /* Attempt to disable interrupts to complete more quickly */
130 DC_WRITE(Adapter, DcCsr7_IrqMask, 0);
131
132 /* Prevent DPCs from executing and stop accepting incoming packets */
133 NdisAcquireSpinLock(&Adapter->SendLock);
134 Adapter->Flags &= ~DC_ACTIVE;
135 NdisReleaseSpinLock(&Adapter->SendLock);
136
137 NdisMCancelTimer(&Adapter->MediaMonitorTimer, &TimerCancelled);
138
139 /* Wait for any DPCs to complete */
141
142 /* Disable interrupts */
143 DC_WRITE(Adapter, DcCsr7_IrqMask, 0);
144
145 /* Wait for completion of TX/RX and stop the DMA engine inside the NIC */
146 DcStopTxRxProcess(Adapter);
147 Adapter->OpMode &= ~(DC_OPMODE_RX_ENABLE | DC_OPMODE_TX_ENABLE);
148
149 DcFlushTransmitQueue(Adapter);
150
151 /* Wait for the packets to be returned to the driver */
152 if (WaitForPackets)
153 {
154 DcStopReceivePath(Adapter);
155 }
156
157 /* Make sure there is no pending OID request */
158 if (Adapter->OidPending)
159 {
160 NdisMSetInformationComplete(Adapter->AdapterHandle, NDIS_STATUS_SUCCESS);
161
162 Adapter->OidPending = FALSE;
163 }
164}
165
166CODE_SEG("PAGE")
167VOID
169 _In_ PDC21X4_ADAPTER Adapter)
170{
171 PAGED_CODE();
172
173 /* Enable interrupts */
174 _InterlockedExchange((PLONG)&Adapter->CurrentInterruptMask, Adapter->InterruptMask);
175 DC_WRITE(Adapter, DcCsr7_IrqMask, Adapter->InterruptMask);
176
177 Adapter->Flags |= DC_ACTIVE;
178
179 /* Start the RX process */
180 Adapter->OpMode |= DC_OPMODE_RX_ENABLE;
181 DC_WRITE(Adapter, DcCsr6_OpMode, Adapter->OpMode);
182
183 /* Start the media monitor, wait the selected media to become ready */
184 NdisMSetTimer(&Adapter->MediaMonitorTimer, 2400);
185}
186
187CODE_SEG("PAGE")
188VOID
189NTAPI
193{
194 PDC21X4_ADAPTER Adapter = Context;
196 ULONG InterruptStatus;
197 LONG ResetReason;
198
200
201 PAGED_CODE();
202
204
205 /* Check if the device is present */
206 InterruptStatus = DC_READ(Adapter, DcCsr5_Status);
207 if (InterruptStatus == 0xFFFFFFFF)
208 {
209 ERR("Hardware is gone...\n");
210
211 /* Remove this adapter */
213
215 goto Done;
216 }
217
218 DcStopAdapter(Adapter, FALSE);
219
220 if (Adapter->LinkUp)
221 {
222 Adapter->LinkUp = FALSE;
223
226 NULL,
227 0);
229 }
230
231 DcSetupAdapter(Adapter);
232
233 DcStartAdapter(Adapter);
234
235Done:
236 ResetReason = _InterlockedExchange(&Adapter->ResetLock, 0);
237
238 /* Complete the pending reset request */
239 if (ResetReason == 1)
240 {
242 }
243}
244
245VOID
246NTAPI
250{
251 PDC21X4_ADAPTER Adapter = Context;
252
254
255 NdisAcquireSpinLock(&Adapter->ModeLock);
256
257 DcStopTxRxProcess(Adapter);
258 DC_WRITE(Adapter, DcCsr6_OpMode, Adapter->OpMode);
259
261
263
265
266 NdisReleaseSpinLock(&Adapter->ModeLock);
267}
268
269static
271NTAPI
273 _In_ NDIS_HANDLE MiniportAdapterContext)
274{
275 PDC21X4_ADAPTER Adapter = (PDC21X4_ADAPTER)MiniportAdapterContext;
276 ULONG TcbCompleted;
277 BOOLEAN TxHang = FALSE;
278
279 if (!(Adapter->Flags & DC_ACTIVE))
280 return FALSE;
281
283
284 if (Adapter->TcbSlots != (DC_TRANSMIT_BLOCKS - DC_TCB_RESERVE))
285 {
286 TcbCompleted = Adapter->TcbCompleted;
287 TxHang = (TcbCompleted == Adapter->LastTcbCompleted);
288 Adapter->LastTcbCompleted = TcbCompleted;
289 }
290
292
293 if (TxHang)
294 {
295 WARN("Transmit timeout, CSR12 %08lx, CSR5 %08lx\n",
296 DC_READ(Adapter, DcCsr12_SiaStatus),
297 DC_READ(Adapter, DcCsr5_Status));
298
300 }
301
302 return FALSE;
303}
304
305static
307NTAPI
309 _Out_ PBOOLEAN AddressingReset,
310 _In_ NDIS_HANDLE MiniportAdapterContext)
311{
312 PDC21X4_ADAPTER Adapter = (PDC21X4_ADAPTER)MiniportAdapterContext;
313
314 WARN("Called\n");
315
316 if (_InterlockedCompareExchange(&Adapter->ResetLock, 1, 0))
317 {
319 }
320
322
323 return NDIS_STATUS_PENDING;
324}
325
326static
327CODE_SEG("PAGE")
328VOID
329NTAPI
331 _In_ NDIS_HANDLE MiniportAdapterContext)
332{
333 PDC21X4_ADAPTER Adapter = (PDC21X4_ADAPTER)MiniportAdapterContext;
334
335 PAGED_CODE();
336
337 INFO("Called\n");
338
339 DcStopAdapter(Adapter, TRUE);
340
341 DcDisableHw(Adapter);
342
343 DcFreeAdapter(Adapter);
344}
345
346static
347VOID
348NTAPI
350 _In_ NDIS_HANDLE MiniportAdapterContext)
351{
352 PDC21X4_ADAPTER Adapter = (PDC21X4_ADAPTER)MiniportAdapterContext;
353
354 INFO("Called\n");
355
356 DcDisableHw(Adapter);
357}
358
359CODE_SEG("INIT")
361NTAPI
365{
366 NDIS_HANDLE WrapperHandle;
368 NDIS_MINIPORT_CHARACTERISTICS Characteristics = { 0 };
369
370 INFO("Called\n");
371
373 if (!WrapperHandle)
374 return NDIS_STATUS_FAILURE;
375
376 Characteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
377 Characteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
378 Characteristics.CheckForHangHandler = DcCheckForHang;
379 Characteristics.HaltHandler = DcHalt;
380 Characteristics.HandleInterruptHandler = DcHandleInterrupt;
381 Characteristics.InitializeHandler = DcInitialize;
382 Characteristics.ISRHandler = DcIsr;
383 Characteristics.QueryInformationHandler = DcQueryInformation;
384 Characteristics.ResetHandler = DcReset;
385 Characteristics.SetInformationHandler = DcSetInformation;
386 Characteristics.ReturnPacketHandler = DcReturnPacket;
387 Characteristics.SendPacketsHandler = DcSendPackets;
388 Characteristics.CancelSendPacketsHandler = DcCancelSendPackets;
389 Characteristics.AdapterShutdownHandler = DcShutdown;
390
391 Status = NdisMRegisterMiniport(WrapperHandle, &Characteristics, sizeof(Characteristics));
393 {
394 NdisTerminateWrapper(WrapperHandle, NULL);
395 return Status;
396 }
397
399
400 return NDIS_STATUS_SUCCESS;
401}
NDIS_STATUS EXPORT NdisMRemoveMiniport(IN NDIS_HANDLE MiniportAdapterHandle)
Definition: 50stubs.c:376
#define PAGED_CODE()
#define CODE_SEG(...)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
Definition: bufpool.h:45
static VOID NTAPI DcShutdown(_In_ NDIS_HANDLE MiniportAdapterContext)
Definition: dc21x4.c:349
static VOID DcFlushTransmitQueue(_In_ PDC21X4_ADAPTER Adapter)
Definition: dc21x4.c:40
VOID DcStartAdapter(_In_ PDC21X4_ADAPTER Adapter)
Definition: dc21x4.c:168
VOID NTAPI DcTransmitTimeoutRecoveryWorker(_In_ PNDIS_WORK_ITEM WorkItem, _In_opt_ PVOID Context)
Definition: dc21x4.c:247
ULONG DcEthernetCrc(_In_reads_bytes_(Size) const VOID *Buffer, _In_ ULONG Size)
Definition: dc21x4.c:17
static VOID NTAPI DcHalt(_In_ NDIS_HANDLE MiniportAdapterContext)
Definition: dc21x4.c:330
DECLSPEC_NOINLINE VOID DcStopAdapter(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN WaitForPackets)
Definition: dc21x4.c:123
static VOID DcStopReceivePath(_In_ PDC21X4_ADAPTER Adapter)
Definition: dc21x4.c:90
static NDIS_STATUS NTAPI DcReset(_Out_ PBOOLEAN AddressingReset, _In_ NDIS_HANDLE MiniportAdapterContext)
Definition: dc21x4.c:308
VOID NTAPI DcResetWorker(_In_ PNDIS_WORK_ITEM WorkItem, _In_opt_ PVOID Context)
Definition: dc21x4.c:190
static BOOLEAN NTAPI DcCheckForHang(_In_ NDIS_HANDLE MiniportAdapterContext)
Definition: dc21x4.c:272
VOID NTAPI DcReturnPacket(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PNDIS_PACKET Packet)
Definition: interrupt.c:244
LIST_ENTRY SRompAdapterList
Definition: eeprom.c:30
NDIS_STATUS DcSetupAdapter(_In_ PDC21X4_ADAPTER Adapter)
Definition: hardware.c:462
VOID DcDisableHw(_In_ PDC21X4_ADAPTER Adapter)
Definition: hardware.c:17
#define DC_TCB_RESERVE
Definition: dc21x4.h:57
struct _DC21X4_ADAPTER * PDC21X4_ADAPTER
Definition: dc21x4.h:61
VOID NTAPI DcCancelSendPackets(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PVOID CancelId)
Definition: send.c:271
VOID NTAPI DcIsr(_Out_ PBOOLEAN InterruptRecognized, _Out_ PBOOLEAN QueueMiniportHandleInterrupt, _In_ NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:594
#define DC_ACTIVE
Definition: dc21x4.h:120
FORCEINLINE ULONG DC_READ(_In_ PDC21X4_ADAPTER Adapter, _In_ DC_CSR Register)
Definition: dc21x4.h:262
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
Definition: hardware.c:38
#define DC_TRANSMIT_BLOCKS
Definition: dc21x4.h:24
VOID NTAPI DcHandleInterrupt(_In_ NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:514
VOID DcFreeAdapter(_In_ __drv_freesMem(Mem) PDC21X4_ADAPTER Adapter)
Definition: init.c:1022
NDIS_STATUS NTAPI DcInitialize(_Out_ PNDIS_STATUS OpenErrorStatus, _Out_ PUINT SelectedMediumIndex, _In_ PNDIS_MEDIUM MediumArray, _In_ UINT MediumArraySize, _In_ NDIS_HANDLE MiniportAdapterHandle, _In_ NDIS_HANDLE WrapperConfigurationContext)
Definition: init.c:1125
#define DC_WRITE(Adapter, Register, Value)
Definition: dc21x4.h:272
NDIS_STATUS NTAPI DcSetInformation(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ NDIS_OID Oid, _In_ PVOID InformationBuffer, _In_ ULONG InformationBufferLength, _Out_ PULONG BytesRead, _Out_ PULONG BytesNeeded)
Definition: requests.c:483
NDIS_STATUS NTAPI DcQueryInformation(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ NDIS_OID Oid, _In_ PVOID InformationBuffer, _In_ ULONG InformationBufferLength, _Out_ PULONG BytesWritten, _Out_ PULONG BytesNeeded)
Definition: requests.c:208
VOID NTAPI DcSendPackets(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PPNDIS_PACKET PacketArray, _In_ UINT NumberOfPackets)
Definition: send.c:228
#define DC_OPMODE_TX_ENABLE
Definition: dc21x4hw.h:330
@ DcCsr6_OpMode
Definition: dc21x4hw.h:180
@ DcCsr5_Status
Definition: dc21x4hw.h:179
@ DcCsr1_TxPoll
Definition: dc21x4hw.h:173
@ DcCsr12_SiaStatus
Definition: dc21x4hw.h:188
@ DcCsr7_IrqMask
Definition: dc21x4hw.h:181
#define DC_TX_POLL_DOORBELL
Definition: dc21x4hw.h:244
#define DC_OPMODE_RX_ENABLE
Definition: dc21x4hw.h:319
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID NTAPI KeFlushQueuedDpcs(VOID)
Definition: dpc.c:919
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define INFO
Definition: debug.h:89
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
Definition: misc.c:467
VOID EXPORT NdisMSetTimer(IN PNDIS_MINIPORT_TIMER Timer, IN UINT MillisecondsToDelay)
Definition: time.c:272
VOID EXPORT NdisMCancelTimer(IN PNDIS_MINIPORT_TIMER Timer, OUT PBOOLEAN TimerCancelled)
Definition: time.c:131
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
long __cdecl _InterlockedCompareExchange(_Interlocked_operand_ long volatile *_Destination, long _Exchange, long _Comparand)
#define ASSERT(a)
Definition: mode.c:44
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define NdisMSetInformationComplete(MiniportAdapterHandle, Status)
Definition: ndis.h:5762
#define NdisReleaseSpinLock(_SpinLock)
Definition: ndis.h:4115
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
#define NdisMIndicateStatusComplete(MiniportAdapterHandle)
Definition: ndis.h:5580
#define NdisDprReleaseSpinLock(_SpinLock)
Definition: ndis.h:4133
#define NdisMResetComplete(MiniportAdapterHandle, Status, AddressingReset)
Definition: ndis.h:5674
#define NDIS_STATUS_MEDIA_DISCONNECT
Definition: ndis.h:362
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define NdisDprAcquireSpinLock(_SpinLock)
Definition: ndis.h:4124
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5592
#define NdisMSendComplete(MiniportAdapterHandle, Packet, Status)
Definition: ndis.h:5689
#define NdisAcquireSpinLock(_SpinLock)
Definition: ndis.h:4106
#define NDIS_STATUS_HARD_ERRORS
Definition: ndis.h:463
#define NDIS_STATUS_RESET_IN_PROGRESS
Definition: ndis.h:477
#define NdisMIndicateStatus(MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
Definition: ndis.h:5570
_Out_ _At_ TimerCancelled PBOOLEAN TimerCancelled
Definition: ndis.h:2820
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
Definition: miniport.c:2928
NDIS_STATUS EXPORT NdisMRegisterMiniport(IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, IN UINT CharacteristicsLength)
Definition: miniport.c:2637
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
Definition: miniport.c:3012
#define DECLSPEC_NOINLINE
Definition: ntbasedef.h:225
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
int NDIS_STATUS
Definition: ntddndis.h:475
long LONG
Definition: pedump.c:60
#define DC_PACKET_FROM_LIST_ENTRY(ListEntry)
Definition: sendrcv.h:13
FORCEINLINE PDC_TCB DC_NEXT_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
Definition: sendrcv.h:74
FORCEINLINE VOID DC_RELEASE_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
Definition: sendrcv.h:58
#define DC_LIST_ENTRY_FROM_PACKET(Packet)
Definition: sendrcv.h:10
base of all file and directory entries
Definition: entries.h:83
ULONG TcbSlots
Definition: dc21x4.h:137
ULONG TcbCompleted
Definition: dc21x4.h:139
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK ModeLock
Definition: dc21x4.h:161
_Interlocked_ volatile LONG ResetLock
Definition: dc21x4.h:239
BOOLEAN LinkUp
Definition: dc21x4.h:176
NDIS_WORK_ITEM ResetWorkItem
Definition: dc21x4.h:237
ULONG LastTcbCompleted
Definition: dc21x4.h:140
ULONG OpMode
Definition: dc21x4.h:173
NDIS_HANDLE AdapterHandle
Definition: dc21x4.h:158
NDIS_WORK_ITEM TxRecoveryWorkItem
Definition: dc21x4.h:238
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK SendLock
Definition: dc21x4.h:129
ULONG Flags
Definition: dc21x4.h:119
PNDIS_PACKET Packet
Definition: sendrcv.h:34
Definition: typedefs.h:120
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
int32_t * PLONG
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:115
unsigned char UCHAR
Definition: xmlstorage.h:181