chsc.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * ioctl interface for /dev/chsc
  3. *
  4. * Copyright IBM Corp. 2008, 2012
  5. * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
  6. */
  7. #ifndef _ASM_CHSC_H
  8. #define _ASM_CHSC_H
  9. #include <linux/types.h>
  10. #include <linux/ioctl.h>
  11. #include <asm/chpid.h>
  12. #include <asm/schid.h>
  13. #define CHSC_SIZE 0x1000
  14. struct chsc_async_header {
  15. __u16 length;
  16. __u16 code;
  17. __u32 cmd_dependend;
  18. __u32 key : 4;
  19. __u32 : 28;
  20. struct subchannel_id sid;
  21. } __attribute__ ((packed));
  22. struct chsc_async_area {
  23. struct chsc_async_header header;
  24. __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
  25. } __attribute__ ((packed));
  26. struct chsc_header {
  27. __u16 length;
  28. __u16 code;
  29. } __attribute__ ((packed));
  30. struct chsc_sync_area {
  31. struct chsc_header header;
  32. __u8 data[CHSC_SIZE - sizeof(struct chsc_header)];
  33. } __attribute__ ((packed));
  34. struct chsc_response_struct {
  35. __u16 length;
  36. __u16 code;
  37. __u32 parms;
  38. __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)];
  39. } __attribute__ ((packed));
  40. struct chsc_chp_cd {
  41. struct chp_id chpid;
  42. int m;
  43. int fmt;
  44. struct chsc_response_struct cpcb;
  45. };
  46. struct chsc_cu_cd {
  47. __u16 cun;
  48. __u8 cssid;
  49. int m;
  50. int fmt;
  51. struct chsc_response_struct cucb;
  52. };
  53. struct chsc_sch_cud {
  54. struct subchannel_id schid;
  55. int fmt;
  56. struct chsc_response_struct scub;
  57. };
  58. struct conf_id {
  59. int m;
  60. __u8 cssid;
  61. __u8 ssid;
  62. };
  63. struct chsc_conf_info {
  64. struct conf_id id;
  65. int fmt;
  66. struct chsc_response_struct scid;
  67. };
  68. struct ccl_parm_chpid {
  69. int m;
  70. struct chp_id chp;
  71. };
  72. struct ccl_parm_cssids {
  73. __u8 f_cssid;
  74. __u8 l_cssid;
  75. };
  76. struct chsc_comp_list {
  77. struct {
  78. enum {
  79. CCL_CU_ON_CHP = 1,
  80. CCL_CHP_TYPE_CAP = 2,
  81. CCL_CSS_IMG = 4,
  82. CCL_CSS_IMG_CONF_CHAR = 5,
  83. CCL_IOP_CHP = 6,
  84. } ctype;
  85. int fmt;
  86. struct ccl_parm_chpid chpid;
  87. struct ccl_parm_cssids cssids;
  88. } req;
  89. struct chsc_response_struct sccl;
  90. };
  91. struct chsc_dcal {
  92. struct {
  93. enum {
  94. DCAL_CSS_IID_PN = 4,
  95. } atype;
  96. __u32 list_parm[2];
  97. int fmt;
  98. } req;
  99. struct chsc_response_struct sdcal;
  100. };
  101. struct chsc_cpd_info {
  102. struct chp_id chpid;
  103. int m;
  104. int fmt;
  105. int rfmt;
  106. int c;
  107. struct chsc_response_struct chpdb;
  108. };
  109. #define CHSC_IOCTL_MAGIC 'c'
  110. #define CHSC_START _IOWR(CHSC_IOCTL_MAGIC, 0x81, struct chsc_async_area)
  111. #define CHSC_INFO_CHANNEL_PATH _IOWR(CHSC_IOCTL_MAGIC, 0x82, \
  112. struct chsc_chp_cd)
  113. #define CHSC_INFO_CU _IOWR(CHSC_IOCTL_MAGIC, 0x83, struct chsc_cu_cd)
  114. #define CHSC_INFO_SCH_CU _IOWR(CHSC_IOCTL_MAGIC, 0x84, struct chsc_sch_cud)
  115. #define CHSC_INFO_CI _IOWR(CHSC_IOCTL_MAGIC, 0x85, struct chsc_conf_info)
  116. #define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
  117. #define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
  118. #define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
  119. #define CHSC_START_SYNC _IOWR(CHSC_IOCTL_MAGIC, 0x89, struct chsc_sync_area)
  120. #define CHSC_ON_CLOSE_SET _IOWR(CHSC_IOCTL_MAGIC, 0x8a, struct chsc_async_area)
  121. #define CHSC_ON_CLOSE_REMOVE _IO(CHSC_IOCTL_MAGIC, 0x8b)
  122. #endif