xref: /linux/drivers/s390/block/dasd_eckd.h (revision 55ab7e14222e5f0b0fd9f7711ca391d2924b35e3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
4  *		    Horst Hummel <Horst.Hummel@de.ibm.com>
5  * Bugreports.to..: <Linux390@de.ibm.com>
6  * Copyright IBM Corp. 1999, 2000
7  *
8  */
9 
10 #ifndef DASD_ECKD_H
11 #define DASD_ECKD_H
12 
13 /*****************************************************************************
14  * SECTION: CCW Definitions
15  ****************************************************************************/
16 #define DASD_ECKD_CCW_NOP		 0x03
17 #define DASD_ECKD_CCW_WRITE		 0x05
18 #define DASD_ECKD_CCW_READ		 0x06
19 #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
20 #define DASD_ECKD_CCW_READ_HOME_ADDRESS	 0x0a
21 #define DASD_ECKD_CCW_WRITE_KD		 0x0d
22 #define DASD_ECKD_CCW_READ_KD		 0x0e
23 #define DASD_ECKD_CCW_ERASE		 0x11
24 #define DASD_ECKD_CCW_READ_COUNT	 0x12
25 #define DASD_ECKD_CCW_SLCK		 0x14
26 #define DASD_ECKD_CCW_WRITE_RECORD_ZERO	 0x15
27 #define DASD_ECKD_CCW_READ_RECORD_ZERO	 0x16
28 #define DASD_ECKD_CCW_WRITE_CKD		 0x1d
29 #define DASD_ECKD_CCW_READ_CKD		 0x1e
30 #define DASD_ECKD_CCW_PSF		 0x27
31 #define DASD_ECKD_CCW_SNID		 0x34
32 #define DASD_ECKD_CCW_RSSD		 0x3e
33 #define DASD_ECKD_CCW_LOCATE_RECORD	 0x47
34 #define DASD_ECKD_CCW_LOCATE_RECORD_EXT	 0x4b
35 #define DASD_ECKD_CCW_SNSS		 0x54
36 #define DASD_ECKD_CCW_DEFINE_EXTENT	 0x63
37 #define DASD_ECKD_CCW_WRITE_MT		 0x85
38 #define DASD_ECKD_CCW_READ_MT		 0x86
39 #define DASD_ECKD_CCW_WRITE_KD_MT	 0x8d
40 #define DASD_ECKD_CCW_READ_KD_MT	 0x8e
41 #define DASD_ECKD_CCW_READ_COUNT_MT	 0x92
42 #define DASD_ECKD_CCW_RELEASE		 0x94
43 #define DASD_ECKD_CCW_WRITE_FULL_TRACK	 0x95
44 #define DASD_ECKD_CCW_READ_CKD_MT	 0x9e
45 #define DASD_ECKD_CCW_WRITE_CKD_MT	 0x9d
46 #define DASD_ECKD_CCW_WRITE_TRACK_DATA	 0xA5
47 #define DASD_ECKD_CCW_READ_TRACK_DATA	 0xA6
48 #define DASD_ECKD_CCW_RESERVE		 0xB4
49 #define DASD_ECKD_CCW_READ_TRACK	 0xDE
50 #define DASD_ECKD_CCW_PFX		 0xE7
51 #define DASD_ECKD_CCW_PFX_READ		 0xEA
52 #define DASD_ECKD_CCW_RSCK		 0xF9
53 #define DASD_ECKD_CCW_RCD		 0xFA
54 #define DASD_ECKD_CCW_DSO		 0xF7
55 
56 /* Define Subsystem Function / Orders */
57 #define DSO_ORDER_RAS			 0x81
58 
59 /*
60  * Perform Subsystem Function / Orders
61  */
62 #define PSF_ORDER_PRSSD			 0x18
63 #define PSF_ORDER_CUIR_RESPONSE		 0x1A
64 #define PSF_ORDER_SSC			 0x1D
65 
66 /*
67  * Perform Subsystem Function / Sub-Orders
68  */
69 #define PSF_SUBORDER_QHA		 0x1C /* Query Host Access */
70 #define PSF_SUBORDER_PPRCEQ		 0x50 /* PPRC Extended Query */
71 #define PSF_SUBORDER_VSQ		 0x52 /* Volume Storage Query */
72 #define PSF_SUBORDER_LCQ		 0x53 /* Logical Configuration Query */
73 
74 /*
75  * PPRC Extended Query Scopes
76  */
77 #define PPRCEQ_SCOPE_4			 0x04 /* Scope 4 for PPRC Extended Query */
78 
79 /*
80  * CUIR response condition codes
81  */
82 #define PSF_CUIR_INVALID		 0x00
83 #define PSF_CUIR_COMPLETED		 0x01
84 #define PSF_CUIR_NOT_SUPPORTED		 0x02
85 #define PSF_CUIR_ERROR_IN_REQ		 0x03
86 #define PSF_CUIR_DENIED			 0x04
87 #define PSF_CUIR_LAST_PATH		 0x05
88 #define PSF_CUIR_DEVICE_ONLINE		 0x06
89 #define PSF_CUIR_VARY_FAILURE		 0x07
90 #define PSF_CUIR_SOFTWARE_FAILURE	 0x08
91 #define PSF_CUIR_NOT_RECOGNIZED		 0x09
92 
93 /*
94  * CUIR codes
95  */
96 #define CUIR_QUIESCE			 0x01
97 #define CUIR_RESUME			 0x02
98 
99 /*
100  * Out-of-space (OOS) Codes
101  */
102 #define REPO_WARN			 0x01
103 #define REPO_EXHAUST			 0x02
104 #define POOL_WARN			 0x03
105 #define POOL_EXHAUST			 0x04
106 #define REPO_RELIEVE			 0x05
107 #define POOL_RELIEVE			 0x06
108 
109 /*
110  * attention message definitions
111  */
112 #define ATTENTION_LENGTH_CUIR		 0x0e
113 #define ATTENTION_FORMAT_CUIR		 0x01
114 #define ATTENTION_LENGTH_OOS		 0x10
115 #define ATTENTION_FORMAT_OOS		 0x06
116 
117 #define DASD_ECKD_PG_GROUPED		 0x10
118 
119 /*
120  * Size that is reported for large volumes in the old 16-bit no_cyl field
121  */
122 #define LV_COMPAT_CYL 0xFFFE
123 
124 
125 #define FCX_MAX_DATA_FACTOR 65536
126 #define DASD_ECKD_RCD_DATA_SIZE 256
127 
128 #define DASD_ECKD_PATH_THRHLD		 256
129 #define DASD_ECKD_PATH_INTERVAL		 300
130 
131 /*
132  * Maximum number of blocks to be chained
133  */
134 #define DASD_ECKD_MAX_BLOCKS		 180
135 #define DASD_ECKD_MAX_BLOCKS_RAW	 256
136 
137 /*****************************************************************************
138  * SECTION: Type Definitions
139  ****************************************************************************/
140 
141 struct eckd_count {
142 	__u16 cyl;
143 	__u16 head;
144 	__u8 record;
145 	__u8 kl;
146 	__u16 dl;
147 } __attribute__ ((packed));
148 
149 struct eckd_r0 {
150 	struct eckd_count count;
151 	__u8 data[8];
152 } __packed;
153 
154 /*
155  * Extended Address Volume track address: the head field carries the actual
156  * head in its low-order 4 bits; the cylinder bits that do not fit the 16-bit
157  * cyl field are shifted in just above them.
158  */
159 #define DASD_EAV_CYL_HI_SHIFT	16	/* cylinder bits beyond the 16-bit cyl field */
160 #define DASD_EAV_HEAD_HI_SHIFT	4	/* head occupies the low-order 4 bits of head */
161 
162 /*
163  * On-disk DASD format label.
164  *
165  * Written into track 0, head 0, record 4 (R4 - the first non-special CDL
166  * record) as part of the same channel program that formats track 0, so it is
167  * stored atomically with the track: either both the track format and the label
168  * make it to disk or neither does. Its presence with a valid magic therefore
169  * marks a completed format and can be used for format detection.
170  *
171  * The structure is exactly the smallest supported block size (512 bytes) so it
172  * always fits into a single record.
173  * For larger block sizes the rest of the record is zero padded.
174  * The magic together with the version is used to recognise a valid label.
175  */
176 #define DASD_ESE_LABEL_MAGIC	0xC4C1E2C4C6D4E3F1ULL	/* EBCDIC "DASDFMT1" */
177 #define DASD_ESE_LABEL_VERSION	1
178 
179 /* dasd_format_label.flags */
180 #define DASD_ESE_LABEL_F_ESE	0x00000001	/* volume is extent space efficient */
181 #define DASD_ESE_LABEL_F_QUICK	0x00000002	/* quick (space released) format */
182 #define DASD_ESE_LABEL_F_FULL	0x00000004	/* full format */
183 
184 struct dasd_format_label {
185 	__u64 magic;			/* DASD_ESE_LABEL_MAGIC */
186 	__u32 version;			/* DASD_ESE_LABEL_VERSION */
187 	__u32 flags;			/* DASD_ESE_LABEL_F_* */
188 	__u32 blksize;			/* block size the volume was formatted with */
189 	__u32 reserved0;
190 	__u64 format_tod;		/* TOD clock at format time */
191 	__u8  kernel_version[64];	/* NUL terminated kernel release (uname -r) */
192 	__u8  reserved[416];		/* pad the struct to 512 bytes */
193 } __packed;
194 
195 struct ch_t {
196 	__u16 cyl;
197 	__u16 head;
198 } __attribute__ ((packed));
199 
200 struct chr_t {
201 	__u16 cyl;
202 	__u16 head;
203 	__u8 record;
204 } __attribute__ ((packed));
205 
206 struct DE_eckd_data {
207 	struct {
208 		unsigned char perm:2;	/* Permissions on this extent */
209 		unsigned char reserved:1;
210 		unsigned char seek:2;	/* Seek control */
211 		unsigned char auth:2;	/* Access authorization */
212 		unsigned char pci:1;	/* PCI Fetch mode */
213 	} __attribute__ ((packed)) mask;
214 	struct {
215 		unsigned char mode:2;	/* Architecture mode */
216 		unsigned char ckd:1;	/* CKD Conversion */
217 		unsigned char operation:3;	/* Operation mode */
218 		unsigned char cfw:1;	/* Cache fast write */
219 		unsigned char dfw:1;	/* DASD fast write */
220 	} __attribute__ ((packed)) attributes;
221 	__u16 blk_size;		/* Blocksize */
222 	__u16 fast_write_id;
223 	__u8 ga_additional;	/* Global Attributes Additional */
224 	__u8 ga_extended;	/* Global Attributes Extended	*/
225 	struct ch_t beg_ext;
226 	struct ch_t end_ext;
227 	unsigned long ep_sys_time; /* Ext Parameter - System Time Stamp */
228 	__u8 ep_format;        /* Extended Parameter format byte       */
229 	__u8 ep_prio;          /* Extended Parameter priority I/O byte */
230 	__u8 ep_reserved1;     /* Extended Parameter Reserved	       */
231 	__u8 ep_rec_per_track; /* Number of records on a track	       */
232 	__u8 ep_reserved[4];   /* Extended Parameter Reserved	       */
233 } __attribute__ ((packed));
234 
235 struct LO_eckd_data {
236 	struct {
237 		unsigned char orientation:2;
238 		unsigned char operation:6;
239 	} __attribute__ ((packed)) operation;
240 	struct {
241 		unsigned char last_bytes_used:1;
242 		unsigned char reserved:6;
243 		unsigned char read_count_suffix:1;
244 	} __attribute__ ((packed)) auxiliary;
245 	__u8 unused;
246 	__u8 count;
247 	struct ch_t seek_addr;
248 	struct chr_t search_arg;
249 	__u8 sector;
250 	__u16 length;
251 } __attribute__ ((packed));
252 
253 struct LRE_eckd_data {
254 	struct {
255 		unsigned char orientation:2;
256 		unsigned char operation:6;
257 	} __attribute__ ((packed)) operation;
258 	struct {
259 		unsigned char length_valid:1;
260 		unsigned char length_scope:1;
261 		unsigned char imbedded_ccw_valid:1;
262 		unsigned char check_bytes:2;
263 		unsigned char imbedded_count_valid:1;
264 		unsigned char reserved:1;
265 		unsigned char read_count_suffix:1;
266 	} __attribute__ ((packed)) auxiliary;
267 	__u8 imbedded_ccw;
268 	__u8 count;
269 	struct ch_t seek_addr;
270 	struct chr_t search_arg;
271 	__u8 sector;
272 	__u16 length;
273 	__u8 imbedded_count;
274 	__u8 extended_operation;
275 	__u16 extended_parameter_length;
276 	__u8 extended_parameter[];
277 } __attribute__ ((packed));
278 
279 /* Prefix data for format 0x00 and 0x01 */
280 struct PFX_eckd_data {
281 	unsigned char format;
282 	struct {
283 		unsigned char define_extent:1;
284 		unsigned char time_stamp:1;
285 		unsigned char verify_base:1;
286 		unsigned char hyper_pav:1;
287 		unsigned char reserved:4;
288 	} __attribute__ ((packed)) validity;
289 	__u8 base_address;
290 	__u8 aux;
291 	__u8 base_lss;
292 	__u8 reserved[7];
293 	struct DE_eckd_data define_extent;
294 	struct LRE_eckd_data locate_record;
295 } __attribute__ ((packed));
296 
297 struct dasd_eckd_characteristics {
298 	__u16 cu_type;
299 	struct {
300 		unsigned char support:2;
301 		unsigned char async:1;
302 		unsigned char reserved:1;
303 		unsigned char cache_info:1;
304 		unsigned char model:3;
305 	} __attribute__ ((packed)) cu_model;
306 	__u16 dev_type;
307 	__u8 dev_model;
308 	struct {
309 		unsigned char mult_burst:1;
310 		unsigned char RT_in_LR:1;
311 		unsigned char reserved1:1;
312 		unsigned char RD_IN_LR:1;
313 		unsigned char reserved2:4;
314 		unsigned char reserved3:8;
315 		unsigned char defect_wr:1;
316 		unsigned char XRC_supported:1;
317 		unsigned char PPRC_enabled:1;
318 		unsigned char striping:1;
319 		unsigned char reserved5:4;
320 		unsigned char cfw:1;
321 		unsigned char reserved6:2;
322 		unsigned char cache:1;
323 		unsigned char dual_copy:1;
324 		unsigned char dfw:1;
325 		unsigned char reset_alleg:1;
326 		unsigned char sense_down:1;
327 	} __attribute__ ((packed)) facilities;
328 	__u8 dev_class;
329 	__u8 unit_type;
330 	__u16 no_cyl;
331 	__u16 trk_per_cyl;
332 	__u8 sec_per_trk;
333 	__u8 byte_per_track[3];
334 	__u16 home_bytes;
335 	__u8 formula;
336 	union {
337 		struct {
338 			__u8 f1;
339 			__u16 f2;
340 			__u16 f3;
341 		} __attribute__ ((packed)) f_0x01;
342 		struct {
343 			__u8 f1;
344 			__u8 f2;
345 			__u8 f3;
346 			__u8 f4;
347 			__u8 f5;
348 		} __attribute__ ((packed)) f_0x02;
349 	} __attribute__ ((packed)) factors;
350 	__u16 first_alt_trk;
351 	__u16 no_alt_trk;
352 	__u16 first_dia_trk;
353 	__u16 no_dia_trk;
354 	__u16 first_sup_trk;
355 	__u16 no_sup_trk;
356 	__u8 MDR_ID;
357 	__u8 OBR_ID;
358 	__u8 director;
359 	__u8 rd_trk_set;
360 	__u16 max_rec_zero;
361 	__u8 reserved1;
362 	__u8 RWANY_in_LR;
363 	__u8 factor6;
364 	__u8 factor7;
365 	__u8 factor8;
366 	__u8 reserved2[3];
367 	__u8 reserved3[6];
368 	__u32 long_no_cyl;
369 } __attribute__ ((packed));
370 
371 /* elements of the configuration data */
372 struct dasd_ned {
373 	struct {
374 		__u8 identifier:2;
375 		__u8 token_id:1;
376 		__u8 sno_valid:1;
377 		__u8 subst_sno:1;
378 		__u8 recNED:1;
379 		__u8 emuNED:1;
380 		__u8 reserved:1;
381 	} __attribute__ ((packed)) flags;
382 	__u8 descriptor;
383 	__u8 dev_class;
384 	__u8 reserved;
385 	__u8 dev_type[6];
386 	__u8 dev_model[3];
387 	__u8 HDA_manufacturer[3];
388 	struct {
389 		__u8 HDA_location[2];
390 		__u8 HDA_seqno[12];
391 	} serial;
392 	__u8 ID;
393 	__u8 unit_addr;
394 } __attribute__ ((packed));
395 
396 struct dasd_sneq {
397 	struct {
398 		__u8 identifier:2;
399 		__u8 reserved:6;
400 	} __attribute__ ((packed)) flags;
401 	__u8 res1;
402 	__u16 format;
403 	__u8 res2[4];		/* byte  4- 7 */
404 	__u8 sua_flags;		/* byte  8    */
405 	__u8 base_unit_addr;	/* byte  9    */
406 	__u8 res3[22];		/* byte 10-31 */
407 } __attribute__ ((packed));
408 
409 struct vd_sneq {
410 	struct {
411 		__u8 identifier:2;
412 		__u8 reserved:6;
413 	} __attribute__ ((packed)) flags;
414 	__u8 res1;
415 	__u16 format;
416 	__u8 res2[4];	/* byte  4- 7 */
417 	__u8 uit[16];	/* byte  8-23 */
418 	__u8 res3[8];	/* byte 24-31 */
419 } __attribute__ ((packed));
420 
421 struct dasd_gneq {
422 	struct {
423 		__u8 identifier:2;
424 		__u8 reserved:6;
425 	} __attribute__ ((packed)) flags;
426 	__u8 record_selector;
427 	__u8 reserved[4];
428 	struct {
429 		__u8 value:2;
430 		__u8 number:6;
431 	} __attribute__ ((packed)) timeout;
432 	__u8 reserved3;
433 	__u16 subsystemID;
434 	__u8 reserved2[22];
435 } __attribute__ ((packed));
436 
437 struct dasd_rssd_features {
438 	char feature[256];
439 } __attribute__((packed));
440 
441 struct dasd_rssd_messages {
442 	__u16 length;
443 	__u8 format;
444 	__u8 code;
445 	__u32 message_id;
446 	__u8 flags;
447 	char messages[4087];
448 } __packed;
449 
450 /*
451  * Read Subsystem Data - Volume Storage Query
452  */
453 struct dasd_rssd_vsq {
454 	struct {
455 		__u8 tse:1;
456 		__u8 space_not_available:1;
457 		__u8 ese:1;
458 		__u8 unused:5;
459 	} __packed vol_info;
460 	__u8 unused1;
461 	__u16 extent_pool_id;
462 	__u8 warn_cap_limit;
463 	__u8 warn_cap_guaranteed;
464 	__u16 unused2;
465 	__u32 limit_capacity;
466 	__u32 guaranteed_capacity;
467 	__u32 space_allocated;
468 	__u32 space_configured;
469 	__u32 logical_capacity;
470 } __packed;
471 
472 /*
473  * Extent Pool Summary
474  */
475 struct dasd_ext_pool_sum {
476 	__u16 pool_id;
477 	__u8 repo_warn_thrshld;
478 	__u8 warn_thrshld;
479 	struct {
480 		__u8 type:1;			/* 0 - CKD / 1 - FB */
481 		__u8 track_space_efficient:1;
482 		__u8 extent_space_efficient:1;
483 		__u8 standard_volume:1;
484 		__u8 extent_size_valid:1;
485 		__u8 capacity_at_warnlevel:1;
486 		__u8 pool_oos:1;
487 		__u8 unused0:1;
488 		__u8 unused1;
489 	} __packed flags;
490 	struct {
491 		__u8 reserved0:1;
492 		__u8 size_1G:1;
493 		__u8 reserved1:5;
494 		__u8 size_16M:1;
495 	} __packed extent_size;
496 	__u8 unused;
497 } __packed;
498 
499 /*
500  * Read Subsystem Data-Response - Logical Configuration Query - Header
501  */
502 struct dasd_rssd_lcq {
503 	__u16 data_length;		/* Length of data returned */
504 	__u16 pool_count;		/* Count of extent pools returned - Max: 448 */
505 	struct {
506 		__u8 pool_info_valid:1;	/* Detailed Information valid */
507 		__u8 pool_id_volume:1;
508 		__u8 pool_id_cec:1;
509 		__u8 unused0:5;
510 		__u8 unused1;
511 	} __packed header_flags;
512 	char sfi_type[6];		/* Storage Facility Image Type (EBCDIC) */
513 	char sfi_model[3];		/* Storage Facility Image Model (EBCDIC) */
514 	__u8 sfi_seq_num[10];		/* Storage Facility Image Sequence Number */
515 	__u8 reserved[7];
516 	struct dasd_ext_pool_sum ext_pool_sum[448];
517 } __packed;
518 
519 struct dasd_oos_message {
520 	__u16 length;
521 	__u8 format;
522 	__u8 code;
523 	__u8 percentage_empty;
524 	__u8 reserved;
525 	__u16 ext_pool_id;
526 	__u16 token;
527 	__u8 unused[6];
528 } __packed;
529 
530 struct dasd_cuir_message {
531 	__u16 length;
532 	__u8 format;
533 	__u8 code;
534 	__u32 message_id;
535 	__u8 flags;
536 	__u8 neq_map[3];
537 	__u8 ned_map;
538 	__u8 record_selector;
539 } __packed;
540 
541 struct dasd_psf_cuir_response {
542 	__u8 order;
543 	__u8 flags;
544 	__u8 cc;
545 	__u8 chpid;
546 	__u16 device_nr;
547 	__u16 reserved;
548 	__u32 message_id;
549 	__u64 system_id;
550 	__u8 cssid;
551 	__u8 ssid;
552 } __packed;
553 
554 struct dasd_ckd_path_group_entry {
555 	__u8 status_flags;
556 	__u8 pgid[11];
557 	__u8 sysplex_name[8];
558 	__u32 timestamp;
559 	__u32 cylinder;
560 	__u8 reserved[4];
561 } __packed;
562 
563 struct dasd_ckd_host_information {
564 	__u8 access_flags;
565 	__u8 entry_size;
566 	__u16 entry_count;
567 	__u8 entry[16390];
568 } __packed;
569 
570 struct dasd_psf_query_host_access {
571 	__u8 access_flag;
572 	__u8 version;
573 	__u16 CKD_length;
574 	__u16 SCSI_length;
575 	__u8 unused[10];
576 	__u8 host_access_information[16394];
577 } __packed;
578 
579 /*
580  * Perform Subsystem Function - Prepare for Read Subsystem Data
581  */
582 struct dasd_psf_prssd_data {
583 	unsigned char order;
584 	unsigned char flags;
585 	unsigned char reserved1;
586 	unsigned char reserved2;
587 	unsigned char lss;
588 	unsigned char volume;
589 	unsigned char suborder;
590 	unsigned char varies[5];
591 } __attribute__ ((packed));
592 
593 /*
594  * Perform Subsystem Function - Set Subsystem Characteristics
595  */
596 struct dasd_psf_ssc_data {
597 	unsigned char order;
598 	unsigned char flags;
599 	unsigned char cu_type[4];
600 	unsigned char suborder;
601 	unsigned char reserved[59];
602 } __attribute__((packed));
603 
604 /* Maximum number of extents for a single Release Allocated Space command */
605 #define DASD_ECKD_RAS_EXTS_MAX		110U
606 
607 struct dasd_dso_ras_ext_range {
608 	struct ch_t beg_ext;
609 	struct ch_t end_ext;
610 } __packed;
611 
612 /*
613  * Define Subsystem Operation - Release Allocated Space
614  */
615 struct dasd_dso_ras_data {
616 	__u8 order;
617 	struct {
618 		__u8 message:1;		/* Must be zero */
619 		__u8 reserved1:2;
620 		__u8 vol_type:1;	/* 0 - CKD/FBA, 1 - FB */
621 		__u8 reserved2:4;
622 	} __packed flags;
623 	/* Operation Flags to specify scope */
624 	struct {
625 		__u8 reserved1:2;
626 		/* Release Space by Extent */
627 		__u8 by_extent:1;	/* 0 - entire volume, 1 - specified extents */
628 		__u8 guarantee_init:1;
629 		__u8 force_release:1;	/* Internal - will be ignored */
630 		__u16 reserved2:11;
631 	} __packed op_flags;
632 	__u8 lss;
633 	__u8 dev_addr;
634 	__u32 reserved1;
635 	__u8 reserved2[10];
636 	__u16 nr_exts;			/* Defines number of ext_scope - max 110 */
637 	__u16 reserved3;
638 } __packed;
639 
640 
641 /*
642  * some structures and definitions for alias handling
643  */
644 struct dasd_unit_address_configuration {
645 	struct {
646 		char ua_type;
647 		char base_ua;
648 	} unit[256];
649 } __attribute__((packed));
650 
651 
652 #define MAX_DEVICES_PER_LCU 256
653 
654 /* flags on the LCU  */
655 #define NEED_UAC_UPDATE  0x01
656 #define UPDATE_PENDING	0x02
657 
658 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
659 
660 
661 struct alias_root {
662 	struct list_head serverlist;
663 	spinlock_t lock;
664 };
665 
666 struct alias_server {
667 	struct list_head server;
668 	struct dasd_uid uid;
669 	struct list_head lculist;
670 };
671 
672 struct summary_unit_check_work_data {
673 	char reason;
674 	struct dasd_device *device;
675 	struct work_struct worker;
676 };
677 
678 struct read_uac_work_data {
679 	struct dasd_device *device;
680 	struct delayed_work dwork;
681 };
682 
683 struct alias_lcu {
684 	struct list_head lcu;
685 	struct dasd_uid uid;
686 	enum pavtype pav;
687 	char flags;
688 	spinlock_t lock;
689 	struct list_head grouplist;
690 	struct list_head active_devices;
691 	struct list_head inactive_devices;
692 	struct dasd_unit_address_configuration *uac;
693 	struct summary_unit_check_work_data suc_data;
694 	struct read_uac_work_data ruac_data;
695 	struct dasd_ccw_req *rsu_cqr;
696 	struct completion lcu_setup;
697 };
698 
699 struct alias_pav_group {
700 	struct list_head group;
701 	struct dasd_uid uid;
702 	struct alias_lcu *lcu;
703 	struct list_head baselist;
704 	struct list_head aliaslist;
705 	struct dasd_device *next;
706 };
707 
708 struct dasd_conf_data {
709 	struct dasd_ned neds[5];
710 	u8 reserved[64];
711 	struct dasd_gneq gneq;
712 } __packed;
713 
714 struct dasd_conf {
715 	u8 *data;
716 	int len;
717 	/* pointers to specific parts in the conf_data */
718 	struct dasd_ned *ned;
719 	struct dasd_sneq *sneq;
720 	struct vd_sneq *vdsneq;
721 	struct dasd_gneq *gneq;
722 };
723 
724 struct dasd_eckd_private {
725 	struct dasd_eckd_characteristics rdc_data;
726 	struct dasd_conf conf;
727 
728 	struct eckd_count count_area[5];
729 	int init_cqr_status;
730 	int uses_cdl;
731 	struct attrib_data_t attrib;	/* e.g. cache operations */
732 	struct dasd_rssd_features features;
733 	struct dasd_rssd_vsq vsq;
734 	struct dasd_ext_pool_sum eps;
735 	u32 real_cyl;
736 
737 	/* alias management */
738 	struct dasd_uid uid;
739 	/*
740 	 * Cached copies of conf.ned->ID (the LSS) and conf.ned->unit_addr,
741 	 * refreshed under ccwdev_lock. Kept outside uid because create_uid()
742 	 * memsets uid before repopulating it, which would expose a transient
743 	 * zero to the lockless CCW-build readers.
744 	 */
745 	__u8 ned_lss;
746 	__u8 ned_ua;
747 	struct alias_pav_group *pavgroup;
748 	struct alias_lcu *lcu;
749 	int count;
750 
751 	u32 fcx_max_data;
752 	char suc_reason;
753 	/*
754 	 * Set when the whole volume's space was released (full RAS); consumed by
755 	 * the next format to mark the on-disk label as a quick (vs full) format.
756 	 */
757 	int ese_format_quick;
758 	/*
759 	 * Cached on-disk format label (R4), read at online and refreshed on
760 	 * format. When valid, is_ese() is derived from it; otherwise it falls
761 	 * back to the hardware ESE field (vsq.vol_info.ese).
762 	 */
763 	struct dasd_format_label ese_label;
764 	bool ese_label_valid;
765 };
766 
767 
768 
769 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
770 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
771 int dasd_alias_add_device(struct dasd_device *);
772 int dasd_alias_remove_device(struct dasd_device *);
773 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
774 void dasd_alias_handle_summary_unit_check(struct work_struct *);
775 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
776 int dasd_alias_update_add_device(struct dasd_device *);
777 #endif				/* DASD_ECKD_H */
778