From 3beee86a4b9374e38dba36b44e81f1423a0d6b54 Mon Sep 17 00:00:00 2001 From: Sjur Brændeland Date: Wed, 20 Mar 2013 13:51:24 +1030 Subject: virtio: Introduce vringh wrappers in virtio_config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add wrappers for the host vrings to support loose coupling between the virtio device and driver. A new struct vringh_config_ops with the functions find_vrhs() and del_vrhs() is added to the virtio_device struct. This enables virtio drivers to manage virtio host rings without detailed knowledge of how the vrings are created and deleted. The function vringh_notify() is added so vringh clients can notify the other side that buffers are added to the used-ring. Cc: Ohad Ben-Cohen Signed-off-by: Sjur Brændeland Signed-off-by: Rusty Russell (constified vringh_config) --- include/linux/virtio.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/virtio.h') diff --git a/include/linux/virtio.h b/include/linux/virtio.h index ff6714e6d0f..5d5b3abc283 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -8,6 +8,7 @@ #include #include #include +#include /** * virtqueue - a queue to register buffers for sending or receiving. @@ -70,6 +71,7 @@ static inline unsigned int virtqueue_get_queue_index(struct virtqueue *vq) * @dev: underlying device. * @id: the device type identification (used to match it with a driver). * @config: the configuration ops for this device. + * @vringh_config: configuration ops for host vrings. * @vqs: the list of virtqueues for this device. * @features: the features supported by both driver and device. * @priv: private pointer for the driver's use. @@ -79,6 +81,7 @@ struct virtio_device { struct device dev; struct virtio_device_id id; const struct virtio_config_ops *config; + const struct vringh_config_ops *vringh_config; struct list_head vqs; /* Note that this is a Linux set_bit-style bitmap. */ unsigned long features[1]; -- cgit v1.2.3-70-g09d2