Lines Matching defs:ops

200 	const struct iommu_ops *ops = dev->bus->iommu_ops;
205 if (!ops)
211 if (!try_module_get(ops->owner)) {
216 iommu_dev = ops->probe_device(dev);
239 ops->release_device(dev);
242 module_put(ops->owner);
252 const struct iommu_ops *ops = dev->bus->iommu_ops;
284 if (ops->probe_finalize)
285 ops->probe_finalize(dev);
299 const struct iommu_ops *ops = dev->bus->iommu_ops;
306 ops->release_device(dev);
309 module_put(ops->owner);
748 if (domain->ops->apply_resv_region)
749 domain->ops->apply_resv_region(dev, domain, entry);
783 if (domain->ops->is_attach_deferred)
784 return domain->ops->is_attach_deferred(domain, dev);
1206 if (!domain || !domain->ops->page_response)
1247 ret = domain->ops->page_response(dev, evt, msg);
1472 const struct iommu_ops *ops = dev->bus->iommu_ops;
1475 if (ops->def_domain_type)
1476 type = ops->def_domain_type(dev);
1537 const struct iommu_ops *ops = dev->bus->iommu_ops;
1545 if (!ops)
1548 group = ops->device_group(dev);
1607 * ADD/DEL call into iommu driver ops if provided, which may
1658 const struct iommu_ops *ops = dev->bus->iommu_ops;
1662 if (ops->def_domain_type)
1663 type = ops->def_domain_type(dev);
1722 if (domain->ops->probe_finalize)
1723 domain->ops->probe_finalize(dev);
1793 static int iommu_bus_init(struct bus_type *bus, const struct iommu_ops *ops)
1829 * @ops: the callbacks provided by the iommu-driver
1833 * the iommu-api after these ops are registered.
1836 * is set up. With this function the iommu-driver can set the iommu-ops
1839 int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops)
1843 if (ops == NULL) {
1851 bus->iommu_ops = ops;
1854 err = iommu_bus_init(bus, ops);
1912 domain->ops = bus->iommu_ops;
1928 domain->ops->domain_free(domain);
1937 if (unlikely(domain->ops->attach_dev == NULL))
1940 ret = domain->ops->attach_dev(domain, dev);
2037 if (unlikely(!domain->ops->cache_invalidate))
2078 return domain->ops->cache_invalidate(domain, dev, &inv_info);
2146 if (unlikely(!domain->ops->sva_bind_gpasid))
2153 return domain->ops->sva_bind_gpasid(domain, dev, &data);
2160 if (unlikely(!domain->ops->sva_unbind_gpasid))
2163 return domain->ops->sva_unbind_gpasid(dev, pasid);
2173 if (unlikely(!domain->ops->sva_bind_gpasid))
2190 if (unlikely(domain->ops->detach_dev == NULL))
2193 domain->ops->detach_dev(domain, dev);
2333 if (unlikely(domain->ops->iova_to_phys == NULL))
2336 return domain->ops->iova_to_phys(domain, iova);
2375 const struct iommu_ops *ops = domain->ops;
2382 if (unlikely(ops->map == NULL ||
2410 ret = ops->map(domain, iova, paddr, pgsize, prot, gfp);
2432 const struct iommu_ops *ops = domain->ops;
2436 if (ret == 0 && ops->iotlb_sync_map)
2437 ops->iotlb_sync_map(domain);
2461 const struct iommu_ops *ops = domain->ops;
2466 if (unlikely(ops->unmap == NULL ||
2496 unmapped_page = ops->unmap(domain, iova, pgsize, iotlb_gather);
2537 const struct iommu_ops *ops = domain->ops;
2568 if (ops->iotlb_sync_map)
2569 ops->iotlb_sync_map(domain);
2598 if (unlikely(domain->ops->domain_window_enable == NULL))
2601 return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size,
2608 if (unlikely(domain->ops->domain_window_disable == NULL))
2611 return domain->ops->domain_window_disable(domain, wnd_nr);
2687 if (!domain->ops->domain_get_attr)
2690 ret = domain->ops->domain_get_attr(domain, attr, data);
2704 if (domain->ops->domain_set_attr == NULL)
2707 ret = domain->ops->domain_set_attr(domain, attr, data);
2716 const struct iommu_ops *ops = dev->bus->iommu_ops;
2718 if (ops && ops->get_resv_regions)
2719 ops->get_resv_regions(dev, list);
2724 const struct iommu_ops *ops = dev->bus->iommu_ops;
2726 if (ops && ops->put_resv_regions)
2727 ops->put_resv_regions(dev, list);
2792 const struct iommu_ops *ops = NULL;
2798 ops = iommu->ops;
2802 return ops;
2806 const struct iommu_ops *ops)
2811 return ops == fwspec->ops ? 0 : -EINVAL;
2823 fwspec->ops = ops;
2872 const struct iommu_ops *ops = dev->bus->iommu_ops;
2874 if (ops && ops->dev_has_feat)
2875 return ops->dev_has_feat(dev, feat);
2884 const struct iommu_ops *ops = dev->iommu->iommu_dev->ops;
2886 if (ops->dev_enable_feat)
2887 return ops->dev_enable_feat(dev, feat);
2902 const struct iommu_ops *ops = dev->iommu->iommu_dev->ops;
2904 if (ops->dev_disable_feat)
2905 return ops->dev_disable_feat(dev, feat);
2915 const struct iommu_ops *ops = dev->iommu->iommu_dev->ops;
2917 if (ops->dev_feat_enabled)
2918 return ops->dev_feat_enabled(dev, feat);
2939 if (domain->ops->aux_attach_dev)
2940 ret = domain->ops->aux_attach_dev(domain, dev);
2951 if (domain->ops->aux_detach_dev) {
2952 domain->ops->aux_detach_dev(domain, dev);
2962 if (domain->ops->aux_get_pasid)
2963 ret = domain->ops->aux_get_pasid(domain, dev);
2989 const struct iommu_ops *ops = dev->bus->iommu_ops;
2991 if (!ops || !ops->sva_bind)
3010 handle = ops->sva_bind(dev, mm, drvdata);
3034 const struct iommu_ops *ops = dev->bus->iommu_ops;
3036 if (!ops || !ops->sva_unbind)
3044 ops->sva_unbind(handle);
3053 const struct iommu_ops *ops = handle->dev->bus->iommu_ops;
3055 if (!ops || !ops->sva_get_pasid)
3058 return ops->sva_get_pasid(handle);