ReactOS  0.4.15-dev-976-g0f66c66
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 
26 typedef void * (*proc_virtqueue_get_buf)(struct virtqueue *vq, unsigned int *len);
27 
29 
30 typedef bool(*proc_virtqueue_enable_cb)(struct virtqueue *vq);
31 
33 
34 typedef void * (*proc_virtqueue_detach_unused_buf)(struct virtqueue *vq);
35 
37 
39 
40 typedef void(*proc_virtqueue_shutdown)(struct virtqueue *vq);
41 
42 /* Represents one virtqueue; only data pointed to by the vring structure is exposed to the host */
43 struct virtqueue {
45  unsigned int index;
46  void (*notification_cb)(struct virtqueue *vq);
48  void *avail_va;
49  void *used_va;
61 };
62 
63 static 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 
75 static inline bool virtqueue_kick_prepare(struct virtqueue *vq)
76 {
77  return vq->kick_prepare(vq);
78 }
79 
80 static inline void virtqueue_kick_always(struct virtqueue *vq)
81 {
82  vq->kick_always(vq);
83 }
84 
85 static inline void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
86 {
87  return vq->get_buf(vq, len);
88 }
89 
90 static inline void virtqueue_disable_cb(struct virtqueue *vq)
91 {
92  vq->disable_cb(vq);
93 }
94 
95 static inline bool virtqueue_enable_cb(struct virtqueue *vq)
96 {
97  return vq->enable_cb(vq);
98 }
99 
100 static inline bool virtqueue_enable_cb_delayed(struct virtqueue *vq)
101 {
102  return vq->enable_cb_delayed(vq);
103 }
104 
105 static 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 
115 static inline BOOLEAN virtqueue_has_buf(struct virtqueue *vq)
116 {
117  return vq->has_buf(vq);
118 }
119 
120 static inline void virtqueue_shutdown(struct virtqueue *vq)
121 {
122  vq->shutdown(vq);
123 }
124 
125 void virtqueue_notify(struct virtqueue *vq);
126 void virtqueue_kick(struct virtqueue *vq);
127 
128 #endif /* _LINUX_VIRTIO_H */
proc_virtqueue_disable_cb disable_cb
Definition: VirtIO.h:54
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
proc_virtqueue_get_buf get_buf
Definition: VirtIO.h:53
void(* notification_cb)(struct virtqueue *vq)
Definition: VirtIO.h:46
static void virtqueue_kick_always(struct virtqueue *vq)
Definition: VirtIO.h:80
void * notification_addr
Definition: VirtIO.h:47
void * used_va
Definition: VirtIO.h:49
static bool virtqueue_kick_prepare(struct virtqueue *vq)
Definition: VirtIO.h:75
void(* proc_virtqueue_shutdown)(struct virtqueue *vq)
Definition: VirtIO.h:40
unsigned int index
Definition: VirtIO.h:45
BOOLEAN(* proc_virtqueue_is_interrupt_enabled)(struct virtqueue *vq)
Definition: VirtIO.h:36
proc_virtqueue_enable_cb_delayed enable_cb_delayed
Definition: VirtIO.h:56
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
bool(* proc_virtqueue_kick_prepare)(struct virtqueue *vq)
Definition: VirtIO.h:22
static BOOLEAN virtqueue_is_interrupt_enabled(struct virtqueue *vq)
Definition: VirtIO.h:110
unsigned char BOOLEAN
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
proc_virtqueue_has_buf has_buf
Definition: VirtIO.h:59
void *(* proc_virtqueue_get_buf)(struct virtqueue *vq, unsigned int *len)
Definition: VirtIO.h:26
proc_virtqueue_detach_unused_buf detach_unused_buf
Definition: VirtIO.h:57
typedef bool(CARDLIBPROC *pCanDragProc)(CardRegion &stackobj
void virtqueue_notify(struct virtqueue *vq)
static void * virtqueue_detach_unused_buf(struct virtqueue *vq)
Definition: VirtIO.h:105
void * avail_va
Definition: VirtIO.h:48
uint64_t ULONGLONG
Definition: typedefs.h:67
BOOLEAN(* proc_virtqueue_has_buf)(struct virtqueue *vq)
Definition: VirtIO.h:38
proc_virtqueue_enable_cb enable_cb
Definition: VirtIO.h:55
static void virtqueue_shutdown(struct virtqueue *vq)
Definition: VirtIO.h:120
proc_virtqueue_add_buf add_buf
Definition: VirtIO.h:50
GLenum GLsizei len
Definition: glext.h:6722
void virtqueue_kick(struct virtqueue *vq)
static bool virtqueue_enable_cb(struct virtqueue *vq)
Definition: VirtIO.h:95
bool(* proc_virtqueue_enable_cb)(struct virtqueue *vq)
Definition: VirtIO.h:30
void(* proc_virtqueue_disable_cb)(struct virtqueue *vq)
Definition: VirtIO.h:28
bool(* proc_virtqueue_enable_cb_delayed)(struct virtqueue *vq)
Definition: VirtIO.h:32
void *(* proc_virtqueue_detach_unused_buf)(struct virtqueue *vq)
Definition: VirtIO.h:34
proc_virtqueue_kick_always kick_always
Definition: VirtIO.h:52
proc_virtqueue_is_interrupt_enabled is_interrupt_enabled
Definition: VirtIO.h:58
static bool virtqueue_enable_cb_delayed(struct virtqueue *vq)
Definition: VirtIO.h:100
#define scatterlist
Definition: VirtIO.h:6
proc_virtqueue_shutdown shutdown
Definition: VirtIO.h:60
#define BOOLEAN
Definition: pedump.c:73
VirtIODevice * vdev
Definition: VirtIO.h:44
unsigned int ULONG
Definition: retypes.h:1
PHYSICAL_ADDRESS physAddr
Definition: VirtIO.h:9
static void * virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
Definition: VirtIO.h:85
void(* proc_virtqueue_kick_always)(struct virtqueue *vq)
Definition: VirtIO.h:24
static BOOLEAN virtqueue_has_buf(struct virtqueue *vq)
Definition: VirtIO.h:115
static void virtqueue_disable_cb(struct virtqueue *vq)
Definition: VirtIO.h:90
static unsigned(__cdecl *hash_bstr)(bstr_t s)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
proc_virtqueue_kick_prepare kick_prepare
Definition: VirtIO.h:51