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_RESERVE 0xB4
42 #define DASD_ECKD_CCW_PFX 0xE7
43 #define DASD_ECKD_CCW_RSCK 0xF9
46 * Perform Subsystem Function / Sub-Orders
48 #define PSF_ORDER_PRSSD 0x18
49 #define PSF_ORDER_SSC 0x1D
52 * Size that is reportet for large volumes in the old 16-bit no_cyl field
54 #define LV_COMPAT_CYL 0xFFFE
56 /*****************************************************************************
57 * SECTION: Type Definitions
58 ****************************************************************************/
66 } __attribute__ ((packed));
71 } __attribute__ ((packed));
77 } __attribute__ ((packed));
83 } __attribute__ ((packed));
89 } __attribute__ ((packed));
92 __u8 skip_control[14];
94 __u8 physical_addr[3];
96 struct ch_t track_addr;
100 } __attribute__ ((packed));
102 struct DE_eckd_data {
104 unsigned char perm:2; /* Permissions on this extent */
105 unsigned char reserved:1;
106 unsigned char seek:2; /* Seek control */
107 unsigned char auth:2; /* Access authorization */
108 unsigned char pci:1; /* PCI Fetch mode */
109 } __attribute__ ((packed)) mask;
111 unsigned char mode:2; /* Architecture mode */
112 unsigned char ckd:1; /* CKD Conversion */
113 unsigned char operation:3; /* Operation mode */
114 unsigned char cfw:1; /* Cache fast write */
115 unsigned char dfw:1; /* DASD fast write */
116 } __attribute__ ((packed)) attributes;
117 __u16 blk_size; /* Blocksize */
119 __u8 ga_additional; /* Global Attributes Additional */
120 __u8 ga_extended; /* Global Attributes Extended */
123 unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
124 __u8 ep_format; /* Extended Parameter format byte */
125 __u8 ep_prio; /* Extended Parameter priority I/O byte */
126 __u8 ep_reserved[6]; /* Extended Parameter Reserved */
127 } __attribute__ ((packed));
129 struct LO_eckd_data {
131 unsigned char orientation:2;
132 unsigned char operation:6;
133 } __attribute__ ((packed)) operation;
135 unsigned char last_bytes_used:1;
136 unsigned char reserved:6;
137 unsigned char read_count_suffix:1;
138 } __attribute__ ((packed)) auxiliary;
141 struct ch_t seek_addr;
142 struct chr_t search_arg;
145 } __attribute__ ((packed));
147 /* Prefix data for format 0x00 and 0x01 */
148 struct PFX_eckd_data {
149 unsigned char format;
151 unsigned char define_extend:1;
152 unsigned char time_stamp:1;
153 unsigned char verify_base:1;
154 unsigned char hyper_pav:1;
155 unsigned char reserved:4;
156 } __attribute__ ((packed)) validity;
161 struct DE_eckd_data define_extend;
162 struct LO_eckd_data locate_record;
163 __u8 LO_extended_data[4];
164 } __attribute__ ((packed));
166 struct dasd_eckd_characteristics {
169 unsigned char support:2;
170 unsigned char async:1;
171 unsigned char reserved:1;
172 unsigned char cache_info:1;
173 unsigned char model:3;
174 } __attribute__ ((packed)) cu_model;
178 unsigned char mult_burst:1;
179 unsigned char RT_in_LR:1;
180 unsigned char reserved1:1;
181 unsigned char RD_IN_LR:1;
182 unsigned char reserved2:4;
183 unsigned char reserved3:8;
184 unsigned char defect_wr:1;
185 unsigned char XRC_supported:1;
186 unsigned char reserved4:1;
187 unsigned char striping:1;
188 unsigned char reserved5:4;
190 unsigned char reserved6:2;
191 unsigned char cache:1;
192 unsigned char dual_copy:1;
194 unsigned char reset_alleg:1;
195 unsigned char sense_down:1;
196 } __attribute__ ((packed)) facilities;
202 __u8 byte_per_track[3];
210 } __attribute__ ((packed)) f_0x01;
217 } __attribute__ ((packed)) f_0x02;
218 } __attribute__ ((packed)) factors;
238 } __attribute__ ((packed));
240 /* elements of the configuration data */
250 } __attribute__ ((packed)) flags;
256 __u8 HDA_manufacturer[3];
257 __u8 HDA_location[2];
261 } __attribute__ ((packed));
267 } __attribute__ ((packed)) flags;
270 __u8 res2[4]; /* byte 4- 7 */
271 __u8 sua_flags; /* byte 8 */
272 __u8 base_unit_addr; /* byte 9 */
273 __u8 res3[22]; /* byte 10-31 */
274 } __attribute__ ((packed));
280 } __attribute__ ((packed)) flags;
283 __u8 res2[4]; /* byte 4- 7 */
284 __u8 uit[16]; /* byte 8-23 */
285 __u8 res3[8]; /* byte 24-31 */
286 } __attribute__ ((packed));
292 } __attribute__ ((packed)) flags;
296 } __attribute__ ((packed));
298 struct dasd_eckd_path {
304 struct dasd_rssd_features {
306 } __attribute__((packed));
310 * Perform Subsystem Function - Prepare for Read Subsystem Data
312 struct dasd_psf_prssd_data {
315 unsigned char reserved[4];
316 unsigned char suborder;
317 unsigned char varies[5];
318 } __attribute__ ((packed));
321 * Perform Subsystem Function - Set Subsystem Characteristics
323 struct dasd_psf_ssc_data {
326 unsigned char cu_type[4];
327 unsigned char suborder;
328 unsigned char reserved[59];
329 } __attribute__((packed));
333 * some structures and definitions for alias handling
335 struct dasd_unit_address_configuration {
340 } __attribute__((packed));
343 #define MAX_DEVICES_PER_LCU 256
345 /* flags on the LCU */
346 #define NEED_UAC_UPDATE 0x01
347 #define UPDATE_PENDING 0x02
349 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
353 struct list_head serverlist;
357 struct alias_server {
358 struct list_head server;
360 struct list_head lculist;
363 struct summary_unit_check_work_data {
365 struct dasd_device *device;
366 struct work_struct worker;
369 struct read_uac_work_data {
370 struct dasd_device *device;
371 struct delayed_work dwork;
375 struct list_head lcu;
380 struct list_head grouplist;
381 struct list_head active_devices;
382 struct list_head inactive_devices;
383 struct dasd_unit_address_configuration *uac;
384 struct summary_unit_check_work_data suc_data;
385 struct read_uac_work_data ruac_data;
386 struct dasd_ccw_req *rsu_cqr;
389 struct alias_pav_group {
390 struct list_head group;
392 struct alias_lcu *lcu;
393 struct list_head baselist;
394 struct list_head aliaslist;
395 struct dasd_device *next;
399 struct dasd_eckd_private {
400 struct dasd_eckd_characteristics rdc_data;
403 /* pointers to specific parts in the conf_data */
404 struct dasd_ned *ned;
405 struct dasd_sneq *sneq;
406 struct vd_sneq *vdsneq;
407 struct dasd_gneq *gneq;
409 struct dasd_eckd_path path_data;
410 struct eckd_count count_area[5];
413 struct attrib_data_t attrib; /* e.g. cache operations */
414 struct dasd_rssd_features features;
417 /* alias managemnet */
419 struct alias_pav_group *pavgroup;
420 struct alias_lcu *lcu;
426 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
427 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
428 int dasd_alias_add_device(struct dasd_device *);
429 int dasd_alias_remove_device(struct dasd_device *);
430 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
431 void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
432 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
434 #endif /* DASD_ECKD_H */