diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-10-07 10:39:47 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-12-09 05:05:25 -0500 |
commit | 890626521503318d7ac92a4a3b9feba55c0131ec (patch) | |
tree | 643da66cb95f5afbfc752901654626c373e26820 /drivers/virtio | |
parent | 92e6d7438ee631aac85258ee3d4de8c860d8c32f (diff) |
virtio: allow transports to get avail/used addresses
For virtio-1, we can theoretically have a more complex virtqueue
layout with avail and used buffers not on a contiguous memory area
with the descriptor table. For now, it's fine for a transport driver
to stay with the old layout: It needs, however, a way to access
the locations of the avail/used rings so it can register them with
the host.
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_ring.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 0d3c73737652..55532a43ead3 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
@@ -827,4 +827,20 @@ void virtio_break_device(struct virtio_device *dev) | |||
827 | } | 827 | } |
828 | EXPORT_SYMBOL_GPL(virtio_break_device); | 828 | EXPORT_SYMBOL_GPL(virtio_break_device); |
829 | 829 | ||
830 | void *virtqueue_get_avail(struct virtqueue *_vq) | ||
831 | { | ||
832 | struct vring_virtqueue *vq = to_vvq(_vq); | ||
833 | |||
834 | return vq->vring.avail; | ||
835 | } | ||
836 | EXPORT_SYMBOL_GPL(virtqueue_get_avail); | ||
837 | |||
838 | void *virtqueue_get_used(struct virtqueue *_vq) | ||
839 | { | ||
840 | struct vring_virtqueue *vq = to_vvq(_vq); | ||
841 | |||
842 | return vq->vring.used; | ||
843 | } | ||
844 | EXPORT_SYMBOL_GPL(virtqueue_get_used); | ||
845 | |||
830 | MODULE_LICENSE("GPL"); | 846 | MODULE_LICENSE("GPL"); |