cmb.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #ifndef S390_CMB_H
  2. #define S390_CMB_H
  3. /**
  4. * struct cmbdata -- channel measurement block data for user space
  5. *
  6. * @size: size of the stored data
  7. * @ssch_rsch_count: XXX
  8. * @sample_count:
  9. * @device_connect_time:
  10. * @function_pending_time:
  11. * @device_disconnect_time:
  12. * @control_unit_queuing_time:
  13. * @device_active_only_time:
  14. * @device_busy_time:
  15. * @initial_command_response_time:
  16. *
  17. * all values are stored as 64 bit for simplicity, especially
  18. * in 32 bit emulation mode. All time values are normalized to
  19. * nanoseconds.
  20. * Currently, two formats are known, which differ by the size of
  21. * this structure, i.e. the last two members are only set when
  22. * the extended channel measurement facility (first shipped in
  23. * z990 machines) is activated.
  24. * Potentially, more fields could be added, which results in a
  25. * new ioctl number.
  26. **/
  27. struct cmbdata {
  28. __u64 size;
  29. __u64 elapsed_time;
  30. /* basic and exended format: */
  31. __u64 ssch_rsch_count;
  32. __u64 sample_count;
  33. __u64 device_connect_time;
  34. __u64 function_pending_time;
  35. __u64 device_disconnect_time;
  36. __u64 control_unit_queuing_time;
  37. __u64 device_active_only_time;
  38. /* extended format only: */
  39. __u64 device_busy_time;
  40. __u64 initial_command_response_time;
  41. };
  42. /* enable channel measurement */
  43. #define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32)
  44. /* enable channel measurement */
  45. #define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33)
  46. /* reset channel measurement block */
  47. #define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34)
  48. /* read channel measurement data */
  49. #define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,u64)
  50. /* read channel measurement data */
  51. #define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata)
  52. #ifdef __KERNEL__
  53. struct ccw_device;
  54. /**
  55. * enable_cmf() - switch on the channel measurement for a specific device
  56. * @cdev: The ccw device to be enabled
  57. * returns 0 for success or a negative error value.
  58. *
  59. * Context:
  60. * non-atomic
  61. **/
  62. extern int enable_cmf(struct ccw_device *cdev);
  63. /**
  64. * disable_cmf() - switch off the channel measurement for a specific device
  65. * @cdev: The ccw device to be disabled
  66. * returns 0 for success or a negative error value.
  67. *
  68. * Context:
  69. * non-atomic
  70. **/
  71. extern int disable_cmf(struct ccw_device *cdev);
  72. /**
  73. * cmf_read() - read one value from the current channel measurement block
  74. * @cmf: the channel to be read
  75. * @index: the name of the value that is read
  76. *
  77. * Context:
  78. * any
  79. **/
  80. extern u64 cmf_read(struct ccw_device *cdev, int index);
  81. /**
  82. * cmf_readall() - read one value from the current channel measurement block
  83. * @cmf: the channel to be read
  84. * @data: a pointer to a data block that will be filled
  85. *
  86. * Context:
  87. * any
  88. **/
  89. extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data);
  90. extern void cmf_reset(struct ccw_device *cdev);
  91. #endif /* __KERNEL__ */
  92. #endif /* S390_CMB_H */