Merge tag 'sunxi-fixes-for-4.8' of https://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / s390 / cio / chsc.h
CommitLineData
1da177e4
LT
1#ifndef S390_CHSC_H
2#define S390_CHSC_H
3
f86635fa
PO
4#include <linux/types.h>
5#include <linux/device.h>
382b7366 6#include <asm/css_chars.h>
e5854a58 7#include <asm/chpid.h>
9d92a7e1
CH
8#include <asm/chsc.h>
9#include <asm/schid.h>
da5b6cb1 10#include <asm/qdio.h>
f86635fa 11
fb6958a5
CH
12#define CHSC_SDA_OC_MSS 0x2
13
495a5b45
CH
14#define NR_MEASUREMENT_CHARS 5
15struct cmg_chars {
16 u32 values[NR_MEASUREMENT_CHARS];
0f008aa3 17} __attribute__ ((packed));
495a5b45
CH
18
19#define NR_MEASUREMENT_ENTRIES 8
20struct cmg_entry {
21 u32 values[NR_MEASUREMENT_ENTRIES];
0f008aa3 22} __attribute__ ((packed));
495a5b45 23
ce322ccd
SO
24struct channel_path_desc_fmt1 {
25 u8 flags;
26 u8 lsn;
27 u8 desc;
28 u8 chpid;
29 u32:24;
30 u8 chpp;
ba54229d
PO
31 u32 unused[2];
32 u16 chid;
33 u32:16;
ce322ccd
SO
34 u16 mdc;
35 u16:13;
36 u8 r:1;
37 u8 s:1;
38 u8 f:1;
39 u32 zeros[2];
40} __attribute__ ((packed));
41
e6b6e10a 42struct channel_path;
1da177e4 43
1da177e4
LT
44struct css_chsc_char {
45 u64 res;
495a5b45
CH
46 u64 : 20;
47 u32 secm : 1; /* bit 84 */
48 u32 : 1;
49 u32 scmc : 1; /* bit 86 */
50 u32 : 20;
1da177e4
LT
51 u32 scssc : 1; /* bit 107 */
52 u32 scsscf : 1; /* bit 108 */
1c59a861
EC
53 u32:7;
54 u32 pnso:1; /* bit 116 */
55 u32:11;
1da177e4
LT
56}__attribute__((packed));
57
1da177e4
LT
58extern struct css_chsc_char css_chsc_characteristics;
59
7ad6a249
PO
60struct chsc_ssd_info {
61 u8 path_mask;
62 u8 fla_valid_mask;
63 struct chp_id chpid[8];
64 u16 fla[8];
65};
906c9768 66
da5b6cb1
SO
67struct chsc_ssqd_area {
68 struct chsc_header request;
69 u16:10;
70 u8 ssid:2;
71 u8 fmt:4;
72 u16 first_sch;
73 u16:16;
74 u16 last_sch;
75 u32:32;
76 struct chsc_header response;
77 u32:32;
78 struct qdio_ssqd_desc qdio_ssqd;
79} __packed;
80
ca4ba153
SO
81struct chsc_scssc_area {
82 struct chsc_header request;
83 u16 operation_code;
84 u16:16;
85 u32:32;
86 u32:32;
87 u64 summary_indicator_addr;
88 u64 subchannel_indicator_addr;
89 u32 ks:4;
90 u32 kc:4;
91 u32:21;
92 u32 isc:3;
93 u32 word_with_d_bit;
94 u32:32;
95 struct subchannel_id schid;
96 u32 reserved[1004];
97 struct chsc_header response;
98 u32:32;
99} __packed;
100
906c9768
SO
101struct chsc_scpd {
102 struct chsc_header request;
103 u32:2;
104 u32 m:1;
105 u32 c:1;
106 u32 fmt:4;
107 u32 cssid:8;
108 u32:4;
109 u32 rfmt:4;
110 u32 first_chpid:8;
111 u32:24;
112 u32 last_chpid:8;
113 u32 zeroes1;
114 struct chsc_header response;
687cb7f2
SO
115 u32:32;
116 u8 data[0];
117} __packed;
906c9768 118
18e22a17
SO
119struct chsc_sda_area {
120 struct chsc_header request;
121 u8 :4;
122 u8 format:4;
123 u8 :8;
124 u16 operation_code;
125 u32 :32;
126 u32 :32;
127 u32 operation_data_area[252];
128 struct chsc_header response;
129 u32 :4;
130 u32 format2:4;
131 u32 :24;
132} __packed __aligned(PAGE_SIZE);
906c9768 133
7ad6a249
PO
134extern int chsc_get_ssd_info(struct subchannel_id schid,
135 struct chsc_ssd_info *ssd);
1da177e4 136extern int chsc_determine_css_characteristics(void);
34aec07c
SO
137extern int chsc_init(void);
138extern void chsc_init_cleanup(void);
1da177e4 139
18e22a17 140int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code);
fb6958a5 141extern int chsc_enable_facility(int);
495a5b45
CH
142struct channel_subsystem;
143extern int chsc_secm(struct channel_subsystem *, int);
34196f82 144int __chsc_do_secm(struct channel_subsystem *css, int enable);
fb6958a5 145
e6b6e10a 146int chsc_chp_vary(struct chp_id chpid, int on);
9d92a7e1 147int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
906c9768 148 int c, int m, void *page);
9d92a7e1
CH
149int chsc_determine_base_channel_path_desc(struct chp_id chpid,
150 struct channel_path_desc *desc);
ce322ccd
SO
151int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
152 struct channel_path_desc_fmt1 *desc);
83b3370c 153void chsc_chp_online(struct chp_id chpid);
e6b6e10a
PO
154void chsc_chp_offline(struct chp_id chpid);
155int chsc_get_channel_measurement_chars(struct channel_path *chp);
da5b6cb1 156int chsc_ssqd(struct subchannel_id schid, struct chsc_ssqd_area *ssqd);
ca4ba153
SO
157int chsc_sadc(struct subchannel_id schid, struct chsc_scssc_area *scssc,
158 u64 summary_indicator_addr, u64 subchannel_indicator_addr);
dae39843
CH
159int chsc_error_from_response(int response);
160
fd0457a6
ME
161int chsc_siosl(struct subchannel_id schid);
162
184b08af
SO
163/* Functions and definitions to query storage-class memory. */
164struct sale {
165 u64 sa;
166 u32 p:4;
167 u32 op_state:4;
168 u32 data_state:4;
169 u32 rank:4;
170 u32 r:1;
171 u32:7;
172 u32 rid:8;
173 u32:32;
174} __packed;
175
176struct chsc_scm_info {
177 struct chsc_header request;
178 u32:32;
179 u64 reqtok;
180 u32 reserved1[4];
181 struct chsc_header response;
182 u64:56;
183 u8 rq;
184 u32 mbc;
185 u64 msa;
186 u16 is;
187 u16 mmc;
188 u32 mci;
189 u64 nr_scm_ini;
190 u64 nr_scm_unini;
191 u32 reserved2[10];
192 u64 restok;
193 struct sale scmal[248];
194} __packed;
195
196int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token);
197
1c59a861
EC
198struct chsc_brinfo_resume_token {
199 u64 t1;
200 u64 t2;
201} __packed;
202
203struct chsc_brinfo_naihdr {
204 struct chsc_brinfo_resume_token resume_token;
205 u32:32;
206 u32 instance;
207 u32:24;
208 u8 naids;
209 u32 reserved[3];
210} __packed;
211
212struct chsc_pnso_area {
213 struct chsc_header request;
214 u8:2;
215 u8 m:1;
216 u8:5;
217 u8:2;
218 u8 ssid:2;
219 u8 fmt:4;
220 u16 sch;
221 u8:8;
222 u8 cssid;
223 u16:16;
224 u8 oc;
225 u32:24;
226 struct chsc_brinfo_resume_token resume_token;
227 u32 n:1;
228 u32:31;
229 u32 reserved[3];
230 struct chsc_header response;
231 u32:32;
232 struct chsc_brinfo_naihdr naihdr;
233 union {
234 struct qdio_brinfo_entry_l3_ipv6 l3_ipv6[0];
235 struct qdio_brinfo_entry_l3_ipv4 l3_ipv4[0];
236 struct qdio_brinfo_entry_l2 l2[0];
237 } entries;
238} __packed;
239
240int chsc_pnso_brinfo(struct subchannel_id schid,
241 struct chsc_pnso_area *brinfo_area,
242 struct chsc_brinfo_resume_token resume_token,
243 int cnc);
244
40ff4cc0
SO
245#ifdef CONFIG_SCM_BUS
246int scm_update_information(void);
aebfa669 247int scm_process_availability_information(void);
40ff4cc0 248#else /* CONFIG_SCM_BUS */
58fece78 249static inline int scm_update_information(void) { return 0; }
aebfa669 250static inline int scm_process_availability_information(void) { return 0; }
40ff4cc0
SO
251#endif /* CONFIG_SCM_BUS */
252
253
1da177e4 254#endif
This page took 1.628662 seconds and 5 git commands to generate.