Path: blob/master/arch/s390/include/asm/ccwgroup.h
10819 views
#ifndef S390_CCWGROUP_H1#define S390_CCWGROUP_H23struct ccw_device;4struct ccw_driver;56/**7* struct ccwgroup_device - ccw group device8* @creator_id: unique number of the driver9* @state: online/offline state10* @count: number of attached slave devices11* @dev: embedded device structure12* @cdev: variable number of slave devices, allocated as needed13*/14struct ccwgroup_device {15unsigned long creator_id;16enum {17CCWGROUP_OFFLINE,18CCWGROUP_ONLINE,19} state;20/* private: */21atomic_t onoff;22struct mutex reg_mutex;23/* public: */24unsigned int count;25struct device dev;26struct ccw_device *cdev[0];27};2829/**30* struct ccwgroup_driver - driver for ccw group devices31* @max_slaves: maximum number of slave devices32* @driver_id: unique id33* @probe: function called on probe34* @remove: function called on remove35* @set_online: function called when device is set online36* @set_offline: function called when device is set offline37* @shutdown: function called when device is shut down38* @prepare: prepare for pm state transition39* @complete: undo work done in @prepare40* @freeze: callback for freezing during hibernation snapshotting41* @thaw: undo work done in @freeze42* @restore: callback for restoring after hibernation43* @driver: embedded driver structure44*/45struct ccwgroup_driver {46int max_slaves;47unsigned long driver_id;4849int (*probe) (struct ccwgroup_device *);50void (*remove) (struct ccwgroup_device *);51int (*set_online) (struct ccwgroup_device *);52int (*set_offline) (struct ccwgroup_device *);53void (*shutdown)(struct ccwgroup_device *);54int (*prepare) (struct ccwgroup_device *);55void (*complete) (struct ccwgroup_device *);56int (*freeze)(struct ccwgroup_device *);57int (*thaw) (struct ccwgroup_device *);58int (*restore)(struct ccwgroup_device *);5960struct device_driver driver;61};6263extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);64extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver);65int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,66struct ccw_driver *cdrv, int num_devices,67const char *buf);6869extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);70extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);7172#define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)73#define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)74#endif757677