chsc.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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;
  32. struct css_general_char {
  33. u64 : 12;
  34. u32 dynio : 1; /* bit 12 */
  35. u32 : 28;
  36. u32 aif : 1; /* bit 41 */
  37. u32 : 3;
  38. u32 mcss : 1; /* bit 45 */
  39. u32 fcs : 1; /* bit 46 */
  40. u32 : 1;
  41. u32 ext_mb : 1; /* bit 48 */
  42. u32 : 7;
  43. u32 aif_tdd : 1; /* bit 56 */
  44. u32 : 1;
  45. u32 qebsm : 1; /* bit 58 */
  46. u32 : 8;
  47. u32 aif_osa : 1; /* bit 67 */
  48. u32 : 14;
  49. u32 cib : 1; /* bit 82 */
  50. u32 : 5;
  51. u32 fcx : 1; /* bit 88 */
  52. u32 : 7;
  53. }__attribute__((packed));
  54. struct css_chsc_char {
  55. u64 res;
  56. u64 : 20;
  57. u32 secm : 1; /* bit 84 */
  58. u32 : 1;
  59. u32 scmc : 1; /* bit 86 */
  60. u32 : 20;
  61. u32 scssc : 1; /* bit 107 */
  62. u32 scsscf : 1; /* bit 108 */
  63. u32 : 19;
  64. }__attribute__((packed));
  65. extern struct css_general_char css_general_characteristics;
  66. extern struct css_chsc_char css_chsc_characteristics;
  67. struct chsc_ssd_info {
  68. u8 path_mask;
  69. u8 fla_valid_mask;
  70. struct chp_id chpid[8];
  71. u16 fla[8];
  72. };
  73. extern int chsc_get_ssd_info(struct subchannel_id schid,
  74. struct chsc_ssd_info *ssd);
  75. extern int chsc_determine_css_characteristics(void);
  76. extern int chsc_alloc_sei_area(void);
  77. extern void chsc_free_sei_area(void);
  78. extern int chsc_enable_facility(int);
  79. struct channel_subsystem;
  80. extern int chsc_secm(struct channel_subsystem *, int);
  81. int chsc_chp_vary(struct chp_id chpid, int on);
  82. int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
  83. int c, int m,
  84. struct chsc_response_struct *resp);
  85. int chsc_determine_base_channel_path_desc(struct chp_id chpid,
  86. struct channel_path_desc *desc);
  87. void chsc_chp_online(struct chp_id chpid);
  88. void chsc_chp_offline(struct chp_id chpid);
  89. int chsc_get_channel_measurement_chars(struct channel_path *chp);
  90. int chsc_error_from_response(int response);
  91. #endif