blob: f9299bd184ba80098375b06981921844670522bf [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Horst Hummel138c0142006-06-29 14:58:12 +02002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
Horst Hummel138c0142006-06-29 14:58:12 +02004 * Horst Hummel <Horst.Hummel@de.ibm.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Bugreports.to..: <Linux390@de.ibm.com>
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02006 * Copyright IBM Corp. 1999, 2000
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
9
10#ifndef DASD_ECKD_H
11#define DASD_ECKD_H
12
13/*****************************************************************************
14 * SECTION: CCW Definitions
15 ****************************************************************************/
Stefan Haberland32ff8ce2022-09-20 21:26:16 +020016#define DASD_ECKD_CCW_NOP 0x03
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#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
Stefan Weinhuber196339f2010-10-29 16:50:43 +020031#define DASD_ECKD_CCW_SNID 0x34
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#define DASD_ECKD_CCW_RSSD 0x3e
33#define DASD_ECKD_CCW_LOCATE_RECORD 0x47
Jan Höppner45f186b2017-03-14 11:10:16 +010034#define DASD_ECKD_CCW_LOCATE_RECORD_EXT 0x4b
Stefan Weinhuber20c64462006-03-24 03:15:25 -080035#define DASD_ECKD_CCW_SNSS 0x54
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#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
Jan Höppner8fd57522015-08-19 13:41:20 +020041#define DASD_ECKD_CCW_READ_COUNT_MT 0x92
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#define DASD_ECKD_CCW_RELEASE 0x94
Stefan Haberlande4dbb0f2011-01-05 12:48:06 +010043#define DASD_ECKD_CCW_WRITE_FULL_TRACK 0x95
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#define DASD_ECKD_CCW_READ_CKD_MT 0x9e
45#define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +010046#define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5
47#define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define DASD_ECKD_CCW_RESERVE 0xB4
Stefan Haberlande4dbb0f2011-01-05 12:48:06 +010049#define DASD_ECKD_CCW_READ_TRACK 0xDE
Stefan Weinhuber8e09f212008-01-26 14:11:23 +010050#define DASD_ECKD_CCW_PFX 0xE7
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +010051#define DASD_ECKD_CCW_PFX_READ 0xEA
Stefan Weinhuber8e09f212008-01-26 14:11:23 +010052#define DASD_ECKD_CCW_RSCK 0xF9
Stefan Weinhubera4d26c62011-01-05 12:48:03 +010053#define DASD_ECKD_CCW_RCD 0xFA
Jan Höppner91dc4a12018-07-23 11:13:30 +020054#define DASD_ECKD_CCW_DSO 0xF7
55
Bhaskar Chowdhurybe4f3612021-04-28 17:35:21 +020056/* Define Subsystem Function / Orders */
Jan Höppner91dc4a12018-07-23 11:13:30 +020057#define DSO_ORDER_RAS 0x81
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
59/*
Jan Höppner461db0e2018-05-29 17:03:10 +020060 * Perform Subsystem Function / Orders
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 */
Stefan Haberland5db84402014-10-01 14:39:47 +020062#define PSF_ORDER_PRSSD 0x18
63#define PSF_ORDER_CUIR_RESPONSE 0x1A
64#define PSF_ORDER_SSC 0x1D
65
66/*
Jan Höppner461db0e2018-05-29 17:03:10 +020067 * Perform Subsystem Function / Sub-Orders
68 */
69#define PSF_SUBORDER_QHA 0x1C /* Query Host Access */
Stefan Haberland3f217cc2022-09-20 21:26:11 +020070#define PSF_SUBORDER_PPRCEQ 0x50 /* PPRC Extended Query */
Jan Höppnerc7296962018-05-29 16:58:03 +020071#define PSF_SUBORDER_VSQ 0x52 /* Volume Storage Query */
72#define PSF_SUBORDER_LCQ 0x53 /* Logical Configuration Query */
Jan Höppner461db0e2018-05-29 17:03:10 +020073
74/*
Stefan Haberland3f217cc2022-09-20 21:26:11 +020075 * PPRC Extended Query Scopes
76 */
77#define PPRCEQ_SCOPE_4 0x04 /* Scope 4 for PPRC Extended Query */
78
79/*
Stefan Haberland5db84402014-10-01 14:39:47 +020080 * 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/*
Jan Höppner9e12e542018-07-03 10:56:51 +0200100 * 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/*
Stefan Haberland5db84402014-10-01 14:39:47 +0200110 * attention message definitions
111 */
112#define ATTENTION_LENGTH_CUIR 0x0e
113#define ATTENTION_FORMAT_CUIR 0x01
Jan Höppner9e12e542018-07-03 10:56:51 +0200114#define ATTENTION_LENGTH_OOS 0x10
115#define ATTENTION_FORMAT_OOS 0x06
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
Stefan Haberland5a3b7b12016-03-18 09:42:13 +0100117#define DASD_ECKD_PG_GROUPED 0x10
118
Stefan Weinhuberb44b0ab32009-03-26 15:23:47 +0100119/*
Bhaskar Chowdhurybe4f3612021-04-28 17:35:21 +0200120 * Size that is reported for large volumes in the old 16-bit no_cyl field
Stefan Weinhuberb44b0ab32009-03-26 15:23:47 +0100121 */
122#define LV_COMPAT_CYL 0xFFFE
123
Stefan Weinhuberef19298b2011-01-05 12:48:02 +0100124
125#define FCX_MAX_DATA_FACTOR 65536
Stefan Weinhubera4d26c62011-01-05 12:48:03 +0100126#define DASD_ECKD_RCD_DATA_SIZE 256
Stefan Weinhuberef19298b2011-01-05 12:48:02 +0100127
Stefan Haberlanda521b042016-08-08 15:56:54 +0200128#define DASD_ECKD_PATH_THRHLD 256
129#define DASD_ECKD_PATH_INTERVAL 300
Stefan Weinhuberef19298b2011-01-05 12:48:02 +0100130
Jan Höppnera0610a82018-04-27 16:55:27 +0200131/*
132 * Maximum number of blocks to be chained
133 */
134#define DASD_ECKD_MAX_BLOCKS 190
135#define DASD_ECKD_MAX_BLOCKS_RAW 256
136
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137/*****************************************************************************
138 * SECTION: Type Definitions
139 ****************************************************************************/
140
141struct eckd_count {
142 __u16 cyl;
143 __u16 head;
144 __u8 record;
145 __u8 kl;
146 __u16 dl;
147} __attribute__ ((packed));
148
149struct ch_t {
150 __u16 cyl;
151 __u16 head;
152} __attribute__ ((packed));
153
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154struct chr_t {
155 __u16 cyl;
156 __u16 head;
157 __u8 record;
158} __attribute__ ((packed));
159
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160struct DE_eckd_data {
161 struct {
162 unsigned char perm:2; /* Permissions on this extent */
163 unsigned char reserved:1;
164 unsigned char seek:2; /* Seek control */
165 unsigned char auth:2; /* Access authorization */
166 unsigned char pci:1; /* PCI Fetch mode */
167 } __attribute__ ((packed)) mask;
168 struct {
169 unsigned char mode:2; /* Architecture mode */
170 unsigned char ckd:1; /* CKD Conversion */
171 unsigned char operation:3; /* Operation mode */
172 unsigned char cfw:1; /* Cache fast write */
173 unsigned char dfw:1; /* DASD fast write */
174 } __attribute__ ((packed)) attributes;
175 __u16 blk_size; /* Blocksize */
176 __u16 fast_write_id;
177 __u8 ga_additional; /* Global Attributes Additional */
178 __u8 ga_extended; /* Global Attributes Extended */
179 struct ch_t beg_ext;
180 struct ch_t end_ext;
Jan Höppner7bf76f012017-08-15 16:40:18 +0200181 unsigned long ep_sys_time; /* Ext Parameter - System Time Stamp */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 __u8 ep_format; /* Extended Parameter format byte */
183 __u8 ep_prio; /* Extended Parameter priority I/O byte */
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +0100184 __u8 ep_reserved1; /* Extended Parameter Reserved */
185 __u8 ep_rec_per_track; /* Number of records on a track */
186 __u8 ep_reserved[4]; /* Extended Parameter Reserved */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187} __attribute__ ((packed));
188
189struct LO_eckd_data {
190 struct {
191 unsigned char orientation:2;
192 unsigned char operation:6;
193 } __attribute__ ((packed)) operation;
194 struct {
195 unsigned char last_bytes_used:1;
196 unsigned char reserved:6;
197 unsigned char read_count_suffix:1;
198 } __attribute__ ((packed)) auxiliary;
199 __u8 unused;
200 __u8 count;
201 struct ch_t seek_addr;
202 struct chr_t search_arg;
203 __u8 sector;
204 __u16 length;
205} __attribute__ ((packed));
206
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +0100207struct LRE_eckd_data {
208 struct {
209 unsigned char orientation:2;
210 unsigned char operation:6;
211 } __attribute__ ((packed)) operation;
212 struct {
213 unsigned char length_valid:1;
214 unsigned char length_scope:1;
215 unsigned char imbedded_ccw_valid:1;
216 unsigned char check_bytes:2;
217 unsigned char imbedded_count_valid:1;
218 unsigned char reserved:1;
219 unsigned char read_count_suffix:1;
220 } __attribute__ ((packed)) auxiliary;
221 __u8 imbedded_ccw;
222 __u8 count;
223 struct ch_t seek_addr;
224 struct chr_t search_arg;
225 __u8 sector;
226 __u16 length;
227 __u8 imbedded_count;
228 __u8 extended_operation;
229 __u16 extended_parameter_length;
Gustavo A. R. Silvafa226f12020-02-21 09:06:12 -0600230 __u8 extended_parameter[];
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +0100231} __attribute__ ((packed));
232
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100233/* Prefix data for format 0x00 and 0x01 */
234struct PFX_eckd_data {
235 unsigned char format;
236 struct {
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +0100237 unsigned char define_extent:1;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100238 unsigned char time_stamp:1;
239 unsigned char verify_base:1;
240 unsigned char hyper_pav:1;
241 unsigned char reserved:4;
242 } __attribute__ ((packed)) validity;
243 __u8 base_address;
244 __u8 aux;
245 __u8 base_lss;
246 __u8 reserved[7];
Stefan Weinhuberf3eb5382009-03-26 15:23:48 +0100247 struct DE_eckd_data define_extent;
248 struct LRE_eckd_data locate_record;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100249} __attribute__ ((packed));
250
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251struct dasd_eckd_characteristics {
252 __u16 cu_type;
253 struct {
254 unsigned char support:2;
255 unsigned char async:1;
256 unsigned char reserved:1;
257 unsigned char cache_info:1;
258 unsigned char model:3;
259 } __attribute__ ((packed)) cu_model;
260 __u16 dev_type;
261 __u8 dev_model;
262 struct {
263 unsigned char mult_burst:1;
264 unsigned char RT_in_LR:1;
265 unsigned char reserved1:1;
266 unsigned char RD_IN_LR:1;
267 unsigned char reserved2:4;
268 unsigned char reserved3:8;
269 unsigned char defect_wr:1;
Horst Hummel138c0142006-06-29 14:58:12 +0200270 unsigned char XRC_supported:1;
Stefan Haberlanda91ff09d2022-09-20 21:26:12 +0200271 unsigned char PPRC_enabled:1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272 unsigned char striping:1;
273 unsigned char reserved5:4;
274 unsigned char cfw:1;
275 unsigned char reserved6:2;
276 unsigned char cache:1;
277 unsigned char dual_copy:1;
278 unsigned char dfw:1;
279 unsigned char reset_alleg:1;
280 unsigned char sense_down:1;
281 } __attribute__ ((packed)) facilities;
282 __u8 dev_class;
283 __u8 unit_type;
284 __u16 no_cyl;
285 __u16 trk_per_cyl;
286 __u8 sec_per_trk;
287 __u8 byte_per_track[3];
288 __u16 home_bytes;
289 __u8 formula;
290 union {
291 struct {
292 __u8 f1;
293 __u16 f2;
294 __u16 f3;
295 } __attribute__ ((packed)) f_0x01;
296 struct {
297 __u8 f1;
298 __u8 f2;
299 __u8 f3;
300 __u8 f4;
301 __u8 f5;
302 } __attribute__ ((packed)) f_0x02;
303 } __attribute__ ((packed)) factors;
304 __u16 first_alt_trk;
305 __u16 no_alt_trk;
306 __u16 first_dia_trk;
307 __u16 no_dia_trk;
308 __u16 first_sup_trk;
309 __u16 no_sup_trk;
310 __u8 MDR_ID;
311 __u8 OBR_ID;
312 __u8 director;
313 __u8 rd_trk_set;
314 __u16 max_rec_zero;
315 __u8 reserved1;
316 __u8 RWANY_in_LR;
317 __u8 factor6;
318 __u8 factor7;
319 __u8 factor8;
320 __u8 reserved2[3];
Stefan Weinhuberb44b0ab32009-03-26 15:23:47 +0100321 __u8 reserved3[6];
322 __u32 long_no_cyl;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323} __attribute__ ((packed));
324
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200325/* elements of the configuration data */
326struct dasd_ned {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 struct {
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200328 __u8 identifier:2;
329 __u8 token_id:1;
330 __u8 sno_valid:1;
331 __u8 subst_sno:1;
332 __u8 recNED:1;
333 __u8 emuNED:1;
334 __u8 reserved:1;
335 } __attribute__ ((packed)) flags;
336 __u8 descriptor;
337 __u8 dev_class;
338 __u8 reserved;
339 __u8 dev_type[6];
340 __u8 dev_model[3];
341 __u8 HDA_manufacturer[3];
Kees Cook2b7a8dc2021-07-01 16:22:21 +0200342 struct {
343 __u8 HDA_location[2];
344 __u8 HDA_seqno[12];
345 } serial;
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200346 __u8 ID;
347 __u8 unit_addr;
348} __attribute__ ((packed));
349
350struct dasd_sneq {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 struct {
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200352 __u8 identifier:2;
353 __u8 reserved:6;
354 } __attribute__ ((packed)) flags;
355 __u8 res1;
356 __u16 format;
357 __u8 res2[4]; /* byte 4- 7 */
358 __u8 sua_flags; /* byte 8 */
359 __u8 base_unit_addr; /* byte 9 */
360 __u8 res3[22]; /* byte 10-31 */
361} __attribute__ ((packed));
362
363struct vd_sneq {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364 struct {
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200365 __u8 identifier:2;
366 __u8 reserved:6;
367 } __attribute__ ((packed)) flags;
368 __u8 res1;
369 __u16 format;
370 __u8 res2[4]; /* byte 4- 7 */
371 __u8 uit[16]; /* byte 8-23 */
372 __u8 res3[8]; /* byte 24-31 */
373} __attribute__ ((packed));
374
375struct dasd_gneq {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 struct {
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200377 __u8 identifier:2;
378 __u8 reserved:6;
379 } __attribute__ ((packed)) flags;
Stefan Haberlandb179b032015-08-07 13:20:16 +0200380 __u8 record_selector;
381 __u8 reserved[4];
Stefan Haberland7c8faa82010-08-09 18:13:00 +0200382 struct {
383 __u8 value:2;
384 __u8 number:6;
385 } __attribute__ ((packed)) timeout;
386 __u8 reserved3;
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200387 __u16 subsystemID;
388 __u8 reserved2[22];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389} __attribute__ ((packed));
390
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100391struct dasd_rssd_features {
392 char feature[256];
393} __attribute__((packed));
394
Stefan Haberland5db84402014-10-01 14:39:47 +0200395struct dasd_rssd_messages {
396 __u16 length;
397 __u8 format;
398 __u8 code;
399 __u32 message_id;
400 __u8 flags;
401 char messages[4087];
402} __packed;
403
Jan Höppnerc7296962018-05-29 16:58:03 +0200404/*
405 * Read Subsystem Data - Volume Storage Query
406 */
407struct dasd_rssd_vsq {
408 struct {
409 __u8 tse:1;
410 __u8 space_not_available:1;
411 __u8 ese:1;
412 __u8 unused:5;
413 } __packed vol_info;
414 __u8 unused1;
415 __u16 extent_pool_id;
416 __u8 warn_cap_limit;
417 __u8 warn_cap_guaranteed;
418 __u16 unused2;
419 __u32 limit_capacity;
420 __u32 guaranteed_capacity;
421 __u32 space_allocated;
422 __u32 space_configured;
423 __u32 logical_capacity;
424} __packed;
425
426/*
427 * Extent Pool Summary
428 */
429struct dasd_ext_pool_sum {
430 __u16 pool_id;
431 __u8 repo_warn_thrshld;
432 __u8 warn_thrshld;
433 struct {
434 __u8 type:1; /* 0 - CKD / 1 - FB */
435 __u8 track_space_efficient:1;
436 __u8 extent_space_efficient:1;
437 __u8 standard_volume:1;
438 __u8 extent_size_valid:1;
439 __u8 capacity_at_warnlevel:1;
440 __u8 pool_oos:1;
441 __u8 unused0:1;
442 __u8 unused1;
443 } __packed flags;
444 struct {
445 __u8 reserved0:1;
446 __u8 size_1G:1;
447 __u8 reserved1:5;
448 __u8 size_16M:1;
449 } __packed extent_size;
450 __u8 unused;
451} __packed;
452
453/*
454 * Read Subsystem Data-Response - Logical Configuration Query - Header
455 */
456struct dasd_rssd_lcq {
457 __u16 data_length; /* Length of data returned */
458 __u16 pool_count; /* Count of extent pools returned - Max: 448 */
459 struct {
460 __u8 pool_info_valid:1; /* Detailed Information valid */
461 __u8 pool_id_volume:1;
462 __u8 pool_id_cec:1;
463 __u8 unused0:5;
464 __u8 unused1;
465 } __packed header_flags;
466 char sfi_type[6]; /* Storage Facility Image Type (EBCDIC) */
467 char sfi_model[3]; /* Storage Facility Image Model (EBCDIC) */
468 __u8 sfi_seq_num[10]; /* Storage Facility Image Sequence Number */
469 __u8 reserved[7];
470 struct dasd_ext_pool_sum ext_pool_sum[448];
471} __packed;
472
Jan Höppner9e12e542018-07-03 10:56:51 +0200473struct dasd_oos_message {
474 __u16 length;
475 __u8 format;
476 __u8 code;
477 __u8 percentage_empty;
478 __u8 reserved;
479 __u16 ext_pool_id;
480 __u16 token;
481 __u8 unused[6];
482} __packed;
483
Stefan Haberland5db84402014-10-01 14:39:47 +0200484struct dasd_cuir_message {
485 __u16 length;
486 __u8 format;
487 __u8 code;
488 __u32 message_id;
489 __u8 flags;
490 __u8 neq_map[3];
491 __u8 ned_map;
492 __u8 record_selector;
493} __packed;
494
495struct dasd_psf_cuir_response {
496 __u8 order;
497 __u8 flags;
498 __u8 cc;
499 __u8 chpid;
500 __u16 device_nr;
501 __u16 reserved;
502 __u32 message_id;
503 __u64 system_id;
504 __u8 cssid;
505 __u8 ssid;
506} __packed;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100507
Stefan Haberland5a3b7b12016-03-18 09:42:13 +0100508struct dasd_ckd_path_group_entry {
509 __u8 status_flags;
510 __u8 pgid[11];
511 __u8 sysplex_name[8];
512 __u32 timestamp;
513 __u32 cylinder;
514 __u8 reserved[4];
515} __packed;
516
517struct dasd_ckd_host_information {
518 __u8 access_flags;
519 __u8 entry_size;
520 __u16 entry_count;
521 __u8 entry[16390];
522} __packed;
523
524struct dasd_psf_query_host_access {
525 __u8 access_flag;
526 __u8 version;
527 __u16 CKD_length;
528 __u16 SCSI_length;
529 __u8 unused[10];
530 __u8 host_access_information[16394];
531} __packed;
532
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533/*
Horst Hummel138c0142006-06-29 14:58:12 +0200534 * Perform Subsystem Function - Prepare for Read Subsystem Data
Linus Torvalds1da177e2005-04-16 15:20:36 -0700535 */
536struct dasd_psf_prssd_data {
537 unsigned char order;
538 unsigned char flags;
Stefan Haberland5a3b7b12016-03-18 09:42:13 +0100539 unsigned char reserved1;
540 unsigned char reserved2;
541 unsigned char lss;
542 unsigned char volume;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 unsigned char suborder;
Stefan Weinhuber49fd38b2008-08-21 19:46:38 +0200544 unsigned char varies[5];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545} __attribute__ ((packed));
546
Horst Hummel40545572006-06-29 15:08:18 +0200547/*
548 * Perform Subsystem Function - Set Subsystem Characteristics
549 */
550struct dasd_psf_ssc_data {
551 unsigned char order;
552 unsigned char flags;
553 unsigned char cu_type[4];
554 unsigned char suborder;
555 unsigned char reserved[59];
556} __attribute__((packed));
557
Jan Höppner91dc4a12018-07-23 11:13:30 +0200558/* Maximum number of extents for a single Release Allocated Space command */
559#define DASD_ECKD_RAS_EXTS_MAX 110U
560
561struct dasd_dso_ras_ext_range {
562 struct ch_t beg_ext;
563 struct ch_t end_ext;
564} __packed;
565
566/*
Bhaskar Chowdhurybe4f3612021-04-28 17:35:21 +0200567 * Define Subsystem Operation - Release Allocated Space
Jan Höppner91dc4a12018-07-23 11:13:30 +0200568 */
569struct dasd_dso_ras_data {
570 __u8 order;
571 struct {
572 __u8 message:1; /* Must be zero */
573 __u8 reserved1:2;
574 __u8 vol_type:1; /* 0 - CKD/FBA, 1 - FB */
575 __u8 reserved2:4;
576 } __packed flags;
577 /* Operation Flags to specify scope */
578 struct {
579 __u8 reserved1:2;
580 /* Release Space by Extent */
581 __u8 by_extent:1; /* 0 - entire volume, 1 - specified extents */
582 __u8 guarantee_init:1;
583 __u8 force_release:1; /* Internal - will be ignored */
584 __u16 reserved2:11;
585 } __packed op_flags;
586 __u8 lss;
587 __u8 dev_addr;
588 __u32 reserved1;
589 __u8 reserved2[10];
590 __u16 nr_exts; /* Defines number of ext_scope - max 110 */
591 __u16 reserved3;
592} __packed;
593
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100594
595/*
596 * some structures and definitions for alias handling
597 */
598struct dasd_unit_address_configuration {
599 struct {
600 char ua_type;
601 char base_ua;
602 } unit[256];
603} __attribute__((packed));
604
605
606#define MAX_DEVICES_PER_LCU 256
607
608/* flags on the LCU */
609#define NEED_UAC_UPDATE 0x01
610#define UPDATE_PENDING 0x02
611
612enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
613
614
615struct alias_root {
616 struct list_head serverlist;
617 spinlock_t lock;
618};
619
620struct alias_server {
621 struct list_head server;
622 struct dasd_uid uid;
623 struct list_head lculist;
624};
625
626struct summary_unit_check_work_data {
627 char reason;
628 struct dasd_device *device;
629 struct work_struct worker;
630};
631
632struct read_uac_work_data {
633 struct dasd_device *device;
634 struct delayed_work dwork;
635};
636
637struct alias_lcu {
638 struct list_head lcu;
639 struct dasd_uid uid;
640 enum pavtype pav;
641 char flags;
642 spinlock_t lock;
643 struct list_head grouplist;
644 struct list_head active_devices;
645 struct list_head inactive_devices;
646 struct dasd_unit_address_configuration *uac;
647 struct summary_unit_check_work_data suc_data;
648 struct read_uac_work_data ruac_data;
649 struct dasd_ccw_req *rsu_cqr;
Stefan Weinhuberf4ac1d02009-12-07 12:51:53 +0100650 struct completion lcu_setup;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100651};
652
653struct alias_pav_group {
654 struct list_head group;
655 struct dasd_uid uid;
656 struct alias_lcu *lcu;
657 struct list_head baselist;
658 struct list_head aliaslist;
659 struct dasd_device *next;
660};
661
Stefan Haberlandb179b032015-08-07 13:20:16 +0200662struct dasd_conf_data {
663 struct dasd_ned neds[5];
664 u8 reserved[64];
665 struct dasd_gneq gneq;
666} __packed;
667
Stefan Haberland542e30c2021-10-20 13:51:22 +0200668struct dasd_conf {
669 u8 *data;
670 int len;
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200671 /* pointers to specific parts in the conf_data */
672 struct dasd_ned *ned;
673 struct dasd_sneq *sneq;
674 struct vd_sneq *vdsneq;
675 struct dasd_gneq *gneq;
Stefan Haberland542e30c2021-10-20 13:51:22 +0200676};
677
678struct dasd_eckd_private {
679 struct dasd_eckd_characteristics rdc_data;
680 struct dasd_conf conf;
Stefan Weinhuber4abb08c2008-08-01 16:39:09 +0200681
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100682 struct eckd_count count_area[5];
683 int init_cqr_status;
684 int uses_cdl;
685 struct attrib_data_t attrib; /* e.g. cache operations */
686 struct dasd_rssd_features features;
Jan Höppnerc7296962018-05-29 16:58:03 +0200687 struct dasd_rssd_vsq vsq;
688 struct dasd_ext_pool_sum eps;
Stefan Weinhuberb44b0ab32009-03-26 15:23:47 +0100689 u32 real_cyl;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100690
Bhaskar Chowdhurybe4f3612021-04-28 17:35:21 +0200691 /* alias management */
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100692 struct dasd_uid uid;
693 struct alias_pav_group *pavgroup;
694 struct alias_lcu *lcu;
695 int count;
Stefan Weinhuberef19298b2011-01-05 12:48:02 +0100696
697 u32 fcx_max_data;
Stefan Haberland59a9ed52016-02-23 10:15:27 +0100698 char suc_reason;
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100699};
700
701
702
703int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
704void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
705int dasd_alias_add_device(struct dasd_device *);
706int dasd_alias_remove_device(struct dasd_device *);
707struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
Stefan Haberland59a9ed52016-02-23 10:15:27 +0100708void dasd_alias_handle_summary_unit_check(struct work_struct *);
Stefan Weinhuber8e09f212008-01-26 14:11:23 +0100709void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
Stefan Haberland501183f2010-05-17 10:00:10 +0200710int dasd_alias_update_add_device(struct dasd_device *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711#endif /* DASD_ECKD_H */