cmb.h 2.1 KB

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