2 * Mediated device interal definitions
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 * Author: Neo Jia <cjia@nvidia.com>
6 * Kirti Wankhede <kwankhede@nvidia.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #ifndef MDEV_PRIVATE_H
14 #define MDEV_PRIVATE_H
16 int mdev_bus_register(void);
17 void mdev_bus_unregister(void);
21 const struct mdev_parent_ops
*ops
;
24 struct list_head next
;
25 struct kset
*mdev_types_kset
;
26 struct list_head type_list
;
31 struct mdev_parent
*parent
;
35 struct list_head next
;
36 struct kobject
*type_kobj
;
39 #define to_mdev_device(dev) container_of(dev, struct mdev_device, dev)
40 #define dev_is_mdev(d) ((d)->bus == &mdev_bus_type)
44 struct kobject
*devices_kobj
;
45 struct mdev_parent
*parent
;
46 struct list_head next
;
47 struct attribute_group
*group
;
50 #define to_mdev_type_attr(_attr) \
51 container_of(_attr, struct mdev_type_attribute, attr)
52 #define to_mdev_type(_kobj) \
53 container_of(_kobj, struct mdev_type, kobj)
55 int parent_create_sysfs_files(struct mdev_parent
*parent
);
56 void parent_remove_sysfs_files(struct mdev_parent
*parent
);
58 int mdev_create_sysfs_files(struct device
*dev
, struct mdev_type
*type
);
59 void mdev_remove_sysfs_files(struct device
*dev
, struct mdev_type
*type
);
61 int mdev_device_create(struct kobject
*kobj
, struct device
*dev
, uuid_le uuid
);
62 int mdev_device_remove(struct device
*dev
, bool force_remove
);
64 #endif /* MDEV_PRIVATE_H */