2 * File...........: linux/drivers/s390/block/dasd_eckd.h
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 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
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
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_RELEASE 0x94
39 #define DASD_ECKD_CCW_READ_CKD_MT 0x9e
40 #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
41 #define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5
42 #define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6
43 #define DASD_ECKD_CCW_RESERVE 0xB4
44 #define DASD_ECKD_CCW_PFX 0xE7
45 #define DASD_ECKD_CCW_PFX_READ 0xEA
46 #define DASD_ECKD_CCW_RSCK 0xF9
49 * Perform Subsystem Function / Sub-Orders
51 #define PSF_ORDER_PRSSD 0x18
52 #define PSF_ORDER_SSC 0x1D
55 * Size that is reportet for large volumes in the old 16-bit no_cyl field
57 #define LV_COMPAT_CYL 0xFFFE
59 /*****************************************************************************
60 * SECTION: Type Definitions
61 ****************************************************************************/
69 } __attribute__ ((packed));
74 } __attribute__ ((packed));
80 } __attribute__ ((packed));
86 } __attribute__ ((packed));
92 } __attribute__ ((packed));
95 __u8 skip_control[14];
97 __u8 physical_addr[3];
99 struct ch_t track_addr;
103 } __attribute__ ((packed));
105 struct DE_eckd_data {
107 unsigned char perm:2; /* Permissions on this extent */
108 unsigned char reserved:1;
109 unsigned char seek:2; /* Seek control */
110 unsigned char auth:2; /* Access authorization */
111 unsigned char pci:1; /* PCI Fetch mode */
112 } __attribute__ ((packed)) mask;
114 unsigned char mode:2; /* Architecture mode */
115 unsigned char ckd:1; /* CKD Conversion */
116 unsigned char operation:3; /* Operation mode */
117 unsigned char cfw:1; /* Cache fast write */
118 unsigned char dfw:1; /* DASD fast write */
119 } __attribute__ ((packed)) attributes;
120 __u16 blk_size; /* Blocksize */
122 __u8 ga_additional; /* Global Attributes Additional */
123 __u8 ga_extended; /* Global Attributes Extended */
126 unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
127 __u8 ep_format; /* Extended Parameter format byte */
128 __u8 ep_prio; /* Extended Parameter priority I/O byte */
129 __u8 ep_reserved1; /* Extended Parameter Reserved */
130 __u8 ep_rec_per_track; /* Number of records on a track */
131 __u8 ep_reserved[4]; /* Extended Parameter Reserved */
132 } __attribute__ ((packed));
134 struct LO_eckd_data {
136 unsigned char orientation:2;
137 unsigned char operation:6;
138 } __attribute__ ((packed)) operation;
140 unsigned char last_bytes_used:1;
141 unsigned char reserved:6;
142 unsigned char read_count_suffix:1;
143 } __attribute__ ((packed)) auxiliary;
146 struct ch_t seek_addr;
147 struct chr_t search_arg;
150 } __attribute__ ((packed));
152 struct LRE_eckd_data {
154 unsigned char orientation:2;
155 unsigned char operation:6;
156 } __attribute__ ((packed)) operation;
158 unsigned char length_valid:1;
159 unsigned char length_scope:1;
160 unsigned char imbedded_ccw_valid:1;
161 unsigned char check_bytes:2;
162 unsigned char imbedded_count_valid:1;
163 unsigned char reserved:1;
164 unsigned char read_count_suffix:1;
165 } __attribute__ ((packed)) auxiliary;
168 struct ch_t seek_addr;
169 struct chr_t search_arg;
173 __u8 extended_operation;
174 __u16 extended_parameter_length;
175 __u8 extended_parameter[0];
176 } __attribute__ ((packed));
178 /* Prefix data for format 0x00 and 0x01 */
179 struct PFX_eckd_data {
180 unsigned char format;
182 unsigned char define_extent:1;
183 unsigned char time_stamp:1;
184 unsigned char verify_base:1;
185 unsigned char hyper_pav:1;
186 unsigned char reserved:4;
187 } __attribute__ ((packed)) validity;
192 struct DE_eckd_data define_extent;
193 struct LRE_eckd_data locate_record;
194 } __attribute__ ((packed));
196 struct dasd_eckd_characteristics {
199 unsigned char support:2;
200 unsigned char async:1;
201 unsigned char reserved:1;
202 unsigned char cache_info:1;
203 unsigned char model:3;
204 } __attribute__ ((packed)) cu_model;
208 unsigned char mult_burst:1;
209 unsigned char RT_in_LR:1;
210 unsigned char reserved1:1;
211 unsigned char RD_IN_LR:1;
212 unsigned char reserved2:4;
213 unsigned char reserved3:8;
214 unsigned char defect_wr:1;
215 unsigned char XRC_supported:1;
216 unsigned char reserved4:1;
217 unsigned char striping:1;
218 unsigned char reserved5:4;
220 unsigned char reserved6:2;
221 unsigned char cache:1;
222 unsigned char dual_copy:1;
224 unsigned char reset_alleg:1;
225 unsigned char sense_down:1;
226 } __attribute__ ((packed)) facilities;
232 __u8 byte_per_track[3];
240 } __attribute__ ((packed)) f_0x01;
247 } __attribute__ ((packed)) f_0x02;
248 } __attribute__ ((packed)) factors;
268 } __attribute__ ((packed));
270 /* elements of the configuration data */
280 } __attribute__ ((packed)) flags;
286 __u8 HDA_manufacturer[3];
287 __u8 HDA_location[2];
291 } __attribute__ ((packed));
297 } __attribute__ ((packed)) flags;
300 __u8 res2[4]; /* byte 4- 7 */
301 __u8 sua_flags; /* byte 8 */
302 __u8 base_unit_addr; /* byte 9 */
303 __u8 res3[22]; /* byte 10-31 */
304 } __attribute__ ((packed));
310 } __attribute__ ((packed)) flags;
313 __u8 res2[4]; /* byte 4- 7 */
314 __u8 uit[16]; /* byte 8-23 */
315 __u8 res3[8]; /* byte 24-31 */
316 } __attribute__ ((packed));
322 } __attribute__ ((packed)) flags;
326 } __attribute__ ((packed));
328 struct dasd_eckd_path {
334 struct dasd_rssd_features {
336 } __attribute__((packed));
340 * Perform Subsystem Function - Prepare for Read Subsystem Data
342 struct dasd_psf_prssd_data {
345 unsigned char reserved[4];
346 unsigned char suborder;
347 unsigned char varies[5];
348 } __attribute__ ((packed));
351 * Perform Subsystem Function - Set Subsystem Characteristics
353 struct dasd_psf_ssc_data {
356 unsigned char cu_type[4];
357 unsigned char suborder;
358 unsigned char reserved[59];
359 } __attribute__((packed));
363 * some structures and definitions for alias handling
365 struct dasd_unit_address_configuration {
370 } __attribute__((packed));
373 #define MAX_DEVICES_PER_LCU 256
375 /* flags on the LCU */
376 #define NEED_UAC_UPDATE 0x01
377 #define UPDATE_PENDING 0x02
379 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
383 struct list_head serverlist;
387 struct alias_server {
388 struct list_head server;
390 struct list_head lculist;
393 struct summary_unit_check_work_data {
395 struct dasd_device *device;
396 struct work_struct worker;
399 struct read_uac_work_data {
400 struct dasd_device *device;
401 struct delayed_work dwork;
405 struct list_head lcu;
410 struct list_head grouplist;
411 struct list_head active_devices;
412 struct list_head inactive_devices;
413 struct dasd_unit_address_configuration *uac;
414 struct summary_unit_check_work_data suc_data;
415 struct read_uac_work_data ruac_data;
416 struct dasd_ccw_req *rsu_cqr;
419 struct alias_pav_group {
420 struct list_head group;
422 struct alias_lcu *lcu;
423 struct list_head baselist;
424 struct list_head aliaslist;
425 struct dasd_device *next;
429 struct dasd_eckd_private {
430 struct dasd_eckd_characteristics rdc_data;
433 /* pointers to specific parts in the conf_data */
434 struct dasd_ned *ned;
435 struct dasd_sneq *sneq;
436 struct vd_sneq *vdsneq;
437 struct dasd_gneq *gneq;
439 struct dasd_eckd_path path_data;
440 struct eckd_count count_area[5];
443 struct attrib_data_t attrib; /* e.g. cache operations */
444 struct dasd_rssd_features features;
447 /* alias managemnet */
449 struct alias_pav_group *pavgroup;
450 struct alias_lcu *lcu;
456 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
457 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
458 int dasd_alias_add_device(struct dasd_device *);
459 int dasd_alias_remove_device(struct dasd_device *);
460 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
461 void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
462 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
464 #endif /* DASD_ECKD_H */