diff options
Diffstat (limited to 'include/linux/virtio.h')
| -rw-r--r-- | include/linux/virtio.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index ff6714e6d0f5..9ff8645b7e0b 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
| 9 | #include <linux/mod_devicetable.h> | 9 | #include <linux/mod_devicetable.h> |
| 10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
| 11 | #include <linux/vringh.h> | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * virtqueue - a queue to register buffers for sending or receiving. | 14 | * virtqueue - a queue to register buffers for sending or receiving. |
| @@ -40,6 +41,23 @@ int virtqueue_add_buf(struct virtqueue *vq, | |||
| 40 | void *data, | 41 | void *data, |
| 41 | gfp_t gfp); | 42 | gfp_t gfp); |
| 42 | 43 | ||
| 44 | int virtqueue_add_outbuf(struct virtqueue *vq, | ||
| 45 | struct scatterlist sg[], unsigned int num, | ||
| 46 | void *data, | ||
| 47 | gfp_t gfp); | ||
| 48 | |||
| 49 | int virtqueue_add_inbuf(struct virtqueue *vq, | ||
| 50 | struct scatterlist sg[], unsigned int num, | ||
| 51 | void *data, | ||
| 52 | gfp_t gfp); | ||
| 53 | |||
| 54 | int virtqueue_add_sgs(struct virtqueue *vq, | ||
| 55 | struct scatterlist *sgs[], | ||
| 56 | unsigned int out_sgs, | ||
| 57 | unsigned int in_sgs, | ||
| 58 | void *data, | ||
| 59 | gfp_t gfp); | ||
| 60 | |||
| 43 | void virtqueue_kick(struct virtqueue *vq); | 61 | void virtqueue_kick(struct virtqueue *vq); |
| 44 | 62 | ||
| 45 | bool virtqueue_kick_prepare(struct virtqueue *vq); | 63 | bool virtqueue_kick_prepare(struct virtqueue *vq); |
| @@ -58,18 +76,13 @@ void *virtqueue_detach_unused_buf(struct virtqueue *vq); | |||
| 58 | 76 | ||
| 59 | unsigned int virtqueue_get_vring_size(struct virtqueue *vq); | 77 | unsigned int virtqueue_get_vring_size(struct virtqueue *vq); |
| 60 | 78 | ||
| 61 | /* FIXME: Obsolete accessor, but required for virtio_net merge. */ | ||
| 62 | static inline unsigned int virtqueue_get_queue_index(struct virtqueue *vq) | ||
| 63 | { | ||
| 64 | return vq->index; | ||
| 65 | } | ||
| 66 | |||
| 67 | /** | 79 | /** |
| 68 | * virtio_device - representation of a device using virtio | 80 | * virtio_device - representation of a device using virtio |
| 69 | * @index: unique position on the virtio bus | 81 | * @index: unique position on the virtio bus |
| 70 | * @dev: underlying device. | 82 | * @dev: underlying device. |
| 71 | * @id: the device type identification (used to match it with a driver). | 83 | * @id: the device type identification (used to match it with a driver). |
| 72 | * @config: the configuration ops for this device. | 84 | * @config: the configuration ops for this device. |
| 85 | * @vringh_config: configuration ops for host vrings. | ||
| 73 | * @vqs: the list of virtqueues for this device. | 86 | * @vqs: the list of virtqueues for this device. |
| 74 | * @features: the features supported by both driver and device. | 87 | * @features: the features supported by both driver and device. |
| 75 | * @priv: private pointer for the driver's use. | 88 | * @priv: private pointer for the driver's use. |
| @@ -79,6 +92,7 @@ struct virtio_device { | |||
| 79 | struct device dev; | 92 | struct device dev; |
| 80 | struct virtio_device_id id; | 93 | struct virtio_device_id id; |
| 81 | const struct virtio_config_ops *config; | 94 | const struct virtio_config_ops *config; |
| 95 | const struct vringh_config_ops *vringh_config; | ||
| 82 | struct list_head vqs; | 96 | struct list_head vqs; |
| 83 | /* Note that this is a Linux set_bit-style bitmap. */ | 97 | /* Note that this is a Linux set_bit-style bitmap. */ |
| 84 | unsigned long features[1]; | 98 | unsigned long features[1]; |
