2 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
3 * Horst Hummel <Horst.Hummel@de.ibm.com>
4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * Copyright IBM Corp. 1999, 2000
12 /*****************************************************************************
13 * SECTION: CCW Definitions
14 ****************************************************************************/
15 #define DASD_ECKD_CCW_WRITE 0x05
16 #define DASD_ECKD_CCW_READ 0x06
17 #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
18 #define DASD_ECKD_CCW_READ_HOME_ADDRESS 0x0a
19 #define DASD_ECKD_CCW_WRITE_KD 0x0d
20 #define DASD_ECKD_CCW_READ_KD 0x0e
21 #define DASD_ECKD_CCW_ERASE 0x11
22 #define DASD_ECKD_CCW_READ_COUNT 0x12
23 #define DASD_ECKD_CCW_SLCK 0x14
24 #define DASD_ECKD_CCW_WRITE_RECORD_ZERO 0x15
25 #define DASD_ECKD_CCW_READ_RECORD_ZERO 0x16
26 #define DASD_ECKD_CCW_WRITE_CKD 0x1d
27 #define DASD_ECKD_CCW_READ_CKD 0x1e
28 #define DASD_ECKD_CCW_PSF 0x27
29 #define DASD_ECKD_CCW_SNID 0x34
30 #define DASD_ECKD_CCW_RSSD 0x3e
31 #define DASD_ECKD_CCW_LOCATE_RECORD 0x47
32 #define DASD_ECKD_CCW_SNSS 0x54
33 #define DASD_ECKD_CCW_DEFINE_EXTENT 0x63
34 #define DASD_ECKD_CCW_WRITE_MT 0x85
35 #define DASD_ECKD_CCW_READ_MT 0x86
36 #define DASD_ECKD_CCW_WRITE_KD_MT 0x8d
37 #define DASD_ECKD_CCW_READ_KD_MT 0x8e
38 #define DASD_ECKD_CCW_READ_COUNT_MT 0x92
39 #define DASD_ECKD_CCW_RELEASE 0x94
40 #define DASD_ECKD_CCW_WRITE_FULL_TRACK 0x95
41 #define DASD_ECKD_CCW_READ_CKD_MT 0x9e
42 #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
43 #define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5
44 #define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6
45 #define DASD_ECKD_CCW_RESERVE 0xB4
46 #define DASD_ECKD_CCW_READ_TRACK 0xDE
47 #define DASD_ECKD_CCW_PFX 0xE7
48 #define DASD_ECKD_CCW_PFX_READ 0xEA
49 #define DASD_ECKD_CCW_RSCK 0xF9
50 #define DASD_ECKD_CCW_RCD 0xFA
53 * Perform Subsystem Function / Sub-Orders
55 #define PSF_ORDER_PRSSD 0x18
56 #define PSF_ORDER_CUIR_RESPONSE 0x1A
57 #define PSF_SUBORDER_QHA 0x1C
58 #define PSF_ORDER_SSC 0x1D
61 * CUIR response condition codes
63 #define PSF_CUIR_INVALID 0x00
64 #define PSF_CUIR_COMPLETED 0x01
65 #define PSF_CUIR_NOT_SUPPORTED 0x02
66 #define PSF_CUIR_ERROR_IN_REQ 0x03
67 #define PSF_CUIR_DENIED 0x04
68 #define PSF_CUIR_LAST_PATH 0x05
69 #define PSF_CUIR_DEVICE_ONLINE 0x06
70 #define PSF_CUIR_VARY_FAILURE 0x07
71 #define PSF_CUIR_SOFTWARE_FAILURE 0x08
72 #define PSF_CUIR_NOT_RECOGNIZED 0x09
77 #define CUIR_QUIESCE 0x01
78 #define CUIR_RESUME 0x02
81 * attention message definitions
83 #define ATTENTION_LENGTH_CUIR 0x0e
84 #define ATTENTION_FORMAT_CUIR 0x01
86 #define DASD_ECKD_PG_GROUPED 0x10
89 * Size that is reportet for large volumes in the old 16-bit no_cyl field
91 #define LV_COMPAT_CYL 0xFFFE
94 #define FCX_MAX_DATA_FACTOR 65536
95 #define DASD_ECKD_RCD_DATA_SIZE 256
98 /*****************************************************************************
99 * SECTION: Type Definitions
100 ****************************************************************************/
108 } __attribute__ ((packed));
113 } __attribute__ ((packed));
119 } __attribute__ ((packed));
125 } __attribute__ ((packed));
131 } __attribute__ ((packed));
134 __u8 skip_control[14];
136 __u8 physical_addr[3];
138 struct ch_t track_addr;
142 } __attribute__ ((packed));
144 struct DE_eckd_data {
146 unsigned char perm:2; /* Permissions on this extent */
147 unsigned char reserved:1;
148 unsigned char seek:2; /* Seek control */
149 unsigned char auth:2; /* Access authorization */
150 unsigned char pci:1; /* PCI Fetch mode */
151 } __attribute__ ((packed)) mask;
153 unsigned char mode:2; /* Architecture mode */
154 unsigned char ckd:1; /* CKD Conversion */
155 unsigned char operation:3; /* Operation mode */
156 unsigned char cfw:1; /* Cache fast write */
157 unsigned char dfw:1; /* DASD fast write */
158 } __attribute__ ((packed)) attributes;
159 __u16 blk_size; /* Blocksize */
161 __u8 ga_additional; /* Global Attributes Additional */
162 __u8 ga_extended; /* Global Attributes Extended */
165 unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
166 __u8 ep_format; /* Extended Parameter format byte */
167 __u8 ep_prio; /* Extended Parameter priority I/O byte */
168 __u8 ep_reserved1; /* Extended Parameter Reserved */
169 __u8 ep_rec_per_track; /* Number of records on a track */
170 __u8 ep_reserved[4]; /* Extended Parameter Reserved */
171 } __attribute__ ((packed));
173 struct LO_eckd_data {
175 unsigned char orientation:2;
176 unsigned char operation:6;
177 } __attribute__ ((packed)) operation;
179 unsigned char last_bytes_used:1;
180 unsigned char reserved:6;
181 unsigned char read_count_suffix:1;
182 } __attribute__ ((packed)) auxiliary;
185 struct ch_t seek_addr;
186 struct chr_t search_arg;
189 } __attribute__ ((packed));
191 struct LRE_eckd_data {
193 unsigned char orientation:2;
194 unsigned char operation:6;
195 } __attribute__ ((packed)) operation;
197 unsigned char length_valid:1;
198 unsigned char length_scope:1;
199 unsigned char imbedded_ccw_valid:1;
200 unsigned char check_bytes:2;
201 unsigned char imbedded_count_valid:1;
202 unsigned char reserved:1;
203 unsigned char read_count_suffix:1;
204 } __attribute__ ((packed)) auxiliary;
207 struct ch_t seek_addr;
208 struct chr_t search_arg;
212 __u8 extended_operation;
213 __u16 extended_parameter_length;
214 __u8 extended_parameter[0];
215 } __attribute__ ((packed));
217 /* Prefix data for format 0x00 and 0x01 */
218 struct PFX_eckd_data {
219 unsigned char format;
221 unsigned char define_extent:1;
222 unsigned char time_stamp:1;
223 unsigned char verify_base:1;
224 unsigned char hyper_pav:1;
225 unsigned char reserved:4;
226 } __attribute__ ((packed)) validity;
231 struct DE_eckd_data define_extent;
232 struct LRE_eckd_data locate_record;
233 } __attribute__ ((packed));
235 struct dasd_eckd_characteristics {
238 unsigned char support:2;
239 unsigned char async:1;
240 unsigned char reserved:1;
241 unsigned char cache_info:1;
242 unsigned char model:3;
243 } __attribute__ ((packed)) cu_model;
247 unsigned char mult_burst:1;
248 unsigned char RT_in_LR:1;
249 unsigned char reserved1:1;
250 unsigned char RD_IN_LR:1;
251 unsigned char reserved2:4;
252 unsigned char reserved3:8;
253 unsigned char defect_wr:1;
254 unsigned char XRC_supported:1;
255 unsigned char reserved4:1;
256 unsigned char striping:1;
257 unsigned char reserved5:4;
259 unsigned char reserved6:2;
260 unsigned char cache:1;
261 unsigned char dual_copy:1;
263 unsigned char reset_alleg:1;
264 unsigned char sense_down:1;
265 } __attribute__ ((packed)) facilities;
271 __u8 byte_per_track[3];
279 } __attribute__ ((packed)) f_0x01;
286 } __attribute__ ((packed)) f_0x02;
287 } __attribute__ ((packed)) factors;
307 } __attribute__ ((packed));
309 /* elements of the configuration data */
319 } __attribute__ ((packed)) flags;
325 __u8 HDA_manufacturer[3];
326 __u8 HDA_location[2];
330 } __attribute__ ((packed));
336 } __attribute__ ((packed)) flags;
339 __u8 res2[4]; /* byte 4- 7 */
340 __u8 sua_flags; /* byte 8 */
341 __u8 base_unit_addr; /* byte 9 */
342 __u8 res3[22]; /* byte 10-31 */
343 } __attribute__ ((packed));
349 } __attribute__ ((packed)) flags;
352 __u8 res2[4]; /* byte 4- 7 */
353 __u8 uit[16]; /* byte 8-23 */
354 __u8 res3[8]; /* byte 24-31 */
355 } __attribute__ ((packed));
361 } __attribute__ ((packed)) flags;
362 __u8 record_selector;
367 } __attribute__ ((packed)) timeout;
371 } __attribute__ ((packed));
373 struct dasd_rssd_features {
375 } __attribute__((packed));
377 struct dasd_rssd_messages {
386 struct dasd_cuir_message {
394 __u8 record_selector;
397 struct dasd_psf_cuir_response {
410 struct dasd_ckd_path_group_entry {
413 __u8 sysplex_name[8];
419 struct dasd_ckd_host_information {
426 struct dasd_psf_query_host_access {
432 __u8 host_access_information[16394];
436 * Perform Subsystem Function - Prepare for Read Subsystem Data
438 struct dasd_psf_prssd_data {
441 unsigned char reserved1;
442 unsigned char reserved2;
444 unsigned char volume;
445 unsigned char suborder;
446 unsigned char varies[5];
447 } __attribute__ ((packed));
450 * Perform Subsystem Function - Set Subsystem Characteristics
452 struct dasd_psf_ssc_data {
455 unsigned char cu_type[4];
456 unsigned char suborder;
457 unsigned char reserved[59];
458 } __attribute__((packed));
462 * some structures and definitions for alias handling
464 struct dasd_unit_address_configuration {
469 } __attribute__((packed));
472 #define MAX_DEVICES_PER_LCU 256
474 /* flags on the LCU */
475 #define NEED_UAC_UPDATE 0x01
476 #define UPDATE_PENDING 0x02
478 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
482 struct list_head serverlist;
486 struct alias_server {
487 struct list_head server;
489 struct list_head lculist;
492 struct summary_unit_check_work_data {
494 struct dasd_device *device;
495 struct work_struct worker;
498 struct read_uac_work_data {
499 struct dasd_device *device;
500 struct delayed_work dwork;
504 struct list_head lcu;
509 struct list_head grouplist;
510 struct list_head active_devices;
511 struct list_head inactive_devices;
512 struct dasd_unit_address_configuration *uac;
513 struct summary_unit_check_work_data suc_data;
514 struct read_uac_work_data ruac_data;
515 struct dasd_ccw_req *rsu_cqr;
516 struct completion lcu_setup;
519 struct alias_pav_group {
520 struct list_head group;
522 struct alias_lcu *lcu;
523 struct list_head baselist;
524 struct list_head aliaslist;
525 struct dasd_device *next;
528 struct dasd_conf_data {
529 struct dasd_ned neds[5];
531 struct dasd_gneq gneq;
534 struct dasd_eckd_private {
535 struct dasd_eckd_characteristics rdc_data;
538 /* per path configuration data */
539 struct dasd_conf_data *path_conf_data[8];
540 /* pointers to specific parts in the conf_data */
541 struct dasd_ned *ned;
542 struct dasd_sneq *sneq;
543 struct vd_sneq *vdsneq;
544 struct dasd_gneq *gneq;
546 struct eckd_count count_area[5];
549 struct attrib_data_t attrib; /* e.g. cache operations */
550 struct dasd_rssd_features features;
553 /* alias managemnet */
555 struct alias_pav_group *pavgroup;
556 struct alias_lcu *lcu;
565 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
566 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
567 int dasd_alias_add_device(struct dasd_device *);
568 int dasd_alias_remove_device(struct dasd_device *);
569 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
570 void dasd_alias_handle_summary_unit_check(struct work_struct *);
571 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
572 void dasd_alias_lcu_setup_complete(struct dasd_device *);
573 void dasd_alias_wait_for_lcu_setup(struct dasd_device *);
574 int dasd_alias_update_add_device(struct dasd_device *);
575 #endif /* DASD_ECKD_H */