]> Pileus Git - ~andy/linux/blobdiff - drivers/iommu/iommu.c
iommu: Add domain window handling functions
[~andy/linux] / drivers / iommu / iommu.c
index 0e0e5f2e0ccc33ae79a2ebdeafce20495459bdb1..b3aced7356cc13a91423fe695cf2974c59b11611 100644 (file)
@@ -852,6 +852,26 @@ size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
 }
 EXPORT_SYMBOL_GPL(iommu_unmap);
 
+
+int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
+                              phys_addr_t paddr, u64 size)
+{
+       if (unlikely(domain->ops->domain_window_enable == NULL))
+               return -ENODEV;
+
+       return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size);
+}
+EXPORT_SYMBOL_GPL(iommu_domain_window_enable);
+
+void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr)
+{
+       if (unlikely(domain->ops->domain_window_disable == NULL))
+               return;
+
+       return domain->ops->domain_window_disable(domain, wnd_nr);
+}
+EXPORT_SYMBOL_GPL(iommu_domain_window_disable);
+
 static int __init iommu_init(void)
 {
        iommu_group_kset = kset_create_and_add("iommu_groups",