diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2013-03-19 23:21:24 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-03-19 23:36:05 -0400 |
commit | 3beee86a4b9374e38dba36b44e81f1423a0d6b54 (patch) | |
tree | 5993020791a65623200b45393ccd63b342d5a933 /include/linux/virtio.h | |
parent | 1515c5ce26ae45a8ecea4e68a484562ca4356442 (diff) |
virtio: Introduce vringh wrappers in virtio_config
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 <ohad@wizery.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (constified vringh_config)
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r-- | include/linux/virtio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index ff6714e6d0f5..5d5b3abc283d 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. |
@@ -70,6 +71,7 @@ static inline unsigned int virtqueue_get_queue_index(struct virtqueue *vq) | |||
70 | * @dev: underlying device. | 71 | * @dev: underlying device. |
71 | * @id: the device type identification (used to match it with a driver). | 72 | * @id: the device type identification (used to match it with a driver). |
72 | * @config: the configuration ops for this device. | 73 | * @config: the configuration ops for this device. |
74 | * @vringh_config: configuration ops for host vrings. | ||
73 | * @vqs: the list of virtqueues for this device. | 75 | * @vqs: the list of virtqueues for this device. |
74 | * @features: the features supported by both driver and device. | 76 | * @features: the features supported by both driver and device. |
75 | * @priv: private pointer for the driver's use. | 77 | * @priv: private pointer for the driver's use. |
@@ -79,6 +81,7 @@ struct virtio_device { | |||
79 | struct device dev; | 81 | struct device dev; |
80 | struct virtio_device_id id; | 82 | struct virtio_device_id id; |
81 | const struct virtio_config_ops *config; | 83 | const struct virtio_config_ops *config; |
84 | const struct vringh_config_ops *vringh_config; | ||
82 | struct list_head vqs; | 85 | struct list_head vqs; |
83 | /* Note that this is a Linux set_bit-style bitmap. */ | 86 | /* Note that this is a Linux set_bit-style bitmap. */ |
84 | unsigned long features[1]; | 87 | unsigned long features[1]; |