ReactOS 0.4.16-dev-295-g4aee028
VirtIO.h
Go to the documentation of this file.
1#ifndef _LINUX_VIRTIO_H
2#define _LINUX_VIRTIO_H
3
4#include "virtio_ring.h"
5
6#define scatterlist VirtIOBufferDescriptor
7
11};
12
14 struct virtqueue *vq,
15 struct scatterlist sg[],
16 unsigned int out_num,
17 unsigned int in_num,
18 void *opaque,
19 void *va_indirect,
20 ULONGLONG phys_indirect);
21
23
25
26typedef void * (*proc_virtqueue_get_buf)(struct virtqueue *vq, unsigned int *len);
27
29
31
33
34typedef void * (*proc_virtqueue_detach_unused_buf)(struct virtqueue *vq);
35
37
39
41
42/* Represents one virtqueue; only data pointed to by the vring structure is exposed to the host */
43struct virtqueue {
45 unsigned int index;
48 void *avail_va;
49 void *used_va;
61};
62
63static inline int virtqueue_add_buf(
64 struct virtqueue *vq,
65 struct scatterlist sg[],
66 unsigned int out_num,
67 unsigned int in_num,
68 void *opaque,
69 void *va_indirect,
70 ULONGLONG phys_indirect)
71{
72 return vq->add_buf(vq, sg, out_num, in_num, opaque, va_indirect, phys_indirect);
73}
74
75static inline bool virtqueue_kick_prepare(struct virtqueue *vq)
76{
77 return vq->kick_prepare(vq);
78}
79
80static inline void virtqueue_kick_always(struct virtqueue *vq)
81{
82 vq->kick_always(vq);
83}
84
85static inline void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
86{
87 return vq->get_buf(vq, len);
88}
89
90static inline void virtqueue_disable_cb(struct virtqueue *vq)
91{
92 vq->disable_cb(vq);
93}
94
95static inline bool virtqueue_enable_cb(struct virtqueue *vq)
96{
97 return vq->enable_cb(vq);
98}
99
100static inline bool virtqueue_enable_cb_delayed(struct virtqueue *vq)
101{
102 return vq->enable_cb_delayed(vq);
103}
104
105static inline void *virtqueue_detach_unused_buf(struct virtqueue *vq)
106{
107 return vq->detach_unused_buf(vq);
108}
109
111{
112 return vq->is_interrupt_enabled(vq);
113}
114
115static inline BOOLEAN virtqueue_has_buf(struct virtqueue *vq)
116{
117 return vq->has_buf(vq);
118}
119
120static inline void virtqueue_shutdown(struct virtqueue *vq)
121{
122 vq->shutdown(vq);
123}
124
125void virtqueue_notify(struct virtqueue *vq);
126void virtqueue_kick(struct virtqueue *vq);
127
128#endif /* _LINUX_VIRTIO_H */
unsigned char BOOLEAN
BOOLEAN(* proc_virtqueue_is_interrupt_enabled)(struct virtqueue *vq)
Definition: VirtIO.h:36
static bool virtqueue_enable_cb_delayed(struct virtqueue *vq)
Definition: VirtIO.h:100
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)
Definition: VirtIO.h:63
void *(* proc_virtqueue_detach_unused_buf)(struct virtqueue *vq)
Definition: VirtIO.h:34
void(* proc_virtqueue_shutdown)(struct virtqueue *vq)
Definition: VirtIO.h:40
BOOLEAN(* proc_virtqueue_has_buf)(struct virtqueue *vq)
Definition: VirtIO.h:38
void virtqueue_kick(struct virtqueue *vq)
static BOOLEAN virtqueue_is_interrupt_enabled(struct virtqueue *vq)
Definition: VirtIO.h:110
static void virtqueue_disable_cb(struct virtqueue *vq)
Definition: VirtIO.h:90
void(* proc_virtqueue_disable_cb)(struct virtqueue *vq)
Definition: VirtIO.h:28
static BOOLEAN virtqueue_has_buf(struct virtqueue *vq)
Definition: VirtIO.h:115
static bool virtqueue_kick_prepare(struct virtqueue *vq)
Definition: VirtIO.h:75
static void virtqueue_kick_always(struct virtqueue *vq)
Definition: VirtIO.h:80
void virtqueue_notify(struct virtqueue *vq)
static void * virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
Definition: VirtIO.h:85
static void * virtqueue_detach_unused_buf(struct virtqueue *vq)
Definition: VirtIO.h:105
bool(* proc_virtqueue_enable_cb)(struct virtqueue *vq)
Definition: VirtIO.h:30
void(* proc_virtqueue_kick_always)(struct virtqueue *vq)
Definition: VirtIO.h:24
int(* proc_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)
Definition: VirtIO.h:13
#define scatterlist
Definition: VirtIO.h:6
bool(* proc_virtqueue_kick_prepare)(struct virtqueue *vq)
Definition: VirtIO.h:22
static bool virtqueue_enable_cb(struct virtqueue *vq)
Definition: VirtIO.h:95
static void virtqueue_shutdown(struct virtqueue *vq)
Definition: VirtIO.h:120
void *(* proc_virtqueue_get_buf)(struct virtqueue *vq, unsigned int *len)
Definition: VirtIO.h:26
bool(* proc_virtqueue_enable_cb_delayed)(struct virtqueue *vq)
Definition: VirtIO.h:32
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLenum GLsizei len
Definition: glext.h:6722
static unsigned(__cdecl *hash_bstr)(bstr_t s)
#define bool
Definition: nsiface.idl:72
#define BOOLEAN
Definition: pedump.c:73
PHYSICAL_ADDRESS physAddr
Definition: VirtIO.h:9
proc_virtqueue_add_buf add_buf
Definition: VirtIO.h:50
proc_virtqueue_shutdown shutdown
Definition: VirtIO.h:60
void * notification_addr
Definition: VirtIO.h:47
proc_virtqueue_enable_cb enable_cb
Definition: VirtIO.h:55
proc_virtqueue_detach_unused_buf detach_unused_buf
Definition: VirtIO.h:57
proc_virtqueue_disable_cb disable_cb
Definition: VirtIO.h:54
proc_virtqueue_has_buf has_buf
Definition: VirtIO.h:59
unsigned int index
Definition: VirtIO.h:45
void * avail_va
Definition: VirtIO.h:48
proc_virtqueue_is_interrupt_enabled is_interrupt_enabled
Definition: VirtIO.h:58
proc_virtqueue_enable_cb_delayed enable_cb_delayed
Definition: VirtIO.h:56
proc_virtqueue_get_buf get_buf
Definition: VirtIO.h:53
void(* notification_cb)(struct virtqueue *vq)
Definition: VirtIO.h:46
proc_virtqueue_kick_prepare kick_prepare
Definition: VirtIO.h:51
void * used_va
Definition: VirtIO.h:49
proc_virtqueue_kick_always kick_always
Definition: VirtIO.h:52
VirtIODevice * vdev
Definition: VirtIO.h:44
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67