diff options
| author | Neeti Desai <neetid@codeaurora.org> | 2015-05-13 17:55:53 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:12:39 -0700 |
| commit | cc0f4edc4e6b62f91badaf288317f8a9be378d4d (patch) | |
| tree | a24d23a56b41f42ef81f588efe09f1c7ea7748fd /include | |
| parent | ab281bcc1dfdc163e6f728d3ccb6d1c22815ac5d (diff) | |
iommu: Add support for .dma_supported() ops
The .dma_supported() checks to see if the device can support DMA to the
memory described by the mask. Add support for this operation in the
iommu layer
Change-Id: Icf37b9540aa68c2be3fd603a48402d6fcccd8208
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/iommu.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 1890dd08b52e..2d835b7c226d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -141,6 +141,8 @@ struct iommu_ops { int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); /* Get the numer of window per domain */ u32 (*domain_get_windows)(struct iommu_domain *domain); + int (*dma_supported)(struct iommu_domain *domain, struct device *dev, + u64 mask); unsigned long pgsize_bitmap; }; @@ -263,6 +265,9 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, return domain->ops->map_sg(domain, iova, sg, nents, prot); } +extern int iommu_dma_supported(struct iommu_domain *domain, struct device *dev, + u64 mask); + #else /* CONFIG_IOMMU_API */ struct iommu_ops {}; @@ -453,6 +458,12 @@ static inline void iommu_device_unlink(struct device *dev, struct device *link) { } +static int iommu_dma_supported(struct iommu_domain *domain, struct device *dev, + u64 mask) +{ + return -EINVAL; +} + #endif /* CONFIG_IOMMU_API */ #endif /* __LINUX_IOMMU_H */ |
