This source file includes following definitions.
- ccw_dev_id_is_equal
- pathmask_to_pos
1
2
3
4
5 #ifndef _ASM_S390_CIO_H_
6 #define _ASM_S390_CIO_H_
7
8 #include <linux/spinlock.h>
9 #include <linux/bitops.h>
10 #include <linux/genalloc.h>
11 #include <asm/types.h>
12
13 #define LPM_ANYPATH 0xff
14 #define __MAX_CSSID 0
15 #define __MAX_SUBCHANNEL 65535
16 #define __MAX_SSID 3
17
18 #include <asm/scsw.h>
19
20
21
22
23
24
25
26
27
28
29
30
31 struct ccw1 {
32 __u8 cmd_code;
33 __u8 flags;
34 __u16 count;
35 __u32 cda;
36 } __attribute__ ((packed,aligned(8)));
37
38
39
40
41
42
43
44
45
46
47
48 struct ccw0 {
49 __u8 cmd_code;
50 __u32 cda : 24;
51 __u8 flags;
52 __u8 reserved;
53 __u16 count;
54 } __packed __aligned(8);
55
56 #define CCW_FLAG_DC 0x80
57 #define CCW_FLAG_CC 0x40
58 #define CCW_FLAG_SLI 0x20
59 #define CCW_FLAG_SKIP 0x10
60 #define CCW_FLAG_PCI 0x08
61 #define CCW_FLAG_IDA 0x04
62 #define CCW_FLAG_SUSPEND 0x02
63
64 #define CCW_CMD_READ_IPL 0x02
65 #define CCW_CMD_NOOP 0x03
66 #define CCW_CMD_BASIC_SENSE 0x04
67 #define CCW_CMD_TIC 0x08
68 #define CCW_CMD_STLCK 0x14
69 #define CCW_CMD_SENSE_PGID 0x34
70 #define CCW_CMD_SUSPEND_RECONN 0x5B
71 #define CCW_CMD_RDC 0x64
72 #define CCW_CMD_RELEASE 0x94
73 #define CCW_CMD_SET_PGID 0xAF
74 #define CCW_CMD_SENSE_ID 0xE4
75 #define CCW_CMD_DCTL 0xF3
76
77 #define SENSE_MAX_COUNT 0x20
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92 struct erw {
93 __u32 res0 : 3;
94 __u32 auth : 1;
95 __u32 pvrf : 1;
96 __u32 cpt : 1;
97 __u32 fsavf : 1;
98 __u32 cons : 1;
99 __u32 scavf : 1;
100 __u32 fsaf : 1;
101 __u32 scnt : 6;
102 __u32 res16 : 16;
103 } __attribute__ ((packed));
104
105
106
107
108
109
110 struct erw_eadm {
111 __u32 : 16;
112 __u32 b : 1;
113 __u32 r : 1;
114 __u32 : 14;
115 } __packed;
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131 struct sublog {
132 __u32 res0 : 1;
133 __u32 esf : 7;
134 __u32 lpum : 8;
135 __u32 arep : 1;
136 __u32 fvf : 5;
137 __u32 sacc : 2;
138 __u32 termc : 2;
139 __u32 devsc : 1;
140 __u32 serr : 1;
141 __u32 ioerr : 1;
142 __u32 seqc : 3;
143 } __attribute__ ((packed));
144
145
146
147
148
149
150
151
152 struct esw0 {
153 struct sublog sublog;
154 struct erw erw;
155 __u32 faddr[2];
156 __u32 saddr;
157 } __attribute__ ((packed));
158
159
160
161
162
163
164
165
166
167 struct esw1 {
168 __u8 zero0;
169 __u8 lpum;
170 __u16 zero16;
171 struct erw erw;
172 __u32 zeros[3];
173 } __attribute__ ((packed));
174
175
176
177
178
179
180
181
182
183 struct esw2 {
184 __u8 zero0;
185 __u8 lpum;
186 __u16 dcti;
187 struct erw erw;
188 __u32 zeros[3];
189 } __attribute__ ((packed));
190
191
192
193
194
195
196
197
198
199 struct esw3 {
200 __u8 zero0;
201 __u8 lpum;
202 __u16 res;
203 struct erw erw;
204 __u32 zeros[3];
205 } __attribute__ ((packed));
206
207
208
209
210
211
212 struct esw_eadm {
213 __u32 sublog;
214 struct erw_eadm erw;
215 __u32 : 32;
216 __u32 : 32;
217 __u32 : 32;
218 } __packed;
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235 struct irb {
236 union scsw scsw;
237 union {
238 struct esw0 esw0;
239 struct esw1 esw1;
240 struct esw2 esw2;
241 struct esw3 esw3;
242 struct esw_eadm eadm;
243 } esw;
244 __u8 ecw[32];
245 } __attribute__ ((packed,aligned(4)));
246
247
248
249
250
251
252
253
254
255 struct ciw {
256 __u32 et : 2;
257 __u32 reserved : 2;
258 __u32 ct : 4;
259 __u32 cmd : 8;
260 __u32 count : 16;
261 } __attribute__ ((packed));
262
263 #define CIW_TYPE_RCD 0x0
264 #define CIW_TYPE_SII 0x1
265 #define CIW_TYPE_RNI 0x2
266
267
268
269
270
271 #define ND_VALIDITY_VALID 0
272 #define ND_VALIDITY_OUTDATED 1
273 #define ND_VALIDITY_INVALID 2
274
275 struct node_descriptor {
276
277 union {
278 struct {
279 u32 validity:3;
280 u32 reserved:5;
281 } __packed;
282 u8 byte0;
283 } __packed;
284
285
286 u32 params:24;
287
288
289 char type[6];
290 char model[3];
291 char manufacturer[3];
292 char plant[2];
293 char seq[12];
294 u16 tag;
295 } __packed;
296
297
298
299
300 #define DOIO_ALLOW_SUSPEND 0x0001
301 #define DOIO_DENY_PREFETCH 0x0002
302 #define DOIO_SUPPRESS_INTER 0x0004
303
304
305 #define CIO_GONE 0x0001
306
307 #define CIO_NO_PATH 0x0002
308
309 #define CIO_OPER 0x0004
310
311 #define CIO_REVALIDATE 0x0008
312
313 #define CIO_BOXED 0x0010
314
315
316
317
318
319
320
321
322
323
324
325
326 struct ccw_dev_id {
327 u8 ssid;
328 u16 devno;
329 };
330
331
332
333
334
335
336
337
338
339
340
341 static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
342 struct ccw_dev_id *dev_id2)
343 {
344 if ((dev_id1->ssid == dev_id2->ssid) &&
345 (dev_id1->devno == dev_id2->devno))
346 return 1;
347 return 0;
348 }
349
350
351
352
353
354 static inline u8 pathmask_to_pos(u8 mask)
355 {
356 return 8 - ffs(mask);
357 }
358
359 void channel_subsystem_reinit(void);
360 extern void css_schedule_reprobe(void);
361
362 extern void *cio_dma_zalloc(size_t size);
363 extern void cio_dma_free(void *cpu_addr, size_t size);
364 extern struct device *cio_get_dma_css_dev(void);
365
366 void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
367 size_t size);
368 void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
369 void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
370 struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
371
372
373 int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta);
374 int chsc_sstpi(void *page, void *result, size_t size);
375 int chsc_sgib(u32 origin);
376
377 #endif