ReactOS  0.4.15-dev-5112-g22d8c0f
nvnet.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS nVidia nForce Ethernet Controller Driver
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Common header file
5  * COPYRIGHT: Copyright 2021-2022 Dmitry Borisov <di.sean@protonmail.com>
6  */
7 
8 #ifndef _NVNET_PCH_
9 #define _NVNET_PCH_
10 
11 #if !DBG
12 #define NO_KERNEL_LIST_ENTRY_CHECKS
13 #endif
14 #include <ndis.h>
15 
16 #include <section_attribs.h>
17 
18 #include "eth.h"
19 #include "nic.h"
20 #include "phyreg.h"
21 
22 #define NVNET_TAG 'ENVN'
23 
24 #if defined(SARCH_XBOX)
25 /* Reduce memory requirements on OG Xbox */
26 #define NVNET_TRANSMIT_BLOCKS 8
27 #define NVNET_TRANSMIT_DESCRIPTORS 32
28 #define NVNET_TRANSMIT_BUFFERS 1
29 #define NVNET_RECEIVE_DESCRIPTORS 16
30 #else
31 #define NVNET_TRANSMIT_BLOCKS 64
32 #define NVNET_TRANSMIT_DESCRIPTORS 512
33 #define NVNET_TRANSMIT_BUFFERS 16
34 #define NVNET_RECEIVE_DESCRIPTORS 512
35 #endif
36 
37 #define NVNET_ALIGNMENT 64
38 
39 #define NVNET_RECEIVE_BUFFER_SIZE 2048
40 
41 #define NVNET_RECEIVE_PROCESSING_LIMIT 64
42 
43 #define NVNET_IM_THRESHOLD 4
44 #define NVNET_IM_MAX_IDLE 40
45 
46 #if defined(SARCH_XBOX)
47 #define NVNET_TRANSMIT_HANG_THRESHOLD 3
48 #else
49 #define NVNET_TRANSMIT_HANG_THRESHOLD 5
50 #endif
51 
52 #if defined(SARCH_XBOX)
53 #define NVNET_FRAGMENTATION_THRESHOLD 8
54 #else
55 #define NVNET_FRAGMENTATION_THRESHOLD 32
56 #endif
57 
58 #define NVNET_MEDIA_DETECTION_INTERVAL 5000
59 
60 #define NVNET_MAXIMUM_FRAME_SIZE 1514
61 #define NVNET_MAXIMUM_FRAME_SIZE_JUMBO 9014
62 #define NVNET_MAXIMUM_VLAN_ID 0xFFF
63 
64 #define NVNET_MULTICAST_LIST_SIZE 32
65 
66 #define NVNET_MINIMUM_LSO_SEGMENT_COUNT 2
67 #define NVNET_MAXIMUM_LSO_FRAME_SIZE 0xFC00
68 
69 #define NVNET_PACKET_FILTERS ( \
70  NDIS_PACKET_TYPE_DIRECTED | \
71  NDIS_PACKET_TYPE_MULTICAST | \
72  NDIS_PACKET_TYPE_BROADCAST | \
73  NDIS_PACKET_TYPE_PROMISCUOUS | \
74  NDIS_PACKET_TYPE_ALL_MULTICAST)
75 
76 #define PACKET_ENTRY(Packet) ((PLIST_ENTRY)(&(Packet)->MiniportReserved[0]))
77 
79 {
84 
86 {
93 
94 typedef union _NVNET_OFFLOAD
95 {
96  struct {
102 
108 
113 
118  };
121 
122 typedef struct _NVNET_STATISTICS
123 {
154 
170 
173 
174 typedef struct _NVNET_WAKE_FRAME
175 {
176  union
177  {
180  } PatternMask;
183 
184 typedef struct _NVNET_TX_BUFFER_DATA
185 {
189 
190 typedef struct _NVNET_TX_BUFFER
191 {
196 
197 typedef union _NVNET_TBD
198 {
202 } NVNET_TBD;
203 
204 typedef struct _NVNET_TCB
205 {
212 #define NV_TCB_LARGE_SEND 0x00000001
213 #define NV_TCB_CHECKSUM_IP 0x00000002
214 #define NV_TCB_CHECKSUM_TCP 0x00000004
215 #define NV_TCB_CHECKSUM_UDP 0x00000008
216 #define NV_TCB_COALESCE 0x00000010
217 
220 
221 typedef union _NV_RBD
222 {
226 } NV_RBD;
227 
228 typedef struct _NVNET_RBD
229 {
234 
235 typedef struct _NVNET_SEND
236 {
252 
253 typedef struct _NVNET_RECEIVE
254 {
258 
260 
261 typedef VOID
263  _In_ PNVNET_ADAPTER Adapter,
264  _In_ PNVNET_TCB Tcb,
267 
268 typedef ULONG
270  _In_ PNVNET_ADAPTER Adapter,
271  _Inout_ PLIST_ENTRY SendReadyList);
273 
274 typedef ULONG
276  _In_ PNVNET_ADAPTER Adapter,
277  _In_ ULONG TotalRxProcessed);
279 
280 typedef struct _NVNET_ADAPTER
281 {
282  volatile PUCHAR IoBase;
286 #define NV_ACTIVE 0x80000000
287 #define NV_SEND_CHECKSUM 0x00000002
288 #define NV_SEND_LARGE_SEND 0x00000004
289 #define NV_SEND_ERRATA_PRESENT 0x00000008
290 
291 #define NV_MAC_IN_USE 0x00000010
292 #define NV_GIGABIT_PHY 0x00000020
293 #define NV_UNIT_SEMAPHORE_ACQUIRED 0x00000040
294 #define NV_USE_SOFT_MAC_ADDRESS 0x00000100
295 #define NV_FORCE_SPEED_AND_DUPLEX 0x00000200
296 #define NV_FORCE_FULL_DUPLEX 0x00000400
297 #define NV_USER_SPEED_100 0x00000800
298 #define NV_PACKET_PRIORITY 0x00001000
299 #define NV_VLAN_TAGGING 0x00002000
300 
311 
315 
318 
330 
336 
340 
342  ULONG MulticastListSize;
343  struct
344  {
347 
350 
352 
355 
357  volatile LONG ResetLock;
358 
361 
364 
367 
373 
377 
386 
387 #define NvNetLogError(Adapter, ErrorCode) \
388  NdisWriteErrorLogEntry((Adapter)->AdapterHandle, ErrorCode, 1, __LINE__)
389 
395 
396 CODE_SEG("PAGE")
398 NTAPI
402  _In_ PNDIS_MEDIUM MediumArray,
406 
407 CODE_SEG("PAGE")
408 VOID
410  _In_ PNVNET_ADAPTER Adapter);
411 
412 CODE_SEG("PAGE")
415  _Inout_ PNVNET_ADAPTER Adapter);
416 
417 CODE_SEG("PAGE")
420  _Inout_ PNVNET_ADAPTER Adapter,
422 
423 CODE_SEG("PAGE")
424 VOID
426  _In_ PNVNET_ADAPTER Adapter,
428 
429 CODE_SEG("PAGE")
432  _In_ PNVNET_ADAPTER Adapter,
433  _In_ BOOLEAN InitPhy);
434 
435 CODE_SEG("PAGE")
438  _In_ PNVNET_ADAPTER Adapter);
439 
440 CODE_SEG("PAGE")
443  _In_ PNVNET_ADAPTER Adapter);
444 
445 VOID
447  _In_ PNVNET_ADAPTER Adapter);
448 
449 CODE_SEG("PAGE")
450 VOID
452  _In_ PNVNET_ADAPTER Adapter);
453 
455 VOID
457  _In_ PNVNET_ADAPTER Adapter);
458 
459 CODE_SEG("PAGE")
460 VOID
462  _In_ PNVNET_ADAPTER Adapter);
463 
464 CODE_SEG("PAGE")
465 VOID
467  _In_ PNVNET_ADAPTER Adapter,
468  _In_ NDIS_STATUS CompleteStatus);
469 
470 KSYNCHRONIZE_ROUTINE NvNetInitPhaseSynchronized;
471 NDIS_TIMER_FUNCTION NvNetMediaDetectionDpc;
472 
473 BOOLEAN
474 MiiWrite(
475  _In_ PNVNET_ADAPTER Adapter,
476  _In_ ULONG PhyAddress,
477  _In_ ULONG RegAddress,
478  _In_ ULONG Data);
479 
480 BOOLEAN
481 MiiRead(
482  _In_ PNVNET_ADAPTER Adapter,
483  _In_ ULONG PhyAddress,
484  _In_ ULONG RegAddress,
485  _Out_ PULONG Data);
486 
487 BOOLEAN
489  _In_ PNVNET_ADAPTER Adapter);
490 
491 VOID
493  _In_ PNVNET_ADAPTER Adapter);
494 
495 VOID
497  _In_ PNVNET_ADAPTER Adapter);
498 
499 VOID
501  _In_ PNVNET_ADAPTER Adapter);
502 
503 VOID
505  _In_ PNVNET_ADAPTER Adapter);
506 
507 VOID
509  _In_ PNVNET_ADAPTER Adapter);
510 
511 CODE_SEG("PAGE")
512 VOID
514  _In_ PNVNET_ADAPTER Adapter,
515  _In_ BOOLEAN ClearPhyControl);
516 
517 VOID
519  _Inout_ PNVNET_ADAPTER Adapter,
520  _In_ ULONG PauseFlags);
521 
522 VOID
524  _In_ PNVNET_ADAPTER Adapter,
525  _In_ BOOLEAN Gate);
526 
527 VOID
529  _In_ PNVNET_ADAPTER Adapter,
530  _In_ NDIS_DEVICE_POWER_STATE NewPowerState,
531  _In_ ULONG WakeFlags);
532 
533 CODE_SEG("PAGE")
534 VOID
536  _In_ PNVNET_ADAPTER Adapter);
537 
538 VOID
540  _In_ PNVNET_ADAPTER Adapter);
541 
542 VOID
544  _In_ PNVNET_ADAPTER Adapter);
545 
547 NTAPI
549  _In_ NDIS_HANDLE MiniportAdapterContext,
551  _In_ UINT Flags);
552 
553 VOID
554 NTAPI
556  _Out_ PBOOLEAN InterruptRecognized,
557  _Out_ PBOOLEAN QueueMiniportHandleInterrupt,
558  _In_ NDIS_HANDLE MiniportAdapterContext);
559 
560 VOID
561 NTAPI
563  _In_ NDIS_HANDLE MiniportAdapterContext);
564 
566 NTAPI
568  _In_ NDIS_HANDLE MiniportAdapterContext,
569  _In_ NDIS_OID Oid,
570  _In_ PVOID InformationBuffer,
571  _In_ ULONG InformationBufferLength,
573  _Out_ PULONG BytesNeeded);
574 
576 NTAPI
578  _In_ NDIS_HANDLE MiniportAdapterContext,
579  _In_ NDIS_OID Oid,
580  _In_ PVOID InformationBuffer,
581  _In_ ULONG InformationBufferLength,
583  _Out_ PULONG BytesNeeded);
584 
585 #define NV_IMPLICIT_ENTRIES(Length) \
586  (((Length - (NV_MAXIMUM_SG_SIZE + 1)) >> NV_TX2_TSO_MAX_SHIFT) + 1)
587 
589 VOID
591  _In_ PNVNET_ADAPTER Adapter,
592  _In_ PNVNET_TCB Tcb)
593 {
594  if (Tcb->Flags & NV_TCB_COALESCE)
595  {
596  PushEntryList(&Adapter->Send.BufferList, &Tcb->Buffer->Link);
597  }
598 
599  Tcb->Packet = NULL;
600 
601  ++Adapter->Send.TcbSlots;
602 
603  Adapter->Send.TbdSlots += Tcb->Slots;
604 
605  Adapter->Send.StuckCount = 0;
606 }
607 
611  _In_ PNVNET_ADAPTER Adapter,
612  _In_ PNVNET_TCB Tcb)
613 {
614  if (Tcb++ == Adapter->Send.TailTcb)
615  return Adapter->Send.HeadTcb;
616  else
617  return Tcb;
618 }
619 
621 NVNET_TBD
623  _In_ PNVNET_ADAPTER Adapter,
624  _In_ NVNET_TBD Tbd)
625 {
626  if (Tbd.x32++ == Adapter->Send.TailTbd.x32)
627  return Adapter->Send.HeadTbd;
628  else
629  return Tbd;
630 }
631 
633 NVNET_TBD
635  _In_ PNVNET_ADAPTER Adapter,
636  _In_ NVNET_TBD Tbd)
637 {
638  if (Tbd.x64++ == Adapter->Send.TailTbd.x64)
639  return Adapter->Send.HeadTbd;
640  else
641  return Tbd;
642 }
643 
645 VOID
647  _In_ PNVNET_ADAPTER Adapter,
648  _In_ NVNET_REGISTER Register,
649  _In_ ULONG Value)
650 {
651  NdisWriteRegisterUlong((PULONG)(Adapter->IoBase + Register), Value);
652 }
653 
655 ULONG
657  _In_ PNVNET_ADAPTER Adapter,
658  _In_ NVNET_REGISTER Register)
659 {
660  ULONG Value;
661 
662  NdisReadRegisterUlong((PULONG)(Adapter->IoBase + Register), &Value);
663  return Value;
664 }
665 
666 #define NvNetDisableInterrupts(Adapter) \
667  NV_WRITE(Adapter, NvRegIrqMask, 0);
668 
669 #define NvNetApplyInterruptMask(Adapter) \
670  NV_WRITE(Adapter, NvRegIrqMask, (Adapter)->InterruptMask);
671 
672 #endif /* _NVNET_PCH_ */
BOOLEAN Connected
Definition: nvnet.h:334
VOID NvNetFreeAdapter(_In_ PNVNET_ADAPTER Adapter)
Definition: init.c:595
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:949
struct _NVNET_ADAPTER * PNVNET_ADAPTER
Definition: nvnet.h:259
ULONG SendIpChecksum
Definition: nvnet.h:101
enum _NVNET_REGISTER NVNET_REGISTER
#define NdisWriteRegisterUlong(Register, Data)
Definition: ndis.h:4294
BOOLEAN MiiWrite(_In_ PNVNET_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _In_ ULONG Data)
Definition: phy.c:26
PVOID SendBuffer
Definition: nvnet.h:378
struct _NVNET_ADAPTER NVNET_ADAPTER
Definition: nvnet.h:259
struct _NVNET_RECEIVE * PNVNET_RECEIVE
ULONG64 TransmitErrors
Definition: nvnet.h:157
ULONG PhyRevision
Definition: nvnet.h:327
UCHAR AsUCHAR[16]
Definition: nvnet.h:178
ULONG VlanId
Definition: nvnet.h:323
ULONG ReceiveTcpV6Checksum
Definition: nvnet.h:116
NVNET_TBD TailTbd
Definition: nvnet.h:244
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6008
PVOID AdapterOriginal
Definition: nvnet.h:381
UCHAR MacAddress[ETH_LENGTH_OF_ADDRESS]
Definition: nvnet.h:345
#define _Inout_
Definition: ms_sal.h:378
_Field_range_(0, NVNET_MULTICAST_LIST_SIZE) ULONG MulticastListSize
ULONG StuckCount
Definition: nvnet.h:248
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
ULONG64 ReceiveOverrunErrors
Definition: nvnet.h:164
union _NVNET_OFFLOAD NVNET_OFFLOAD
ULONG() NVNET_PROCESS_RECEIVE(_In_ PNVNET_ADAPTER Adapter, _In_ ULONG TotalRxProcessed)
Definition: nvnet.h:275
Definition: ntbasedef.h:628
ULONG Flags
Definition: nvnet.h:285
#define _Out_
Definition: ms_sal.h:345
DECLSPEC_NOINLINE VOID NvNetPauseProcessing(_In_ PNVNET_ADAPTER Adapter)
Definition: nvnet.c:46
UCHAR RevisionId
Definition: nvnet.h:366
NVNET_RECEIVE Receive
Definition: nvnet.h:312
ULONG TxRxControl
Definition: nvnet.h:301
NDIS_STATUS NvNetGetPermanentMacAddress(_Inout_ PNVNET_ADAPTER Adapter, _Out_writes_bytes_all_(ETH_LENGTH_OF_ADDRESS) PUCHAR MacAddress)
Definition: nic.c:541
#define NV_WAKEUPPATTERNS_V2
Definition: nic.h:467
PVOID VirtualAddress
Definition: nvnet.h:186
ULONG Slots
Definition: nvnet.h:210
ULONG64 HwTxBroadcast
Definition: nvnet.h:153
ULONG64 HwRxUnicast
Definition: nvnet.h:148
PVOID TbdOriginal
Definition: nvnet.h:379
NDIS_SPIN_LOCK Lock
Definition: nvnet.h:320
MDL * PNDIS_BUFFER
Definition: ndis.h:343
ULONG InterruptMask
Definition: nvnet.h:302
ULONG64 HwRxDropFrame
Definition: nvnet.h:147
NVNET_TBD DeferredTbd
Definition: nvnet.h:207
ULONG SendUdpChecksum
Definition: nvnet.h:100
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG InterruptLevel
Definition: nvnet.h:371
NDIS_PHYSICAL_ADDRESS PhysicalAddress
Definition: nvnet.h:194
ULONG ReceiveTcpOptions
Definition: nvnet.h:104
PNVNET_TCB LastTcb
Definition: nvnet.h:240
* PNDIS_STATUS
Definition: ndis.h:45
ULONG NDIS_OID
Definition: ntddndis.h:230
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
ULONG ReceiveUdpChecksum
Definition: nvnet.h:106
PNDIS_PACKET Packet
Definition: nvnet.h:231
ULONG64 HwTxFrame
Definition: nvnet.h:143
SINGLE_LIST_ENTRY Link
Definition: nvnet.h:192
ULONG WakeFrameBitmap
Definition: nvnet.h:348
NDIS_WORK_ITEM PowerWorkItem
Definition: nvnet.h:353
ULONG InterruptVector
Definition: nvnet.h:370
VOID NvNetStartReceiver(_In_ PNVNET_ADAPTER Adapter)
Definition: nic.c:104
struct _NVNET_ADAPTER::@981 MulticastList[NVNET_MULTICAST_LIST_SIZE]
VOID NvNetStopReceiver(_In_ PNVNET_ADAPTER Adapter)
Definition: nic.c:147
ULONG64 HwTxMulticast
Definition: nvnet.h:152
NDIS_HANDLE WrapperConfigurationHandle
Definition: nvnet.h:351
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6008
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
ULONG64 HwRxMulticast
Definition: nvnet.h:149
BOOLEAN InterruptShared
Definition: nvnet.h:368
ULONG64 TransmitOneRetry
Definition: nvnet.h:167
ULONG64 HwRxRunt
Definition: nvnet.h:136
ULONG64 HwRxLateCol
Definition: nvnet.h:135
PUCHAR ReceiveBuffer
Definition: nvnet.h:313
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: init.c:700
NVNET_TRANSMIT_PACKET NvNetTransmitPacket64
Definition: nvnet.h:391
ULONG64 HwTxCnt
Definition: nvnet.h:124
ULONG SendIpOptions
Definition: nvnet.h:97
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3944
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
ULONG64 HwRxFCSErr
Definition: nvnet.h:139
PNVNET_DESCRIPTOR_32 x32
Definition: nvnet.h:223
ULONG Features
Definition: nvnet.h:284
NVNET_TBD CurrentTbd
Definition: nvnet.h:245
int NDIS_STATUS
Definition: ntddndis.h:475
NDIS_PHYSICAL_ADDRESS IoAddress
Definition: nvnet.h:359
ULONG64 HwTxUnicast
Definition: nvnet.h:151
PVOID RbdOriginal
Definition: nvnet.h:380
enum _NVNET_FLOW_CONTROL_MODE NVNET_FLOW_CONTROL_MODE
FORCEINLINE VOID PushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
Definition: rtlfuncs.h:253
PNVNET_TRANSMIT_PACKET TransmitPacket
Definition: nvnet.h:316
BOOLEAN MiiRead(_In_ PNVNET_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _Out_ PULONG Data)
Definition: phy.c:62
ULONG SendUdpV6Checksum
Definition: nvnet.h:112
ULONG SendTcpV6Options
Definition: nvnet.h:110
ULONG IpHeaderOffset
Definition: nvnet.h:308
NDIS_PHYSICAL_ADDRESS TbdPhysOriginal
Definition: nvnet.h:382
ULONG64 TransmitExcessiveCollisions
Definition: nvnet.h:163
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG64 HwTxExcessDef
Definition: nvnet.h:131
ULONG64 HwTxDef
Definition: nvnet.h:142
ULONG64 TransmitLateCollisions
Definition: nvnet.h:169
ULONG ReceiveIpOptions
Definition: nvnet.h:103
ULONG64 TransmitDeferred
Definition: nvnet.h:162
long LONG
Definition: pedump.c:60
NVNET_PROCESS_TRANSMIT ProcessTransmitDescriptors64
Definition: nvnet.h:394
ULONG64 TransmitZeroRetry
Definition: nvnet.h:166
NDIS_MINIPORT_TIMER MediaDetectionTimer
Definition: nvnet.h:363
VOID NvNetResetReceiverAndTransmitter(_In_ PNVNET_ADAPTER Adapter)
Definition: nic.c:91
UCHAR PermanentMacAddress[ETH_LENGTH_OF_ADDRESS]
Definition: nvnet.h:338
NDIS_PHYSICAL_ADDRESS PhysicalAddress
Definition: nvnet.h:187
volatile PUCHAR IoBase
Definition: nvnet.h:282
VOID NvNetSetPowerState(_In_ PNVNET_ADAPTER Adapter, _In_ NDIS_DEVICE_POWER_STATE NewPowerState, _In_ ULONG WakeFlags)
Definition: requests.c:500
unsigned char BOOLEAN
struct _NVNET_TX_BUFFER_DATA NVNET_TX_BUFFER_DATA
ULONG WakeFlags
Definition: nvnet.h:324
VOID NvNetStartAdapter(_In_ PNVNET_ADAPTER Adapter)
Definition: nvnet.c:74
NDIS_STATUS NvNetRecognizeHardware(_Inout_ PNVNET_ADAPTER Adapter)
Definition: nic.c:675
NVNET_PROCESS_TRANSMIT * PNVNET_PROCESS_TRANSMIT
Definition: nvnet.h:272
#define _Out_writes_bytes_all_(size)
Definition: ms_sal.h:362
#define _In_
Definition: ms_sal.h:308
ULONG PowerStatePending
Definition: nvnet.h:329
ULONG ReceiveUdpV6Checksum
Definition: nvnet.h:117
KSYNCHRONIZE_ROUTINE NvNetInitPhaseSynchronized
Definition: nvnet.h:470
FORCEINLINE VOID NV_WRITE(_In_ PNVNET_ADAPTER Adapter, _In_ NVNET_REGISTER Register, _In_ ULONG Value)
Definition: nvnet.h:646
UCHAR WakeUpPattern[128]
Definition: nvnet.h:181
VOID NTAPI MiniportISR(_Out_ PBOOLEAN InterruptRecognized, _Out_ PBOOLEAN QueueMiniportHandleInterrupt, _In_ NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:518
VOID SidebandUnitReleaseSemaphore(_In_ PNVNET_ADAPTER Adapter)
Definition: phy.c:667
FORCEINLINE NVNET_TBD NV_NEXT_TBD_32(_In_ PNVNET_ADAPTER Adapter, _In_ NVNET_TBD Tbd)
Definition: nvnet.h:622
struct _NVNET_RECEIVE NVNET_RECEIVE
PNVNET_WAKE_FRAME WakeFrames[NV_WAKEUPPATTERNS_V2]
Definition: nvnet.h:349
ULONG64 HwRxLenErr
Definition: nvnet.h:141
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
ULONG PauseFlags
Definition: nvnet.h:332
VOID NvNetFlushTransmitQueue(_In_ PNVNET_ADAPTER Adapter, _In_ NDIS_STATUS CompleteStatus)
Definition: nvnet.c:24
#define NVNET_TRANSMIT_BUFFERS
Definition: nvnet.h:33
NDIS_PHYSICAL_ADDRESS RbdPhys
Definition: nvnet.h:375
NVNET_STATISTICS Statistics
Definition: nvnet.h:319
struct _NVNET_WAKE_FRAME * PNVNET_WAKE_FRAME
NDIS_SPIN_LOCK Lock
Definition: nvnet.h:255
ULONG InterruptIdleCount
Definition: nvnet.h:304
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN NvNetUpdateLinkSpeed(_In_ PNVNET_ADAPTER Adapter)
Definition: phy.c:990
FORCEINLINE PNVNET_TCB NV_NEXT_TCB(_In_ PNVNET_ADAPTER Adapter, _In_ PNVNET_TCB Tcb)
Definition: nvnet.h:610
PNVNET_DESCRIPTOR_64 x64
Definition: nvnet.h:200
struct _NVNET_TX_BUFFER * PNVNET_TX_BUFFER
ULONG() NVNET_PROCESS_TRANSMIT(_In_ PNVNET_ADAPTER Adapter, _Inout_ PLIST_ENTRY SendReadyList)
Definition: nvnet.h:269
NDIS_SPIN_LOCK Lock
Definition: nvnet.h:237
ULONG64 HwRxFrameErr
Definition: nvnet.h:133
SINGLE_LIST_ENTRY BufferList
Definition: nvnet.h:250
NDIS_STATUS NvNetFindPhyDevice(_In_ PNVNET_ADAPTER Adapter)
PNVNET_TCB HeadTcb
Definition: nvnet.h:238
ULONG ReceiveTcpV6Options
Definition: nvnet.h:115
#define NVNET_MULTICAST_LIST_SIZE
Definition: nvnet.h:64
ULONG64 HwRxFrameAlignErr
Definition: nvnet.h:140
struct _NVNET_RBD NVNET_RBD
VOID NvNetBackoffReseed(_In_ PNVNET_ADAPTER Adapter)
Definition: backoff.c:91
ULONG64 TransmitUnderrunErrors
Definition: nvnet.h:165
NVNET_TRANSMIT_PACKET NvNetTransmitPacket32
Definition: nvnet.h:390
ULONG64 HwTxZeroReXmt
Definition: nvnet.h:125
ULONG64 HwTxLossCarrier
Definition: nvnet.h:130
PNVNET_TX_BUFFER Buffer
Definition: nvnet.h:209
VOID NvNetUpdatePauseFrame(_Inout_ PNVNET_ADAPTER Adapter, _In_ ULONG PauseFlags)
Definition: nic.c:242
NV_RBD NvRbd
Definition: nvnet.h:230
NDIS_STATUS NTAPI MiniportSend(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PNDIS_PACKET Packet, _In_ UINT Flags)
Definition: send.c:49
ULONG PhyOui
Definition: nvnet.h:328
ULONG PacketFilter
Definition: nvnet.h:309
NVNET_TBD HeadTbd
Definition: nvnet.h:243
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char UCHAR
Definition: xmlstorage.h:181
NDIS_WORK_ITEM ResetWorkItem
Definition: nvnet.h:354
ULONG LinkSpeed
Definition: nvnet.h:333
char * PBOOLEAN
Definition: retypes.h:11
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION _In_ PSCATTER_GATHER_LIST SgList
VOID NvNetSetupMacAddress(_In_ PNVNET_ADAPTER Adapter, _In_reads_bytes_(ETH_LENGTH_OF_ADDRESS) PUCHAR MacAddress)
Definition: nic.c:622
struct _NVNET_WAKE_FRAME NVNET_WAKE_FRAME
ULONG64 HwRxOverflow
Definition: nvnet.h:138
ULONG Value
Definition: nvnet.h:119
_NVNET_FLOW_CONTROL_MODE
Definition: nvnet.h:85
NV_RBD NvRbd
Definition: nvnet.h:256
ULONG InterruptFlags
Definition: nvnet.h:372
VOID NvNetIdleTransmitter(_In_ PNVNET_ADAPTER Adapter, _In_ BOOLEAN ClearPhyControl)
Definition: nic.c:211
#define VOID
Definition: acefi.h:82
enum _NDIS_MEDIUM * PNDIS_MEDIUM
NVNET_TRANSMIT_PACKET * PNVNET_TRANSMIT_PACKET
Definition: nvnet.h:266
PNDIS_BUFFER Buffer
Definition: nvnet.h:232
NVNET_OPTIMIZATION_MODE OptimizationMode
Definition: nvnet.h:306
ULONG64 ReceiveCrcErrors
Definition: nvnet.h:160
UCHAR CurrentMacAddress[ETH_LENGTH_OF_ADDRESS]
Definition: nvnet.h:339
Definition: typedefs.h:119
enum _NVNET_OPTIMIZATION_MODE NVNET_OPTIMIZATION_MODE
union _NVNET_TBD NVNET_TBD
PNVNET_PROCESS_TRANSMIT ProcessTransmit
Definition: nvnet.h:317
ULONG AdapterStatus
Definition: nvnet.h:305
BOOLEAN FullDuplex
Definition: nvnet.h:335
PNVNET_DESCRIPTOR_32 x32
Definition: nvnet.h:199
ULONG64 HwTxLateCol
Definition: nvnet.h:128
NDIS_HANDLE AdapterHandle
Definition: nvnet.h:283
ULONG SendTcpV6Checksum
Definition: nvnet.h:111
NDIS_PHYSICAL_ADDRESS RbdPhysOriginal
Definition: nvnet.h:383
ULONG TbdSlots
Definition: nvnet.h:247
struct _NVNET_TCB NVNET_TCB
struct _NVNET_SEND * PNVNET_SEND
PNDIS_PACKET Packet
Definition: nvnet.h:208
ULONG ReceiveIpChecksum
Definition: nvnet.h:107
VOID NvNetBackoffReseedEx(_In_ PNVNET_ADAPTER Adapter)
Definition: backoff.c:125
NDIS_PHYSICAL_ADDRESS TbdPhys
Definition: nvnet.h:374
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: requests.c:1306
ULONG64 HwRxPause
Definition: nvnet.h:146
VOID NvNetStopAdapter(_In_ PNVNET_ADAPTER Adapter)
Definition: nvnet.c:58
ULONG64 HwRxExtraByte
Definition: nvnet.h:134
NVNET_TBD Tbd
Definition: nvnet.h:206
ULONG SendTcpChecksum
Definition: nvnet.h:99
_NVNET_OPTIMIZATION_MODE
Definition: nvnet.h:78
PNVNET_TCB TailTcb
Definition: nvnet.h:239
ULONG64 HwRxCnt
Definition: nvnet.h:144
ULONG SendIpV6Options
Definition: nvnet.h:109
ULONG64 ReceiveNoBuffers
Definition: nvnet.h:159
unsigned short USHORT
Definition: pedump.c:61
ULONG OriginalMacAddress[2]
Definition: nvnet.h:337
ULONG ReceiveIrqNoBuffers
Definition: nvnet.h:171
ULONG InterruptStatus
Definition: nvnet.h:303
ULONG PhyModel
Definition: nvnet.h:326
NDIS_STATUS NvNetPhyInit(_In_ PNVNET_ADAPTER Adapter)
Definition: phy.c:1036
FORCEINLINE NVNET_TBD NV_NEXT_TBD_64(_In_ PNVNET_ADAPTER Adapter, _In_ NVNET_TBD Tbd)
Definition: nvnet.h:634
NVNET_PROCESS_TRANSMIT ProcessTransmitDescriptorsLegacy
Definition: nvnet.h:392
ULONG ReceiveBufferSize
Definition: nvnet.h:322
ULONG64 ReceiveErrors
Definition: nvnet.h:158
NDIS_STATUS NvNetInitNIC(_In_ PNVNET_ADAPTER Adapter, _In_ BOOLEAN InitPhy)
Definition: nic.c:401
struct _NVNET_SEND NVNET_SEND
#define FORCEINLINE
Definition: wdftypes.h:67
union _NV_RBD NV_RBD
VOID NvNetStartTransmitter(_In_ PNVNET_ADAPTER Adapter)
Definition: nic.c:130
PNVNET_DESCRIPTOR_64 x64
Definition: nvnet.h:224
struct _NVNET_TX_BUFFER NVNET_TX_BUFFER
unsigned int * PULONG
Definition: retypes.h:1
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
ULONG Mss
Definition: nvnet.h:218
unsigned int UINT
Definition: ndis.h:50
#define NdisReadRegisterUlong(Register, Data)
Definition: ndis.h:4267
#define NULL
Definition: types.h:112
PVOID Memory
Definition: nvnet.h:225
NVNET_TX_BUFFER_DATA SendBufferAllocationData[NVNET_TRANSMIT_BUFFERS]
Definition: nvnet.h:384
ULONG PhyAddress
Definition: nvnet.h:325
ULONG64 HwTxUnderflow
Definition: nvnet.h:129
ULONG64 TransmitOk
Definition: nvnet.h:155
struct _NVNET_RBD * PNVNET_RBD
struct _NVNET_TX_BUFFER_DATA * PNVNET_TX_BUFFER_DATA
PNVNET_TCB DeferredTcb
Definition: nvnet.h:242
ULONG64 TransmitLostCarrierSense
Definition: nvnet.h:168
ULONG SendTcpOptions
Definition: nvnet.h:98
union _NVNET_OFFLOAD * PNVNET_OFFLOAD
VOID NvNetToggleClockPowerGating(_In_ PNVNET_ADAPTER Adapter, _In_ BOOLEAN Gate)
Definition: nic.c:294
VOID NTAPI MiniportHandleInterrupt(_In_ NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:449
#define NV_TCB_COALESCE
Definition: nvnet.h:216
NVNET_PROCESS_TRANSMIT ProcessTransmitDescriptors32
Definition: nvnet.h:393
PVOID Memory
Definition: nvnet.h:201
enum _NDIS_DEVICE_POWER_STATE NDIS_DEVICE_POWER_STATE
struct _NVNET_STATISTICS NVNET_STATISTICS
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: requests.c:997
PVOID VirtualAddress
Definition: nvnet.h:193
ULONG ReceiveTcpChecksum
Definition: nvnet.h:105
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
Definition: iotypes.h:2204
VOID() NVNET_TRANSMIT_PACKET(_In_ PNVNET_ADAPTER Adapter, _In_ PNVNET_TCB Tcb, _In_ PSCATTER_GATHER_LIST SgList)
Definition: nvnet.h:262
unsigned int ULONG
Definition: retypes.h:1
NDIS_PHYSICAL_ADDRESS ReceiveBufferPhys
Definition: nvnet.h:376
FORCEINLINE VOID NV_RELEASE_TCB(_In_ PNVNET_ADAPTER Adapter, _In_ PNVNET_TCB Tcb)
Definition: nvnet.h:590
ULONG Flags
Definition: nvnet.h:211
struct _NVNET_TCB * PNVNET_TCB
ULONG64 HwRxFrameTooLong
Definition: nvnet.h:137
VOID NvNetBackoffSetSlotTime(_In_ PNVNET_ADAPTER Adapter)
Definition: backoff.c:58
ULONG ReceiveIpV6Options
Definition: nvnet.h:114
ULONG64 HwTxPause
Definition: nvnet.h:145
ULONG64 HwTxOneReXmt
Definition: nvnet.h:126
PNVNET_TCB CurrentTcb
Definition: nvnet.h:241
#define _Interlocked_
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: nvnet.h:369
VOID NvNetStopTransmitter(_In_ PNVNET_ADAPTER Adapter)
Definition: nic.c:178
ULONG VlanControl
Definition: nvnet.h:331
ULONG64 ReceiveAlignmentErrors
Definition: nvnet.h:161
ULONG AsULONG[4]
Definition: nvnet.h:179
NVNET_OFFLOAD Offload
Definition: nvnet.h:307
USHORT DeviceId
Definition: nvnet.h:365
NVNET_PROCESS_RECEIVE * PNVNET_PROCESS_RECEIVE
Definition: nvnet.h:278
ULONG PacketsCount
Definition: nvnet.h:249
#define DECLSPEC_NOINLINE
Definition: ntbasedef.h:225
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
NDIS_TIMER_FUNCTION NvNetMediaDetectionDpc
Definition: nvnet.h:471
NVNET_SEND Send
Definition: nvnet.h:310
_Interlocked_ volatile LONG ResetLock
Definition: nvnet.h:357
ULONG MaximumFrameSize
Definition: nvnet.h:321
FORCEINLINE ULONG NV_READ(_In_ PNVNET_ADAPTER Adapter, _In_ NVNET_REGISTER Register)
Definition: nvnet.h:656
struct _NVNET_STATISTICS * PNVNET_STATISTICS
union _NVNET_WAKE_FRAME::@980 PatternMask
NVNET_FLOW_CONTROL_MODE FlowControlMode
Definition: nvnet.h:362
unsigned int * PUINT
Definition: ndis.h:50
ULONG64 ReceiveOk
Definition: nvnet.h:156
ULONG IoLength
Definition: nvnet.h:360
Definition: nvnet.h:221
ULONG64 HwTxRetryErr
Definition: nvnet.h:132
ULONG64 HwTxManyReXmt
Definition: nvnet.h:127
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
ULONG64 HwRxBroadcast
Definition: nvnet.h:150
ULONG TcbSlots
Definition: nvnet.h:246
ULONG CurrentRx
Definition: nvnet.h:314