diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2022-07-08 10:50:57 -0600 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-07-26 07:27:48 -0400 |
commit | 159bf19270e80b5bc4b13aa88072dcb390b4d297 (patch) | |
tree | 75717c2bb4987d1fa94fe913de87f7ab6460b5cb /include/linux/dma-map-ops.h | |
parent | f02ad36d4f76645e7e1c21f572260e9a2e61c26b (diff) | |
download | lwn-159bf19270e80b5bc4b13aa88072dcb390b4d297.tar.gz lwn-159bf19270e80b5bc4b13aa88072dcb390b4d297.zip |
dma-mapping: add flags to dma_map_ops to indicate PCI P2PDMA support
Add a flags member to the dma_map_ops structure with one flag to
indicate support for PCI P2PDMA.
Also, add a helper to check if a device supports PCI P2PDMA.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/dma-map-ops.h')
-rw-r--r-- | include/linux/dma-map-ops.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index 99cec59dbfcb..010df04358aa 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -11,7 +11,17 @@ struct cma; +/* + * Values for struct dma_map_ops.flags: + * + * DMA_F_PCI_P2PDMA_SUPPORTED: Indicates the dma_map_ops implementation can + * handle PCI P2PDMA pages in the map_sg/unmap_sg operation. + */ +#define DMA_F_PCI_P2PDMA_SUPPORTED (1 << 0) + struct dma_map_ops { + unsigned int flags; + void *(*alloc)(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs); |