ReactOS 0.4.16-dev-122-g325d74c
ndis.c
Go to the documentation of this file.
1/*
2 * ReactOS Realtek 8139 Driver
3 *
4 * Copyright (C) 2013 Cameron Gutman
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 */
21
22#include "nic.h"
23
24#define NDEBUG
25#include <debug.h>
26
28
32 OUT PBOOLEAN AddressingReset,
33 IN NDIS_HANDLE MiniportAdapterContext
34 )
35{
36 *AddressingReset = FALSE;
38}
39
43 IN NDIS_HANDLE MiniportAdapterContext,
46 )
47{
48 PRTL_ADAPTER adapter = (PRTL_ADAPTER)MiniportAdapterContext;
52 ULONG transmitLength;
53 ULONG transmitBuffer;
54 PNDIS_BUFFER firstBuffer;
55 PVOID firstBufferVa;
56 UINT firstBufferLength, totalBufferLength;
57 PUCHAR runtBuffer;
58
59 ASSERT(sgList != NULL);
60
61 ASSERT(sgList->NumberOfElements == 1);
62 ASSERT(sgList->Elements[0].Address.HighPart == 0);
63 ASSERT((sgList->Elements[0].Address.LowPart & 3) == 0);
64 ASSERT(sgList->Elements[0].Length <= MAXIMUM_FRAME_SIZE);
65
66 NDIS_DbgPrint(MAX_TRACE, ("Sending %d byte packet\n", sgList->Elements[0].Length));
67
69
70 if (adapter->TxFull)
71 {
72 NDIS_DbgPrint(MIN_TRACE, ("All TX descriptors are full\n"));
75 }
76
77 NDIS_DbgPrint(MAX_TRACE, ("Sending packet on TX desc %d\n", adapter->CurrentTxDesc));
78
79 //
80 // If this is a runt, we need to pad it manually for the RTL8139
81 //
82 if (sgList->Elements[0].Length < MINIMUM_FRAME_SIZE)
83 {
84 transmitLength = MINIMUM_FRAME_SIZE;
85 transmitBuffer = adapter->RuntTxBuffersPa.LowPart +
86 (MINIMUM_FRAME_SIZE * adapter->CurrentTxDesc);
87
89 &firstBuffer,
90 &firstBufferVa,
91 &firstBufferLength,
92 &totalBufferLength,
94 if (firstBufferVa == NULL)
95 {
96 NDIS_DbgPrint(MIN_TRACE, ("Unable to get buffer from packet\n"));
99 }
100
101 ASSERT(firstBufferLength == totalBufferLength);
102
103 runtBuffer = adapter->RuntTxBuffers + (MINIMUM_FRAME_SIZE * adapter->CurrentTxDesc);
104 RtlCopyMemory(runtBuffer, firstBufferVa, firstBufferLength);
105 RtlFillMemory(runtBuffer + firstBufferLength, MINIMUM_FRAME_SIZE - firstBufferLength, 0x00);
106 }
107 else
108 {
109 transmitLength = sgList->Elements[0].Length;
110 transmitBuffer = sgList->Elements[0].Address.LowPart;
111 }
112
113 status = NICTransmitPacket(adapter, adapter->CurrentTxDesc, transmitBuffer, transmitLength);
115 {
116 NDIS_DbgPrint(MIN_TRACE, ("Transmit packet failed\n"));
118 return status;
119 }
120
121 adapter->CurrentTxDesc++;
122 adapter->CurrentTxDesc %= TX_DESC_COUNT;
123
124 if (adapter->CurrentTxDesc == adapter->DirtyTxDesc)
125 {
126 NDIS_DbgPrint(MID_TRACE, ("All TX descriptors are full now\n"));
127 adapter->TxFull = TRUE;
128 }
129
131
132 return NDIS_STATUS_SUCCESS;
133}
134
135VOID
136NTAPI
138 IN NDIS_HANDLE MiniportAdapterContext
139 )
140{
141 PRTL_ADAPTER adapter = (PRTL_ADAPTER)MiniportAdapterContext;
142
143 ASSERT(adapter != NULL);
144
145 //
146 // Interrupts need to stop first
147 //
148 if (adapter->InterruptRegistered != FALSE)
149 {
151 }
152
153 //
154 // If we have a mapped IO port range, we can talk to the NIC
155 //
156 if (adapter->IoBase != NULL)
157 {
158 if (adapter->ReceiveBuffer != NULL)
159 {
160 //
161 // Disassociate our shared buffer before freeing it to avoid
162 // NIC-induced memory corruption
163 //
165
166 NdisMFreeSharedMemory(adapter->MiniportAdapterHandle,
167 adapter->ReceiveBufferLength,
168 FALSE,
169 adapter->ReceiveBuffer,
170 adapter->ReceiveBufferPa);
171 }
172
173 if (adapter->RuntTxBuffers != NULL)
174 {
175 NdisMFreeSharedMemory(adapter->MiniportAdapterHandle,
177 FALSE,
178 adapter->RuntTxBuffers,
179 adapter->RuntTxBuffersPa);
180 }
181
182 //
183 // Unregister the IO range
184 //
185 NdisMDeregisterIoPortRange(adapter->MiniportAdapterHandle,
186 adapter->IoRangeStart,
187 adapter->IoRangeLength,
188 adapter->IoBase);
189 }
190
191 //
192 // Destroy the adapter context
193 //
194 NdisFreeMemory(adapter, sizeof(*adapter), 0);
195}
196
198NTAPI
202 IN PNDIS_MEDIUM MediumArray,
206 )
207{
210 UINT i;
211 PNDIS_RESOURCE_LIST resourceList;
212 UINT resourceListSize;
213
214 //
215 // Make sure the medium is supported
216 //
217 for (i = 0; i < MediumArraySize; i++)
218 {
219 if (MediumArray[i] == NdisMedium802_3)
220 {
222 break;
223 }
224 }
225
226 if (i == MediumArraySize)
227 {
228 NDIS_DbgPrint(MIN_TRACE, ("802.3 medium was not found in the medium array\n"));
230 }
231
232 //
233 // Allocate our adapter context
234 //
236 sizeof(*adapter),
239 {
240 NDIS_DbgPrint(MIN_TRACE, ("Failed to allocate adapter context\n"));
242 }
243
244 RtlZeroMemory(adapter, sizeof(*adapter));
245 adapter->MiniportAdapterHandle = MiniportAdapterHandle;
247
248 //
249 // Notify NDIS of some characteristics of our NIC
250 //
252 adapter,
253 0,
256
257 //
258 // Get our resources for IRQ and IO base information
259 //
260 resourceList = NULL;
261 resourceListSize = 0;
264 resourceList,
265 &resourceListSize);
267 {
268 NDIS_DbgPrint(MIN_TRACE, ("Unexpected failure of NdisMQueryAdapterResources #1\n"));
270 goto Cleanup;
271 }
272
273 status = NdisAllocateMemoryWithTag((PVOID*)&resourceList,
274 resourceListSize,
277 {
278 NDIS_DbgPrint(MIN_TRACE, ("Failed to allocate resource list\n"));
279 goto Cleanup;
280 }
281
284 resourceList,
285 &resourceListSize);
287 {
288 NDIS_DbgPrint(MIN_TRACE, ("Unexpected failure of NdisMQueryAdapterResources #2\n"));
289 goto Cleanup;
290 }
291
292 ASSERT(resourceList->Version == 1);
293 ASSERT(resourceList->Revision == 1);
294
295 for (i = 0; i < resourceList->Count; i++)
296 {
297 switch (resourceList->PartialDescriptors[i].Type)
298 {
300 ASSERT(adapter->IoRangeStart == 0);
301
302 ASSERT(resourceList->PartialDescriptors[i].u.Port.Start.HighPart == 0);
303
304 adapter->IoRangeStart = resourceList->PartialDescriptors[i].u.Port.Start.LowPart;
305 adapter->IoRangeLength = resourceList->PartialDescriptors[i].u.Port.Length;
306
307 NDIS_DbgPrint(MID_TRACE, ("I/O port range is %p to %p\n",
308 adapter->IoRangeStart, adapter->IoRangeStart + adapter->IoRangeLength));
309 break;
310
312 ASSERT(adapter->InterruptVector == 0);
313 ASSERT(adapter->InterruptLevel == 0);
314
315 adapter->InterruptVector = resourceList->PartialDescriptors[i].u.Interrupt.Vector;
316 adapter->InterruptLevel = resourceList->PartialDescriptors[i].u.Interrupt.Level;
317 adapter->InterruptShared = (resourceList->PartialDescriptors[i].ShareDisposition == CmResourceShareShared);
318 adapter->InterruptFlags = resourceList->PartialDescriptors[i].Flags;
319
320 NDIS_DbgPrint(MID_TRACE, ("IRQ vector is %d\n", adapter->InterruptVector));
321 break;
322
323 default:
324 NDIS_DbgPrint(MIN_TRACE, ("Unrecognized resource type: 0x%x\n", resourceList->PartialDescriptors[i].Type));
325 break;
326 }
327 }
328
329 NdisFreeMemory(resourceList, resourceListSize, 0);
330 resourceList = NULL;
331
332 if (adapter->IoRangeStart == 0 || adapter->InterruptVector == 0)
333 {
334 NDIS_DbgPrint(MIN_TRACE, ("Adapter didn't receive enough resources\n"));
335 goto Cleanup;
336 }
337
338 //
339 // Allocate the DMA resources
340 //
342 FALSE, // RTL8139 only supports 32-bit addresses
345 {
346 NDIS_DbgPrint(MIN_TRACE, ("Unable to configure DMA\n"));
347 goto Cleanup;
348 }
349
350 adapter->ReceiveBufferLength = FULL_RECEIVE_BUFFER_SIZE;
352 adapter->ReceiveBufferLength,
353 FALSE,
354 (PVOID*)&adapter->ReceiveBuffer,
355 &adapter->ReceiveBufferPa);
356 if (adapter->ReceiveBuffer == NULL)
357 {
358 NDIS_DbgPrint(MIN_TRACE, ("Unable to allocate receive buffer\n"));
360 goto Cleanup;
361 }
362
365 FALSE,
366 (PVOID*)&adapter->RuntTxBuffers,
367 &adapter->RuntTxBuffersPa);
368 if (adapter->RuntTxBuffers == NULL)
369 {
370 NDIS_DbgPrint(MIN_TRACE, ("Unable to allocate runt TX buffer\n"));
372 goto Cleanup;
373 }
374
375 //
376 // Register the I/O port range and configure the NIC
377 //
380 adapter->IoRangeStart,
381 adapter->IoRangeLength);
383 {
384 NDIS_DbgPrint(MIN_TRACE, ("Unable to register IO port range (0x%x)\n", status));
385 goto Cleanup;
386 }
387
388 //
389 // Adapter setup
390 //
393 {
394 NDIS_DbgPrint(MIN_TRACE, ("Unable to power on NIC (0x%x)\n", status));
395 goto Cleanup;
396 }
397
400 {
401 NDIS_DbgPrint(MIN_TRACE, ("Unable to reset the NIC (0x%x)\n", status));
402 goto Cleanup;
403 }
404
405 status = NICGetPermanentMacAddress(adapter, adapter->PermanentMacAddress);
407 {
408 NDIS_DbgPrint(MIN_TRACE, ("Unable to get the fixed MAC address (0x%x)\n", status));
409 goto Cleanup;
410 }
411
412 RtlCopyMemory(adapter->CurrentMacAddress, adapter->PermanentMacAddress, IEEE_802_ADDR_LENGTH);
413
414 //
415 // Update link state and speed
416 //
418
421 {
422 NDIS_DbgPrint(MIN_TRACE, ("Unable to setup receive buffer (0x%x)\n", status));
423 goto Cleanup;
424 }
425
426 //
427 // We're ready to handle interrupts now
428 //
431 adapter->InterruptVector,
432 adapter->InterruptLevel,
433 TRUE, // We always want ISR calls
434 adapter->InterruptShared,
435 (adapter->InterruptFlags & CM_RESOURCE_INTERRUPT_LATCHED) ?
438 {
439 NDIS_DbgPrint(MIN_TRACE, ("Unable to register interrupt (0x%x)\n", status));
440 goto Cleanup;
441 }
442
443 adapter->InterruptRegistered = TRUE;
444
445 //
446 // Enable interrupts on the NIC
447 //
448 adapter->InterruptMask = DEFAULT_INTERRUPT_MASK;
451 {
452 NDIS_DbgPrint(MIN_TRACE, ("Unable to apply interrupt mask (0x%x)\n", status));
453 goto Cleanup;
454 }
455
456 //
457 // Turn on TX and RX now
458 //
461 {
462 NDIS_DbgPrint(MIN_TRACE, ("Unable to enable TX and RX (0x%x)\n", status));
463 goto Cleanup;
464 }
465
466 return NDIS_STATUS_SUCCESS;
467
468Cleanup:
469 if (resourceList != NULL)
470 {
471 NdisFreeMemory(resourceList, resourceListSize, 0);
472 }
473 if (adapter != NULL)
474 {
476 }
477
478 return status;
479}
480
482NTAPI
486 )
487{
488 NDIS_HANDLE wrapperHandle;
489 NDIS_MINIPORT_CHARACTERISTICS characteristics;
491
492 RtlZeroMemory(&characteristics, sizeof(characteristics));
493 characteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
494 characteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
495 characteristics.CheckForHangHandler = NULL;
496 characteristics.DisableInterruptHandler = NULL;
497 characteristics.EnableInterruptHandler = NULL;
498 characteristics.HaltHandler = MiniportHalt;
499 characteristics.HandleInterruptHandler = MiniportHandleInterrupt;
500 characteristics.InitializeHandler = MiniportInitialize;
501 characteristics.ISRHandler = MiniportISR;
502 characteristics.QueryInformationHandler = MiniportQueryInformation;
503 characteristics.ReconfigureHandler = NULL;
504 characteristics.ResetHandler = MiniportReset;
505 characteristics.SendHandler = MiniportSend;
506 characteristics.SetInformationHandler = MiniportSetInformation;
507 characteristics.TransferDataHandler = NULL;
508 characteristics.ReturnPacketHandler = NULL;
509 characteristics.SendPacketsHandler = NULL;
510 characteristics.AllocateCompleteHandler = NULL;
511
513 if (!wrapperHandle)
514 {
515 return NDIS_STATUS_FAILURE;
516 }
517
518 status = NdisMRegisterMiniport(wrapperHandle, &characteristics, sizeof(characteristics));
520 {
521 NdisTerminateWrapper(wrapperHandle, 0);
522 return NDIS_STATUS_FAILURE;
523 }
524
525 return NDIS_STATUS_SUCCESS;
526}
LONG NTSTATUS
Definition: precomp.h:26
#define MIN_TRACE
Definition: debug.h:14
#define MID_TRACE
Definition: debug.h:15
#define MAX_TRACE
Definition: debug.h:16
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR Cleanup[]
Definition: register.c:80
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
NDIS_STATUS NTAPI NICPowerOn(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:509
NDIS_STATUS NTAPI NICEnableTxRx(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:574
NDIS_STATUS NTAPI NICSoftReset(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:531
NDIS_STATUS NTAPI NICGetPermanentMacAddress(IN PE1000_ADAPTER Adapter, OUT PUCHAR MacAddress)
Definition: hardware.c:661
VOID NTAPI NICUpdateLinkStatus(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:740
NDIS_STATUS NTAPI MiniportSetInformation(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesRead, OUT PULONG BytesNeeded)
Definition: info.c:276
NDIS_STATUS NTAPI MiniportQueryInformation(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesWritten, OUT PULONG BytesNeeded)
Definition: info.c:73
VOID NTAPI MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:16
VOID NTAPI MiniportHandleInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:46
static NDIS_STATUS NICTransmitPacket(_In_ PE1000_ADAPTER Adapter, _In_ PHYSICAL_ADDRESS PhysicalAddress, _In_ ULONG Length)
Definition: send.c:15
NDIS_STATUS NTAPI NICRemoveReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:88
NDIS_STATUS NTAPI NICRegisterReceiveBuffer(IN PRTL_ADAPTER Adapter)
Definition: hardware.c:75
VOID EXPORT NdisMQueryAdapterResources(OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, OUT PNDIS_RESOURCE_LIST ResourceList, IN OUT PUINT BufferSize)
Definition: hardware.c:103
VOID EXPORT NdisMDeregisterInterrupt(IN PNDIS_MINIPORT_INTERRUPT Interrupt)
Definition: io.c:700
VOID EXPORT NdisMDeregisterIoPortRange(IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts, IN PVOID PortOffset)
Definition: io.c:1093
NDIS_STATUS EXPORT NdisMRegisterIoPortRange(OUT PVOID *PortOffset, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts)
Definition: io.c:1018
NDIS_STATUS EXPORT NdisMInitializeScatterGatherDma(IN NDIS_HANDLE MiniportAdapterHandle, IN BOOLEAN Dma64BitAddresses, IN ULONG MaximumPhysicalMapping)
Definition: io.c:1169
NDIS_STATUS EXPORT NdisMRegisterInterrupt(OUT PNDIS_MINIPORT_INTERRUPT Interrupt, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InterruptVector, IN UINT InterruptLevel, IN BOOLEAN RequestIsr, IN BOOLEAN SharedInterrupt, IN NDIS_INTERRUPT_MODE InterruptMode)
Definition: io.c:941
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
Definition: memory.c:110
NDIS_STATUS EXPORT NdisAllocateMemoryWithTag(OUT PVOID *VirtualAddress, IN UINT Length, IN ULONG Tag)
Definition: memory.c:21
VOID EXPORT NdisMAllocateSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, OUT PVOID *VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
Definition: memory.c:148
VOID EXPORT NdisMFreeSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, IN PVOID VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
Definition: memory.c:215
ULONG DebugTraceLevel
Definition: ndis.c:13
NDIS_STATUS NTAPI MiniportInitialize(OUT PNDIS_STATUS OpenErrorStatus, OUT PUINT SelectedMediumIndex, IN PNDIS_MEDIUM MediumArray, IN UINT MediumArraySize, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: ndis.c:50
VOID NTAPI MiniportHalt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: ndis.c:28
NDIS_STATUS NTAPI MiniportReset(OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
Definition: ndis.c:17
#define MAXIMUM_FRAME_SIZE
Definition: nic.h:19
#define DEFAULT_INTERRUPT_MASK
Definition: nic.h:24
NDIS_STATUS NTAPI MiniportSend(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PNDIS_PACKET Packet, _In_ UINT Flags)
Definition: send.c:49
FORCEINLINE VOID NICApplyInterruptMask(_In_ PE1000_ADAPTER Adapter)
Definition: nic.h:243
#define IEEE_802_ADDR_LENGTH
Definition: e1000hw.h:11
return adapter
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
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
#define ASSERT(a)
Definition: mode.c:44
@ NormalPagePriority
Definition: imports.h:54
#define NdisReleaseSpinLock(_SpinLock)
Definition: ndis.h:4115
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
#define NdisInterruptLatched
Definition: ndis.h:921
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
#define NDIS_ATTRIBUTE_BUS_MASTER
Definition: ndis.h:586
#define NdisInterruptLevelSensitive
Definition: ndis.h:920
#define NdisAllocateSpinLock(_SpinLock)
Definition: ndis.h:4088
#define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType)
Definition: ndis.h:1351
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6011
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
MDL * PNDIS_BUFFER
Definition: ndis.h:343
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
@ NdisInterfacePci
Definition: ndis.h:905
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3946
#define NdisGetFirstBufferFromPacketSafe(_Packet, _FirstBuffer, _FirstBufferVA, _FirstBufferLength, _TotalBufferLength, _Priority)
Definition: ndis.h:3056
@ ScatterGatherListPacketInfo
Definition: ndis.h:1183
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
#define NDIS_STATUS_UNSUPPORTED_MEDIA
Definition: ndis.h:490
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6009
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5592
* PNDIS_STATUS
Definition: ndis.h:45
#define NdisAcquireSpinLock(_SpinLock)
Definition: ndis.h:4106
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
VOID EXPORT NdisMSetAttributesEx(IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE MiniportAdapterContext, IN UINT CheckForHangTimeInSeconds OPTIONAL, IN ULONG AttributeFlags, IN NDIS_INTERFACE_TYPE AdapterType)
Definition: miniport.c:2883
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
enum _NDIS_MEDIUM * PNDIS_MEDIUM
@ NdisMedium802_3
Definition: ntddndis.h:188
int NDIS_STATUS
Definition: ntddndis.h:475
#define RESOURCE_LIST_TAG
Definition: nic.h:16
#define ADAPTER_TAG
Definition: nic.h:15
struct _RTL_ADAPTER * PRTL_ADAPTER
#define MINIMUM_FRAME_SIZE
Definition: nic.h:25
#define FULL_RECEIVE_BUFFER_SIZE
Definition: nic.h:22
#define TX_DESC_COUNT
Definition: rtlhw.h:14
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
Definition: ps.c:97
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_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_ ULONG Flags
Definition: wsk.h:170
@ CmResourceShareShared
Definition: cmtypes.h:243
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
Definition: iotypes.h:2204