aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_ring.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/virtio_ring.h')
-rw-r--r--include/linux/virtio_ring.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 71e03722fb59..e4d144b132b5 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -14,6 +14,8 @@
14#define VRING_DESC_F_NEXT 1 14#define VRING_DESC_F_NEXT 1
15/* This marks a buffer as write-only (otherwise read-only). */ 15/* This marks a buffer as write-only (otherwise read-only). */
16#define VRING_DESC_F_WRITE 2 16#define VRING_DESC_F_WRITE 2
17/* This means the buffer contains a list of buffer descriptors. */
18#define VRING_DESC_F_INDIRECT 4
17 19
18/* The Host uses this in used->flags to advise the Guest: don't kick me when 20/* The Host uses this in used->flags to advise the Guest: don't kick me when
19 * you add a buffer. It's unreliable, so it's simply an optimization. Guest 21 * you add a buffer. It's unreliable, so it's simply an optimization. Guest
@@ -24,9 +26,11 @@
24 * optimization. */ 26 * optimization. */
25#define VRING_AVAIL_F_NO_INTERRUPT 1 27#define VRING_AVAIL_F_NO_INTERRUPT 1
26 28
29/* We support indirect buffer descriptors */
30#define VIRTIO_RING_F_INDIRECT_DESC 28
31
27/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ 32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
28struct vring_desc 33struct vring_desc {
29{
30 /* Address (guest-physical). */ 34 /* Address (guest-physical). */
31 __u64 addr; 35 __u64 addr;
32 /* Length. */ 36 /* Length. */
@@ -37,24 +41,21 @@ struct vring_desc
37 __u16 next; 41 __u16 next;
38}; 42};
39 43
40struct vring_avail 44struct vring_avail {
41{
42 __u16 flags; 45 __u16 flags;
43 __u16 idx; 46 __u16 idx;
44 __u16 ring[]; 47 __u16 ring[];
45}; 48};
46 49
47/* u32 is used here for ids for padding reasons. */ 50/* u32 is used here for ids for padding reasons. */
48struct vring_used_elem 51struct vring_used_elem {
49{
50 /* Index of start of used descriptor chain. */ 52 /* Index of start of used descriptor chain. */
51 __u32 id; 53 __u32 id;
52 /* Total length of the descriptor chain which was used (written to) */ 54 /* Total length of the descriptor chain which was used (written to) */
53 __u32 len; 55 __u32 len;
54}; 56};
55 57
56struct vring_used 58struct vring_used {
57{
58 __u16 flags; 59 __u16 flags;
59 __u16 idx; 60 __u16 idx;
60 struct vring_used_elem ring[]; 61 struct vring_used_elem ring[];
@@ -119,7 +120,8 @@ struct virtqueue *vring_new_virtqueue(unsigned int num,
119 struct virtio_device *vdev, 120 struct virtio_device *vdev,
120 void *pages, 121 void *pages,
121 void (*notify)(struct virtqueue *vq), 122 void (*notify)(struct virtqueue *vq),
122 void (*callback)(struct virtqueue *vq)); 123 void (*callback)(struct virtqueue *vq),
124 const char *name);
123void vring_del_virtqueue(struct virtqueue *vq); 125void vring_del_virtqueue(struct virtqueue *vq);
124/* Filter out transport-specific feature bits. */ 126/* Filter out transport-specific feature bits. */
125void vring_transport_features(struct virtio_device *vdev); 127void vring_transport_features(struct virtio_device *vdev);