blob: 925b3ddfa1411419a39316a0053a786826cf4260 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef S390_CCWGROUP_H
2#define S390_CCWGROUP_H
3
4struct ccw_device;
5struct ccw_driver;
6
7struct ccwgroup_device {
8 unsigned long creator_id; /* unique number of the driver */
9 enum {
10 CCWGROUP_OFFLINE,
11 CCWGROUP_ONLINE,
12 } state;
13 atomic_t onoff;
Cornelia Huckd76123e2007-04-27 16:01:37 +020014 struct mutex reg_mutex;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 unsigned int count; /* number of attached slave devices */
16 struct device dev; /* master device */
17 struct ccw_device *cdev[0]; /* variable number, allocate as needed */
18};
19
20struct ccwgroup_driver {
21 struct module *owner;
22 char *name;
23 int max_slaves;
24 unsigned long driver_id;
25
26 int (*probe) (struct ccwgroup_device *);
27 void (*remove) (struct ccwgroup_device *);
28 int (*set_online) (struct ccwgroup_device *);
29 int (*set_offline) (struct ccwgroup_device *);
30
31 struct device_driver driver; /* this driver */
32};
33
34extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
35extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver);
36extern int ccwgroup_create (struct device *root,
37 unsigned int creator_id,
38 struct ccw_driver *gdrv,
39 int argc, char *argv[]);
40
41extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
42extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);
43
44#define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)
45#define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)
46#endif