search for: virtio_alloc_coherent

Displaying 1 result from an estimated 1 matches for "virtio_alloc_coherent".

2020 Apr 28
0
[PATCH 5/5] virtio: Add bounce DMA ops
...lt;linux/of.h> > +#include <linux/of_fdt.h> > + > +static phys_addr_t bounce_buf_paddr; > +static void *bounce_buf_vaddr; > +static size_t bounce_buf_size; > +struct swiotlb_pool *virtio_pool; > + > +#define VIRTIO_MAX_BOUNCE_SIZE (16*4096) > + > +static void *virtio_alloc_coherent(struct device *dev, size_t size, > + dma_addr_t *dma_handle, gfp_t gfp_flags, unsigned long attrs) > +{ > + phys_addr_t addr; > + > + if (!virtio_pool) > + return NULL; > + > + addr = swiotlb_alloc(virtio_pool, size, bounce_buf_paddr, ULONG_MAX); > + if (addr == DMA_MAP...