This source file includes following definitions.
- dev_is_ccwgroup
1
2 #ifndef S390_CCWGROUP_H
3 #define S390_CCWGROUP_H
4
5 struct ccw_device;
6 struct ccw_driver;
7
8
9
10
11
12
13
14
15
16
17 struct ccwgroup_device {
18 enum {
19 CCWGROUP_OFFLINE,
20 CCWGROUP_ONLINE,
21 } state;
22
23 atomic_t onoff;
24 struct mutex reg_mutex;
25
26 unsigned int count;
27 struct device dev;
28 struct work_struct ungroup_work;
29 struct ccw_device *cdev[0];
30 };
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 struct ccwgroup_driver {
48 int (*setup) (struct ccwgroup_device *);
49 void (*remove) (struct ccwgroup_device *);
50 int (*set_online) (struct ccwgroup_device *);
51 int (*set_offline) (struct ccwgroup_device *);
52 void (*shutdown)(struct ccwgroup_device *);
53 int (*prepare) (struct ccwgroup_device *);
54 void (*complete) (struct ccwgroup_device *);
55 int (*freeze)(struct ccwgroup_device *);
56 int (*thaw) (struct ccwgroup_device *);
57 int (*restore)(struct ccwgroup_device *);
58
59 struct device_driver driver;
60 struct ccw_driver *ccw_driver;
61 };
62
63 extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
64 extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver);
65 int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv,
66 int num_devices, const char *buf);
67 struct ccwgroup_device *get_ccwgroupdev_by_busid(struct ccwgroup_driver *gdrv,
68 char *bus_id);
69
70 extern int ccwgroup_set_online(struct ccwgroup_device *gdev);
71 extern int ccwgroup_set_offline(struct ccwgroup_device *gdev);
72
73 extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
74 extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);
75
76 #define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)
77 #define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)
78
79 #if IS_ENABLED(CONFIG_CCWGROUP)
80 bool dev_is_ccwgroup(struct device *dev);
81 #else
82 static inline bool dev_is_ccwgroup(struct device *dev)
83 {
84 return false;
85 }
86 #endif
87
88 #endif