Showing the changes to include/linux (1 of 6 files). Show all
Unified · Split
| @@ -26,6 +26,9 @@ · 25 unmodified lines | ||
| 26 | 26 | * operations documented below |
| 27 | 27 | * @mmap: Perform mmap(2) on a region of the device file descriptor |
| 28 | 28 | * @request: Request for the bus driver to release the device |
| 29 | + * @match: Optional device name match callback (return: 0 for no-match, >0 for | |
| 30 | + * match, -errno for abort (ex. match with insufficient or incorrect | |
| 31 | + * additional args) | |
| 29 | 32 | */ |
| 30 | 33 | struct vfio_device_ops { |
| 31 | 34 | char *name; |
| @@ -39,6 +42,7 @@ struct vfio_device_ops { · 7 unmodified lines | ||
| 39 | 42 | unsigned long arg); |
| 40 | 43 | int (*mmap)(void *device_data, struct vm_area_struct *vma); |
| 41 | 44 | void (*request)(void *device_data, unsigned int count); |
| 45 | + int (*match)(void *device_data, char *buf); | |
| 42 | 46 | }; |
| 43 | 47 | |
| 44 | 48 | extern struct iommu_group *vfio_iommu_group_get(struct device *dev); |
| @@ -82,6 +86,8 @@ struct vfio_iommu_driver_ops { · 37 unmodified lines | ||
| 82 | 86 | struct notifier_block *nb); |
| 83 | 87 | int (*unregister_notifier)(void *iommu_data, |
| 84 | 88 | struct notifier_block *nb); |
| 89 | + int (*dma_rw)(void *iommu_data, dma_addr_t user_iova, | |
| 90 | + void *data, size_t count, bool write); | |
| 85 | 91 | }; |
| 86 | 92 | |
| 87 | 93 | extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops); |
| @@ -94,6 +100,8 @@ extern void vfio_unregister_iommu_driver( · 6 unmodified lines | ||
| 94 | 100 | */ |
| 95 | 101 | extern struct vfio_group *vfio_group_get_external_user(struct file *filep); |
| 96 | 102 | extern void vfio_group_put_external_user(struct vfio_group *group); |
| 103 | +extern struct vfio_group *vfio_group_get_external_user_from_dev(struct device | |
| 104 | + *dev); | |
| 97 | 105 | extern bool vfio_external_group_match_file(struct vfio_group *group, |
| 98 | 106 | struct file *filep); |
| 99 | 107 | extern int vfio_external_user_iommu_id(struct vfio_group *group); |
| @@ -107,6 +115,15 @@ extern int vfio_pin_pages(struct device *dev, unsigned long *user_pfn, · 7 unmodified lines | ||
| 107 | 115 | extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn, |
| 108 | 116 | int npage); |
| 109 | 117 | |
| 118 | +extern int vfio_group_pin_pages(struct vfio_group *group, | |
| 119 | + unsigned long *user_iova_pfn, int npage, | |
| 120 | + int prot, unsigned long *phys_pfn); | |
| 121 | +extern int vfio_group_unpin_pages(struct vfio_group *group, | |
| 122 | + unsigned long *user_iova_pfn, int npage); | |
| 123 | + | |
| 124 | +extern int vfio_dma_rw(struct vfio_group *group, dma_addr_t user_iova, | |
| 125 | + void *data, size_t len, bool write); | |
| 126 | + | |
| 110 | 127 | /* each type has independent events */ |
| 111 | 128 | enum vfio_notify_type { |
| 112 | 129 | VFIO_IOMMU_NOTIFY = 0, |