Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef S390_CMB_H |
| 2 | #define S390_CMB_H |
Heiko Carstens | 0680ba0 | 2009-01-09 12:14:52 +0100 | [diff] [blame] | 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | /** |
Cornelia Huck | c020871 | 2007-10-12 16:11:16 +0200 | [diff] [blame] | 7 | * struct cmbdata - channel measurement block data for user space |
| 8 | * @size: size of the stored data |
| 9 | * @elapsed_time: time since last sampling |
| 10 | * @ssch_rsch_count: number of ssch and rsch |
| 11 | * @sample_count: number of samples |
| 12 | * @device_connect_time: time of device connect |
| 13 | * @function_pending_time: time of function pending |
| 14 | * @device_disconnect_time: time of device disconnect |
| 15 | * @control_unit_queuing_time: time of control unit queuing |
| 16 | * @device_active_only_time: time of device active only |
| 17 | * @device_busy_time: time of device busy (ext. format) |
| 18 | * @initial_command_response_time: initial command response time (ext. format) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | * |
Cornelia Huck | c020871 | 2007-10-12 16:11:16 +0200 | [diff] [blame] | 20 | * All values are stored as 64 bit for simplicity, especially |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | * in 32 bit emulation mode. All time values are normalized to |
| 22 | * nanoseconds. |
| 23 | * Currently, two formats are known, which differ by the size of |
| 24 | * this structure, i.e. the last two members are only set when |
| 25 | * the extended channel measurement facility (first shipped in |
| 26 | * z990 machines) is activated. |
Cornelia Huck | c020871 | 2007-10-12 16:11:16 +0200 | [diff] [blame] | 27 | * Potentially, more fields could be added, which would result in a |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | * new ioctl number. |
Cornelia Huck | c020871 | 2007-10-12 16:11:16 +0200 | [diff] [blame] | 29 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | struct cmbdata { |
| 31 | __u64 size; |
| 32 | __u64 elapsed_time; |
| 33 | /* basic and exended format: */ |
| 34 | __u64 ssch_rsch_count; |
| 35 | __u64 sample_count; |
| 36 | __u64 device_connect_time; |
| 37 | __u64 function_pending_time; |
| 38 | __u64 device_disconnect_time; |
| 39 | __u64 control_unit_queuing_time; |
| 40 | __u64 device_active_only_time; |
| 41 | /* extended format only: */ |
| 42 | __u64 device_busy_time; |
| 43 | __u64 initial_command_response_time; |
| 44 | }; |
| 45 | |
| 46 | /* enable channel measurement */ |
Cornelia Huck | fc5019c | 2007-10-12 16:11:15 +0200 | [diff] [blame] | 47 | #define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER, 32) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | /* enable channel measurement */ |
Cornelia Huck | fc5019c | 2007-10-12 16:11:15 +0200 | [diff] [blame] | 49 | #define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER, 33) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | /* read channel measurement data */ |
Cornelia Huck | fc5019c | 2007-10-12 16:11:15 +0200 | [diff] [blame] | 51 | #define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 53 | #ifdef __KERNEL__ |
Cornelia Huck | 4beb370 | 2005-05-01 08:58:59 -0700 | [diff] [blame] | 54 | struct ccw_device; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | extern int enable_cmf(struct ccw_device *cdev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | extern int disable_cmf(struct ccw_device *cdev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | extern u64 cmf_read(struct ccw_device *cdev, int index); |
Cornelia Huck | fc5019c | 2007-10-12 16:11:15 +0200 | [diff] [blame] | 58 | extern int cmf_readall(struct ccw_device *cdev, struct cmbdata *data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | #endif /* __KERNEL__ */ |
| 61 | #endif /* S390_CMB_H */ |