0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef DASD_ECKD_H
0011 #define DASD_ECKD_H
0012
0013
0014
0015
0016 #define DASD_ECKD_CCW_WRITE 0x05
0017 #define DASD_ECKD_CCW_READ 0x06
0018 #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
0019 #define DASD_ECKD_CCW_READ_HOME_ADDRESS 0x0a
0020 #define DASD_ECKD_CCW_WRITE_KD 0x0d
0021 #define DASD_ECKD_CCW_READ_KD 0x0e
0022 #define DASD_ECKD_CCW_ERASE 0x11
0023 #define DASD_ECKD_CCW_READ_COUNT 0x12
0024 #define DASD_ECKD_CCW_SLCK 0x14
0025 #define DASD_ECKD_CCW_WRITE_RECORD_ZERO 0x15
0026 #define DASD_ECKD_CCW_READ_RECORD_ZERO 0x16
0027 #define DASD_ECKD_CCW_WRITE_CKD 0x1d
0028 #define DASD_ECKD_CCW_READ_CKD 0x1e
0029 #define DASD_ECKD_CCW_PSF 0x27
0030 #define DASD_ECKD_CCW_SNID 0x34
0031 #define DASD_ECKD_CCW_RSSD 0x3e
0032 #define DASD_ECKD_CCW_LOCATE_RECORD 0x47
0033 #define DASD_ECKD_CCW_LOCATE_RECORD_EXT 0x4b
0034 #define DASD_ECKD_CCW_SNSS 0x54
0035 #define DASD_ECKD_CCW_DEFINE_EXTENT 0x63
0036 #define DASD_ECKD_CCW_WRITE_MT 0x85
0037 #define DASD_ECKD_CCW_READ_MT 0x86
0038 #define DASD_ECKD_CCW_WRITE_KD_MT 0x8d
0039 #define DASD_ECKD_CCW_READ_KD_MT 0x8e
0040 #define DASD_ECKD_CCW_READ_COUNT_MT 0x92
0041 #define DASD_ECKD_CCW_RELEASE 0x94
0042 #define DASD_ECKD_CCW_WRITE_FULL_TRACK 0x95
0043 #define DASD_ECKD_CCW_READ_CKD_MT 0x9e
0044 #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
0045 #define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5
0046 #define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6
0047 #define DASD_ECKD_CCW_RESERVE 0xB4
0048 #define DASD_ECKD_CCW_READ_TRACK 0xDE
0049 #define DASD_ECKD_CCW_PFX 0xE7
0050 #define DASD_ECKD_CCW_PFX_READ 0xEA
0051 #define DASD_ECKD_CCW_RSCK 0xF9
0052 #define DASD_ECKD_CCW_RCD 0xFA
0053 #define DASD_ECKD_CCW_DSO 0xF7
0054
0055
0056 #define DSO_ORDER_RAS 0x81
0057
0058
0059
0060
0061 #define PSF_ORDER_PRSSD 0x18
0062 #define PSF_ORDER_CUIR_RESPONSE 0x1A
0063 #define PSF_ORDER_SSC 0x1D
0064
0065
0066
0067
0068 #define PSF_SUBORDER_QHA 0x1C
0069 #define PSF_SUBORDER_VSQ 0x52
0070 #define PSF_SUBORDER_LCQ 0x53
0071
0072
0073
0074
0075 #define PSF_CUIR_INVALID 0x00
0076 #define PSF_CUIR_COMPLETED 0x01
0077 #define PSF_CUIR_NOT_SUPPORTED 0x02
0078 #define PSF_CUIR_ERROR_IN_REQ 0x03
0079 #define PSF_CUIR_DENIED 0x04
0080 #define PSF_CUIR_LAST_PATH 0x05
0081 #define PSF_CUIR_DEVICE_ONLINE 0x06
0082 #define PSF_CUIR_VARY_FAILURE 0x07
0083 #define PSF_CUIR_SOFTWARE_FAILURE 0x08
0084 #define PSF_CUIR_NOT_RECOGNIZED 0x09
0085
0086
0087
0088
0089 #define CUIR_QUIESCE 0x01
0090 #define CUIR_RESUME 0x02
0091
0092
0093
0094
0095 #define REPO_WARN 0x01
0096 #define REPO_EXHAUST 0x02
0097 #define POOL_WARN 0x03
0098 #define POOL_EXHAUST 0x04
0099 #define REPO_RELIEVE 0x05
0100 #define POOL_RELIEVE 0x06
0101
0102
0103
0104
0105 #define ATTENTION_LENGTH_CUIR 0x0e
0106 #define ATTENTION_FORMAT_CUIR 0x01
0107 #define ATTENTION_LENGTH_OOS 0x10
0108 #define ATTENTION_FORMAT_OOS 0x06
0109
0110 #define DASD_ECKD_PG_GROUPED 0x10
0111
0112
0113
0114
0115 #define LV_COMPAT_CYL 0xFFFE
0116
0117
0118 #define FCX_MAX_DATA_FACTOR 65536
0119 #define DASD_ECKD_RCD_DATA_SIZE 256
0120
0121 #define DASD_ECKD_PATH_THRHLD 256
0122 #define DASD_ECKD_PATH_INTERVAL 300
0123
0124
0125
0126
0127 #define DASD_ECKD_MAX_BLOCKS 190
0128 #define DASD_ECKD_MAX_BLOCKS_RAW 256
0129
0130
0131
0132
0133
0134 struct eckd_count {
0135 __u16 cyl;
0136 __u16 head;
0137 __u8 record;
0138 __u8 kl;
0139 __u16 dl;
0140 } __attribute__ ((packed));
0141
0142 struct ch_t {
0143 __u16 cyl;
0144 __u16 head;
0145 } __attribute__ ((packed));
0146
0147 struct chr_t {
0148 __u16 cyl;
0149 __u16 head;
0150 __u8 record;
0151 } __attribute__ ((packed));
0152
0153 struct DE_eckd_data {
0154 struct {
0155 unsigned char perm:2;
0156 unsigned char reserved:1;
0157 unsigned char seek:2;
0158 unsigned char auth:2;
0159 unsigned char pci:1;
0160 } __attribute__ ((packed)) mask;
0161 struct {
0162 unsigned char mode:2;
0163 unsigned char ckd:1;
0164 unsigned char operation:3;
0165 unsigned char cfw:1;
0166 unsigned char dfw:1;
0167 } __attribute__ ((packed)) attributes;
0168 __u16 blk_size;
0169 __u16 fast_write_id;
0170 __u8 ga_additional;
0171 __u8 ga_extended;
0172 struct ch_t beg_ext;
0173 struct ch_t end_ext;
0174 unsigned long ep_sys_time;
0175 __u8 ep_format;
0176 __u8 ep_prio;
0177 __u8 ep_reserved1;
0178 __u8 ep_rec_per_track;
0179 __u8 ep_reserved[4];
0180 } __attribute__ ((packed));
0181
0182 struct LO_eckd_data {
0183 struct {
0184 unsigned char orientation:2;
0185 unsigned char operation:6;
0186 } __attribute__ ((packed)) operation;
0187 struct {
0188 unsigned char last_bytes_used:1;
0189 unsigned char reserved:6;
0190 unsigned char read_count_suffix:1;
0191 } __attribute__ ((packed)) auxiliary;
0192 __u8 unused;
0193 __u8 count;
0194 struct ch_t seek_addr;
0195 struct chr_t search_arg;
0196 __u8 sector;
0197 __u16 length;
0198 } __attribute__ ((packed));
0199
0200 struct LRE_eckd_data {
0201 struct {
0202 unsigned char orientation:2;
0203 unsigned char operation:6;
0204 } __attribute__ ((packed)) operation;
0205 struct {
0206 unsigned char length_valid:1;
0207 unsigned char length_scope:1;
0208 unsigned char imbedded_ccw_valid:1;
0209 unsigned char check_bytes:2;
0210 unsigned char imbedded_count_valid:1;
0211 unsigned char reserved:1;
0212 unsigned char read_count_suffix:1;
0213 } __attribute__ ((packed)) auxiliary;
0214 __u8 imbedded_ccw;
0215 __u8 count;
0216 struct ch_t seek_addr;
0217 struct chr_t search_arg;
0218 __u8 sector;
0219 __u16 length;
0220 __u8 imbedded_count;
0221 __u8 extended_operation;
0222 __u16 extended_parameter_length;
0223 __u8 extended_parameter[];
0224 } __attribute__ ((packed));
0225
0226
0227 struct PFX_eckd_data {
0228 unsigned char format;
0229 struct {
0230 unsigned char define_extent:1;
0231 unsigned char time_stamp:1;
0232 unsigned char verify_base:1;
0233 unsigned char hyper_pav:1;
0234 unsigned char reserved:4;
0235 } __attribute__ ((packed)) validity;
0236 __u8 base_address;
0237 __u8 aux;
0238 __u8 base_lss;
0239 __u8 reserved[7];
0240 struct DE_eckd_data define_extent;
0241 struct LRE_eckd_data locate_record;
0242 } __attribute__ ((packed));
0243
0244 struct dasd_eckd_characteristics {
0245 __u16 cu_type;
0246 struct {
0247 unsigned char support:2;
0248 unsigned char async:1;
0249 unsigned char reserved:1;
0250 unsigned char cache_info:1;
0251 unsigned char model:3;
0252 } __attribute__ ((packed)) cu_model;
0253 __u16 dev_type;
0254 __u8 dev_model;
0255 struct {
0256 unsigned char mult_burst:1;
0257 unsigned char RT_in_LR:1;
0258 unsigned char reserved1:1;
0259 unsigned char RD_IN_LR:1;
0260 unsigned char reserved2:4;
0261 unsigned char reserved3:8;
0262 unsigned char defect_wr:1;
0263 unsigned char XRC_supported:1;
0264 unsigned char reserved4:1;
0265 unsigned char striping:1;
0266 unsigned char reserved5:4;
0267 unsigned char cfw:1;
0268 unsigned char reserved6:2;
0269 unsigned char cache:1;
0270 unsigned char dual_copy:1;
0271 unsigned char dfw:1;
0272 unsigned char reset_alleg:1;
0273 unsigned char sense_down:1;
0274 } __attribute__ ((packed)) facilities;
0275 __u8 dev_class;
0276 __u8 unit_type;
0277 __u16 no_cyl;
0278 __u16 trk_per_cyl;
0279 __u8 sec_per_trk;
0280 __u8 byte_per_track[3];
0281 __u16 home_bytes;
0282 __u8 formula;
0283 union {
0284 struct {
0285 __u8 f1;
0286 __u16 f2;
0287 __u16 f3;
0288 } __attribute__ ((packed)) f_0x01;
0289 struct {
0290 __u8 f1;
0291 __u8 f2;
0292 __u8 f3;
0293 __u8 f4;
0294 __u8 f5;
0295 } __attribute__ ((packed)) f_0x02;
0296 } __attribute__ ((packed)) factors;
0297 __u16 first_alt_trk;
0298 __u16 no_alt_trk;
0299 __u16 first_dia_trk;
0300 __u16 no_dia_trk;
0301 __u16 first_sup_trk;
0302 __u16 no_sup_trk;
0303 __u8 MDR_ID;
0304 __u8 OBR_ID;
0305 __u8 director;
0306 __u8 rd_trk_set;
0307 __u16 max_rec_zero;
0308 __u8 reserved1;
0309 __u8 RWANY_in_LR;
0310 __u8 factor6;
0311 __u8 factor7;
0312 __u8 factor8;
0313 __u8 reserved2[3];
0314 __u8 reserved3[6];
0315 __u32 long_no_cyl;
0316 } __attribute__ ((packed));
0317
0318
0319 struct dasd_ned {
0320 struct {
0321 __u8 identifier:2;
0322 __u8 token_id:1;
0323 __u8 sno_valid:1;
0324 __u8 subst_sno:1;
0325 __u8 recNED:1;
0326 __u8 emuNED:1;
0327 __u8 reserved:1;
0328 } __attribute__ ((packed)) flags;
0329 __u8 descriptor;
0330 __u8 dev_class;
0331 __u8 reserved;
0332 __u8 dev_type[6];
0333 __u8 dev_model[3];
0334 __u8 HDA_manufacturer[3];
0335 struct {
0336 __u8 HDA_location[2];
0337 __u8 HDA_seqno[12];
0338 } serial;
0339 __u8 ID;
0340 __u8 unit_addr;
0341 } __attribute__ ((packed));
0342
0343 struct dasd_sneq {
0344 struct {
0345 __u8 identifier:2;
0346 __u8 reserved:6;
0347 } __attribute__ ((packed)) flags;
0348 __u8 res1;
0349 __u16 format;
0350 __u8 res2[4];
0351 __u8 sua_flags;
0352 __u8 base_unit_addr;
0353 __u8 res3[22];
0354 } __attribute__ ((packed));
0355
0356 struct vd_sneq {
0357 struct {
0358 __u8 identifier:2;
0359 __u8 reserved:6;
0360 } __attribute__ ((packed)) flags;
0361 __u8 res1;
0362 __u16 format;
0363 __u8 res2[4];
0364 __u8 uit[16];
0365 __u8 res3[8];
0366 } __attribute__ ((packed));
0367
0368 struct dasd_gneq {
0369 struct {
0370 __u8 identifier:2;
0371 __u8 reserved:6;
0372 } __attribute__ ((packed)) flags;
0373 __u8 record_selector;
0374 __u8 reserved[4];
0375 struct {
0376 __u8 value:2;
0377 __u8 number:6;
0378 } __attribute__ ((packed)) timeout;
0379 __u8 reserved3;
0380 __u16 subsystemID;
0381 __u8 reserved2[22];
0382 } __attribute__ ((packed));
0383
0384 struct dasd_rssd_features {
0385 char feature[256];
0386 } __attribute__((packed));
0387
0388 struct dasd_rssd_messages {
0389 __u16 length;
0390 __u8 format;
0391 __u8 code;
0392 __u32 message_id;
0393 __u8 flags;
0394 char messages[4087];
0395 } __packed;
0396
0397
0398
0399
0400 struct dasd_rssd_vsq {
0401 struct {
0402 __u8 tse:1;
0403 __u8 space_not_available:1;
0404 __u8 ese:1;
0405 __u8 unused:5;
0406 } __packed vol_info;
0407 __u8 unused1;
0408 __u16 extent_pool_id;
0409 __u8 warn_cap_limit;
0410 __u8 warn_cap_guaranteed;
0411 __u16 unused2;
0412 __u32 limit_capacity;
0413 __u32 guaranteed_capacity;
0414 __u32 space_allocated;
0415 __u32 space_configured;
0416 __u32 logical_capacity;
0417 } __packed;
0418
0419
0420
0421
0422 struct dasd_ext_pool_sum {
0423 __u16 pool_id;
0424 __u8 repo_warn_thrshld;
0425 __u8 warn_thrshld;
0426 struct {
0427 __u8 type:1;
0428 __u8 track_space_efficient:1;
0429 __u8 extent_space_efficient:1;
0430 __u8 standard_volume:1;
0431 __u8 extent_size_valid:1;
0432 __u8 capacity_at_warnlevel:1;
0433 __u8 pool_oos:1;
0434 __u8 unused0:1;
0435 __u8 unused1;
0436 } __packed flags;
0437 struct {
0438 __u8 reserved0:1;
0439 __u8 size_1G:1;
0440 __u8 reserved1:5;
0441 __u8 size_16M:1;
0442 } __packed extent_size;
0443 __u8 unused;
0444 } __packed;
0445
0446
0447
0448
0449 struct dasd_rssd_lcq {
0450 __u16 data_length;
0451 __u16 pool_count;
0452 struct {
0453 __u8 pool_info_valid:1;
0454 __u8 pool_id_volume:1;
0455 __u8 pool_id_cec:1;
0456 __u8 unused0:5;
0457 __u8 unused1;
0458 } __packed header_flags;
0459 char sfi_type[6];
0460 char sfi_model[3];
0461 __u8 sfi_seq_num[10];
0462 __u8 reserved[7];
0463 struct dasd_ext_pool_sum ext_pool_sum[448];
0464 } __packed;
0465
0466 struct dasd_oos_message {
0467 __u16 length;
0468 __u8 format;
0469 __u8 code;
0470 __u8 percentage_empty;
0471 __u8 reserved;
0472 __u16 ext_pool_id;
0473 __u16 token;
0474 __u8 unused[6];
0475 } __packed;
0476
0477 struct dasd_cuir_message {
0478 __u16 length;
0479 __u8 format;
0480 __u8 code;
0481 __u32 message_id;
0482 __u8 flags;
0483 __u8 neq_map[3];
0484 __u8 ned_map;
0485 __u8 record_selector;
0486 } __packed;
0487
0488 struct dasd_psf_cuir_response {
0489 __u8 order;
0490 __u8 flags;
0491 __u8 cc;
0492 __u8 chpid;
0493 __u16 device_nr;
0494 __u16 reserved;
0495 __u32 message_id;
0496 __u64 system_id;
0497 __u8 cssid;
0498 __u8 ssid;
0499 } __packed;
0500
0501 struct dasd_ckd_path_group_entry {
0502 __u8 status_flags;
0503 __u8 pgid[11];
0504 __u8 sysplex_name[8];
0505 __u32 timestamp;
0506 __u32 cylinder;
0507 __u8 reserved[4];
0508 } __packed;
0509
0510 struct dasd_ckd_host_information {
0511 __u8 access_flags;
0512 __u8 entry_size;
0513 __u16 entry_count;
0514 __u8 entry[16390];
0515 } __packed;
0516
0517 struct dasd_psf_query_host_access {
0518 __u8 access_flag;
0519 __u8 version;
0520 __u16 CKD_length;
0521 __u16 SCSI_length;
0522 __u8 unused[10];
0523 __u8 host_access_information[16394];
0524 } __packed;
0525
0526
0527
0528
0529 struct dasd_psf_prssd_data {
0530 unsigned char order;
0531 unsigned char flags;
0532 unsigned char reserved1;
0533 unsigned char reserved2;
0534 unsigned char lss;
0535 unsigned char volume;
0536 unsigned char suborder;
0537 unsigned char varies[5];
0538 } __attribute__ ((packed));
0539
0540
0541
0542
0543 struct dasd_psf_ssc_data {
0544 unsigned char order;
0545 unsigned char flags;
0546 unsigned char cu_type[4];
0547 unsigned char suborder;
0548 unsigned char reserved[59];
0549 } __attribute__((packed));
0550
0551
0552 #define DASD_ECKD_RAS_EXTS_MAX 110U
0553
0554 struct dasd_dso_ras_ext_range {
0555 struct ch_t beg_ext;
0556 struct ch_t end_ext;
0557 } __packed;
0558
0559
0560
0561
0562 struct dasd_dso_ras_data {
0563 __u8 order;
0564 struct {
0565 __u8 message:1;
0566 __u8 reserved1:2;
0567 __u8 vol_type:1;
0568 __u8 reserved2:4;
0569 } __packed flags;
0570
0571 struct {
0572 __u8 reserved1:2;
0573
0574 __u8 by_extent:1;
0575 __u8 guarantee_init:1;
0576 __u8 force_release:1;
0577 __u16 reserved2:11;
0578 } __packed op_flags;
0579 __u8 lss;
0580 __u8 dev_addr;
0581 __u32 reserved1;
0582 __u8 reserved2[10];
0583 __u16 nr_exts;
0584 __u16 reserved3;
0585 } __packed;
0586
0587
0588
0589
0590
0591 struct dasd_unit_address_configuration {
0592 struct {
0593 char ua_type;
0594 char base_ua;
0595 } unit[256];
0596 } __attribute__((packed));
0597
0598
0599 #define MAX_DEVICES_PER_LCU 256
0600
0601
0602 #define NEED_UAC_UPDATE 0x01
0603 #define UPDATE_PENDING 0x02
0604
0605 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
0606
0607
0608 struct alias_root {
0609 struct list_head serverlist;
0610 spinlock_t lock;
0611 };
0612
0613 struct alias_server {
0614 struct list_head server;
0615 struct dasd_uid uid;
0616 struct list_head lculist;
0617 };
0618
0619 struct summary_unit_check_work_data {
0620 char reason;
0621 struct dasd_device *device;
0622 struct work_struct worker;
0623 };
0624
0625 struct read_uac_work_data {
0626 struct dasd_device *device;
0627 struct delayed_work dwork;
0628 };
0629
0630 struct alias_lcu {
0631 struct list_head lcu;
0632 struct dasd_uid uid;
0633 enum pavtype pav;
0634 char flags;
0635 spinlock_t lock;
0636 struct list_head grouplist;
0637 struct list_head active_devices;
0638 struct list_head inactive_devices;
0639 struct dasd_unit_address_configuration *uac;
0640 struct summary_unit_check_work_data suc_data;
0641 struct read_uac_work_data ruac_data;
0642 struct dasd_ccw_req *rsu_cqr;
0643 struct completion lcu_setup;
0644 };
0645
0646 struct alias_pav_group {
0647 struct list_head group;
0648 struct dasd_uid uid;
0649 struct alias_lcu *lcu;
0650 struct list_head baselist;
0651 struct list_head aliaslist;
0652 struct dasd_device *next;
0653 };
0654
0655 struct dasd_conf_data {
0656 struct dasd_ned neds[5];
0657 u8 reserved[64];
0658 struct dasd_gneq gneq;
0659 } __packed;
0660
0661 struct dasd_conf {
0662 u8 *data;
0663 int len;
0664
0665 struct dasd_ned *ned;
0666 struct dasd_sneq *sneq;
0667 struct vd_sneq *vdsneq;
0668 struct dasd_gneq *gneq;
0669 };
0670
0671 struct dasd_eckd_private {
0672 struct dasd_eckd_characteristics rdc_data;
0673 struct dasd_conf conf;
0674
0675 struct eckd_count count_area[5];
0676 int init_cqr_status;
0677 int uses_cdl;
0678 struct attrib_data_t attrib;
0679 struct dasd_rssd_features features;
0680 struct dasd_rssd_vsq vsq;
0681 struct dasd_ext_pool_sum eps;
0682 u32 real_cyl;
0683
0684
0685 struct dasd_uid uid;
0686 struct alias_pav_group *pavgroup;
0687 struct alias_lcu *lcu;
0688 int count;
0689
0690 u32 fcx_max_data;
0691 char suc_reason;
0692 };
0693
0694
0695
0696 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
0697 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
0698 int dasd_alias_add_device(struct dasd_device *);
0699 int dasd_alias_remove_device(struct dasd_device *);
0700 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
0701 void dasd_alias_handle_summary_unit_check(struct work_struct *);
0702 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
0703 int dasd_alias_update_add_device(struct dasd_device *);
0704 #endif