diff options
| author | Aaron Young | 2021-10-28 01:05:43 +0200 |
|---|---|---|
| committer | Michael Brown | 2021-10-28 14:19:30 +0200 |
| commit | f24a2794e1b527e45efbbcad1c272f176f3d9df0 (patch) | |
| tree | 1bb4cc38e3e7059259fe37f3a7716a864f55eb13 /src/include/ipxe | |
| parent | [readline] Extend maximum read line length to 1024 characters (diff) | |
| download | ipxe-f24a2794e1b527e45efbbcad1c272f176f3d9df0.tar.gz ipxe-f24a2794e1b527e45efbbcad1c272f176f3d9df0.tar.xz ipxe-f24a2794e1b527e45efbbcad1c272f176f3d9df0.zip | |
[virtio] Update driver to use DMA API
Signed-off-by: Aaron Young <aaron.young@oracle.com>
Diffstat (limited to 'src/include/ipxe')
| -rw-r--r-- | src/include/ipxe/virtio-pci.h | 8 | ||||
| -rw-r--r-- | src/include/ipxe/virtio-ring.h | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/include/ipxe/virtio-pci.h b/src/include/ipxe/virtio-pci.h index f3074f14d..7abae26ff 100644 --- a/src/include/ipxe/virtio-pci.h +++ b/src/include/ipxe/virtio-pci.h @@ -1,6 +1,8 @@ #ifndef _VIRTIO_PCI_H_ # define _VIRTIO_PCI_H_ +#include <ipxe/dma.h> + /* A 32-bit r/o bitmask of the features supported by the host */ #define VIRTIO_PCI_HOST_FEATURES 0 @@ -198,7 +200,8 @@ struct vring_virtqueue; void vp_free_vq(struct vring_virtqueue *vq); int vp_find_vq(unsigned int ioaddr, int queue_index, - struct vring_virtqueue *vq); + struct vring_virtqueue *vq, struct dma_device *dma_dev, + size_t header_size); /* Virtio 1.0 I/O routines abstract away the three possible HW access @@ -298,7 +301,8 @@ void vpm_notify(struct virtio_pci_modern_device *vdev, struct vring_virtqueue *vq); int vpm_find_vqs(struct virtio_pci_modern_device *vdev, - unsigned nvqs, struct vring_virtqueue *vqs); + unsigned nvqs, struct vring_virtqueue *vqs, + struct dma_device *dma_dev, size_t header_size); int virtio_pci_find_capability(struct pci_device *pci, uint8_t cfg_type); diff --git a/src/include/ipxe/virtio-ring.h b/src/include/ipxe/virtio-ring.h index 852769f29..d082139e9 100644 --- a/src/include/ipxe/virtio-ring.h +++ b/src/include/ipxe/virtio-ring.h @@ -2,6 +2,7 @@ # define _VIRTIO_RING_H_ #include <ipxe/virtio-pci.h> +#include <ipxe/dma.h> /* Status byte for guest to report progress, and synchronize features. */ /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */ @@ -74,17 +75,21 @@ struct vring { struct vring_virtqueue { unsigned char *queue; + size_t queue_size; + struct dma_mapping map; + struct dma_device *dma; struct vring vring; u16 free_head; u16 last_used_idx; void **vdata; + struct virtio_net_hdr_modern *empty_header; /* PCI */ int queue_index; struct virtio_pci_region notification; }; struct vring_list { - char *addr; + physaddr_t addr; unsigned int length; }; |
