vfio/mdev: Correct the function signatures for the mdev_type_attributes
[linux-2.6-microblaze.git] / include / linux / mdev.h
index cb771c7..1fb34ea 100644 (file)
 #ifndef MDEV_H
 #define MDEV_H
 
+struct mdev_type;
+
 struct mdev_device {
        struct device dev;
-       struct mdev_parent *parent;
        guid_t uuid;
        void *driver_data;
        struct list_head next;
-       struct kobject *type_kobj;
+       struct mdev_type *type;
        struct device *iommu_device;
        bool active;
 };
@@ -45,6 +46,10 @@ static inline struct device *mdev_get_iommu_device(struct mdev_device *mdev)
        return mdev->iommu_device;
 }
 
+unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
+unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
+struct device *mtype_get_parent_dev(struct mdev_type *mtype);
+
 /**
  * struct mdev_parent_ops - Structure to be registered for each parent device to
  * register the device to mdev module.
@@ -57,7 +62,6 @@ static inline struct device *mdev_get_iommu_device(struct mdev_device *mdev)
  * @create:            Called to allocate basic resources in parent device's
  *                     driver for a particular mediated device. It is
  *                     mandatory to provide create ops.
- *                     @kobj: kobject of type for which 'create' is called.
  *                     @mdev: mdev_device structure on of mediated device
  *                           that is being created
  *                     Returns integer: success (0) or error (< 0)
@@ -103,7 +107,7 @@ struct mdev_parent_ops {
        const struct attribute_group **mdev_attr_groups;
        struct attribute_group **supported_type_groups;
 
-       int     (*create)(struct kobject *kobj, struct mdev_device *mdev);
+       int     (*create)(struct mdev_device *mdev);
        int     (*remove)(struct mdev_device *mdev);
        int     (*open)(struct mdev_device *mdev);
        void    (*release)(struct mdev_device *mdev);
@@ -120,9 +124,11 @@ struct mdev_parent_ops {
 /* interface for exporting mdev supported type attributes */
 struct mdev_type_attribute {
        struct attribute attr;
-       ssize_t (*show)(struct kobject *kobj, struct device *dev, char *buf);
-       ssize_t (*store)(struct kobject *kobj, struct device *dev,
-                        const char *buf, size_t count);
+       ssize_t (*show)(struct mdev_type *mtype,
+                       struct mdev_type_attribute *attr, char *buf);
+       ssize_t (*store)(struct mdev_type *mtype,
+                        struct mdev_type_attribute *attr, const char *buf,
+                        size_t count);
 };
 
 #define MDEV_TYPE_ATTR(_name, _mode, _show, _store)            \