Go to the source code of this file.
|
static u32 | ReadVirtIODeviceRegister (ULONG_PTR ulRegister) |
|
static void | WriteVirtIODeviceRegister (ULONG_PTR ulRegister, u32 ulValue) |
|
static u8 | ReadVirtIODeviceByte (ULONG_PTR ulRegister) |
|
static void | WriteVirtIODeviceByte (ULONG_PTR ulRegister, u8 bValue) |
|
static u16 | ReadVirtIODeviceWord (ULONG_PTR ulRegister) |
|
static void | WriteVirtIODeviceWord (ULONG_PTR ulRegister, u16 wValue) |
|
static void * | mem_alloc_contiguous_pages (void *context, size_t size) |
|
static void | mem_free_contiguous_pages (void *context, void *virt) |
|
static ULONGLONG | mem_get_physical_address (void *context, void *virt) |
|
static void * | mem_alloc_nonpaged_block (void *context, size_t size) |
|
static void | mem_free_nonpaged_block (void *context, void *addr) |
|
static int | PCIReadConfig (PPARANDIS_ADAPTER pContext, int where, void *buffer, size_t length) |
|
static int | pci_read_config_byte (void *context, int where, u8 *bVal) |
|
static int | pci_read_config_word (void *context, int where, u16 *wVal) |
|
static int | pci_read_config_dword (void *context, int where, u32 *dwVal) |
|
static size_t | pci_get_resource_len (void *context, int bar) |
|
static void * | pci_map_address_range (void *context, int bar, size_t offset, size_t maxlen) |
|
static u16 | vdev_get_msix_vector (void *context, int queue) |
|
static void | vdev_sleep (void *context, unsigned int msecs) |
|
◆ PORT_MASK
◆ mem_alloc_contiguous_pages()
static void * mem_alloc_contiguous_pages |
( |
void * |
context, |
|
|
size_t |
size |
|
) |
| |
|
static |
Definition at line 135 of file ParaNdis-VirtIO.c.
136{
140
141
148 break;
149 }
150 }
151
152 if (!retVal) {
153
156 break;
157 }
158 }
167 if (retVal) {
171 }
172 }
173 }
174
175 if (retVal) {
177 } else {
179 }
180 return retVal;
181}
#define DPrintf(Level, Fmt)
VOID EXPORT NdisMAllocateSharedMemory(IN NDIS_HANDLE MiniportAdapterHandle, IN ULONG Length, IN BOOLEAN Cached, OUT PVOID *VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
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 MAX_NUM_OF_QUEUES
#define NdisZeroMemory(Destination, Length)
NDIS_PHYSICAL_ADDRESS BasePA
NDIS_HANDLE MiniportHandle
tBusResource SharedMemoryRanges[MAX_NUM_OF_QUEUES]
◆ mem_alloc_nonpaged_block()
static void * mem_alloc_nonpaged_block |
( |
void * |
context, |
|
|
size_t |
size |
|
) |
| |
|
static |
Definition at line 222 of file ParaNdis-VirtIO.c.
223{
225
227 &retVal,
231 }
232
233 if (retVal) {
236 } else {
238 }
239 return retVal;
240}
NDIS_STATUS EXPORT NdisAllocateMemoryWithTag(OUT PVOID *VirtualAddress, IN UINT Length, IN ULONG Tag)
#define PARANDIS_MEMORY_TAG
#define NDIS_STATUS_SUCCESS
◆ mem_free_contiguous_pages()
static void mem_free_contiguous_pages |
( |
void * |
context, |
|
|
void * |
virt |
|
) |
| |
|
static |
Definition at line 183 of file ParaNdis-VirtIO.c.
184{
187
191 break;
192 }
193 }
194
197 } else {
199 }
200}
◆ mem_free_nonpaged_block()
static void mem_free_nonpaged_block |
( |
void * |
context, |
|
|
void * |
addr |
|
) |
| |
|
static |
Definition at line 242 of file ParaNdis-VirtIO.c.
243{
245
248}
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
GLenum const GLvoid * addr
#define UNREFERENCED_PARAMETER(P)
◆ mem_get_physical_address()
Definition at line 202 of file ParaNdis-VirtIO.c.
203{
207
212
214 return retVal;
215 }
216 }
217
219 return 0;
220}
◆ pci_get_resource_len()
Definition at line 288 of file ParaNdis-VirtIO.c.
289{
291
294 }
295
297 return 0;
298}
tBusResource PciBars[PCI_TYPE0_ADDRESSES]
tAdapterResources AdapterResources
#define PCI_TYPE0_ADDRESSES
◆ pci_map_address_range()
Definition at line 300 of file ParaNdis-VirtIO.c.
301{
303
307
315 } else {
318 }
319 } else {
326 } else {
329 }
330 }
331 }
332 if (pRes->
pBase !=
NULL && offset < pRes->uLength) {
334
336 } else {
337
339 }
340 } else {
342 }
343 } else {
345 }
346
348}
NDIS_STATUS EXPORT NdisMMapIoSpace(OUT PVOID *VirtualAddress, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, IN UINT Length)
NDIS_STATUS EXPORT NdisMRegisterIoPortRange(OUT PVOID *PortOffset, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts)
◆ pci_read_config_byte()
static int pci_read_config_byte |
( |
void * |
context, |
|
|
int |
where, |
|
|
u8 * |
bVal |
|
) |
| |
|
static |
Definition at line 273 of file ParaNdis-VirtIO.c.
274{
276}
static int PCIReadConfig(PPARANDIS_ADAPTER pContext, int where, void *buffer, size_t length)
◆ pci_read_config_dword()
static int pci_read_config_dword |
( |
void * |
context, |
|
|
int |
where, |
|
|
u32 * |
dwVal |
|
) |
| |
|
static |
◆ pci_read_config_word()
static int pci_read_config_word |
( |
void * |
context, |
|
|
int |
where, |
|
|
u16 * |
wVal |
|
) |
| |
|
static |
◆ PCIReadConfig()
◆ ReadVirtIODeviceByte()
Definition at line 68 of file ParaNdis-VirtIO.c.
69{
71
74 } else {
76 }
77
79 return bValue;
80}
#define NdisRawReadPortUchar(Port, Data)
#define NdisReadRegisterUchar(Register, Data)
◆ ReadVirtIODeviceRegister()
Definition at line 43 of file ParaNdis-VirtIO.c.
44{
46
49 } else {
51 }
52
54 return ulValue;
55}
#define NdisRawReadPortUlong(Port, Data)
#define NdisReadRegisterUlong(Register, Data)
◆ ReadVirtIODeviceWord()
Definition at line 93 of file ParaNdis-VirtIO.c.
94{
96
99 } else {
101 }
102
104 return wValue;
105}
#define NdisRawReadPortUshort(Port, Data)
#define NdisReadRegisterUshort(Register, Data)
◆ vdev_get_msix_vector()
static u16 vdev_get_msix_vector |
( |
void * |
context, |
|
|
int |
queue |
|
) |
| |
|
static |
Definition at line 350 of file ParaNdis-VirtIO.c.
351{
354
355
358 }
359
361}
#define VIRTIO_MSI_NO_VECTOR
◆ vdev_sleep()
Definition at line 363 of file ParaNdis-VirtIO.c.
364{
366
368}
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
◆ WriteVirtIODeviceByte()
◆ WriteVirtIODeviceRegister()
Definition at line 57 of file ParaNdis-VirtIO.c.
58{
60
63 } else {
65 }
66}
#define NdisRawWritePortUlong(Port, Data)
#define NdisWriteRegisterUlong(Register, Data)
◆ WriteVirtIODeviceWord()
Definition at line 107 of file ParaNdis-VirtIO.c.
108{
109#if 1
112 } else {
114 }
115#else
116
117
118 static int nCounterToFail = 0;
119 static const int StartFail = 200, StopFail = 600;
122 if ((ulRegister & 0x1F) == 0x10)
123 {
124 nCounterToFail++;
125 bFail = nCounterToFail >= StartFail && nCounterToFail < StopFail;
126 }
128 else
129 {
131 }
132#endif
133}
#define NdisWriteRegisterUshort(Register, Data)
#define NdisRawWritePortUshort(Port, Data)
◆ ParaNdisSystemOps
Initial value:= {
}
static void WriteVirtIODeviceByte(ULONG_PTR ulRegister, u8 bValue)
static u16 ReadVirtIODeviceWord(ULONG_PTR ulRegister)
static void WriteVirtIODeviceRegister(ULONG_PTR ulRegister, u32 ulValue)
static u32 ReadVirtIODeviceRegister(ULONG_PTR ulRegister)
static void WriteVirtIODeviceWord(ULONG_PTR ulRegister, u16 wValue)
static u8 ReadVirtIODeviceByte(ULONG_PTR ulRegister)
#define pci_read_config_byte(vdev, where, bVal)
#define mem_get_physical_address(vdev, virt)
#define mem_free_nonpaged_block(vdev, addr)
#define pci_read_config_word(vdev, where, wVal)
#define mem_alloc_nonpaged_block(vdev, size)
#define pci_map_address_range(vdev, bar, offset, maxlen)
#define mem_alloc_contiguous_pages(vdev, size)
#define mem_free_contiguous_pages(vdev, virt)
#define vdev_sleep(vdev, msecs)
#define pci_read_config_dword(vdev, where, dwVal)
#define pci_get_resource_len(vdev, bar)
#define vdev_get_msix_vector(vdev, queue)
Definition at line 370 of file ParaNdis-VirtIO.c.
Referenced by ParaNdis_InitializeContext().