aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vfio.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2020-03-24 09:28:25 -0600
committerAlex Williamson <alex.williamson@redhat.com>2020-03-24 09:28:25 -0600
commit5f3874c2a2310d9bd6969ca6764961d27a843b9d (patch)
treee0795d72ed06c8c56dc0ea76243d5e5ea3884b19 /include/linux/vfio.h
parentLinux 5.6-rc7 (diff)
downloadlinux-dev-5f3874c2a2310d9bd6969ca6764961d27a843b9d.tar.xz
linux-dev-5f3874c2a2310d9bd6969ca6764961d27a843b9d.zip
vfio: Include optional device match in vfio_device_ops callbacks
Allow bus drivers to provide their own callback to match a device to the user provided string. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/vfio.h')
-rw-r--r--include/linux/vfio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index e42a711a2800..029694b977f2 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -26,6 +26,9 @@
* operations documented below
* @mmap: Perform mmap(2) on a region of the device file descriptor
* @request: Request for the bus driver to release the device
+ * @match: Optional device name match callback (return: 0 for no-match, >0 for
+ * match, -errno for abort (ex. match with insufficient or incorrect
+ * additional args)
*/
struct vfio_device_ops {
char *name;
@@ -39,6 +42,7 @@ struct vfio_device_ops {
unsigned long arg);
int (*mmap)(void *device_data, struct vm_area_struct *vma);
void (*request)(void *device_data, unsigned int count);
+ int (*match)(void *device_data, char *buf);
};
extern struct iommu_group *vfio_iommu_group_get(struct device *dev);