summaryrefslogtreecommitdiff
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2025-08-21 14:46:36 +0800
committerMichael S. Tsirkin <mst@redhat.com>2025-10-01 07:24:43 -0400
commitb16060c5c7d56455da3c3c50b4a20a83c2a30810 (patch)
tree26ccf12be6288a3df6925c0109f5387efb99a7eb /include/linux/virtio.h
parentb41cb3bcf67fcb7b8297e5acc5bb3309c96c2ff2 (diff)
virtio: introduce virtio_map container union
Following patch will introduce the mapping operations for virtio device. In order to achieve this, besides the dma device, virtio core needs to support a transport or device specific mapping metadata as well. So this patch introduces a union container of a dma device. The idea is the allow the transport layer to pass device specific mapping metadata which will be used as a parameter for the virtio mapping operations. For the transport or device that is using DMA, dma device is still being used. Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20250821064641.5025-5-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r--include/linux/virtio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 576e08bd7697..b4ba1a99e5ab 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -41,6 +41,11 @@ struct virtqueue {
void *priv;
};
+union virtio_map {
+ /* Device that performs DMA */
+ struct device *dma_dev;
+};
+
int virtqueue_add_outbuf(struct virtqueue *vq,
struct scatterlist sg[], unsigned int num,
void *data,