Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Horst Hummel | 138c014 | 2006-06-29 14:58:12 +0200 | [diff] [blame] | 2 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com> |
Horst Hummel | 138c014 | 2006-06-29 14:58:12 +0200 | [diff] [blame] | 4 | * Horst Hummel <Horst.Hummel@de.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * Bugreports.to..: <Linux390@de.ibm.com> |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 6 | * Copyright IBM Corp. 1999, 2000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef DASD_ECKD_H |
| 11 | #define DASD_ECKD_H |
| 12 | |
| 13 | /***************************************************************************** |
| 14 | * SECTION: CCW Definitions |
| 15 | ****************************************************************************/ |
| 16 | #define DASD_ECKD_CCW_WRITE 0x05 |
| 17 | #define DASD_ECKD_CCW_READ 0x06 |
| 18 | #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09 |
| 19 | #define DASD_ECKD_CCW_READ_HOME_ADDRESS 0x0a |
| 20 | #define DASD_ECKD_CCW_WRITE_KD 0x0d |
| 21 | #define DASD_ECKD_CCW_READ_KD 0x0e |
| 22 | #define DASD_ECKD_CCW_ERASE 0x11 |
| 23 | #define DASD_ECKD_CCW_READ_COUNT 0x12 |
| 24 | #define DASD_ECKD_CCW_SLCK 0x14 |
| 25 | #define DASD_ECKD_CCW_WRITE_RECORD_ZERO 0x15 |
| 26 | #define DASD_ECKD_CCW_READ_RECORD_ZERO 0x16 |
| 27 | #define DASD_ECKD_CCW_WRITE_CKD 0x1d |
| 28 | #define DASD_ECKD_CCW_READ_CKD 0x1e |
| 29 | #define DASD_ECKD_CCW_PSF 0x27 |
Stefan Weinhuber | 196339f | 2010-10-29 16:50:43 +0200 | [diff] [blame] | 30 | #define DASD_ECKD_CCW_SNID 0x34 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #define DASD_ECKD_CCW_RSSD 0x3e |
| 32 | #define DASD_ECKD_CCW_LOCATE_RECORD 0x47 |
Jan Höppner | 45f186b | 2017-03-14 11:10:16 +0100 | [diff] [blame] | 33 | #define DASD_ECKD_CCW_LOCATE_RECORD_EXT 0x4b |
Stefan Weinhuber | 20c6446 | 2006-03-24 03:15:25 -0800 | [diff] [blame] | 34 | #define DASD_ECKD_CCW_SNSS 0x54 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #define DASD_ECKD_CCW_DEFINE_EXTENT 0x63 |
| 36 | #define DASD_ECKD_CCW_WRITE_MT 0x85 |
| 37 | #define DASD_ECKD_CCW_READ_MT 0x86 |
| 38 | #define DASD_ECKD_CCW_WRITE_KD_MT 0x8d |
| 39 | #define DASD_ECKD_CCW_READ_KD_MT 0x8e |
Jan Höppner | 8fd5752 | 2015-08-19 13:41:20 +0200 | [diff] [blame] | 40 | #define DASD_ECKD_CCW_READ_COUNT_MT 0x92 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define DASD_ECKD_CCW_RELEASE 0x94 |
Stefan Haberland | e4dbb0f | 2011-01-05 12:48:06 +0100 | [diff] [blame] | 42 | #define DASD_ECKD_CCW_WRITE_FULL_TRACK 0x95 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #define DASD_ECKD_CCW_READ_CKD_MT 0x9e |
| 44 | #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 45 | #define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5 |
| 46 | #define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | #define DASD_ECKD_CCW_RESERVE 0xB4 |
Stefan Haberland | e4dbb0f | 2011-01-05 12:48:06 +0100 | [diff] [blame] | 48 | #define DASD_ECKD_CCW_READ_TRACK 0xDE |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 49 | #define DASD_ECKD_CCW_PFX 0xE7 |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 50 | #define DASD_ECKD_CCW_PFX_READ 0xEA |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 51 | #define DASD_ECKD_CCW_RSCK 0xF9 |
Stefan Weinhuber | a4d26c6 | 2011-01-05 12:48:03 +0100 | [diff] [blame] | 52 | #define DASD_ECKD_CCW_RCD 0xFA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
| 54 | /* |
Horst Hummel | 4054557 | 2006-06-29 15:08:18 +0200 | [diff] [blame] | 55 | * Perform Subsystem Function / Sub-Orders |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | */ |
Stefan Haberland | 5db8440 | 2014-10-01 14:39:47 +0200 | [diff] [blame] | 57 | #define PSF_ORDER_PRSSD 0x18 |
| 58 | #define PSF_ORDER_CUIR_RESPONSE 0x1A |
Stefan Haberland | 5a3b7b1 | 2016-03-18 09:42:13 +0100 | [diff] [blame] | 59 | #define PSF_SUBORDER_QHA 0x1C |
Stefan Haberland | 5db8440 | 2014-10-01 14:39:47 +0200 | [diff] [blame] | 60 | #define PSF_ORDER_SSC 0x1D |
| 61 | |
| 62 | /* |
| 63 | * CUIR response condition codes |
| 64 | */ |
| 65 | #define PSF_CUIR_INVALID 0x00 |
| 66 | #define PSF_CUIR_COMPLETED 0x01 |
| 67 | #define PSF_CUIR_NOT_SUPPORTED 0x02 |
| 68 | #define PSF_CUIR_ERROR_IN_REQ 0x03 |
| 69 | #define PSF_CUIR_DENIED 0x04 |
| 70 | #define PSF_CUIR_LAST_PATH 0x05 |
| 71 | #define PSF_CUIR_DEVICE_ONLINE 0x06 |
| 72 | #define PSF_CUIR_VARY_FAILURE 0x07 |
| 73 | #define PSF_CUIR_SOFTWARE_FAILURE 0x08 |
| 74 | #define PSF_CUIR_NOT_RECOGNIZED 0x09 |
| 75 | |
| 76 | /* |
| 77 | * CUIR codes |
| 78 | */ |
| 79 | #define CUIR_QUIESCE 0x01 |
| 80 | #define CUIR_RESUME 0x02 |
| 81 | |
| 82 | /* |
| 83 | * attention message definitions |
| 84 | */ |
| 85 | #define ATTENTION_LENGTH_CUIR 0x0e |
| 86 | #define ATTENTION_FORMAT_CUIR 0x01 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Stefan Haberland | 5a3b7b1 | 2016-03-18 09:42:13 +0100 | [diff] [blame] | 88 | #define DASD_ECKD_PG_GROUPED 0x10 |
| 89 | |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 90 | /* |
| 91 | * Size that is reportet for large volumes in the old 16-bit no_cyl field |
| 92 | */ |
| 93 | #define LV_COMPAT_CYL 0xFFFE |
| 94 | |
Stefan Weinhuber | ef19298b | 2011-01-05 12:48:02 +0100 | [diff] [blame] | 95 | |
| 96 | #define FCX_MAX_DATA_FACTOR 65536 |
Stefan Weinhuber | a4d26c6 | 2011-01-05 12:48:03 +0100 | [diff] [blame] | 97 | #define DASD_ECKD_RCD_DATA_SIZE 256 |
Stefan Weinhuber | ef19298b | 2011-01-05 12:48:02 +0100 | [diff] [blame] | 98 | |
Stefan Haberland | a521b04 | 2016-08-08 15:56:54 +0200 | [diff] [blame] | 99 | #define DASD_ECKD_PATH_THRHLD 256 |
| 100 | #define DASD_ECKD_PATH_INTERVAL 300 |
Stefan Weinhuber | ef19298b | 2011-01-05 12:48:02 +0100 | [diff] [blame] | 101 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | /***************************************************************************** |
| 103 | * SECTION: Type Definitions |
| 104 | ****************************************************************************/ |
| 105 | |
| 106 | struct eckd_count { |
| 107 | __u16 cyl; |
| 108 | __u16 head; |
| 109 | __u8 record; |
| 110 | __u8 kl; |
| 111 | __u16 dl; |
| 112 | } __attribute__ ((packed)); |
| 113 | |
| 114 | struct ch_t { |
| 115 | __u16 cyl; |
| 116 | __u16 head; |
| 117 | } __attribute__ ((packed)); |
| 118 | |
| 119 | struct chs_t { |
| 120 | __u16 cyl; |
| 121 | __u16 head; |
| 122 | __u32 sector; |
| 123 | } __attribute__ ((packed)); |
| 124 | |
| 125 | struct chr_t { |
| 126 | __u16 cyl; |
| 127 | __u16 head; |
| 128 | __u8 record; |
| 129 | } __attribute__ ((packed)); |
| 130 | |
| 131 | struct geom_t { |
| 132 | __u16 cyl; |
| 133 | __u16 head; |
| 134 | __u32 sector; |
| 135 | } __attribute__ ((packed)); |
| 136 | |
| 137 | struct eckd_home { |
| 138 | __u8 skip_control[14]; |
| 139 | __u16 cell_number; |
| 140 | __u8 physical_addr[3]; |
| 141 | __u8 flag; |
| 142 | struct ch_t track_addr; |
| 143 | __u8 reserved; |
| 144 | __u8 key_length; |
| 145 | __u8 reserved2[2]; |
| 146 | } __attribute__ ((packed)); |
| 147 | |
| 148 | struct DE_eckd_data { |
| 149 | struct { |
| 150 | unsigned char perm:2; /* Permissions on this extent */ |
| 151 | unsigned char reserved:1; |
| 152 | unsigned char seek:2; /* Seek control */ |
| 153 | unsigned char auth:2; /* Access authorization */ |
| 154 | unsigned char pci:1; /* PCI Fetch mode */ |
| 155 | } __attribute__ ((packed)) mask; |
| 156 | struct { |
| 157 | unsigned char mode:2; /* Architecture mode */ |
| 158 | unsigned char ckd:1; /* CKD Conversion */ |
| 159 | unsigned char operation:3; /* Operation mode */ |
| 160 | unsigned char cfw:1; /* Cache fast write */ |
| 161 | unsigned char dfw:1; /* DASD fast write */ |
| 162 | } __attribute__ ((packed)) attributes; |
| 163 | __u16 blk_size; /* Blocksize */ |
| 164 | __u16 fast_write_id; |
| 165 | __u8 ga_additional; /* Global Attributes Additional */ |
| 166 | __u8 ga_extended; /* Global Attributes Extended */ |
| 167 | struct ch_t beg_ext; |
| 168 | struct ch_t end_ext; |
Jan Höppner | 7bf76f01 | 2017-08-15 16:40:18 +0200 | [diff] [blame] | 169 | unsigned long ep_sys_time; /* Ext Parameter - System Time Stamp */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | __u8 ep_format; /* Extended Parameter format byte */ |
| 171 | __u8 ep_prio; /* Extended Parameter priority I/O byte */ |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 172 | __u8 ep_reserved1; /* Extended Parameter Reserved */ |
| 173 | __u8 ep_rec_per_track; /* Number of records on a track */ |
| 174 | __u8 ep_reserved[4]; /* Extended Parameter Reserved */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | } __attribute__ ((packed)); |
| 176 | |
| 177 | struct LO_eckd_data { |
| 178 | struct { |
| 179 | unsigned char orientation:2; |
| 180 | unsigned char operation:6; |
| 181 | } __attribute__ ((packed)) operation; |
| 182 | struct { |
| 183 | unsigned char last_bytes_used:1; |
| 184 | unsigned char reserved:6; |
| 185 | unsigned char read_count_suffix:1; |
| 186 | } __attribute__ ((packed)) auxiliary; |
| 187 | __u8 unused; |
| 188 | __u8 count; |
| 189 | struct ch_t seek_addr; |
| 190 | struct chr_t search_arg; |
| 191 | __u8 sector; |
| 192 | __u16 length; |
| 193 | } __attribute__ ((packed)); |
| 194 | |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 195 | struct LRE_eckd_data { |
| 196 | struct { |
| 197 | unsigned char orientation:2; |
| 198 | unsigned char operation:6; |
| 199 | } __attribute__ ((packed)) operation; |
| 200 | struct { |
| 201 | unsigned char length_valid:1; |
| 202 | unsigned char length_scope:1; |
| 203 | unsigned char imbedded_ccw_valid:1; |
| 204 | unsigned char check_bytes:2; |
| 205 | unsigned char imbedded_count_valid:1; |
| 206 | unsigned char reserved:1; |
| 207 | unsigned char read_count_suffix:1; |
| 208 | } __attribute__ ((packed)) auxiliary; |
| 209 | __u8 imbedded_ccw; |
| 210 | __u8 count; |
| 211 | struct ch_t seek_addr; |
| 212 | struct chr_t search_arg; |
| 213 | __u8 sector; |
| 214 | __u16 length; |
| 215 | __u8 imbedded_count; |
| 216 | __u8 extended_operation; |
| 217 | __u16 extended_parameter_length; |
| 218 | __u8 extended_parameter[0]; |
| 219 | } __attribute__ ((packed)); |
| 220 | |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 221 | /* Prefix data for format 0x00 and 0x01 */ |
| 222 | struct PFX_eckd_data { |
| 223 | unsigned char format; |
| 224 | struct { |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 225 | unsigned char define_extent:1; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 226 | unsigned char time_stamp:1; |
| 227 | unsigned char verify_base:1; |
| 228 | unsigned char hyper_pav:1; |
| 229 | unsigned char reserved:4; |
| 230 | } __attribute__ ((packed)) validity; |
| 231 | __u8 base_address; |
| 232 | __u8 aux; |
| 233 | __u8 base_lss; |
| 234 | __u8 reserved[7]; |
Stefan Weinhuber | f3eb538 | 2009-03-26 15:23:48 +0100 | [diff] [blame] | 235 | struct DE_eckd_data define_extent; |
| 236 | struct LRE_eckd_data locate_record; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 237 | } __attribute__ ((packed)); |
| 238 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | struct dasd_eckd_characteristics { |
| 240 | __u16 cu_type; |
| 241 | struct { |
| 242 | unsigned char support:2; |
| 243 | unsigned char async:1; |
| 244 | unsigned char reserved:1; |
| 245 | unsigned char cache_info:1; |
| 246 | unsigned char model:3; |
| 247 | } __attribute__ ((packed)) cu_model; |
| 248 | __u16 dev_type; |
| 249 | __u8 dev_model; |
| 250 | struct { |
| 251 | unsigned char mult_burst:1; |
| 252 | unsigned char RT_in_LR:1; |
| 253 | unsigned char reserved1:1; |
| 254 | unsigned char RD_IN_LR:1; |
| 255 | unsigned char reserved2:4; |
| 256 | unsigned char reserved3:8; |
| 257 | unsigned char defect_wr:1; |
Horst Hummel | 138c014 | 2006-06-29 14:58:12 +0200 | [diff] [blame] | 258 | unsigned char XRC_supported:1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | unsigned char reserved4:1; |
| 260 | unsigned char striping:1; |
| 261 | unsigned char reserved5:4; |
| 262 | unsigned char cfw:1; |
| 263 | unsigned char reserved6:2; |
| 264 | unsigned char cache:1; |
| 265 | unsigned char dual_copy:1; |
| 266 | unsigned char dfw:1; |
| 267 | unsigned char reset_alleg:1; |
| 268 | unsigned char sense_down:1; |
| 269 | } __attribute__ ((packed)) facilities; |
| 270 | __u8 dev_class; |
| 271 | __u8 unit_type; |
| 272 | __u16 no_cyl; |
| 273 | __u16 trk_per_cyl; |
| 274 | __u8 sec_per_trk; |
| 275 | __u8 byte_per_track[3]; |
| 276 | __u16 home_bytes; |
| 277 | __u8 formula; |
| 278 | union { |
| 279 | struct { |
| 280 | __u8 f1; |
| 281 | __u16 f2; |
| 282 | __u16 f3; |
| 283 | } __attribute__ ((packed)) f_0x01; |
| 284 | struct { |
| 285 | __u8 f1; |
| 286 | __u8 f2; |
| 287 | __u8 f3; |
| 288 | __u8 f4; |
| 289 | __u8 f5; |
| 290 | } __attribute__ ((packed)) f_0x02; |
| 291 | } __attribute__ ((packed)) factors; |
| 292 | __u16 first_alt_trk; |
| 293 | __u16 no_alt_trk; |
| 294 | __u16 first_dia_trk; |
| 295 | __u16 no_dia_trk; |
| 296 | __u16 first_sup_trk; |
| 297 | __u16 no_sup_trk; |
| 298 | __u8 MDR_ID; |
| 299 | __u8 OBR_ID; |
| 300 | __u8 director; |
| 301 | __u8 rd_trk_set; |
| 302 | __u16 max_rec_zero; |
| 303 | __u8 reserved1; |
| 304 | __u8 RWANY_in_LR; |
| 305 | __u8 factor6; |
| 306 | __u8 factor7; |
| 307 | __u8 factor8; |
| 308 | __u8 reserved2[3]; |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 309 | __u8 reserved3[6]; |
| 310 | __u32 long_no_cyl; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | } __attribute__ ((packed)); |
| 312 | |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 313 | /* elements of the configuration data */ |
| 314 | struct dasd_ned { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | struct { |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 316 | __u8 identifier:2; |
| 317 | __u8 token_id:1; |
| 318 | __u8 sno_valid:1; |
| 319 | __u8 subst_sno:1; |
| 320 | __u8 recNED:1; |
| 321 | __u8 emuNED:1; |
| 322 | __u8 reserved:1; |
| 323 | } __attribute__ ((packed)) flags; |
| 324 | __u8 descriptor; |
| 325 | __u8 dev_class; |
| 326 | __u8 reserved; |
| 327 | __u8 dev_type[6]; |
| 328 | __u8 dev_model[3]; |
| 329 | __u8 HDA_manufacturer[3]; |
| 330 | __u8 HDA_location[2]; |
| 331 | __u8 HDA_seqno[12]; |
| 332 | __u8 ID; |
| 333 | __u8 unit_addr; |
| 334 | } __attribute__ ((packed)); |
| 335 | |
| 336 | struct dasd_sneq { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | struct { |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 338 | __u8 identifier:2; |
| 339 | __u8 reserved:6; |
| 340 | } __attribute__ ((packed)) flags; |
| 341 | __u8 res1; |
| 342 | __u16 format; |
| 343 | __u8 res2[4]; /* byte 4- 7 */ |
| 344 | __u8 sua_flags; /* byte 8 */ |
| 345 | __u8 base_unit_addr; /* byte 9 */ |
| 346 | __u8 res3[22]; /* byte 10-31 */ |
| 347 | } __attribute__ ((packed)); |
| 348 | |
| 349 | struct vd_sneq { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | struct { |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 351 | __u8 identifier:2; |
| 352 | __u8 reserved:6; |
| 353 | } __attribute__ ((packed)) flags; |
| 354 | __u8 res1; |
| 355 | __u16 format; |
| 356 | __u8 res2[4]; /* byte 4- 7 */ |
| 357 | __u8 uit[16]; /* byte 8-23 */ |
| 358 | __u8 res3[8]; /* byte 24-31 */ |
| 359 | } __attribute__ ((packed)); |
| 360 | |
| 361 | struct dasd_gneq { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | struct { |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 363 | __u8 identifier:2; |
| 364 | __u8 reserved:6; |
| 365 | } __attribute__ ((packed)) flags; |
Stefan Haberland | b179b03 | 2015-08-07 13:20:16 +0200 | [diff] [blame] | 366 | __u8 record_selector; |
| 367 | __u8 reserved[4]; |
Stefan Haberland | 7c8faa8 | 2010-08-09 18:13:00 +0200 | [diff] [blame] | 368 | struct { |
| 369 | __u8 value:2; |
| 370 | __u8 number:6; |
| 371 | } __attribute__ ((packed)) timeout; |
| 372 | __u8 reserved3; |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 373 | __u16 subsystemID; |
| 374 | __u8 reserved2[22]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | } __attribute__ ((packed)); |
| 376 | |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 377 | struct dasd_rssd_features { |
| 378 | char feature[256]; |
| 379 | } __attribute__((packed)); |
| 380 | |
Stefan Haberland | 5db8440 | 2014-10-01 14:39:47 +0200 | [diff] [blame] | 381 | struct dasd_rssd_messages { |
| 382 | __u16 length; |
| 383 | __u8 format; |
| 384 | __u8 code; |
| 385 | __u32 message_id; |
| 386 | __u8 flags; |
| 387 | char messages[4087]; |
| 388 | } __packed; |
| 389 | |
| 390 | struct dasd_cuir_message { |
| 391 | __u16 length; |
| 392 | __u8 format; |
| 393 | __u8 code; |
| 394 | __u32 message_id; |
| 395 | __u8 flags; |
| 396 | __u8 neq_map[3]; |
| 397 | __u8 ned_map; |
| 398 | __u8 record_selector; |
| 399 | } __packed; |
| 400 | |
| 401 | struct dasd_psf_cuir_response { |
| 402 | __u8 order; |
| 403 | __u8 flags; |
| 404 | __u8 cc; |
| 405 | __u8 chpid; |
| 406 | __u16 device_nr; |
| 407 | __u16 reserved; |
| 408 | __u32 message_id; |
| 409 | __u64 system_id; |
| 410 | __u8 cssid; |
| 411 | __u8 ssid; |
| 412 | } __packed; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 413 | |
Stefan Haberland | 5a3b7b1 | 2016-03-18 09:42:13 +0100 | [diff] [blame] | 414 | struct dasd_ckd_path_group_entry { |
| 415 | __u8 status_flags; |
| 416 | __u8 pgid[11]; |
| 417 | __u8 sysplex_name[8]; |
| 418 | __u32 timestamp; |
| 419 | __u32 cylinder; |
| 420 | __u8 reserved[4]; |
| 421 | } __packed; |
| 422 | |
| 423 | struct dasd_ckd_host_information { |
| 424 | __u8 access_flags; |
| 425 | __u8 entry_size; |
| 426 | __u16 entry_count; |
| 427 | __u8 entry[16390]; |
| 428 | } __packed; |
| 429 | |
| 430 | struct dasd_psf_query_host_access { |
| 431 | __u8 access_flag; |
| 432 | __u8 version; |
| 433 | __u16 CKD_length; |
| 434 | __u16 SCSI_length; |
| 435 | __u8 unused[10]; |
| 436 | __u8 host_access_information[16394]; |
| 437 | } __packed; |
| 438 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | /* |
Horst Hummel | 138c014 | 2006-06-29 14:58:12 +0200 | [diff] [blame] | 440 | * Perform Subsystem Function - Prepare for Read Subsystem Data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | */ |
| 442 | struct dasd_psf_prssd_data { |
| 443 | unsigned char order; |
| 444 | unsigned char flags; |
Stefan Haberland | 5a3b7b1 | 2016-03-18 09:42:13 +0100 | [diff] [blame] | 445 | unsigned char reserved1; |
| 446 | unsigned char reserved2; |
| 447 | unsigned char lss; |
| 448 | unsigned char volume; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | unsigned char suborder; |
Stefan Weinhuber | 49fd38b | 2008-08-21 19:46:38 +0200 | [diff] [blame] | 450 | unsigned char varies[5]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 451 | } __attribute__ ((packed)); |
| 452 | |
Horst Hummel | 4054557 | 2006-06-29 15:08:18 +0200 | [diff] [blame] | 453 | /* |
| 454 | * Perform Subsystem Function - Set Subsystem Characteristics |
| 455 | */ |
| 456 | struct dasd_psf_ssc_data { |
| 457 | unsigned char order; |
| 458 | unsigned char flags; |
| 459 | unsigned char cu_type[4]; |
| 460 | unsigned char suborder; |
| 461 | unsigned char reserved[59]; |
| 462 | } __attribute__((packed)); |
| 463 | |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 464 | |
| 465 | /* |
| 466 | * some structures and definitions for alias handling |
| 467 | */ |
| 468 | struct dasd_unit_address_configuration { |
| 469 | struct { |
| 470 | char ua_type; |
| 471 | char base_ua; |
| 472 | } unit[256]; |
| 473 | } __attribute__((packed)); |
| 474 | |
| 475 | |
| 476 | #define MAX_DEVICES_PER_LCU 256 |
| 477 | |
| 478 | /* flags on the LCU */ |
| 479 | #define NEED_UAC_UPDATE 0x01 |
| 480 | #define UPDATE_PENDING 0x02 |
| 481 | |
| 482 | enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV}; |
| 483 | |
| 484 | |
| 485 | struct alias_root { |
| 486 | struct list_head serverlist; |
| 487 | spinlock_t lock; |
| 488 | }; |
| 489 | |
| 490 | struct alias_server { |
| 491 | struct list_head server; |
| 492 | struct dasd_uid uid; |
| 493 | struct list_head lculist; |
| 494 | }; |
| 495 | |
| 496 | struct summary_unit_check_work_data { |
| 497 | char reason; |
| 498 | struct dasd_device *device; |
| 499 | struct work_struct worker; |
| 500 | }; |
| 501 | |
| 502 | struct read_uac_work_data { |
| 503 | struct dasd_device *device; |
| 504 | struct delayed_work dwork; |
| 505 | }; |
| 506 | |
| 507 | struct alias_lcu { |
| 508 | struct list_head lcu; |
| 509 | struct dasd_uid uid; |
| 510 | enum pavtype pav; |
| 511 | char flags; |
| 512 | spinlock_t lock; |
| 513 | struct list_head grouplist; |
| 514 | struct list_head active_devices; |
| 515 | struct list_head inactive_devices; |
| 516 | struct dasd_unit_address_configuration *uac; |
| 517 | struct summary_unit_check_work_data suc_data; |
| 518 | struct read_uac_work_data ruac_data; |
| 519 | struct dasd_ccw_req *rsu_cqr; |
Stefan Weinhuber | f4ac1d0 | 2009-12-07 12:51:53 +0100 | [diff] [blame] | 520 | struct completion lcu_setup; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 521 | }; |
| 522 | |
| 523 | struct alias_pav_group { |
| 524 | struct list_head group; |
| 525 | struct dasd_uid uid; |
| 526 | struct alias_lcu *lcu; |
| 527 | struct list_head baselist; |
| 528 | struct list_head aliaslist; |
| 529 | struct dasd_device *next; |
| 530 | }; |
| 531 | |
Stefan Haberland | b179b03 | 2015-08-07 13:20:16 +0200 | [diff] [blame] | 532 | struct dasd_conf_data { |
| 533 | struct dasd_ned neds[5]; |
| 534 | u8 reserved[64]; |
| 535 | struct dasd_gneq gneq; |
| 536 | } __packed; |
| 537 | |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 538 | struct dasd_eckd_private { |
| 539 | struct dasd_eckd_characteristics rdc_data; |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 540 | u8 *conf_data; |
| 541 | int conf_len; |
Stefan Haberland | c934615 | 2016-08-08 15:53:54 +0200 | [diff] [blame] | 542 | |
Stefan Weinhuber | 4abb08c | 2008-08-01 16:39:09 +0200 | [diff] [blame] | 543 | /* pointers to specific parts in the conf_data */ |
| 544 | struct dasd_ned *ned; |
| 545 | struct dasd_sneq *sneq; |
| 546 | struct vd_sneq *vdsneq; |
| 547 | struct dasd_gneq *gneq; |
| 548 | |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 549 | struct eckd_count count_area[5]; |
| 550 | int init_cqr_status; |
| 551 | int uses_cdl; |
| 552 | struct attrib_data_t attrib; /* e.g. cache operations */ |
| 553 | struct dasd_rssd_features features; |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 554 | u32 real_cyl; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 555 | |
| 556 | /* alias managemnet */ |
| 557 | struct dasd_uid uid; |
| 558 | struct alias_pav_group *pavgroup; |
| 559 | struct alias_lcu *lcu; |
| 560 | int count; |
Stefan Weinhuber | ef19298b | 2011-01-05 12:48:02 +0100 | [diff] [blame] | 561 | |
| 562 | u32 fcx_max_data; |
Stefan Haberland | 59a9ed5 | 2016-02-23 10:15:27 +0100 | [diff] [blame] | 563 | char suc_reason; |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 564 | }; |
| 565 | |
| 566 | |
| 567 | |
| 568 | int dasd_alias_make_device_known_to_lcu(struct dasd_device *); |
| 569 | void dasd_alias_disconnect_device_from_lcu(struct dasd_device *); |
| 570 | int dasd_alias_add_device(struct dasd_device *); |
| 571 | int dasd_alias_remove_device(struct dasd_device *); |
| 572 | struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *); |
Stefan Haberland | 59a9ed5 | 2016-02-23 10:15:27 +0100 | [diff] [blame] | 573 | void dasd_alias_handle_summary_unit_check(struct work_struct *); |
Stefan Weinhuber | 8e09f21 | 2008-01-26 14:11:23 +0100 | [diff] [blame] | 574 | void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *); |
Stefan Weinhuber | f4ac1d0 | 2009-12-07 12:51:53 +0100 | [diff] [blame] | 575 | void dasd_alias_lcu_setup_complete(struct dasd_device *); |
| 576 | void dasd_alias_wait_for_lcu_setup(struct dasd_device *); |
Stefan Haberland | 501183f | 2010-05-17 10:00:10 +0200 | [diff] [blame] | 577 | int dasd_alias_update_add_device(struct dasd_device *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 578 | #endif /* DASD_ECKD_H */ |