diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 18:13:44 +0300 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 18:13:44 +0300 |
commit | 99e3123e3d72616a829dad6d25aa005ef1ef9b13 (patch) | |
tree | 691b36439a737eb0679e3544e3401335d7efda4e /drivers/vfio/mdev/mdev_private.h | |
parent | 9372e6feaafb65d88f667ffb5b7b425f8568344f (diff) | |
download | linux-99e3123e3d72616a829dad6d25aa005ef1ef9b13.tar.xz |
vfio-mdev: Make mdev_device private and abstract interfaces
Abstract access to mdev_device so that we can define which interfaces
are public rather than relying on comments in the structure.
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Jike Song <jike.song@intel.com>
Reviewed by: Kirti Wankhede <kwankhede@nvidia.com>
Diffstat (limited to 'drivers/vfio/mdev/mdev_private.h')
-rw-r--r-- | drivers/vfio/mdev/mdev_private.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h index b05dd22fc9a6..a9cefd70a705 100644 --- a/drivers/vfio/mdev/mdev_private.h +++ b/drivers/vfio/mdev/mdev_private.h @@ -26,6 +26,19 @@ struct mdev_parent { struct list_head type_list; }; +struct mdev_device { + struct device dev; + struct mdev_parent *parent; + uuid_le uuid; + void *driver_data; + struct kref ref; + struct list_head next; + struct kobject *type_kobj; +}; + +#define to_mdev_device(dev) container_of(dev, struct mdev_device, dev) +#define dev_is_mdev(d) ((d)->bus == &mdev_bus_type) + struct mdev_type { struct kobject kobj; struct kobject *devices_kobj; |