chsc.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef S390_CHSC_H
  2. #define S390_CHSC_H
  3. #include <linux/types.h>
  4. #include <linux/device.h>
  5. #include <asm/chpid.h>
  6. #include <asm/chsc.h>
  7. #include <asm/schid.h>
  8. #define CHSC_SDA_OC_MSS 0x2
  9. struct chsc_header {
  10. u16 length;
  11. u16 code;
  12. } __attribute__ ((packed));
  13. #define NR_MEASUREMENT_CHARS 5
  14. struct cmg_chars {
  15. u32 values[NR_MEASUREMENT_CHARS];
  16. } __attribute__ ((packed));
  17. #define NR_MEASUREMENT_ENTRIES 8
  18. struct cmg_entry {
  19. u32 values[NR_MEASUREMENT_ENTRIES];
  20. } __attribute__ ((packed));
  21. struct channel_path_desc {
  22. u8 flags;
  23. u8 lsn;
  24. u8 desc;
  25. u8 chpid;
  26. u8 swla;
  27. u8 zeroes;
  28. u8 chla;
  29. u8 chpp;
  30. } __attribute__ ((packed));
  31. struct channel_path_desc_fmt1 {
  32. u8 flags;
  33. u8 lsn;
  34. u8 desc;
  35. u8 chpid;
  36. u32:24;
  37. u8 chpp;
  38. u32 unused[3];
  39. u16 mdc;
  40. u16:13;
  41. u8 r:1;
  42. u8 s:1;
  43. u8 f:1;
  44. u32 zeros[2];
  45. } __attribute__ ((packed));
  46. struct channel_path;
  47. struct css_chsc_char {
  48. u64 res;
  49. u64 : 20;
  50. u32 secm : 1; /* bit 84 */
  51. u32 : 1;
  52. u32 scmc : 1; /* bit 86 */
  53. u32 : 20;
  54. u32 scssc : 1; /* bit 107 */
  55. u32 scsscf : 1; /* bit 108 */
  56. u32 : 19;
  57. }__attribute__((packed));
  58. extern struct css_chsc_char css_chsc_characteristics;
  59. struct chsc_ssd_info {
  60. u8 path_mask;
  61. u8 fla_valid_mask;
  62. struct chp_id chpid[8];
  63. u16 fla[8];
  64. };
  65. struct chsc_scpd {
  66. struct chsc_header request;
  67. u32:2;
  68. u32 m:1;
  69. u32 c:1;
  70. u32 fmt:4;
  71. u32 cssid:8;
  72. u32:4;
  73. u32 rfmt:4;
  74. u32 first_chpid:8;
  75. u32:24;
  76. u32 last_chpid:8;
  77. u32 zeroes1;
  78. struct chsc_header response;
  79. u8 data[PAGE_SIZE - 20];
  80. } __attribute__ ((packed));
  81. extern int chsc_get_ssd_info(struct subchannel_id schid,
  82. struct chsc_ssd_info *ssd);
  83. extern int chsc_determine_css_characteristics(void);
  84. extern int chsc_init(void);
  85. extern void chsc_init_cleanup(void);
  86. extern int chsc_enable_facility(int);
  87. struct channel_subsystem;
  88. extern int chsc_secm(struct channel_subsystem *, int);
  89. int __chsc_do_secm(struct channel_subsystem *css, int enable);
  90. int chsc_chp_vary(struct chp_id chpid, int on);
  91. int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
  92. int c, int m, void *page);
  93. int chsc_determine_base_channel_path_desc(struct chp_id chpid,
  94. struct channel_path_desc *desc);
  95. int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
  96. struct channel_path_desc_fmt1 *desc);
  97. void chsc_chp_online(struct chp_id chpid);
  98. void chsc_chp_offline(struct chp_id chpid);
  99. int chsc_get_channel_measurement_chars(struct channel_path *chp);
  100. int chsc_error_from_response(int response);
  101. int chsc_siosl(struct subchannel_id schid);
  102. #endif