31#ifdef WPP_EVENT_TRACING
32#include "ParaNdis-Common.tmh"
39#define MAX_VLAN_ID 4095
45 DPrintf(
level, (
"[%s] %02X%02X%02X%02X%02X%02X => %02X%02X%02X%02X%02X%02X", prefix,
46 peth[6], peth[7], peth[8], peth[9], peth[10], peth[11],
47 peth[0], peth[1], peth[2], peth[3], peth[4], peth[5]));
75 return !bBroadcast && !bEmpty && !bMulticast && (!bLocal || bLA);
135 {
"Promiscuous", 0, 0, 1 },
136 {
"Priority", 0, 0, 1 },
137 {
"ConnectRate", 100,10,10000 },
138 {
"DoLog", 1, 0, 1 },
139 {
"DebugLevel", 2, 0, 8 },
140 {
"ConnectTimer", 0, 0, 300000 },
141 {
"DpcCheck", 0, 0, 2 },
142 {
"TxCapacity", 1024, 16, 1024 },
143 {
"RxCapacity", 256, 32, 1024 },
144 {
"InterruptRecovery", 0, 0, 1},
145 {
"LogStatistics", 0, 0, 10000},
146 {
"PacketFilter", 1, 0, 1},
147 {
"Gather", 1, 0, 1},
148 {
"BatchReceive", 1, 0, 1},
149 {
"Offload.TxChecksum", 0, 0, 31},
150 {
"Offload.TxLSO", 0, 0, 2},
151 {
"Offload.RxCS", 0, 0, 31},
152 {
"Offload.GuestCS", 0, 0, 1},
153 {
"UseSwTxChecksum", 0, 0, 1 },
154 {
"IPPacketsCheck", 0, 0, 3 },
155 {
"*IPChecksumOffloadIPv4", 3, 0, 3 },
156 {
"*TCPChecksumOffloadIPv4",3, 0, 3 },
157 {
"*TCPChecksumOffloadIPv6",3, 0, 3 },
158 {
"*UDPChecksumOffloadIPv4",3, 0, 3 },
159 {
"*UDPChecksumOffloadIPv6",3, 0, 3 },
160 {
"*LsoV1IPv4", 1, 0, 1 },
161 {
"*LsoV2IPv4", 1, 0, 1 },
162 {
"*LsoV2IPv6", 1, 0, 1 },
163 {
"*PriorityVLANTag", 3, 0, 3},
165 {
"MergeableBuf", 1, 0, 1},
166 {
"MTU", 1500, 500, 65500},
167 {
"NumberOfHandledRXPackersInDPC",
MAX_RX_LOOPS, 1, 10000},
168 {
"Indirect", 0, 0, 2},
178#ifdef VIRTIO_RESET_VERIFY
203 const char *statusName;
217 if (ulValue >=
pEntry->ulMinimal && ulValue <= pEntry->ulMaximal)
219 pEntry->ulValue = ulValue;
220 statusName =
"value";
224 statusName =
"out of range";
229 statusName =
"nothing";
231 DPrintf(2, (
"[%s] %s read for %s - 0x%x",
320 #if !defined(WPP_EVENT_TRACING)
387 if (*ppNewMACAddress)
471 if (
read !=
sizeof(pci_config)) {
510 DPrintf(0, (
"Found Interrupt vector %d, level %d, affinity %X, flags %X",
545 for (
i = 0;
i <
sizeof(Features)/
sizeof(Features[0]); ++
i)
549 DPrintf(0, (
"VirtIO Host Feature %s", Features[
i].
Name));
567 DPrintf(0,(
"WARNING: Interrupt Line %d(%s)!", ulActive,
Label));
586 DPrintf(0, (
"[Diag!%X] RX buffers at VIRTIO %d of %d",
590 DPrintf(0, (
"[Diag!] TX desc available %d/%d, buf %d/min. %d",
600 DPrintf(0, (
"[Diag!] Bytes transmitted %I64u, received %I64u",
603 DPrintf(0, (
"[Diag!] Tx frames %I64u, CSO %d, LSO %d, indirect %d",
608 DPrintf(0, (
"[Diag!] Rx frames %I64u, Rx.Pri %d, RxHwCS.OK %d, FiltOut %d",
613 DPrintf(0, (
"[Diag!] RxHwCS mistakes: missed bad %d, missed good %d",
771 DPrintf(0,(
"Invalid device MAC ignored(%02x-%02x-%02x-%02x-%02x-%02x)",
784 DPrintf(0, (
"No device MAC present, use default"));
792 DPrintf(0,(
"Device MAC = %02x-%02x-%02x-%02x-%02x-%02x",
809 DPrintf(0,(
"Current MAC = %02x-%02x-%02x-%02x-%02x-%02x",
831 ULONG dependentOptions;
908 if(pBufferDescriptor)
910 if (pBufferDescriptor->
pHolder)
958 p->HeaderInfo.size = size1;
959 p->DataInfo.size = size2;
960 p->HeaderInfo.IsCached =
p->DataInfo.IsCached = 1;
961 p->HeaderInfo.IsTX =
p->DataInfo.IsTX = bForTx;
962 p->nofUsedBuffers = 0;
970 DPrintf(0, (
"[INITPHYS](%s) Failed to bind memory to net packet", bForTx ?
"TX" :
"RX"));
981 DPrintf(0, (
"[INITPHYS](%s) Failed to allocate memory block", bForTx ?
"TX" :
"RX"));
986 DPrintf(3, (
"[INITPHYS](%s) Header v%p(p%08lX), Data v%p(p%08lX)", bForTx ?
"TX" :
"RX",
987 p->HeaderInfo.Virtual,
p->HeaderInfo.Physical.LowPart,
988 p->DataInfo.Virtual,
p->DataInfo.Physical.LowPart));
1001 UINT nBuffers, nMaxBuffers;
1006 for (nBuffers = 0; nBuffers < nMaxBuffers; ++nBuffers)
1014 if (!pBuffersDescriptor)
break;
1024 DPrintf(0, (
"[%s] available %d Tx descriptors, %d hw buffers",
1030 UINT nBuffersToSubmit = 2;
1043 nBuffersToSubmit = 1;
1075 if (!pBuffersDescriptor)
break;
1202#if !defined(UNIFY_LOCKS)
1314 }
while (inside > 1);
1364#if !defined(UNIFY_LOCKS)
1454 ULONG knownInterruptSources)
1490 if(!pBuffersDescriptor)
1503 DPrintf(0, (
" Error: NetNofReceiveBuffers > NetMaxReceiveBuffers(%d>%d)",
1527 DPrintf(0, (
"FAILED TO REUSE THE BUFFER!!!!"));
1599 (
PUCHAR)packetData + ipHeaderOffset,
1624 UINT nRequiredBuffers;
1633 Params->nofSGFragments == 0 ||
1638 nRequiredBuffers = 2;
1643 nRequiredBuffers = 1;
1664 else if (
Params->offloadMss && bUseCopy)
1676 UINT nMappedBuffers;
1699 if (pBuffersDescriptor->
DataInfo.
size >= (space1 + space2))
1705 else if (nMappedBuffers <= pContext->nofFreeHardwareBuffers)
1724 if (!
Params->tcpHeaderOffset)
1733 Params->tcpHeaderOffset += addPriorityLen;
1780 DPrintf(2, (
"[%s] Submitted %d buffers (%d bytes), avail %d desc, %d bufs",
1869 UINT nRequiredHardwareBuffers = 2;
1880 NdisZeroMemory(pBuffersDescriptor->HeaderInfo.Virtual, pBuffersDescriptor->HeaderInfo.size);
1881 sg[0].
physAddr = pBuffersDescriptor->HeaderInfo.Physical;
1882 sg[0].
length = pBuffersDescriptor->HeaderInfo.size;
1883 sg[1].
physAddr = pBuffersDescriptor->DataInfo.Physical;
1886 pBuffersDescriptor->DataInfo.Virtual,
1887 pBuffersDescriptor->DataInfo.size,
1903 pBuffersDescriptor->DataInfo.Virtual,
1957 pBuffersDescriptor->nofUsedBuffers = nRequiredHardwareBuffers;
1971 pBuffersDescriptor->nofUsedBuffers = 0;
1979 DPrintf(2, (
"[%s] Submitted %d buffers (%d bytes), avail %d desc, %d bufs",
2097 UINT nReceived = 0, nRetrieved = 0, nReported = 0;
2120 if (!pBatchOfPackets)
2128 pBuffersDescriptor);
2139 pBuffersDescriptor);
2141 if (
b) pBatchOfPackets[nReceived] =
packet;
2171 if (pBatchOfPackets && nReceived == maxPacketsInBatch)
2173 DPrintf(1, (
"[%s] received %d buffers of max %d",
__FUNCTION__, nReceived, ulMaxPacketsToIndicate));
2189 if (nReceived && pBatchOfPackets)
2232 ULONG stillRequiresProcessing = 0;
2233 ULONG interruptSources;
2234 UINT uIndicatedRXPackets = 0;
2258 int nRestartResult = 0;
2272 DPrintf(nRestartResult ? 2 : 6, (
"[%s] queue restarted%s",
__FUNCTION__, nRestartResult ?
"(Rerun)" :
"(Done)"));
2274 if (uIndicatedRXPackets < numOfPacketsToIndicate)
2278 else if (uIndicatedRXPackets == numOfPacketsToIndicate)
2280 DPrintf(1, (
"[%s] Breaking Rx loop after %d indications",
__FUNCTION__, uIndicatedRXPackets));
2286 DPrintf(0, (
"[%s] Glitch found: %d allowed, %d indicated",
__FUNCTION__, numOfPacketsToIndicate, uIndicatedRXPackets));
2293 if (!nRestartResult)
2304 }
while (nRestartResult);
2306 if (nRestartResult) stillRequiresProcessing |=
isReceive;
2316#ifdef PARANDIS_TEST_TX_KICK_ALWAYS
2328 return stillRequiresProcessing;
2354 int isrStatus1, isrStatus2;
2357 if (isrStatus1 || isrStatus2)
2359 DPrintf(0, (
"WARNING: Interrupt status %d=>%d", isrStatus1, isrStatus2));
2380#ifdef DBG_USE_VIRTIO_PCI_ISR_FOR_HOST_REPORT
2402#if defined(CRASH_ON_NO_RX)
2425 static int nHangOn = 0;
2426 BOOLEAN b = nHangOn >= 3 && nHangOn < 6;
2514 const char *
pName =
"";
2517#define MAKECASE(x) case (x): pName = #x; break;
2657 uCast.header.entries = 1;
2665 u16 val = vlanId & 0xfff;
2781 DPrintf(0, (
"FAILED TO REUSE THE BUFFER!!!!"));
2857 DPrintf(0, (
"WARNING: deleting queues!!!!!!!!!"));
2871#ifdef DBG_USE_VIRTIO_PCI_ISR_FOR_HOST_REPORT
2883 ULONG flagsToCalculate = 0;
2917 if (
f.fRxIPChecksum)
2926 if (
f.fRxTCPChecksum)
2929 res.flags.TcpFailed = !
res.flags.TcpOK;
2934 if (
f.fRxUDPChecksum)
2937 res.flags.UdpFailed = !
res.flags.UdpOK;
2948 if (
f.fRxTCPv6Checksum)
2951 res.flags.TcpFailed = !
res.flags.TcpOK;
2956 if (
f.fRxUDPv6Checksum)
2959 res.flags.UdpFailed = !
res.flags.UdpOK;
2966 (
f.fRxIPChecksum ||
f.fRxTCPChecksum ||
f.fRxUDPChecksum ||
f.fRxTCPv6Checksum ||
f.fRxUDPv6Checksum))
3004 if (diff.
flags.IpFailed || diff.
flags.TcpFailed || diff.
flags.UdpFailed)
@ hopInternalReceivePause
#define PARANDIS_STORE_LAST_INTERRUPT_TIMESTAMP(p)
#define VIRTIO_NET_HDR_F_DATA_VALID
#define VIRTIO_NET_CTRL_MAC_TABLE_SET
struct tag_virtio_net_ctrl_hdr virtio_net_ctrl_hdr
struct _tagvirtio_net_hdr virtio_net_hdr_basic
#define VIRTIO_NET_CTRL_RX_MODE_PROMISC
#define VIRTIO_NET_CTRL_MAC
#define VIRTIO_NET_CTRL_RX_MODE_ALLMULTI
#define VIRTIO_NET_CTRL_RX_MODE_NOMULTI
#define VIRTIO_NET_CTRL_VLAN_ADD
#define VIRTIO_NET_CTRL_VLAN_DEL
#define VIRTIO_NET_CTRL_RX_MODE_NOUNI
struct _tagvirtio_net_hdr_ext virtio_net_hdr_ext
#define VIRTIO_NET_CTRL_VLAN
#define VIRTIO_NET_HDR_F_NEEDS_CSUM
#define VIRTIO_NET_CTRL_RX_MODE
#define VIRTIO_NET_CTRL_RX_MODE_NOBCAST
BOOLEAN ParaNdis_OnLegacyInterrupt(PARANDIS_ADAPTER *pContext, OUT BOOLEAN *pRunDpc)
void ParaNdis_PadPacketReceived(PVOID pDataBuffer, PULONG pLength)
NDIS_STATUS ParaNdis_FinishInitialization(PARANDIS_ADAPTER *pContext)
static void VirtIONetRelease(PARANDIS_ADAPTER *pContext)
static void FreeDescriptorsFromList(PARANDIS_ADAPTER *pContext, PLIST_ENTRY pListRoot, PNDIS_SPIN_LOCK pLock)
static void ReadNicConfiguration(PARANDIS_ADAPTER *pContext, PUCHAR *ppNewMACAddress)
static void ReuseReceiveBufferRegular(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBuffersDescriptor)
void FORCEINLINE DebugDumpPacket(LPCSTR prefix, PVOID header, int level)
UINT ParaNdis_VirtIONetReleaseTransmitBuffers(PARANDIS_ADAPTER *pContext)
static VOID ParaNdis_DeviceFiltersUpdateAddresses(PARANDIS_ADAPTER *pContext)
BOOLEAN ParaNdis_CheckForHang(PARANDIS_ADAPTER *pContext)
NDIS_STATUS ParaNdis_PowerOn(PARANDIS_ADAPTER *pContext)
VOID ParaNdis_VirtIOEnableIrqSynchronized(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
static BOOLEAN CheckRunningDpc(PARANDIS_ADAPTER *pContext)
static int PrepareReceiveBuffers(PARANDIS_ADAPTER *pContext)
tChecksumCheckResult ParaNdis_CheckRxChecksum(PARANDIS_ADAPTER *pContext, ULONG virtioFlags, PVOID pRxPacket, ULONG len)
VOID ParaNdis_CleanupContext(PARANDIS_ADAPTER *pContext)
static void VirtIODeviceRemoveStatus(VirtIODevice *vdev, u8 status)
static void DumpVirtIOFeatures(PARANDIS_ADAPTER *pContext)
static ULONG FORCEINLINE QueryTcpHeaderOffset(PVOID packetData, ULONG ipHeaderOffset, ULONG ipPacketLength)
VOID ParaNdis_OnPnPEvent(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_PNP_EVENT pEvent, PVOID pInfo, ULONG ulSize)
tCopyPacketResult ParaNdis_DoCopyPacketData(PARANDIS_ADAPTER *pContext, tTxOperationParameters *pParams)
void ParaNdis_ResetOffloadSettings(PARANDIS_ADAPTER *pContext, tOffloadSettingsFlags *pDest, PULONG from)
static BOOLEAN GetAdapterResources(NDIS_HANDLE MiniportHandle, PNDIS_RESOURCE_LIST RList, tAdapterResources *pResources)
static NDIS_STATUS FindNetQueues(PARANDIS_ADAPTER *pContext)
static void GetConfigurationEntry(NDIS_HANDLE cfg, tConfigurationEntry *pEntry)
static UINT ParaNdis_ProcessRxPath(PARANDIS_ADAPTER *pContext, ULONG ulMaxPacketsToIndicate)
VOID ParaNdis_UpdateDeviceFilters(PARANDIS_ADAPTER *pContext)
static void JustForCheckClearInterrupt(PARANDIS_ADAPTER *pContext, const char *Label)
static VOID ParaNdis_DeviceFiltersUpdateRxMode(PARANDIS_ADAPTER *pContext)
static VOID SetSingleVlanFilter(PARANDIS_ADAPTER *pContext, ULONG vlanId, BOOLEAN bOn, int levelIfOK)
static void ReuseReceiveBufferPowerOff(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBuffersDescriptor)
VOID ParaNdis_PowerOff(PARANDIS_ADAPTER *pContext)
BOOLEAN ParaNdis_ValidateMacAddress(PUCHAR pcMacAddress, BOOLEAN bLocal)
static void VirtIONetFreeBufferDescriptor(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDescriptor)
void ParaNdis_ReportLinkStatus(PARANDIS_ADAPTER *pContext, BOOLEAN bForce)
static void PrepareTransmitBuffers(PARANDIS_ADAPTER *pContext)
static void PreventDPCServicing(PARANDIS_ADAPTER *pContext)
static void DisableLSOv6Permanently(PARANDIS_ADAPTER *pContext, LPCSTR procname, LPCSTR reason)
VOID ParaNdis_DeviceFiltersUpdateVlanId(PARANDIS_ADAPTER *pContext)
BOOLEAN ParaNdis_OnQueuedInterrupt(PARANDIS_ADAPTER *pContext, OUT BOOLEAN *pRunDpc, ULONG knownInterruptSources)
static void ParaNdis_ResetVirtIONetDevice(PARANDIS_ADAPTER *pContext)
static BOOLEAN NTAPI RestartQueueSynchronously(tSynchronizedContext *SyncContext)
VOID ParaNdis_VirtIODisableIrqSynchronized(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
static VOID SetAllVlanFilters(PARANDIS_ADAPTER *pContext, BOOLEAN bOn)
ULONG ParaNdis_DPCWorkBody(PARANDIS_ADAPTER *pContext, ULONG ulMaxPacketsToIndicate)
static NDIS_STATUS FinalizeFeatures(PARANDIS_ADAPTER *pContext)
static BOOLEAN AddRxBufferToQueue(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDescriptor)
static void PrintStatistics(PARANDIS_ADAPTER *pContext)
struct _tagConfigurationEntries tConfigurationEntries
VOID ParaNdis_OnShutdown(PARANDIS_ADAPTER *pContext)
struct _tagConfigurationEntry tConfigurationEntry
NDIS_STATUS ParaNdis_InitializeContext(PARANDIS_ADAPTER *pContext, PNDIS_RESOURCE_LIST pResourceList)
void ParaNdis_CallOnBugCheck(PARANDIS_ADAPTER *pContext)
static eInspectedPacketType QueryPacketType(PVOID data)
static const tConfigurationEntries defaultConfiguration
NDIS_STATUS ParaNdis_SetMulticastList(PARANDIS_ADAPTER *pContext, PVOID Buffer, ULONG BufferSize, PUINT pBytesRead, PUINT pBytesNeeded)
static BOOLEAN SendControlMessage(PARANDIS_ADAPTER *pContext, UCHAR cls, UCHAR cmd, PVOID buffer1, ULONG size1, PVOID buffer2, ULONG size2, int levelIfOK)
static void DisableLSOv4Permanently(PARANDIS_ADAPTER *pContext, LPCSTR procname, LPCSTR reason)
static void DisableBothLSOPermanently(PARANDIS_ADAPTER *pContext, LPCSTR procname, LPCSTR reason)
static pIONetDescriptor AllocatePairOfBuffersOnInit(PARANDIS_ADAPTER *pContext, ULONG size1, ULONG size2, BOOLEAN bForTx)
static NDIS_STATUS ParaNdis_VirtIONetInit(PARANDIS_ADAPTER *pContext)
tCopyPacketResult ParaNdis_DoSubmitPacket(PARANDIS_ADAPTER *pContext, tTxOperationParameters *Params)
static void DeleteNetQueues(PARANDIS_ADAPTER *pContext)
static NDIS_STATUS NTStatusToNdisStatus(NTSTATUS nt_status)
static ULONG ShallPassPacket(PARANDIS_ADAPTER *pContext, PVOID address, UINT len, eInspectedPacketType *pType)
static void WriteVirtIODeviceByte(ULONG_PTR ulRegister, u8 bValue)
static bool virtqueue_enable_cb_delayed(struct virtqueue *vq)
static int virtqueue_add_buf(struct virtqueue *vq, struct scatterlist sg[], unsigned int out_num, unsigned int in_num, void *opaque, void *va_indirect, ULONGLONG phys_indirect)
void virtqueue_kick(struct virtqueue *vq)
static void virtqueue_disable_cb(struct virtqueue *vq)
static void virtqueue_kick_always(struct virtqueue *vq)
static void * virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
static bool virtqueue_enable_cb(struct virtqueue *vq)
static void virtqueue_shutdown(struct virtqueue *vq)
#define InterlockedIncrement
#define InterlockedExchange
#define InterlockedDecrement
#define NT_SUCCESS(StatCode)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define ETH_IS_LOCALLY_ADMINISTERED(Address)
#define ETH_IS_EMPTY(Address)
#define DEBUG_ENTRY(level)
#define DPrintf(Level, Fmt)
#define DEBUG_EXIT_STATUS(level, status)
VOID EXPORT NdisCloseConfiguration(IN NDIS_HANDLE ConfigurationHandle)
VOID EXPORT NdisReadConfiguration(OUT PNDIS_STATUS Status, OUT PNDIS_CONFIGURATION_PARAMETER *ParameterValue, IN NDIS_HANDLE ConfigurationHandle, IN PNDIS_STRING Keyword, IN NDIS_PARAMETER_TYPE ParameterType)
VOID EXPORT NdisReadNetworkAddress(OUT PNDIS_STATUS Status, OUT PVOID *NetworkAddress, OUT PUINT NetworkAddressLength, IN NDIS_HANDLE ConfigurationHandle)
VOID EXPORT NdisInitializeEvent(IN PNDIS_EVENT Event)
ULONG EXPORT NdisReadPciSlotInformation(IN NDIS_HANDLE NdisAdapterHandle, IN ULONG SlotNumber, IN ULONG Offset, IN PVOID Buffer, IN ULONG Length)
VOID EXPORT NdisMDeregisterIoPortRange(IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts, IN PVOID PortOffset)
VOID EXPORT NdisMUnmapIoSpace(IN NDIS_HANDLE MiniportAdapterHandle, IN PVOID VirtualAddress, IN UINT Length)
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
VOID EXPORT NdisMFreeSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, IN PVOID VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
VOID EXPORT NdisInitializeString(IN OUT PNDIS_STRING DestinationString, IN PUCHAR SourceString)
#define ETH_LENGTH_OF_ADDRESS
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
enum _tag_eInspectedPacketType eInspectedPacketType
#define TCP_CHECKSUM_OFFSET
#define ETH_PRIORITY_HEADER_SIZE
#define ETH_HAS_PRIO_HEADER(Address)
#define UDP_CHECKSUM_OFFSET
#define ETH_MIN_PACKET_SIZE
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLenum const GLvoid * addr
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
#define CmResourceTypeMemory
#define CmResourceTypePort
#define CmResourceTypeInterrupt
static IPrintDialogCallback callback
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
@ osbT4RxTCPOptionsChecksum
@ osbT4TcpOptionsChecksum
@ osbT4RxIPOptionsChecksum
@ osbT6TcpOptionsChecksum
@ osbT6RxTCPOptionsChecksum
tTcpIpPacketParsingResult ParaNdis_CheckSumVerify(PVOID buffer, ULONG size, ULONG flags, LPCSTR caller)
#define VIRTIO_NET_F_CSUM
VOID ParaNdis_FreePhysicalMemory(PARANDIS_ADAPTER *pContext, tCompletePhysicalAddress *pAddresses)
tTcpIpPacketParsingResult ParaNdis_ReviewIPPacket(PVOID buffer, ULONG size, LPCSTR caller)
#define VIRTIO_NET_F_GUEST_TSO4
static void VirtIODeviceEnableGuestFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
NDIS_HANDLE ParaNdis_OpenNICConfiguration(PARANDIS_ADAPTER *pContext)
#define RtlOffsetToPointer(Base, Offset)
VOID ParaNdis_PacketMapper(PARANDIS_ADAPTER *pContext, tPacketType packet, PVOID Reference, struct VirtIOBufferDescriptor *buffers, pIONetDescriptor pDesc, tMapperResult *pMapperResult)
tCopyPacketResult ParaNdis_PacketCopier(tPacketType packet, PVOID dest, ULONG maxSize, PVOID refValue, BOOLEAN bPreview)
VOID ParaNdis_OnTransmitBufferReleased(PARANDIS_ADAPTER *pContext, IONetDescriptor *pDesc)
#define VIRTIO_NET_F_HOST_TSO4
PVOID ParaNdis_AllocateMemory(PARANDIS_ADAPTER *pContext, ULONG ulRequiredSize)
void(* tReuseReceiveBufferProc)(void *pContext, pIONetDescriptor pDescriptor)
VOID ParaNdis_Resume(PARANDIS_ADAPTER *pContext)
VOID ParaNdis_IndicateReceivedBatch(PARANDIS_ADAPTER *pContext, tPacketIndicationType *pBatch, ULONG nofPackets)
#define VIRTIO_NET_F_GUEST_CSUM
#define VIRTIO_NET_F_GUEST_ECN
BOOLEAN ParaNdis_InitialAllocatePhysicalMemory(PARANDIS_ADAPTER *pContext, tCompletePhysicalAddress *pAddresses)
#define PARANDIS_UNLIMITED_PACKETS_TO_INDICATE
VOID ParaNdis_SetPowerState(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_POWER_STATE newState)
tPacketIndicationType ParaNdis_IndicateReceivedPacket(PARANDIS_ADAPTER *pContext, PVOID dataBuffer, PULONG pLength, BOOLEAN bPrepareOnly, pIONetDescriptor pBufferDesc)
#define VIRTIO_NET_S_LINK_UP
static BOOLEAN FORCEINLINE IsPrioritySupported(PARANDIS_ADAPTER *pContext)
#define VIRTIO_NET_F_GUEST_TSO6
static BOOLEAN FORCEINLINE IsVlanSupported(PARANDIS_ADAPTER *pContext)
static __inline struct virtqueue * ParaNdis_GetQueueForInterrupt(PARANDIS_ADAPTER *pContext, ULONG interruptSource)
#define VIRTIO_NET_F_HOST_UFO
#define VIRTIO_NET_F_HOST_TSO6
#define VIRTIO_NET_F_MRG_RXBUF
void ParaNdis_IndicateConnect(PARANDIS_ADAPTER *pContext, BOOLEAN bConnected, BOOLEAN bForce)
#define VIRTIO_NET_F_CTRL_VQ
BOOLEAN ParaNdis_SynchronizeWithInterrupt(PARANDIS_ADAPTER *pContext, ULONG messageId, tSynchronizedProcedure procedure, PVOID parameter)
#define VIRTIO_NET_F_HOST_ECN
VirtIOSystemOps ParaNdisSystemOps
#define VIRTIO_NET_F_CTRL_RX
VOID ParaNdis_FinalizeCleanup(PARANDIS_ADAPTER *pContext)
NDIS_STATUS NTAPI ParaNdis_FinishSpecificInitialization(PARANDIS_ADAPTER *pContext)
#define VIRTIO_NET_F_STATUS
struct _tagIONetDescriptor * pIONetDescriptor
#define VIRTIO_NET_F_CTRL_VLAN
void ParaNdis_RestoreDeviceConfigurationAfterReset(PARANDIS_ADAPTER *pContext)
VOID(* ONPAUSECOMPLETEPROC)(VOID *)
#define VIRTIO_NET_INVALID_INTERRUPT_STATUS
void ParaNdis_UnbindBufferFromPacket(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDesc)
VOID ParaNdis_Suspend(PARANDIS_ADAPTER *pContext)
#define VIRTIO_NET_F_GUEST_UFO
static __inline BOOLEAN ParaNDIS_IsQueueInterruptEnabled(struct virtqueue *_vq)
BOOLEAN ParaNdis_BindBufferToPacket(PARANDIS_ADAPTER *pContext, pIONetDescriptor pBufferDesc)
#define VIRTIO_NET_F_CTRL_RX_EXTRA
static bool VirtIODeviceGetHostFeature(PARANDIS_ADAPTER *pContext, unsigned uFeature)
static void FORCEINLINE ParaNdis_DebugHistory(PARANDIS_ADAPTER *pContext, eHistoryLogOperation op, PVOID pParam1, ULONG lParam2, ULONG lParam3, ULONG lParam4)
#define MAX_NUM_OF_QUEUES
#define PARANDIS_MAX_LSO_SIZE
BOOLEAN ParaNdis_ProcessTx(PARANDIS_ADAPTER *pContext, BOOLEAN IsDpc, BOOLEAN IsInterrupt)
enum _NDIS_DEVICE_PNP_EVENT NDIS_DEVICE_PNP_EVENT
@ NdisDevicePnPEventRemoved
@ NdisDevicePnPEventQueryStopped
@ NdisDevicePnPEventPowerProfileChanged
@ NdisDevicePnPEventStopped
@ NdisDevicePnPEventQueryRemoved
@ NdisDevicePnPEventSurpriseRemoved
#define NDIS_STATUS_INVALID_DEVICE_REQUEST
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_CONFIGURATION_PARAMETER _In_ NDIS_HANDLE _In_ PNDIS_STRING _In_ NDIS_PARAMETER_TYPE ParameterType
#define NdisReleaseSpinLock(_SpinLock)
#define NDIS_PACKET_TYPE_PROMISCUOUS
#define NdisZeroMemory(Destination, Length)
#define NDIS_STATUS_RESOURCE_CONFLICT
#define NDIS_STATUS_INVALID_LENGTH
#define NdisAllocateSpinLock(_SpinLock)
#define NDIS_STATUS_FAILURE
#define NdisGetCurrentSystemTime
#define NDIS_PACKET_TYPE_BROADCAST
#define NDIS_STATUS_SUCCESS
#define NDIS_PACKET_TYPE_MULTICAST
#define NDIS_PACKET_TYPE_DIRECTED
enum _NDIS_PARAMETER_TYPE NDIS_PARAMETER_TYPE
#define NDIS_PACKET_TYPE_ALL_MULTICAST
#define NDIS_STATUS_ADAPTER_NOT_FOUND
#define NdisFreeSpinLock(_SpinLock)
#define NdisAcquireSpinLock(_SpinLock)
#define NdisFreeString(_s)
#define NdisMoveMemory(Destination, Source, Length)
#define NDIS_STATUS_RESOURCES
#define NDIS_STATUS_MULTICAST_FULL
#define CM_RESOURCE_INTERRUPT_MESSAGE
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
PHYSICAL_ADDRESS physAddr
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@396 Memory
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
union _NDIS_CONFIGURATION_PARAMETER::@2104 ParameterData
tBusResource PciBars[PCI_TYPE0_ADDRESSES]
NDIS_PHYSICAL_ADDRESS BasePA
struct _tagChecksumCheckResult::@1000::@1002 flags
PHYSICAL_ADDRESS Physical
tConfigurationEntry IPPacketsCheck
tConfigurationEntry OffloadGuestCS
tConfigurationEntry OffloadTxLSO
tConfigurationEntry isPromiscuous
tConfigurationEntry stdTcpcsV6
tConfigurationEntry VlanId
tConfigurationEntry RxCapacity
tConfigurationEntry ConnectRate
tConfigurationEntry LogStatistics
tConfigurationEntry stdUdpcsV4
tConfigurationEntry InterruptRecovery
tConfigurationEntry PrioritySupport
tConfigurationEntry Indirect
tConfigurationEntry connectTimer
tConfigurationEntry UseSwTxChecksum
tConfigurationEntry ScatterGather
tConfigurationEntry stdLsoV1
tConfigurationEntry isLogEnabled
tConfigurationEntry NumberOfHandledRXPackersInDPC
tConfigurationEntry OffloadRxCS
tConfigurationEntry TxCapacity
tConfigurationEntry stdTcpcsV4
tConfigurationEntry stdLsoV2ip6
tConfigurationEntry stdLsoV2ip4
tConfigurationEntry BatchReceive
tConfigurationEntry debugLevel
tConfigurationEntry PriorityVlanTagging
tConfigurationEntry PacketFiltering
tConfigurationEntry UseMergeableBuffers
tConfigurationEntry OffloadTxChecksum
tConfigurationEntry dpcChecker
tConfigurationEntry stdUdpcsV6
tConfigurationEntry stdIpcsV4
tCompletePhysicalAddress HeaderInfo
tPacketHolderType pHolder
tCompletePhysicalAddress DataInfo
ULONG nofMulticastEntries
UCHAR MulticastList[ETH_LENGTH_OF_ADDRESS *PARANDIS_MULTICAST_LIST_SIZE]
ULONG64 ifHCOutMulticastPkts
ULONG64 ifHCInBroadcastPkts
ULONG64 ifHCOutMulticastOctets
ULONG64 ifHCOutBroadcastOctets
ULONG64 ifHCInMulticastOctets
ULONG64 ifHCInMulticastPkts
ULONG64 ifHCInUcastOctets
ULONG64 ifHCOutUcastOctets
ULONG64 ifHCOutBroadcastPkts
ULONG64 ifHCInBroadcastOctets
tOffloadSettingsFlags flags
NDIS_OFFLOAD_PARAMETERS InitialOffloadParameters
NDIS_DEVICE_POWER_STATE powerState
tAdapterResources AdapterResources
UINT maxFreeHardwareBuffers
LONG NetTxPacketsToReturn
BOOLEAN bDoKickOnNoBuffer
ULONGLONG ullHostFeatures
ULONGLONG ulFormalLinkSpeed
NDIS_HANDLE MiniportHandle
UINT nofFreeHardwareBuffers
BOOLEAN bHasHardwareFilters
BOOLEAN bNoPauseOnSuspend
UINT uNumberOfHandledRXPacketsInDPC
BOOLEAN bFastSuspendInProcess
NDIS_SPIN_LOCK ReceiveLock
ONPAUSECOMPLETEPROC ReceivePauseCompletionProc
tMulticastData MulticastData
NDIS_STATISTICS_INFO Statistics
UINT minFreeHardwareBuffers
struct _tagPARANDIS_ADAPTER::@1003 extraStatistics
BOOLEAN bIODeviceInitialized
BOOLEAN bDoInterruptRecovery
BOOLEAN bDoGuestChecksumOnReceive
ULONG ulCurrentVlansFilterSet
BOOLEAN bUseScatterGather
BOOLEAN bUseMergedBuffers
struct virtqueue * NetSendQueue
NDIS_DEVICE_PNP_EVENT PnpEvents[16]
UINT nofFreeTxDescriptors
struct VirtIOBufferDescriptor * sgTxGatherTable
BOOLEAN bDoHwPacketFiltering
BOOLEAN bDoSupportPriority
ULONGLONG ullGuestFeatures
LIST_ENTRY NetSendBuffersInUse
tReuseReceiveBufferProc ReuseBufferProc
tSendReceiveState ReceiveState
UINT NetMaxReceiveBuffers
BOOLEAN bEnableInterruptChecking
BOOLEAN bDoHardwareChecksum
ULONG ulPriorityVlanSetting
BOOLEAN bEnableInterruptHandlingDPC
UINT NetNofReceiveBuffers
tBusResource SharedMemoryRanges[MAX_NUM_OF_QUEUES]
ULONG nDetectedInactivity
UCHAR CurrentMacAddress[ETH_LENGTH_OF_ADDRESS]
UCHAR PermanentMacAddress[ETH_LENGTH_OF_ADDRESS]
LIST_ENTRY NetFreeSendBuffers
BOOLEAN bLinkDetectSupported
tCompletePhysicalAddress ControlData
LIST_ENTRY NetReceiveBuffers
tMaxPacketSize MaxPacketSize
struct virtqueue * NetControlQueue
UINT maxFreeTxDescriptors
LARGE_INTEGER LastTxCompletionTimeStamp
struct virtqueue * NetReceiveQueue
LIST_ENTRY NetReceiveBuffersWaiting
PARANDIS_ADAPTER * pContext
#define RtlZeroMemory(Destination, Length)
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define VIRTIO_CONFIG_S_DRIVER
#define SIZE_OF_SINGLE_INDIRECT_DESC
#define VIRTIO_CONFIG_S_ACKNOWLEDGE
#define VIRTIO_F_ANY_LAYOUT
#define VIRTIO_CONFIG_S_FAILED
#define VIRTIO_F_VERSION_1
#define VIRTIO_CONFIG_S_DRIVER_OK
int virtio_get_bar_index(PPCI_COMMON_HEADER pPCIHeader, PHYSICAL_ADDRESS BasePA)
u32 virtio_get_queue_size(struct virtqueue *vq)
NTSTATUS virtio_find_queues(VirtIODevice *vdev, unsigned nvqs, struct virtqueue *vqs[])
NTSTATUS virtio_device_initialize(VirtIODevice *vdev, const VirtIOSystemOps *pSystemOps, void *DeviceContext, bool msix_used)
void virtio_device_shutdown(VirtIODevice *vdev)
void virtio_delete_queues(VirtIODevice *vdev)
void virtio_set_status(VirtIODevice *vdev, u8 status)
void virtio_add_status(VirtIODevice *vdev, u8 status)
void virtio_device_ready(VirtIODevice *vdev)
u8 virtio_read_isr_status(VirtIODevice *vdev)
u64 virtio_get_features(VirtIODevice *dev)
u8 virtio_get_status(VirtIODevice *vdev)
void virtio_device_reset(VirtIODevice *vdev)
void virtio_get_config(VirtIODevice *vdev, unsigned offset, void *buf, unsigned len)
NTSTATUS virtio_set_features(VirtIODevice *vdev, u64 features)
#define VIRTIO_RING_F_INDIRECT_DESC
#define VIRTIO_RING_F_EVENT_IDX
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
#define PCI_TYPE0_ADDRESSES
#define ETH_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result)
#define ETH_IS_BROADCAST(Address)
#define ETH_IS_MULTICAST(Address)