xref: /openbmc/linux/arch/s390/include/asm/chsc.h (revision b6dcefde)
1 /*
2  * ioctl interface for /dev/chsc
3  *
4  * Copyright 2008 IBM Corp.
5  * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6  */
7 
8 #ifndef _ASM_CHSC_H
9 #define _ASM_CHSC_H
10 
11 #include <linux/types.h>
12 #include <asm/chpid.h>
13 #include <asm/schid.h>
14 
15 struct chsc_async_header {
16 	__u16 length;
17 	__u16 code;
18 	__u32 cmd_dependend;
19 	__u32 key : 4;
20 	__u32 : 28;
21 	struct subchannel_id sid;
22 } __attribute__ ((packed));
23 
24 struct chsc_async_area {
25 	struct chsc_async_header header;
26 	__u8 data[PAGE_SIZE - 16 /* size of chsc_async_header */];
27 } __attribute__ ((packed));
28 
29 
30 struct chsc_response_struct {
31 	__u16 length;
32 	__u16 code;
33 	__u32 parms;
34 	__u8 data[PAGE_SIZE - 8];
35 } __attribute__ ((packed));
36 
37 struct chsc_chp_cd {
38 	struct chp_id chpid;
39 	int m;
40 	int fmt;
41 	struct chsc_response_struct cpcb;
42 };
43 
44 struct chsc_cu_cd {
45 	__u16 cun;
46 	__u8 cssid;
47 	int m;
48 	int fmt;
49 	struct chsc_response_struct cucb;
50 };
51 
52 struct chsc_sch_cud {
53 	struct subchannel_id schid;
54 	int fmt;
55 	struct chsc_response_struct scub;
56 };
57 
58 struct conf_id {
59 	int m;
60 	__u8 cssid;
61 	__u8 ssid;
62 };
63 
64 struct chsc_conf_info {
65 	struct conf_id id;
66 	int fmt;
67 	struct chsc_response_struct scid;
68 };
69 
70 struct ccl_parm_chpid {
71 	int m;
72 	struct chp_id chp;
73 };
74 
75 struct ccl_parm_cssids {
76 	__u8 f_cssid;
77 	__u8 l_cssid;
78 };
79 
80 struct chsc_comp_list {
81 	struct {
82 		enum {
83 			CCL_CU_ON_CHP = 1,
84 			CCL_CHP_TYPE_CAP = 2,
85 			CCL_CSS_IMG = 4,
86 			CCL_CSS_IMG_CONF_CHAR = 5,
87 			CCL_IOP_CHP = 6,
88 		} ctype;
89 		int fmt;
90 		struct ccl_parm_chpid chpid;
91 		struct ccl_parm_cssids cssids;
92 	} req;
93 	struct chsc_response_struct sccl;
94 };
95 
96 struct chsc_dcal {
97 	struct {
98 		enum {
99 			DCAL_CSS_IID_PN = 4,
100 		} atype;
101 		__u32 list_parm[2];
102 		int fmt;
103 	} req;
104 	struct chsc_response_struct sdcal;
105 };
106 
107 struct chsc_cpd_info {
108 	struct chp_id chpid;
109 	int m;
110 	int fmt;
111 	int rfmt;
112 	int c;
113 	struct chsc_response_struct chpdb;
114 };
115 
116 #define CHSC_IOCTL_MAGIC 'c'
117 
118 #define CHSC_START _IOWR(CHSC_IOCTL_MAGIC, 0x81, struct chsc_async_area)
119 #define CHSC_INFO_CHANNEL_PATH _IOWR(CHSC_IOCTL_MAGIC, 0x82, \
120 				    struct chsc_chp_cd)
121 #define CHSC_INFO_CU _IOWR(CHSC_IOCTL_MAGIC, 0x83, struct chsc_cu_cd)
122 #define CHSC_INFO_SCH_CU _IOWR(CHSC_IOCTL_MAGIC, 0x84, struct chsc_sch_cud)
123 #define CHSC_INFO_CI _IOWR(CHSC_IOCTL_MAGIC, 0x85, struct chsc_conf_info)
124 #define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
125 #define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
126 #define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
127 
128 #ifdef __KERNEL__
129 
130 struct css_general_char {
131 	u64 : 12;
132 	u32 dynio : 1;	 /* bit 12 */
133 	u32 : 28;
134 	u32 aif : 1;	 /* bit 41 */
135 	u32 : 3;
136 	u32 mcss : 1;	 /* bit 45 */
137 	u32 fcs : 1;	 /* bit 46 */
138 	u32 : 1;
139 	u32 ext_mb : 1;  /* bit 48 */
140 	u32 : 7;
141 	u32 aif_tdd : 1; /* bit 56 */
142 	u32 : 1;
143 	u32 qebsm : 1;	 /* bit 58 */
144 	u32 : 8;
145 	u32 aif_osa : 1; /* bit 67 */
146 	u32 : 14;
147 	u32 cib : 1;	 /* bit 82 */
148 	u32 : 5;
149 	u32 fcx : 1;	 /* bit 88 */
150 	u32 : 7;
151 }__attribute__((packed));
152 
153 extern struct css_general_char css_general_characteristics;
154 
155 #endif /* __KERNEL__ */
156 #endif
157