Lines Matching refs:device

11 #include <linux/device.h>
58 struct device;
68 typedef int (*iommu_fault_handler_t)(struct iommu_domain *, struct device *, unsigned long, int, void *);
150 * for instance in device assignment use case (USB, Graphics)
153 /* Arbitrary "never map this or give it to a device" address ranges */
177 /* Per device IOMMU features */
209 * @attach_dev: attach device to an iommu domain
210 * @detach_dev: detach device from an iommu domain
223 * @probe_device: Add device to iommu driver handling
224 * @release_device: Remove device from iommu driver handling
225 * @probe_finalize: Do final setup work after the device is added to an IOMMU
227 * @device_group: find iommu group for a particular device
230 * @get_resv_regions: Request list of reserved regions for a device
231 * @put_resv_regions: Free list of reserved regions for a device
237 * driver init to device driver init (default no)
238 * @dev_has/enable/disable_feat: per device entries to check/enable/disable
243 * @sva_bind: Bind process address space to device
244 * @sva_unbind: Unbind process address space from device
250 * @def_domain_type: device default domain type, return value:
264 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
265 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
279 struct iommu_device *(*probe_device)(struct device *dev);
280 void (*release_device)(struct device *dev);
281 void (*probe_finalize)(struct device *dev);
282 struct iommu_group *(*device_group)(struct device *dev);
286 /* Request/Free a list of reserved regions for a device */
287 void (*get_resv_regions)(struct device *dev, struct list_head *list);
288 void (*put_resv_regions)(struct device *dev, struct list_head *list);
289 void (*apply_resv_region)(struct device *dev, struct iommu_domain *domain, struct iommu_resv_region *region);
295 int (*of_xlate)(struct device *dev, struct of_phandle_args *args);
296 bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);
298 /* Per device IOMMU features */
299 bool (*dev_has_feat)(struct device *dev, enum iommu_dev_features f);
300 bool (*dev_feat_enabled)(struct device *dev, enum iommu_dev_features f);
301 int (*dev_enable_feat)(struct device *dev, enum iommu_dev_features f);
302 int (*dev_disable_feat)(struct device *dev, enum iommu_dev_features f);
305 int (*aux_attach_dev)(struct iommu_domain *domain, struct device *dev);
306 void (*aux_detach_dev)(struct iommu_domain *domain, struct device *dev);
307 int (*aux_get_pasid)(struct iommu_domain *domain, struct device *dev);
309 struct iommu_sva *(*sva_bind)(struct device *dev, struct mm_struct *mm, void *drvdata);
313 int (*page_response)(struct device *dev, struct iommu_fault_event *evt, struct iommu_page_response *msg);
314 int (*cache_invalidate)(struct iommu_domain *domain, struct device *dev,
316 int (*sva_bind_gpasid)(struct iommu_domain *domain, struct device *dev, struct iommu_gpasid_bind_data *data);
318 int (*sva_unbind_gpasid)(struct device *dev, u32 pasid);
320 int (*def_domain_type)(struct device *dev);
331 * @dev: struct device for sysfs handling
337 struct device *dev;
355 * struct iommu_fault_param - per-device IOMMU fault data
356 * @handler: Callback function to handle IOMMU faults at device level
369 * struct dev_iommu - Collection of per-device IOMMU data
371 * @fault_param: IOMMU detected device fault reporting data
373 * @iommu_dev: IOMMU device this device is linked to
376 * migrate other per device data pointers under iommu_dev_data, e.g.
389 int iommu_device_sysfs_add(struct iommu_device *iommu, struct device *parent, const struct attribute_group **groups,
392 int iommu_device_link(struct iommu_device *iommu, struct device *link);
393 void iommu_device_unlink(struct iommu_device *iommu, struct device *link);
412 static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
438 extern int iommu_attach_device(struct iommu_domain *domain, struct device *dev);
439 extern void iommu_detach_device(struct iommu_domain *domain, struct device *dev);
440 extern int iommu_uapi_cache_invalidate(struct iommu_domain *domain, struct device *dev, void __user *uinfo);
442 extern int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata);
443 extern int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata);
444 extern int iommu_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, ioasid_t pasid);
445 extern struct iommu_domain *iommu_get_domain_for_dev(struct device *dev);
446 extern struct iommu_domain *iommu_get_dma_domain(struct device *dev);
459 extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
460 extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
461 extern void generic_iommu_put_resv_regions(struct device *dev, struct list_head *list);
475 extern int iommu_group_add_device(struct iommu_group *group, struct device *dev);
476 extern void iommu_group_remove_device(struct device *dev);
477 extern int iommu_group_for_each_dev(struct iommu_group *group, void *data, int (*fn)(struct device *, void *));
478 extern struct iommu_group *iommu_group_get(struct device *dev);
483 extern int iommu_register_device_fault_handler(struct device *dev, iommu_dev_fault_handler_t handler, void *data);
485 extern int iommu_unregister_device_fault_handler(struct device *dev);
487 extern int iommu_report_device_fault(struct device *dev, struct iommu_fault_event *evt);
488 extern int iommu_page_response(struct device *dev, struct iommu_page_response *msg);
500 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev, unsigned long iova, int flags);
544 /* PCI device grouping function */
545 extern struct iommu_group *pci_device_group(struct device *dev);
546 /* Generic device grouping function */
547 extern struct iommu_group *generic_device_group(struct device *dev);
548 extern void rk_iommu_mask_irq(struct device *dev);
549 extern void rk_iommu_unmask_irq(struct device *dev);
550 /* FSL-MC device grouping function */
551 struct iommu_group *fsl_mc_device_group(struct device *dev);
554 * struct iommu_fwspec - per-device IOMMU instance data
555 * @ops: ops for this device's IOMMU
556 * @iommu_fwnode: firmware handle for this device's IOMMU
557 * @iommu_priv: IOMMU driver private data for this device
558 * @num_pasid_bits: number of PASID bits supported by this device
559 * @num_ids: number of associated device IDs
560 * @ids: IDs which this device may present to the IOMMU
575 * struct iommu_sva - handle to a device-mm bond
578 struct device *dev;
581 int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, const struct iommu_ops *ops);
582 void iommu_fwspec_free(struct device *dev);
583 int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids);
586 static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
595 static inline void dev_iommu_fwspec_set(struct device *dev, struct iommu_fwspec *fwspec)
600 static inline void *dev_iommu_priv_get(struct device *dev)
609 static inline void dev_iommu_priv_set(struct device *dev, void *priv)
614 int iommu_probe_device(struct device *dev);
615 void iommu_release_device(struct device *dev);
617 bool iommu_dev_has_feature(struct device *dev, enum iommu_dev_features f);
618 int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
619 int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);
620 bool iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features f);
621 int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev);
622 void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev);
623 int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev);
625 struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm, void *drvdata);
668 static inline int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
673 static inline void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
677 static inline struct iommu_domain *iommu_get_domain_for_dev(struct device *dev)
743 static inline void iommu_get_resv_regions(struct device *dev, struct list_head *list)
747 static inline void iommu_put_resv_regions(struct device *dev, struct list_head *list)
798 static inline int iommu_group_add_device(struct iommu_group *group, struct device *dev)
803 static inline void iommu_group_remove_device(struct device *dev)
807 static inline int iommu_group_for_each_dev(struct iommu_group *group, void *data, int (*fn)(struct device *, void *))
812 static inline struct iommu_group *iommu_group_get(struct device *dev)
831 static inline int iommu_register_device_fault_handler(struct device *dev, iommu_dev_fault_handler_t handler, void *data)
836 static inline int iommu_unregister_device_fault_handler(struct device *dev)
841 static inline int iommu_report_device_fault(struct device *dev, struct iommu_fault_event *evt)
846 static inline int iommu_page_response(struct device *dev, struct iommu_page_response *msg)
879 static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
897 static inline int iommu_device_sysfs_add(struct iommu_device *iommu, struct device *parent,
907 static inline int iommu_device_link(struct device *dev, struct device *link)
912 static inline void iommu_device_unlink(struct device *dev, struct device *link)
916 static inline int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, const struct iommu_ops *ops)
921 static inline void iommu_fwspec_free(struct device *dev)
925 static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids)
935 static inline bool iommu_dev_has_feature(struct device *dev, enum iommu_dev_features feat)
940 static inline bool iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features feat)
945 static inline int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features feat)
950 static inline int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features feat)
955 static inline int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev)
960 static inline void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev)
964 static inline int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev)
969 static inline struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm, void *drvdata)
983 static inline int iommu_uapi_cache_invalidate(struct iommu_domain *domain, struct device *dev,
989 static inline int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata)
994 static inline int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata)
999 static inline int iommu_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, ioasid_t pasid)
1004 static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
1009 static inline void rk_iommu_mask_irq(struct device *dev)
1013 static inline void rk_iommu_unmask_irq(struct device *dev)