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_SNID 0x34
31 #define DASD_ECKD_CCW_RSSD 0x3e
32 #define DASD_ECKD_CCW_LOCATE_RECORD 0x47
33 #define DASD_ECKD_CCW_SNSS 0x54
34 #define DASD_ECKD_CCW_DEFINE_EXTENT 0x63
35 #define DASD_ECKD_CCW_WRITE_MT 0x85
36 #define DASD_ECKD_CCW_READ_MT 0x86
37 #define DASD_ECKD_CCW_WRITE_KD_MT 0x8d
38 #define DASD_ECKD_CCW_READ_KD_MT 0x8e
39 #define DASD_ECKD_CCW_RELEASE 0x94
40 #define DASD_ECKD_CCW_READ_CKD_MT 0x9e
41 #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
42 #define DASD_ECKD_CCW_WRITE_TRACK_DATA 0xA5
43 #define DASD_ECKD_CCW_READ_TRACK_DATA 0xA6
44 #define DASD_ECKD_CCW_RESERVE 0xB4
45 #define DASD_ECKD_CCW_PFX 0xE7
46 #define DASD_ECKD_CCW_PFX_READ 0xEA
47 #define DASD_ECKD_CCW_RSCK 0xF9
50 * Perform Subsystem Function / Sub-Orders
52 #define PSF_ORDER_PRSSD 0x18
53 #define PSF_ORDER_SSC 0x1D
56 * Size that is reportet for large volumes in the old 16-bit no_cyl field
58 #define LV_COMPAT_CYL 0xFFFE
60 /*****************************************************************************
61 * SECTION: Type Definitions
62 ****************************************************************************/
70 } __attribute__ ((packed));
75 } __attribute__ ((packed));
81 } __attribute__ ((packed));
87 } __attribute__ ((packed));
93 } __attribute__ ((packed));
96 __u8 skip_control[14];
98 __u8 physical_addr[3];
100 struct ch_t track_addr;
104 } __attribute__ ((packed));
106 struct DE_eckd_data {
108 unsigned char perm:2; /* Permissions on this extent */
109 unsigned char reserved:1;
110 unsigned char seek:2; /* Seek control */
111 unsigned char auth:2; /* Access authorization */
112 unsigned char pci:1; /* PCI Fetch mode */
113 } __attribute__ ((packed)) mask;
115 unsigned char mode:2; /* Architecture mode */
116 unsigned char ckd:1; /* CKD Conversion */
117 unsigned char operation:3; /* Operation mode */
118 unsigned char cfw:1; /* Cache fast write */
119 unsigned char dfw:1; /* DASD fast write */
120 } __attribute__ ((packed)) attributes;
121 __u16 blk_size; /* Blocksize */
123 __u8 ga_additional; /* Global Attributes Additional */
124 __u8 ga_extended; /* Global Attributes Extended */
127 unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
128 __u8 ep_format; /* Extended Parameter format byte */
129 __u8 ep_prio; /* Extended Parameter priority I/O byte */
130 __u8 ep_reserved1; /* Extended Parameter Reserved */
131 __u8 ep_rec_per_track; /* Number of records on a track */
132 __u8 ep_reserved[4]; /* Extended Parameter Reserved */
133 } __attribute__ ((packed));
135 struct LO_eckd_data {
137 unsigned char orientation:2;
138 unsigned char operation:6;
139 } __attribute__ ((packed)) operation;
141 unsigned char last_bytes_used:1;
142 unsigned char reserved:6;
143 unsigned char read_count_suffix:1;
144 } __attribute__ ((packed)) auxiliary;
147 struct ch_t seek_addr;
148 struct chr_t search_arg;
151 } __attribute__ ((packed));
153 struct LRE_eckd_data {
155 unsigned char orientation:2;
156 unsigned char operation:6;
157 } __attribute__ ((packed)) operation;
159 unsigned char length_valid:1;
160 unsigned char length_scope:1;
161 unsigned char imbedded_ccw_valid:1;
162 unsigned char check_bytes:2;
163 unsigned char imbedded_count_valid:1;
164 unsigned char reserved:1;
165 unsigned char read_count_suffix:1;
166 } __attribute__ ((packed)) auxiliary;
169 struct ch_t seek_addr;
170 struct chr_t search_arg;
174 __u8 extended_operation;
175 __u16 extended_parameter_length;
176 __u8 extended_parameter[0];
177 } __attribute__ ((packed));
179 /* Prefix data for format 0x00 and 0x01 */
180 struct PFX_eckd_data {
181 unsigned char format;
183 unsigned char define_extent:1;
184 unsigned char time_stamp:1;
185 unsigned char verify_base:1;
186 unsigned char hyper_pav:1;
187 unsigned char reserved:4;
188 } __attribute__ ((packed)) validity;
193 struct DE_eckd_data define_extent;
194 struct LRE_eckd_data locate_record;
195 } __attribute__ ((packed));
197 struct dasd_eckd_characteristics {
200 unsigned char support:2;
201 unsigned char async:1;
202 unsigned char reserved:1;
203 unsigned char cache_info:1;
204 unsigned char model:3;
205 } __attribute__ ((packed)) cu_model;
209 unsigned char mult_burst:1;
210 unsigned char RT_in_LR:1;
211 unsigned char reserved1:1;
212 unsigned char RD_IN_LR:1;
213 unsigned char reserved2:4;
214 unsigned char reserved3:8;
215 unsigned char defect_wr:1;
216 unsigned char XRC_supported:1;
217 unsigned char reserved4:1;
218 unsigned char striping:1;
219 unsigned char reserved5:4;
221 unsigned char reserved6:2;
222 unsigned char cache:1;
223 unsigned char dual_copy:1;
225 unsigned char reset_alleg:1;
226 unsigned char sense_down:1;
227 } __attribute__ ((packed)) facilities;
233 __u8 byte_per_track[3];
241 } __attribute__ ((packed)) f_0x01;
248 } __attribute__ ((packed)) f_0x02;
249 } __attribute__ ((packed)) factors;
269 } __attribute__ ((packed));
271 /* elements of the configuration data */
281 } __attribute__ ((packed)) flags;
287 __u8 HDA_manufacturer[3];
288 __u8 HDA_location[2];
292 } __attribute__ ((packed));
298 } __attribute__ ((packed)) flags;
301 __u8 res2[4]; /* byte 4- 7 */
302 __u8 sua_flags; /* byte 8 */
303 __u8 base_unit_addr; /* byte 9 */
304 __u8 res3[22]; /* byte 10-31 */
305 } __attribute__ ((packed));
311 } __attribute__ ((packed)) flags;
314 __u8 res2[4]; /* byte 4- 7 */
315 __u8 uit[16]; /* byte 8-23 */
316 __u8 res3[8]; /* byte 24-31 */
317 } __attribute__ ((packed));
323 } __attribute__ ((packed)) flags;
328 } __attribute__ ((packed)) timeout;
332 } __attribute__ ((packed));
334 struct dasd_eckd_path {
340 struct dasd_rssd_features {
342 } __attribute__((packed));
346 * Perform Subsystem Function - Prepare for Read Subsystem Data
348 struct dasd_psf_prssd_data {
351 unsigned char reserved[4];
352 unsigned char suborder;
353 unsigned char varies[5];
354 } __attribute__ ((packed));
357 * Perform Subsystem Function - Set Subsystem Characteristics
359 struct dasd_psf_ssc_data {
362 unsigned char cu_type[4];
363 unsigned char suborder;
364 unsigned char reserved[59];
365 } __attribute__((packed));
369 * some structures and definitions for alias handling
371 struct dasd_unit_address_configuration {
376 } __attribute__((packed));
379 #define MAX_DEVICES_PER_LCU 256
381 /* flags on the LCU */
382 #define NEED_UAC_UPDATE 0x01
383 #define UPDATE_PENDING 0x02
385 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
389 struct list_head serverlist;
393 struct alias_server {
394 struct list_head server;
396 struct list_head lculist;
399 struct summary_unit_check_work_data {
401 struct dasd_device *device;
402 struct work_struct worker;
405 struct read_uac_work_data {
406 struct dasd_device *device;
407 struct delayed_work dwork;
411 struct list_head lcu;
416 struct list_head grouplist;
417 struct list_head active_devices;
418 struct list_head inactive_devices;
419 struct dasd_unit_address_configuration *uac;
420 struct summary_unit_check_work_data suc_data;
421 struct read_uac_work_data ruac_data;
422 struct dasd_ccw_req *rsu_cqr;
423 struct completion lcu_setup;
426 struct alias_pav_group {
427 struct list_head group;
429 struct alias_lcu *lcu;
430 struct list_head baselist;
431 struct list_head aliaslist;
432 struct dasd_device *next;
435 struct dasd_eckd_private {
436 struct dasd_eckd_characteristics rdc_data;
439 /* pointers to specific parts in the conf_data */
440 struct dasd_ned *ned;
441 struct dasd_sneq *sneq;
442 struct vd_sneq *vdsneq;
443 struct dasd_gneq *gneq;
445 struct dasd_eckd_path path_data;
446 struct eckd_count count_area[5];
449 struct attrib_data_t attrib; /* e.g. cache operations */
450 struct dasd_rssd_features features;
453 /* alias managemnet */
455 struct alias_pav_group *pavgroup;
456 struct alias_lcu *lcu;
462 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
463 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
464 int dasd_alias_add_device(struct dasd_device *);
465 int dasd_alias_remove_device(struct dasd_device *);
466 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
467 void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
468 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
469 void dasd_alias_lcu_setup_complete(struct dasd_device *);
470 void dasd_alias_wait_for_lcu_setup(struct dasd_device *);
471 int dasd_alias_update_add_device(struct dasd_device *);
472 #endif /* DASD_ECKD_H */