blob: d35097cbf3d755c027b7a98a8e6daed835754117 [file] [log] [blame]
Kirti Wankhede7b969532016-11-17 02:16:13 +05301/*
2 * Mediated device interal definitions
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 * Author: Neo Jia <cjia@nvidia.com>
6 * Kirti Wankhede <kwankhede@nvidia.com>
7 *
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.
11 */
12
13#ifndef MDEV_PRIVATE_H
14#define MDEV_PRIVATE_H
15
16int mdev_bus_register(void);
17void mdev_bus_unregister(void);
18
19struct mdev_type {
20 struct kobject kobj;
21 struct kobject *devices_kobj;
22 struct parent_device *parent;
23 struct list_head next;
24 struct attribute_group *group;
25};
26
27#define to_mdev_type_attr(_attr) \
28 container_of(_attr, struct mdev_type_attribute, attr)
29#define to_mdev_type(_kobj) \
30 container_of(_kobj, struct mdev_type, kobj)
31
32int parent_create_sysfs_files(struct parent_device *parent);
33void parent_remove_sysfs_files(struct parent_device *parent);
34
35int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type);
36void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type);
37
38int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid);
39int mdev_device_remove(struct device *dev, bool force_remove);
40
41#endif /* MDEV_PRIVATE_H */