1 #ifndef S390_CCWGROUP_H
2 #define S390_CCWGROUP_H
8 * struct ccwgroup_device - ccw group device
9 * @creator_id: unique number of the driver
10 * @state: online/offline state
11 * @count: number of attached slave devices
12 * @dev: embedded device structure
13 * @cdev: variable number of slave devices, allocated as needed
15 struct ccwgroup_device
{
16 unsigned long creator_id
;
23 struct mutex reg_mutex
;
27 struct ccw_device
*cdev
[0];
31 * struct ccwgroup_driver - driver for ccw group devices
32 * @owner: driver owner
34 * @max_slaves: maximum number of slave devices
35 * @driver_id: unique id
36 * @probe: function called on probe
37 * @remove: function called on remove
38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline
40 * @shutdown: function called when device is shut down
41 * @prepare: prepare for pm state transition
42 * @complete: undo work done in @prepare
43 * @freeze: callback for freezing during hibernation snapshotting
44 * @thaw: undo work done in @freeze
45 * @restore: callback for restoring after hibernation
46 * @driver: embedded driver structure
48 struct ccwgroup_driver
{
52 unsigned long driver_id
;
54 int (*probe
) (struct ccwgroup_device
*);
55 void (*remove
) (struct ccwgroup_device
*);
56 int (*set_online
) (struct ccwgroup_device
*);
57 int (*set_offline
) (struct ccwgroup_device
*);
58 void (*shutdown
)(struct ccwgroup_device
*);
59 int (*prepare
) (struct ccwgroup_device
*);
60 void (*complete
) (struct ccwgroup_device
*);
61 int (*freeze
)(struct ccwgroup_device
*);
62 int (*thaw
) (struct ccwgroup_device
*);
63 int (*restore
)(struct ccwgroup_device
*);
65 struct device_driver driver
;
68 extern int ccwgroup_driver_register (struct ccwgroup_driver
*cdriver
);
69 extern void ccwgroup_driver_unregister (struct ccwgroup_driver
*cdriver
);
70 int ccwgroup_create_from_string(struct device
*root
, unsigned int creator_id
,
71 struct ccw_driver
*cdrv
, int num_devices
,
74 extern int ccwgroup_probe_ccwdev(struct ccw_device
*cdev
);
75 extern void ccwgroup_remove_ccwdev(struct ccw_device
*cdev
);
77 #define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)
78 #define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)