vfio: Introduce common function to add capabilities
authorKirti Wankhede <kwankhede@nvidia.com>
Wed, 16 Nov 2016 20:46:25 +0000 (02:16 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 17 Nov 2016 15:33:20 +0000 (08:33 -0700)
commitb3c0a866f1692da2d1059dadd9c429ff5b364fc9
tree84442e9b18df0a2c6900aa3395800a095eecdea8
parentc086de818dd81c3c2f7cecff23de6585b74340c0
vfio: Introduce common function to add capabilities

Vendor driver using mediated device framework should use
vfio_info_add_capability() to add capabilities.
Introduced this function to reduce code duplication in vendor drivers.

vfio_info_cap_shift() manipulated a data buffer to add an offset to each
element in a chain. This data buffer is documented in a uapi header.
Changing vfio_info_cap_shift symbol to be available to all drivers.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Neo Jia <cjia@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c
include/linux/vfio.h