ReactOS  0.4.15-dev-1384-g878186b
ndis56common.h
Go to the documentation of this file.
1 /*
2  * This file contains general definitions for VirtIO network adapter driver,
3  * common for both NDIS5 and NDIS6
4  *
5  * Copyright (c) 2008-2017 Red Hat, Inc.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met :
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and / or other materials provided with the distribution.
15  * 3. Neither the names of the copyright holders nor the names of their contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 #ifndef PARANDIS_56_COMMON_H
31 #define PARANDIS_56_COMMON_H
32 
33 //#define PARANDIS_TEST_TX_KICK_ALWAYS
34 
35 #if defined(OFFLOAD_UNIT_TEST)
36 #include <windows.h>
37 #include <stdio.h>
38 
39 #define ETH_LENGTH_OF_ADDRESS 6
40 #define DoPrint(fmt, ...) printf(fmt##"\n", __VA_ARGS__)
41 #define DPrintf(a,b) DoPrint b
42 #define RtlOffsetToPointer(B,O) ((PCHAR)( ((PCHAR)(B)) + ((ULONG_PTR)(O)) ))
43 
44 #include "ethernetutils.h"
45 #endif //+OFFLOAD_UNIT_TEST
46 
47 #if !defined(OFFLOAD_UNIT_TEST)
48 
49 #if !defined(RtlOffsetToPointer)
50 #define RtlOffsetToPointer(Base,Offset) ((PCHAR)(((PCHAR)(Base))+((ULONG_PTR)(Offset))))
51 #endif
52 
53 #if !defined(RtlPointerToOffset)
54 #define RtlPointerToOffset(Base,Pointer) ((ULONG)(((PCHAR)(Pointer))-((PCHAR)(Base))))
55 #endif
56 
57 
58 #include <ndis.h>
59 #include "osdep.h"
60 #include "kdebugprint.h"
61 #include "ethernetutils.h"
62 #include "virtio_pci.h"
63 #include "VirtIO.h"
64 #include "virtio_ring.h"
65 #include "IONetDescriptor.h"
66 #include "DebugData.h"
67 
68 // those stuff defined in NDIS
69 //NDIS_MINIPORT_MAJOR_VERSION
70 //NDIS_MINIPORT_MINOR_VERSION
71 // those stuff defined in build environment
72 // PARANDIS_MAJOR_DRIVER_VERSION
73 // PARANDIS_MINOR_DRIVER_VERSION
74 
75 #if !defined(NDIS_MINIPORT_MAJOR_VERSION) || !defined(NDIS_MINIPORT_MINOR_VERSION)
76 #error "Something is wrong with NDIS environment"
77 #endif
78 
79 //define to see when the status register is unreadable(see ParaNdis_ResetVirtIONetDevice)
80 //#define VIRTIO_RESET_VERIFY
81 
82 //define to if hardware raise interrupt on error (see ParaNdis_DPCWorkBody)
83 //#define VIRTIO_SIGNAL_ERROR
84 
85 // define if qemu supports logging to static IO port for synchronization
86 // of driver output with qemu printouts; in this case define the port number
87 // #define VIRTIO_DBG_USE_IOPORT 0x99
88 
89 // to be set to real limit later
90 #define MAX_RX_LOOPS 1000
91 
92 // maximum number of virtio queues used by the driver
93 #define MAX_NUM_OF_QUEUES 3
94 
95 /* The feature bitmap for virtio net */
96 #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
97 #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
98 #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
99 #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */
100 #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */
101 #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */
102 #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */
103 #define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */
104 #define VIRTIO_NET_F_HOST_TSO4 11 /* Host can handle TSOv4 in. */
105 #define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */
106 #define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
107 #define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
108 #define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can handle merged Rx buffers and requires bigger header for that. */
109 #define VIRTIO_NET_F_STATUS 16
110 #define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
111 #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
112 #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
113 #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
114 
115 #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
116 
117 #define VIRTIO_NET_INVALID_INTERRUPT_STATUS 0xFF
118 
119 #define PARANDIS_MULTICAST_LIST_SIZE 32
120 #define PARANDIS_MEMORY_TAG '5muQ'
121 #define PARANDIS_FORMAL_LINK_SPEED (pContext->ulFormalLinkSpeed)
122 #define PARANDIS_MAXIMUM_TRANSMIT_SPEED PARANDIS_FORMAL_LINK_SPEED
123 #define PARANDIS_MAXIMUM_RECEIVE_SPEED PARANDIS_FORMAL_LINK_SPEED
124 #define PARANDIS_MIN_LSO_SEGMENTS 2
125 // reported
126 #define PARANDIS_MAX_LSO_SIZE 0xF800
127 
128 #define PARANDIS_UNLIMITED_PACKETS_TO_INDICATE (~0ul)
129 
131 
133 {
135  isReceive = 0x10,
136  isTransmit = 0x20,
137  isUnknown = 0x40,
140  isDisable = 0x80
142 
149 
151 
152 
154 {
155  srsDisabled = 0, // initial state
159 
160 typedef struct _tagBusResource {
166 } tBusResource;
167 
168 typedef struct _tagAdapterResources
169 {
176 
178 {
179  osbT4IpChecksum = (1 << 0),
180  osbT4TcpChecksum = (1 << 1),
181  osbT4UdpChecksum = (1 << 2),
184  osbT4Lso = (1 << 5),
185  osbT4LsoIp = (1 << 6),
186  osbT4LsoTcp = (1 << 7),
187  osbT4RxTCPChecksum = (1 << 8),
189  osbT4RxIPChecksum = (1 << 10),
191  osbT4RxUDPChecksum = (1 << 12),
192  osbT6TcpChecksum = (1 << 13),
193  osbT6UdpChecksum = (1 << 14),
195  osbT6IpExtChecksum = (1 << 16),
196  osbT6Lso = (1 << 17),
197  osbT6LsoIpExt = (1 << 18),
198  osbT6LsoTcpOptions = (1 << 19),
199  osbT6RxTCPChecksum = (1 << 20),
201  osbT6RxUDPChecksum = (1 << 22),
202  osbT6RxIpExtChecksum = (1 << 23),
204 
206 {
232 
233 
234 typedef struct _tagOffloadSettings
235 {
236  /* current value of enabled offload features */
238  /* load once, do not modify - bitmask of offload features, enabled in configuration */
243 
245 {
246  union
247  {
248  struct
249  {
256  } flags;
258  };
260 
261 /*
262 for simplicity, we use for NDIS5 the same statistics as native NDIS6 uses
263 */
264 typedef struct _tagNdisStatistics
265 {
285 
289 
290 typedef struct _tagNdisOffloadParams
291 {
301 
302 //#define UNIFY_LOCKS
303 
304 typedef struct _tagOurCounters
305 {
310 }tOurCounters;
311 
312 typedef struct _tagMaxPacketSize
313 {
319 
321 {
326  ULONG IsTX : 1;
328 
329 typedef struct _tagMulticastData
330 {
334 
335 typedef struct _tagIONetDescriptor {
343 
344 typedef void (*tReuseReceiveBufferProc)(void *pContext, pIONetDescriptor pDescriptor);
345 
346 typedef struct _tagPARANDIS_ADAPTER
347 {
353 
358 
360 #ifdef PARANDIS_DEBUG_INTERRUPTS
362 #endif
409  /* send part */
410 #if !defined(UNIFY_LOCKS)
413 #else
414  union
415  {
418  };
419 #endif
421  struct
422  {
431  } extraStatistics;
439  /* Net part - management of buffers and queues of QEMU */
444  /* list of Rx buffers available for data (under VIRTIO management) */
447  /* list of Rx buffers waiting for return (under NDIS management) */
449  /* list of Tx buffers in process (under VIRTIO management) */
451  /* list of Tx buffers ready for data (under MINIPORT management) */
453  /* current number of free Tx descriptors */
455  /* initial number of free Tx descriptor(from cfg) - max number of available Tx descriptors */
457  /* current number of free Tx buffers, which can be submitted */
459  /* maximal number of free Tx buffers, which can be used by SG */
461  /* minimal number of free Tx buffers */
463  /* current number of Tx packets (or lists) to return */
465  /* total of Rx buffer in turnaround */
472  // we keep these members common for XP and Vista
473  // for XP and non-MSI case of Vista they are set to zero
477 
489 
491 typedef struct _tagCopyPacketResult
492 {
496 
498 {
502 
504 
505 /**********************************************************
506 LAZY release procedure returns buffers to VirtIO
507 only where there are no free buffers available
508 
509 NON-LAZY release releases transmit buffers from VirtIO
510 library every time there is something to release
511 ***********************************************************/
512 //#define LAZY_TX_RELEASE
513 
514 static inline bool VirtIODeviceGetHostFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
515 {
516  DPrintf(4, ("%s\n", __FUNCTION__));
517 
518  return virtio_is_feature_enabled(pContext->ullHostFeatures, uFeature);
519 }
520 
521 static inline void VirtIODeviceEnableGuestFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
522 {
523  DPrintf(4, ("%s\n", __FUNCTION__));
524 
525  virtio_feature_enable(pContext->ullGuestFeatures, uFeature);
526 }
527 
529 {
530 #ifndef LAZY_TX_RELEASE
531  return pContext->nofFreeTxDescriptors < pContext->maxFreeTxDescriptors;
532 #else
533  return pContext->nofFreeTxDescriptors == 0;
534 #endif
535 }
536 
538 {
539  return pContext->VlanId == 0 || pContext->VlanId == VlanID;
540 }
541 
543 {
544  return pContext->ulPriorityVlanSetting & 2;
545 }
546 
548 {
549  return pContext->ulPriorityVlanSetting & 1;
550 }
551 
553  PUCHAR pcMacAddress,
554  BOOLEAN bLocal);
555 
557  PARANDIS_ADAPTER *pContext,
559 
561  PARANDIS_ADAPTER *pContext);
562 
564  PARANDIS_ADAPTER *pContext);
565 
566 
568  PARANDIS_ADAPTER *pContext);
569 
571  PARANDIS_ADAPTER *pContext,
572  ULONG ulMaxPacketsToIndicate);
573 
575  PARANDIS_ADAPTER *pContext,
576  PVOID Buffer,
578  PUINT pBytesRead,
579  PUINT pBytesNeeded);
580 
582  PARANDIS_ADAPTER *pContext,
583  ULONG interruptSource);
584 
586  PARANDIS_ADAPTER *pContext,
587  ULONG interruptSource);
588 
589 static __inline struct virtqueue *
591 {
592  if (interruptSource & isTransmit)
593  return pContext->NetSendQueue;
594  if (interruptSource & isReceive)
595  return pContext->NetReceiveQueue;
596 
597  return NULL;
598 }
599 
600 static __inline BOOLEAN
602 {
603  return virtqueue_is_interrupt_enabled(_vq);
604 }
605 
607  PARANDIS_ADAPTER *pContext,
608  NDIS_DEVICE_PNP_EVENT pEvent,
609  PVOID pInfo,
610  ULONG ulSize);
611 
613  PARANDIS_ADAPTER *pContext,
614  BOOLEAN *pRunDpc);
615 
617  PARANDIS_ADAPTER *pContext,
618  BOOLEAN *pRunDpc,
619  ULONG knownInterruptSources);
620 
622  PARANDIS_ADAPTER *pContext);
623 
625  PARANDIS_ADAPTER *pContext);
626 
628  PARANDIS_ADAPTER *pContext,
629  BOOLEAN bForce);
630 
632  PARANDIS_ADAPTER *pContext
633 );
634 
636  PARANDIS_ADAPTER *pContext
637 );
638 
640 void ParaNdis_DebugCleanup(PDRIVER_OBJECT pDriverObject);
641 void ParaNdis_DebugRegisterMiniport(PARANDIS_ADAPTER *pContext, BOOLEAN bRegister);
642 
643 
644 //#define ENABLE_HISTORY_LOG
645 #if !defined(ENABLE_HISTORY_LOG)
646 
648  PARANDIS_ADAPTER *pContext,
650  PVOID pParam1,
651  ULONG lParam2,
652  ULONG lParam3,
653  ULONG lParam4)
654 {
655 
656 }
657 
658 #else
659 
661  PARANDIS_ADAPTER *pContext,
663  PVOID pParam1,
664  ULONG lParam2,
665  ULONG lParam3,
666  ULONG lParam4);
667 
668 #endif
669 
671 {
678  ULONG flags; //see tPacketOffloadRequest
680 
682  PARANDIS_ADAPTER *pContext,
683  tTxOperationParameters *pParams);
684 
685 typedef struct _tagMapperResult
686 {
691 
692 
694 
696 
698 
700 
701 /*****************************************************
702 Procedures to implement for NDIS specific implementation
703 ******************************************************/
704 
706  PARANDIS_ADAPTER *pContext,
707  ULONG ulRequiredSize);
708 
710  PARANDIS_ADAPTER *pContext);
711 
713  PARANDIS_ADAPTER *pContext);
714 
716  PARANDIS_ADAPTER *pContext);
717 
719  PARANDIS_ADAPTER *pContext,
721  PULONG pLength,
722  BOOLEAN bPrepareOnly,
723  pIONetDescriptor pBufferDesc);
724 
726  PARANDIS_ADAPTER *pContext,
727  tPacketIndicationType *pBatch,
728  ULONG nofPackets);
729 
731  PARANDIS_ADAPTER *pContext,
733  PVOID Reference,
735  pIONetDescriptor pDesc,
736  tMapperResult *pMapperResult
737  );
738 
741  PVOID dest,
742  ULONG maxSize,
743  PVOID refValue,
744  BOOLEAN bPreview);
745 
747  PARANDIS_ADAPTER *pContext,
748  BOOLEAN IsDpc,
749  BOOLEAN IsInterrupt);
750 
752  NDIS_HANDLE timer,
753  LONG millies);
754 
756  PARANDIS_ADAPTER *pContext,
757  ULONG messageId,
758  tSynchronizedProcedure procedure,
759  PVOID parameter);
760 
762  PARANDIS_ADAPTER *pContext);
763 
765  PARANDIS_ADAPTER *pContext);
766 
768  PARANDIS_ADAPTER *pContext,
769  IONetDescriptor *pDesc);
770 
771 
773  PARANDIS_ADAPTER *pContext,
774  tCompletePhysicalAddress *pAddresses);
775 
776 
778 {
783 
784 
786  PARANDIS_ADAPTER *pContext,
787  tCompletePhysicalAddress *pAddresses);
788 
790  PARANDIS_ADAPTER *pContext,
791  tCompletePhysicalAddress *pAddresses);
792 
794  PARANDIS_ADAPTER *pContext,
795  pIONetDescriptor pBufferDesc);
796 
798  PARANDIS_ADAPTER *pContext,
799  pIONetDescriptor pBufferDesc);
800 
802  PARANDIS_ADAPTER *pContext,
804  BOOLEAN bForce);
805 
807  PARANDIS_ADAPTER *pContext);
808 
810  PARANDIS_ADAPTER *pContext);
811 
813  PARANDIS_ADAPTER *pContext);
814 
816  PARANDIS_ADAPTER *pContext,
817  NDIS_DEVICE_POWER_STATE newState);
818 
819 
820 #endif //-OFFLOAD_UNIT_TEST
821 
822 typedef enum _tagppResult
823 {
837 }ppResult;
838 
840 {
841  struct {
842  /* 0 - not tested, 1 - not IP, 2 - IPV4, 3 - IPV6 */
844  /* 0 - not tested, 1 - n/a, 2 - CS, 3 - bad */
846  /* 0 - not tested, 1 - PCS, 2 - CS, 3 - bad */
848  /* 0 - not tested, 1 - other, 2 - known(contains basic TCP or UDP header), 3 - known incomplete */
850  /* 1 - contains complete payload */
859  };
862 
864 {
865  pcrIpChecksum = (1 << 0),
866  pcrTcpV4Checksum = (1 << 1),
867  pcrUdpV4Checksum = (1 << 2),
868  pcrTcpV6Checksum = (1 << 3),
869  pcrUdpV6Checksum = (1 << 4),
873  pcrLSO = (1 << 5),
874  pcrIsIP = (1 << 6),
875  pcrFixIPChecksum = (1 << 7),
876  pcrFixPHChecksum = (1 << 8),
878  pcrFixUdpV4Checksum = (1 << 10),
879  pcrFixTcpV6Checksum = (1 << 11),
880  pcrFixUdpV6Checksum = (1 << 12),
882  pcrPriorityTag = (1 << 13),
883  pcrNoIndirect = (1 << 14)
885 
886 // sw offload
889 
890 void ParaNdis_PadPacketReceived(PVOID pDataBuffer, PULONG pLength);
891 
892 #endif
VirtIOSystemOps ParaNdisSystemOps
VOID ParaNdis_PowerOff(PARANDIS_ADAPTER *pContext)
enum _tagInterruptSource tInterruptSource
struct _tagIONetDescriptor IONetDescriptor
LIST_ENTRY listEntry
Definition: ndis56common.h:336
NDIS_STATUS ParaNdis_InitializeContext(PARANDIS_ADAPTER *pContext, PNDIS_RESOURCE_LIST ResourceList)
NDIS_OFFLOAD_PARAMETERS InitialOffloadParameters
Definition: ndis56common.h:471
NDIS_HANDLE PacketPool
Definition: ndis56common.h:479
tSendReceiveState ReceiveState
Definition: ndis56common.h:435
tCompletePhysicalAddress address
Definition: ndis56common.h:779
#define PCI_TYPE0_ADDRESSES
Definition: iotypes.h:3479
VOID ParaNdis_PacketMapper(PARANDIS_ADAPTER *pContext, tPacketType packet, PVOID Reference, struct VirtIOBufferDescriptor *buffers, pIONetDescriptor pDesc, tMapperResult *pMapperResult)
NDIS_SPIN_LOCK ReceiveLock
Definition: ndis56common.h:412
USHORT usBuffersMapped
Definition: ndis56common.h:687
static BOOLEAN FORCEINLINE IsTimeToReleaseTx(PARANDIS_ADAPTER *pContext)
Definition: ndis56common.h:528
VOID ParaNdis_UpdateDeviceFilters(PARANDIS_ADAPTER *pContext)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
void ParaNdis_UnbindBufferFromPacket(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDesc)
#define VIRTIO_PCI_ISR_CONFIG
Definition: virtio_pci.h:96
NDIS_STATUS ParaNdis_FinishInitialization(PARANDIS_ADAPTER *pContext)
void ParaNdis_CallOnBugCheck(PARANDIS_ADAPTER *pContext)
NDIS_HANDLE BuffersPool
Definition: ndis56common.h:480
BOOLEAN ParaNdis_CheckForHang(PARANDIS_ADAPTER *pContext)
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
UINT ParaNdis_VirtIONetReleaseTransmitBuffers(PARANDIS_ADAPTER *pContext)
NDIS_DEVICE_POWER_STATE powerState
Definition: ndis56common.h:389
tAdapterResources AdapterResources
Definition: ndis56common.h:351
VOID ParaNdis_Suspend(PARANDIS_ADAPTER *pContext)
NDIS_TIMER DPCPostProcessTimer
Definition: ndis56common.h:486
struct _tagChecksumCheckResult::@993::@995 flags
unsigned char * PUCHAR
Definition: retypes.h:3
static void VirtIODeviceEnableGuestFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
Definition: ndis56common.h:521
LIST_ENTRY NetReceiveBuffersWaiting
Definition: ndis56common.h:448
ULONG64 ifHCOutMulticastPkts
Definition: ndis56common.h:278
NDIS_STATUS ParaNdis_SetMulticastList(PARANDIS_ADAPTER *pContext, PVOID Buffer, ULONG BufferSize, PUINT pBytesRead, PUINT pBytesNeeded)
VOID ParaNdis_IndicateReceivedBatch(PARANDIS_ADAPTER *pContext, tPacketIndicationType *pBatch, ULONG nofPackets)
struct VirtIOBufferDescriptor * sgTxGatherTable
Definition: ndis56common.h:467
ULONG64 ifHCInBroadcastPkts
Definition: ndis56common.h:271
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
tOurCounters Limits
Definition: ndis56common.h:433
BOOLEAN ParaNdis_ProcessTx(PARANDIS_ADAPTER *pContext, BOOLEAN IsDpc, BOOLEAN IsInterrupt)
BOOLEAN bEnableInterruptChecking
Definition: ndis56common.h:365
tTcpIpPacketParsingResult ParaNdis_CheckSumVerify(PVOID buffer, ULONG size, ULONG flags, LPCSTR caller)
Definition: sw-offload.c:565
ULONG64 ifHCOutUcastPkts
Definition: ndis56common.h:276
tPacketHolderType pHolder
Definition: ndis56common.h:339
tCompletePhysicalAddress ControlData
Definition: ndis56common.h:441
ULONGLONG ullGuestFeatures
Definition: ndis56common.h:357
struct _tagOffloadSettingsFlags tOffloadSettingsFlags
GLuint buffer
Definition: glext.h:5915
enum _NDIS_DEVICE_PNP_EVENT NDIS_DEVICE_PNP_EVENT
VOID ParaNdis_CleanupContext(PARANDIS_ADAPTER *pContext)
const GLuint * buffers
Definition: glext.h:5916
tChecksumCheckResult ParaNdis_CheckRxChecksum(PARANDIS_ADAPTER *pContext, ULONG virtioFlags, PVOID pRxPacket, ULONG len)
struct _tagNdisStatistics NDIS_STATISTICS_INFO
struct _tagCompletePhysicalAddress tCompletePhysicalAddress
tBusResource SharedMemoryRanges[MAX_NUM_OF_QUEUES]
Definition: ndis56common.h:352
LIST_ENTRY NetReceiveBuffers
Definition: ndis56common.h:445
_tagPacketOffloadRequest
Definition: ndis56common.h:863
VOID ParaNdis_ReportLinkStatus(PARANDIS_ADAPTER *pContext, BOOLEAN bForce)
struct _tagMapperResult tMapperResult
enum _tagPacketOffloadRequest tPacketOffloadRequest
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
VOID ParaNdis_FreePhysicalMemory(PARANDIS_ADAPTER *pContext, tCompletePhysicalAddress *pAddresses)
enum _tagOffloadSettingsBit tOffloadSettingsBit
BOOLEAN bIODeviceInitialized
Definition: ndis56common.h:355
PVOID dataBuffer
VOID ParaNdis_VirtIOEnableIrqSynchronized(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
NDIS_PHYSICAL_ADDRESS BasePA
Definition: ndis56common.h:161
BOOLEAN bEnableInterruptHandlingDPC
Definition: ndis56common.h:364
int NDIS_STATUS
Definition: ntddndis.h:471
BOOLEAN(* tSynchronizedProcedure)(tSynchronizedContext *context)
Definition: ndis56common.h:503
tOffloadSettingsFlags flags
Definition: ndis56common.h:237
NDIS_STATISTICS_INFO Statistics
Definition: ndis56common.h:420
VOID ParaNdis_DeviceFiltersUpdateVlanId(PARANDIS_ADAPTER *pContext)
BOOLEAN ParaNdis_BindBufferToPacket(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDesc)
VOID(* tOnAdditionalPhysicalMemoryAllocated)(PARANDIS_ADAPTER *pContext, tCompletePhysicalAddress *pAddresses)
Definition: ndis56common.h:772
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
void ParaNdis_ResetOffloadSettings(PARANDIS_ADAPTER *pContext, tOffloadSettingsFlags *pDest, PULONG from)
static BOOLEAN FORCEINLINE IsPrioritySupported(PARANDIS_ADAPTER *pContext)
Definition: ndis56common.h:547
long LONG
Definition: pedump.c:60
VOID ParaNdis_OnTransmitBufferReleased(PARANDIS_ADAPTER *pContext, IONetDescriptor *pDesc)
struct _tagOurCounters tOurCounters
static BOOLEAN virtqueue_is_interrupt_enabled(struct virtqueue *vq)
Definition: VirtIO.h:110
ULONG64 ifHCInMulticastOctets
Definition: ndis56common.h:270
#define virtio_is_feature_enabled(FeaturesList, Feature)
Definition: virtio_pci.h:311
PVOID ParaNdis_AllocateMemory(PARANDIS_ADAPTER *pContext, ULONG ulRequiredSize)
#define DPrintf(Level, Fmt)
Definition: kdebugprint.h:61
USHORT usBufferSpaceUsed
Definition: ndis56common.h:688
ULONG64 ifHCOutBroadcastOctets
Definition: ndis56common.h:281
tCompletePhysicalAddress HeaderInfo
Definition: ndis56common.h:337
unsigned char BOOLEAN
tCopyPacketResult ParaNdis_DoSubmitPacket(PARANDIS_ADAPTER *pContext, tTxOperationParameters *Params)
NDIS_DEVICE_PNP_EVENT PnpEvents[16]
Definition: ndis56common.h:469
VOID ParaNdis_FinalizeCleanup(PARANDIS_ADAPTER *pContext)
static BOOLEAN FORCEINLINE IsVlanSupported(PARANDIS_ADAPTER *pContext)
Definition: ndis56common.h:542
static __inline BOOLEAN ParaNDIS_IsQueueInterruptEnabled(struct virtqueue *_vq)
Definition: ndis56common.h:601
ULONG64 ifHCInMulticastPkts
Definition: ndis56common.h:269
UCHAR CurrentMacAddress[ETH_LENGTH_OF_ADDRESS]
Definition: ndis56common.h:402
Definition: bufpool.h:45
LIST_ENTRY TxWaitingList
Definition: ndis56common.h:483
struct _tagNdisOffloadParams NDIS_OFFLOAD_PARAMETERS
const char * LPCSTR
Definition: xmlstorage.h:183
PNDIS_PACKET tPacketType
Definition: ndis56common.h:286
BOOLEAN bPortSpace
Definition: ndis56common.h:164
#define NDIS_PACKET_TYPE_ALL_MULTICAST
Definition: ndis.h:665
enum _etagHistoryLogOperation eHistoryLogOperation
VOID(* ONPAUSECOMPLETEPROC)(VOID *)
Definition: ndis56common.h:150
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define virtio_feature_enable(FeaturesList, Feature)
Definition: virtio_pci.h:312
Definition: dhcpd.h:135
struct _tagMulticastData tMulticastData
BOOLEAN ParaNdis_OnQueuedInterrupt(PARANDIS_ADAPTER *pContext, BOOLEAN *pRunDpc, ULONG knownInterruptSources)
GLsizeiptr size
Definition: glext.h:5919
tSendReceiveState SendState
Definition: ndis56common.h:434
tReuseReceiveBufferProc ReuseBufferProc
Definition: ndis56common.h:438
BOOLEAN bDoInterruptRecovery
Definition: ndis56common.h:366
VOID ParaNdis_Resume(PARANDIS_ADAPTER *pContext)
uint64_t ULONGLONG
Definition: typedefs.h:67
ULONGLONG ulFormalLinkSpeed
Definition: ndis56common.h:396
void(* tReuseReceiveBufferProc)(void *pContext, pIONetDescriptor pDescriptor)
Definition: ndis56common.h:344
NDIS_HANDLE MiniportHandle
Definition: ndis56common.h:349
BOOLEAN bFastSuspendInProcess
Definition: ndis56common.h:384
static const ULONG PARANDIS_PACKET_FILTERS
Definition: ndis56common.h:143
tCopyPacketError
Definition: ndis56common.h:490
void ParaNdis_IndicateConnect(PARANDIS_ADAPTER *pContext, BOOLEAN bConnected, BOOLEAN bForce)
_tagSendReceiveState
Definition: ndis56common.h:153
NDIS_TIMER ConnectTimer
Definition: ndis56common.h:485
UINT op
Definition: effect.c:224
BOOL bConnected
Definition: fdebug.c:27
_tagInterruptSource
Definition: ndis56common.h:132
struct _tagTxOperationParameters tTxOperationParameters
#define NDIS_PACKET_TYPE_MULTICAST
Definition: ndis.h:664
NDIS_HANDLE ParaNdis_OpenNICConfiguration(PARANDIS_ADAPTER *pContext)
tOnAdditionalPhysicalMemoryAllocated Callback
Definition: ndis56common.h:781
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
tCopyPacketResult ParaNdis_DoCopyPacketData(PARANDIS_ADAPTER *pContext, tTxOperationParameters *pParams)
GLbitfield flags
Definition: glext.h:7161
BOOLEAN ParaNdis_OnLegacyInterrupt(PARANDIS_ADAPTER *pContext, BOOLEAN *pRunDpc)
NDIS_STATUS NTAPI ParaNdis_FinishSpecificInitialization(PARANDIS_ADAPTER *pContext)
LARGE_INTEGER LastInterruptTimeStamp
Definition: ndis56common.h:361
unsigned __int64 ULONG64
Definition: imports.h:198
struct virtqueue * NetControlQueue
Definition: ndis56common.h:440
unsigned char UCHAR
Definition: xmlstorage.h:181
enum _tagppResult ppResult
LIST_ENTRY NetFreeSendBuffers
Definition: ndis56common.h:452
ULONG64 ifHCInBroadcastOctets
Definition: ndis56common.h:272
#define VOID
Definition: acefi.h:82
UCHAR MulticastList[ETH_LENGTH_OF_ADDRESS *PARANDIS_MULTICAST_LIST_SIZE]
Definition: ndis56common.h:332
GLenum GLsizei len
Definition: glext.h:6722
LARGE_INTEGER LastTxCompletionTimeStamp
Definition: ndis56common.h:359
static bool VirtIODeviceGetHostFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
Definition: ndis56common.h:514
NDIS_HANDLE DriverHandle
Definition: ndis56common.h:348
Definition: typedefs.h:119
void ParaNdis_DebugCleanup(PDRIVER_OBJECT pDriverObject)
tCopyPacketError error
Definition: ndis56common.h:494
ULONG64 ifHCInUcastOctets
Definition: ndis56common.h:268
NDIS_STATUS ParaNdis_PowerOn(PARANDIS_ADAPTER *pContext)
VOID ParaNdis_VirtIODisableIrqSynchronized(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
UINT uNumberOfHandledRXPacketsInDPC
Definition: ndis56common.h:388
static void FORCEINLINE ParaNdis_DebugHistory(PARANDIS_ADAPTER *pContext, eHistoryLogOperation op, PVOID pParam1, ULONG lParam2, ULONG lParam3, ULONG lParam4)
Definition: ndis56common.h:647
BOOLEAN ParaNdis_ValidateMacAddress(PUCHAR pcMacAddress, BOOLEAN bLocal)
ULONG ParaNdis_DPCWorkBody(PARANDIS_ADAPTER *pContext, ULONG ulMaxPacketsToIndicate)
BOOLEAN bLinkDetectSupported
Definition: ndis56common.h:371
struct virtqueue * NetReceiveQueue
Definition: ndis56common.h:442
BOOLEAN ParaNdis_InitialAllocatePhysicalMemory(PARANDIS_ADAPTER *pContext, tCompletePhysicalAddress *pAddresses)
#define MAX_NUM_OF_QUEUES
Definition: ndis56common.h:93
struct _tagAdapterResources tAdapterResources
struct _tagChecksumCheckResult tChecksumCheckResult
struct _tagMaxPacketSize tMaxPacketSize
LIST_ENTRY NetSendBuffersInUse
Definition: ndis56common.h:450
tOffloadSettings Offload
Definition: ndis56common.h:470
enum _tagSendReceiveState tSendReceiveState
tOurCounters Counters
Definition: ndis56common.h:432
ONPAUSECOMPLETEPROC ReceivePauseCompletionProc
Definition: ndis56common.h:437
ULONG64 ifHCOutBroadcastPkts
Definition: ndis56common.h:280
struct _tagBusResource tBusResource
void ParaNdis_RestoreDeviceConfigurationAfterReset(PARANDIS_ADAPTER *pContext)
void ParaNdis_DebugRegisterMiniport(PARANDIS_ADAPTER *pContext, BOOLEAN bRegister)
unsigned short USHORT
Definition: pedump.c:61
ULONG_PTR KAFFINITY
Definition: compat.h:85
BOOLEAN bDoGuestChecksumOnReceive
Definition: ndis56common.h:373
VOID ParaNdis_OnPnPEvent(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_PNP_EVENT pEvent, PVOID pInfo, ULONG ulSize)
_tagppResult
Definition: ndis56common.h:822
NDIS_HANDLE WrapperConfigurationHandle
Definition: ndis56common.h:481
#define FORCEINLINE
Definition: wdftypes.h:67
unsigned int * PULONG
Definition: retypes.h:1
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
ULONGLONG ullHostFeatures
Definition: ndis56common.h:356
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define NDIS_PACKET_TYPE_PROMISCUOUS
Definition: ndis.h:668
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: ndis56common.h:478
PNDIS_PACKET tPacketHolderType
Definition: ndis56common.h:287
static __inline struct virtqueue * ParaNdis_GetQueueForInterrupt(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
Definition: ndis56common.h:590
PHYSICAL_ADDRESS Physical
Definition: ndis56common.h:322
void ParaNdis_DebugInitialize(PVOID DriverObject, PVOID RegistryPath)
VirtIODevice IODevice
Definition: ndis56common.h:354
tMaxPacketSize MaxPacketSize
Definition: ndis56common.h:398
ONPAUSECOMPLETEPROC SendPauseCompletionProc
Definition: ndis56common.h:436
struct _tagPARANDIS_ADAPTER PARANDIS_ADAPTER
struct _tagOffloadSettings tOffloadSettings
tCopyPacketResult ParaNdis_PacketCopier(tPacketType packet, PVOID dest, ULONG maxSize, PVOID refValue, BOOLEAN bPreview)
PARANDIS_ADAPTER * pContext
Definition: ndis56common.h:499
enum _NDIS_DEVICE_POWER_STATE NDIS_DEVICE_POWER_STATE
#define BOOLEAN
Definition: pedump.c:73
static BOOLEAN FORCEINLINE IsValidVlanId(PARANDIS_ADAPTER *pContext, ULONG VlanID)
Definition: ndis56common.h:537
unsigned int ULONG
Definition: retypes.h:1
struct _tagPARANDIS_ADAPTER::@996 extraStatistics
BOOLEAN ParaNdis_SynchronizeWithInterrupt(PARANDIS_ADAPTER *pContext, ULONG messageId, tSynchronizedProcedure procedure, PVOID parameter)
static char * dest
Definition: rtl.c:135
struct _tagCopyPacketResult tCopyPacketResult
union _tagTcpIpPacketParsingResult tTcpIpPacketParsingResult
struct _tagPARANDIS_ADAPTER * PPARANDIS_ADAPTER
struct virtqueue * NetSendQueue
Definition: ndis56common.h:443
BOOLEAN bDoHwPacketFiltering
Definition: ndis56common.h:368
tMulticastData MulticastData
Definition: ndis56common.h:387
CardRegion * from
Definition: spigame.cpp:19
VOID ParaNdis_OnShutdown(PARANDIS_ADAPTER *pContext)
UCHAR PermanentMacAddress[ETH_LENGTH_OF_ADDRESS]
Definition: ndis56common.h:401
struct _tagPhysicalAddressAllocationContext tPhysicalAddressAllocationContext
VOID ParaNdis_SetPowerState(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_POWER_STATE newState)
PNDIS_PACKET tPacketIndicationType
Definition: ndis56common.h:288
tPacketIndicationType ParaNdis_IndicateReceivedPacket(PARANDIS_ADAPTER *pContext, PVOID dataBuffer, PULONG pLength, BOOLEAN bPrepareOnly, pIONetDescriptor pBufferDesc)
#define __FUNCTION__
Definition: types.h:112
ULONG64 ifHCOutUcastOctets
Definition: ndis56common.h:277
tCompletePhysicalAddress DataInfo
Definition: ndis56common.h:338
NDIS_SPIN_LOCK SendLock
Definition: ndis56common.h:411
tTcpIpPacketParsingResult ParaNdis_ReviewIPPacket(PVOID buffer, ULONG size, LPCSTR caller)
Definition: sw-offload.c:614
_tagOffloadSettingsBit
Definition: ndis56common.h:177
unsigned int * PUINT
Definition: ndis.h:50
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
struct _tagIONetDescriptor * pIONetDescriptor
#define NDIS_PACKET_TYPE_DIRECTED
Definition: ndis.h:663
void ParaNdis_PadPacketReceived(PVOID pDataBuffer, PULONG pLength)
#define NDIS_PACKET_TYPE_BROADCAST
Definition: ndis.h:666
BOOLEAN ParaNdis_SetTimer(NDIS_HANDLE timer, LONG millies)
tBusResource PciBars[PCI_TYPE0_ADDRESSES]
Definition: ndis56common.h:170
struct _tagSynchronizedContext tSynchronizedContext
ULONG64 ifHCOutMulticastOctets
Definition: ndis56common.h:279
#define PARANDIS_MULTICAST_LIST_SIZE
Definition: ndis56common.h:119