xref: /linux/arch/s390/include/uapi/asm/cmb.h (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
29807f759SDavid Howells #ifndef _UAPIS390_CMB_H
39807f759SDavid Howells #define _UAPIS390_CMB_H
49807f759SDavid Howells 
59807f759SDavid Howells #include <linux/types.h>
69807f759SDavid Howells 
79807f759SDavid Howells /**
89807f759SDavid Howells  * struct cmbdata - channel measurement block data for user space
99807f759SDavid Howells  * @size: size of the stored data
109807f759SDavid Howells  * @elapsed_time: time since last sampling
119807f759SDavid Howells  * @ssch_rsch_count: number of ssch and rsch
129807f759SDavid Howells  * @sample_count: number of samples
139807f759SDavid Howells  * @device_connect_time: time of device connect
149807f759SDavid Howells  * @function_pending_time: time of function pending
159807f759SDavid Howells  * @device_disconnect_time: time of device disconnect
169807f759SDavid Howells  * @control_unit_queuing_time: time of control unit queuing
179807f759SDavid Howells  * @device_active_only_time: time of device active only
189807f759SDavid Howells  * @device_busy_time: time of device busy (ext. format)
199807f759SDavid Howells  * @initial_command_response_time: initial command response time (ext. format)
209807f759SDavid Howells  *
219807f759SDavid Howells  * All values are stored as 64 bit for simplicity, especially
229807f759SDavid Howells  * in 32 bit emulation mode. All time values are normalized to
239807f759SDavid Howells  * nanoseconds.
249807f759SDavid Howells  * Currently, two formats are known, which differ by the size of
259807f759SDavid Howells  * this structure, i.e. the last two members are only set when
269807f759SDavid Howells  * the extended channel measurement facility (first shipped in
279807f759SDavid Howells  * z990 machines) is activated.
289807f759SDavid Howells  * Potentially, more fields could be added, which would result in a
299807f759SDavid Howells  * new ioctl number.
309807f759SDavid Howells  */
319807f759SDavid Howells struct cmbdata {
329807f759SDavid Howells 	__u64 size;
339807f759SDavid Howells 	__u64 elapsed_time;
34*cada938aSHeiko Carstens  /* basic and extended format: */
359807f759SDavid Howells 	__u64 ssch_rsch_count;
369807f759SDavid Howells 	__u64 sample_count;
379807f759SDavid Howells 	__u64 device_connect_time;
389807f759SDavid Howells 	__u64 function_pending_time;
399807f759SDavid Howells 	__u64 device_disconnect_time;
409807f759SDavid Howells 	__u64 control_unit_queuing_time;
419807f759SDavid Howells 	__u64 device_active_only_time;
429807f759SDavid Howells  /* extended format only: */
439807f759SDavid Howells 	__u64 device_busy_time;
449807f759SDavid Howells 	__u64 initial_command_response_time;
459807f759SDavid Howells };
469807f759SDavid Howells 
479807f759SDavid Howells /* enable channel measurement */
489807f759SDavid Howells #define BIODASDCMFENABLE	_IO(DASD_IOCTL_LETTER, 32)
499807f759SDavid Howells /* enable channel measurement */
509807f759SDavid Howells #define BIODASDCMFDISABLE	_IO(DASD_IOCTL_LETTER, 33)
519807f759SDavid Howells /* read channel measurement data */
529807f759SDavid Howells #define BIODASDREADALLCMB	_IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata)
539807f759SDavid Howells 
549807f759SDavid Howells #endif /* _UAPIS390_CMB_H */
55