aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 432acc4c054..cc26f89c4ee 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -48,19 +48,33 @@ struct iommu_domain {
48 48
49#ifdef CONFIG_IOMMU_API 49#ifdef CONFIG_IOMMU_API
50 50
51/**
52 * struct iommu_ops - iommu ops and capabilities
53 * @domain_init: init iommu domain
54 * @domain_destroy: destroy iommu domain
55 * @attach_dev: attach device to an iommu domain
56 * @detach_dev: detach device from an iommu domain
57 * @map: map a physically contiguous memory region to an iommu domain
58 * @unmap: unmap a physically contiguous memory region from an iommu domain
59 * @iova_to_phys: translate iova to physical address
60 * @domain_has_cap: domain capabilities query
61 * @commit: commit iommu domain
62 * @pgsize_bitmap: bitmap of supported page sizes
63 */
51struct iommu_ops { 64struct iommu_ops {
52 int (*domain_init)(struct iommu_domain *domain); 65 int (*domain_init)(struct iommu_domain *domain);
53 void (*domain_destroy)(struct iommu_domain *domain); 66 void (*domain_destroy)(struct iommu_domain *domain);
54 int (*attach_dev)(struct iommu_domain *domain, struct device *dev); 67 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
55 void (*detach_dev)(struct iommu_domain *domain, struct device *dev); 68 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
56 int (*map)(struct iommu_domain *domain, unsigned long iova, 69 int (*map)(struct iommu_domain *domain, unsigned long iova,
57 phys_addr_t paddr, int gfp_order, int prot); 70 phys_addr_t paddr, size_t size, int prot);
58 int (*unmap)(struct iommu_domain *domain, unsigned long iova, 71 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
59 int gfp_order); 72 size_t size);
60 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, 73 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
61 unsigned long iova); 74 unsigned long iova);
62 int (*domain_has_cap)(struct iommu_domain *domain, 75 int (*domain_has_cap)(struct iommu_domain *domain,
63 unsigned long cap); 76 unsigned long cap);
77 unsigned long pgsize_bitmap;
64}; 78};
65 79
66extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); 80extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
@@ -72,9 +86,9 @@ extern int iommu_attach_device(struct iommu_domain *domain,
72extern void iommu_detach_device(struct iommu_domain *domain, 86extern void iommu_detach_device(struct iommu_domain *domain,
73 struct device *dev); 87 struct device *dev);
74extern int iommu_map(struct iommu_domain *domain, unsigned long iova, 88extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
75 phys_addr_t paddr, int gfp_order, int prot); 89 phys_addr_t paddr, size_t size, int prot);
76extern int iommu_unmap(struct iommu_domain *domain, unsigned long iova, 90extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
77 int gfp_order); 91 size_t size);
78extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 92extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
79 unsigned long iova); 93 unsigned long iova);
80extern int iommu_domain_has_cap(struct iommu_domain *domain, 94extern int iommu_domain_has_cap(struct iommu_domain *domain,