aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-07-11 02:19:32 -0400
committerJoerg Roedel <jroedel@suse.de>2014-07-23 10:04:47 -0400
commit8594d83261d14754288ef00993f0971131ff08eb (patch)
tree00d7c2c9933fb55e0d4e37e3b4c41a3128a529cc
parent129ad28100cccc0ff01f2227dd8d0849c0114ade (diff)
iommu/vt-d: Simplify include/linux/dmar.h
Simplify include/linux/dmar.h a bit based on the fact that both CONFIG_INTEL_IOMMU and CONFIG_IRQ_REMAP select CONFIG_DMAR_TABLE. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--include/linux/dmar.h50
1 files changed, 18 insertions, 32 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 23c8db129560..1deece46a0ca 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -114,22 +114,30 @@ extern int dmar_remove_dev_scope(struct dmar_pci_notify_info *info,
114/* Intel IOMMU detection */ 114/* Intel IOMMU detection */
115extern int detect_intel_iommu(void); 115extern int detect_intel_iommu(void);
116extern int enable_drhd_fault_handling(void); 116extern int enable_drhd_fault_handling(void);
117#else 117
118struct dmar_pci_notify_info; 118#ifdef CONFIG_INTEL_IOMMU
119static inline int detect_intel_iommu(void) 119extern int iommu_detected, no_iommu;
120extern int intel_iommu_init(void);
121extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
122extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
123extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info);
124#else /* !CONFIG_INTEL_IOMMU: */
125static inline int intel_iommu_init(void) { return -ENODEV; }
126static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
120{ 127{
121 return -ENODEV; 128 return 0;
122} 129}
123 130static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
124static inline int dmar_table_init(void)
125{ 131{
126 return -ENODEV; 132 return 0;
127} 133}
128static inline int enable_drhd_fault_handling(void) 134static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)
129{ 135{
130 return -1; 136 return 0;
131} 137}
132#endif /* !CONFIG_DMAR_TABLE */ 138#endif /* CONFIG_INTEL_IOMMU */
139
140#endif /* CONFIG_DMAR_TABLE */
133 141
134struct irte { 142struct irte {
135 union { 143 union {
@@ -177,26 +185,4 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu);
177extern irqreturn_t dmar_fault(int irq, void *dev_id); 185extern irqreturn_t dmar_fault(int irq, void *dev_id);
178extern int arch_setup_dmar_msi(unsigned int irq); 186extern int arch_setup_dmar_msi(unsigned int irq);
179 187
180#ifdef CONFIG_INTEL_IOMMU
181extern int iommu_detected, no_iommu;
182extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
183extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
184extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info);
185extern int intel_iommu_init(void);
186#else /* !CONFIG_INTEL_IOMMU: */
187static inline int intel_iommu_init(void) { return -ENODEV; }
188static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
189{
190 return 0;
191}
192static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
193{
194 return 0;
195}
196static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)
197{
198 return 0;
199}
200#endif /* CONFIG_INTEL_IOMMU */
201
202#endif /* __DMAR_H__ */ 188#endif /* __DMAR_H__ */