This source file includes following definitions.
- iommu_setup_dma_ops
- iommu_get_dma_cookie
- iommu_get_msi_cookie
- iommu_put_dma_cookie
- iommu_dma_prepare_msi
- iommu_dma_compose_msi_msg
- iommu_dma_get_resv_regions
1
2
3
4
5 #ifndef __DMA_IOMMU_H
6 #define __DMA_IOMMU_H
7
8 #include <linux/errno.h>
9 #include <linux/types.h>
10
11 #ifdef CONFIG_IOMMU_DMA
12 #include <linux/dma-mapping.h>
13 #include <linux/iommu.h>
14 #include <linux/msi.h>
15
16
17 int iommu_get_dma_cookie(struct iommu_domain *domain);
18 int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base);
19 void iommu_put_dma_cookie(struct iommu_domain *domain);
20
21
22 void iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size);
23
24
25
26
27
28
29
30
31
32 int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr);
33
34
35 void iommu_dma_compose_msi_msg(struct msi_desc *desc,
36 struct msi_msg *msg);
37
38 void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
39
40 #else
41
42 struct iommu_domain;
43 struct msi_desc;
44 struct msi_msg;
45 struct device;
46
47 static inline void iommu_setup_dma_ops(struct device *dev, u64 dma_base,
48 u64 size)
49 {
50 }
51
52 static inline int iommu_get_dma_cookie(struct iommu_domain *domain)
53 {
54 return -ENODEV;
55 }
56
57 static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base)
58 {
59 return -ENODEV;
60 }
61
62 static inline void iommu_put_dma_cookie(struct iommu_domain *domain)
63 {
64 }
65
66 static inline int iommu_dma_prepare_msi(struct msi_desc *desc,
67 phys_addr_t msi_addr)
68 {
69 return 0;
70 }
71
72 static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc,
73 struct msi_msg *msg)
74 {
75 }
76
77 static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
78 {
79 }
80
81 #endif
82 #endif