88 return vdev->
device->get_status(vdev);
103 vdev->
device->reset(vdev);
116 return vdev->
device->get_features(vdev);
121 unsigned char dev_status;
137 dev_status = vdev->
device->get_status(vdev);
139 DPrintf(0,
"virtio: device refuses features: %x\n", dev_status);
150 u32 old, gen = vdev->
device->get_config_generation ?
151 vdev->
device->get_config_generation(vdev) : 0;
162 gen = vdev->
device->get_config_generation ?
163 vdev->
device->get_config_generation(vdev) : 0;
164 }
while (gen != old);
217 unsigned short *pNumEntries,
218 unsigned long *pRingSize,
219 unsigned long *pHeapSize)
221 return vdev->
device->query_queue_alloc(vdev,
index, pNumEntries, pRingSize, pHeapSize);
236 vdev->
info = new_info;
284 msix_vec = vdev->
device->set_config_vector(vdev, msix_vec);
293 for (
i = 0;
i < nvqs;
i++) {
366 BAR.
LowPart = pPCIHeader->u.type0.BaseAddresses[
i];
376 BAR.
HighPart = pPCIHeader->u.type0.BaseAddresses[++
i];
398 DPrintf(6,
"virtio: vp_notify vq->index = %x\n", vq->
index);
int virtio_get_bar_index(PPCI_COMMON_HEADER pPCIHeader, PHYSICAL_ADDRESS BasePA)
NTSTATUS virtio_device_initialize(VirtIODevice *vdev, const VirtIOSystemOps *pSystemOps, PVOID DeviceContext, bool msix_used)
static NTSTATUS vp_setup_vq(struct virtqueue **queue, VirtIODevice *vdev, unsigned index, u16 msix_vec)
u32 virtio_get_queue_size(struct virtqueue *vq)
NTSTATUS virtio_find_queues(VirtIODevice *vdev, unsigned nvqs, struct virtqueue *vqs[])
void virtio_device_shutdown(VirtIODevice *vdev)
u16 virtio_set_queue_vector(struct virtqueue *vq, u16 vector)
void virtqueue_kick(struct virtqueue *vq)
void virtio_delete_queues(VirtIODevice *vdev)
void virtio_set_status(VirtIODevice *vdev, u8 status)
void virtio_add_status(VirtIODevice *vdev, u8 status)
void virtqueue_notify(struct virtqueue *vq)
void virtio_device_ready(VirtIODevice *vdev)
void virtio_set_config(VirtIODevice *vdev, unsigned offset, void *buf, unsigned len)
NTSTATUS virtio_find_queue(VirtIODevice *vdev, unsigned index, struct virtqueue **vq)
NTSTATUS virtio_reserve_queue_memory(VirtIODevice *vdev, unsigned nvqs)
static void virtio_cwrite_many(VirtIODevice *vdev, unsigned int offset, void *buf, size_t count, size_t bytes)
u8 virtio_read_isr_status(VirtIODevice *vdev)
u8 virtio_get_status(VirtIODevice *vdev)
void vp_notify(struct virtqueue *vq)
void virtio_delete_queue(struct virtqueue *vq)
void virtio_device_reset(VirtIODevice *vdev)
static void virtio_cread_many(VirtIODevice *vdev, unsigned int offset, void *buf, size_t count, size_t bytes)
NTSTATUS virtio_query_queue_allocation(VirtIODevice *vdev, unsigned index, unsigned short *pNumEntries, unsigned long *pRingSize, unsigned long *pHeapSize)
u64 virtio_get_features(VirtIODevice *vdev)
void virtio_get_config(VirtIODevice *vdev, unsigned offset, void *buf, unsigned len)
u16 virtio_set_config_vector(VirtIODevice *vdev, u16 vector)
NTSTATUS virtio_set_features(VirtIODevice *vdev, u64 features)
static bool virtqueue_kick_prepare(struct virtqueue *vq)
static unsigned char bytes[4]
#define NT_SUCCESS(StatCode)
#define DPrintf(Level, Fmt)
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
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
_In_ PNDIS_STRING _In_opt_ NDIS_HANDLE DeviceContext
bool event_suppression_enabled
const struct virtio_system_ops * system
const struct virtio_device_ops * device
VirtIOQueueInfo inline_info[MAX_QUEUES_PER_DEVICE_DEFAULT]
void(* notification_cb)(struct virtqueue *vq)
#define RtlZeroMemory(Destination, Length)
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_DEVICE_BUSY
#define STATUS_INSUFFICIENT_RESOURCES
#define VIRTIO_CONFIG_S_DRIVER
#define VIRTIO_F_RING_PACKED
#define VIRTIO_CONFIG_S_FEATURES_OK
#define VIRTIO_CONFIG_S_ACKNOWLEDGE
#define VIRTIO_F_VERSION_1
#define VIRTIO_CONFIG_S_DRIVER_OK
#define virtio_is_feature_enabled(FeaturesList, Feature)
#define VIRTIO_MSI_NO_VECTOR
static ULONG FORCEINLINE virtio_get_queue_descriptor_size()
#define mem_free_nonpaged_block(vdev, addr)
#define mem_alloc_nonpaged_block(vdev, size)
NTSTATUS vio_modern_initialize(VirtIODevice *vdev)
#define iowrite16(vdev, val, addr)
#define ioread8(vdev, addr)
NTSTATUS vio_legacy_initialize(VirtIODevice *vdev)
#define vdev_get_msix_vector(vdev, queue)
#define VIRTIO_RING_F_EVENT_IDX
#define PCI_MULTIFUNCTION
#define PCI_ADDRESS_IO_ADDRESS_MASK
#define PCI_TYPE0_ADDRESSES
#define PCI_ADDRESS_IO_SPACE
#define PCI_ADDRESS_MEMORY_ADDRESS_MASK
#define PCI_ADDRESS_MEMORY_TYPE_MASK