aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mdev.h')
-rw-r--r--include/linux/mdev.h31
1 files changed, 6 insertions, 25 deletions
diff --git a/include/linux/mdev.h b/include/linux/mdev.h
index f586222b6c25..3ee44b8d2bb3 100644
--- a/include/linux/mdev.h
+++ b/include/linux/mdev.h
@@ -13,18 +13,7 @@
13#ifndef MDEV_H 13#ifndef MDEV_H
14#define MDEV_H 14#define MDEV_H
15 15
16/* Mediated device */ 16struct mdev_device;
17struct mdev_device {
18 struct device dev;
19 struct mdev_parent *parent;
20 uuid_le uuid;
21 void *driver_data;
22
23 /* internal */
24 struct kref ref;
25 struct list_head next;
26 struct kobject *type_kobj;
27};
28 17
29/** 18/**
30 * struct mdev_parent_ops - Structure to be registered for each parent device to 19 * struct mdev_parent_ops - Structure to be registered for each parent device to
@@ -75,7 +64,6 @@ struct mdev_device {
75 * Parent device that support mediated device should be registered with mdev 64 * Parent device that support mediated device should be registered with mdev
76 * module with mdev_parent_ops structure. 65 * module with mdev_parent_ops structure.
77 **/ 66 **/
78
79struct mdev_parent_ops { 67struct mdev_parent_ops {
80 struct module *owner; 68 struct module *owner;
81 const struct attribute_group **dev_attr_groups; 69 const struct attribute_group **dev_attr_groups;
@@ -129,22 +117,13 @@ struct mdev_driver {
129}; 117};
130 118
131#define to_mdev_driver(drv) container_of(drv, struct mdev_driver, driver) 119#define to_mdev_driver(drv) container_of(drv, struct mdev_driver, driver)
132#define to_mdev_device(dev) container_of(dev, struct mdev_device, dev)
133 120
134static inline void *mdev_get_drvdata(struct mdev_device *mdev) 121extern void *mdev_get_drvdata(struct mdev_device *mdev);
135{ 122extern void mdev_set_drvdata(struct mdev_device *mdev, void *data);
136 return mdev->driver_data; 123extern uuid_le mdev_uuid(struct mdev_device *mdev);
137}
138
139static inline void mdev_set_drvdata(struct mdev_device *mdev, void *data)
140{
141 mdev->driver_data = data;
142}
143 124
144extern struct bus_type mdev_bus_type; 125extern struct bus_type mdev_bus_type;
145 126
146#define dev_is_mdev(d) ((d)->bus == &mdev_bus_type)
147
148extern int mdev_register_device(struct device *dev, 127extern int mdev_register_device(struct device *dev,
149 const struct mdev_parent_ops *ops); 128 const struct mdev_parent_ops *ops);
150extern void mdev_unregister_device(struct device *dev); 129extern void mdev_unregister_device(struct device *dev);
@@ -153,5 +132,7 @@ extern int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
153extern void mdev_unregister_driver(struct mdev_driver *drv); 132extern void mdev_unregister_driver(struct mdev_driver *drv);
154 133
155extern struct device *mdev_parent_dev(struct mdev_device *mdev); 134extern struct device *mdev_parent_dev(struct mdev_device *mdev);
135extern struct device *mdev_dev(struct mdev_device *mdev);
136extern struct mdev_device *mdev_from_dev(struct device *dev);
156 137
157#endif /* MDEV_H */ 138#endif /* MDEV_H */