diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2015-02-06 15:05:07 -0700 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2015-02-10 12:37:47 -0700 |
commit | 13060b64b819c194909121b90b5f8dd9abb5ea4e (patch) | |
tree | 3fc90f7744d110341d191dd44fe228c70422bd69 /include/linux/vfio.h | |
parent | 4a68810dbbb4664fe4a9ac1be4d1c0e34a9b58f5 (diff) | |
download | blackbird-op-linux-13060b64b819c194909121b90b5f8dd9abb5ea4e.tar.gz blackbird-op-linux-13060b64b819c194909121b90b5f8dd9abb5ea4e.zip |
vfio: Add and use device request op for vfio bus drivers
When a request is made to unbind a device from a vfio bus driver,
we need to wait for the device to become unused, ie. for userspace
to release the device. However, we have a long standing TODO in
the code to do something proactive to make that happen. To enable
this, we add a request callback on the vfio bus driver struct,
which is intended to signal the user through the vfio device
interface to release the device. Instead of passively waiting for
the device to become unused, we can now pester the user to give
it up.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/vfio.h')
-rw-r--r-- | include/linux/vfio.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h index d3204115f15d..2d67b8998fd8 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -26,6 +26,7 @@ * @ioctl: Perform ioctl(2) on device file descriptor, supporting VFIO_DEVICE_* * 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 */ struct vfio_device_ops { char *name; @@ -38,6 +39,7 @@ struct vfio_device_ops { long (*ioctl)(void *device_data, unsigned int cmd, unsigned long arg); int (*mmap)(void *device_data, struct vm_area_struct *vma); + void (*request)(void *device_data, unsigned int count); }; extern int vfio_add_group_dev(struct device *dev, |