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_RELEASE 0x94
39 #define DASD_ECKD_CCW_WRITE_FULL_TRACK 0x95
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_READ_TRACK 0xDE
46 #define DASD_ECKD_CCW_PFX 0xE7
47 #define DASD_ECKD_CCW_PFX_READ 0xEA
48 #define DASD_ECKD_CCW_RSCK 0xF9
49 #define DASD_ECKD_CCW_RCD 0xFA
52 * Perform Subsystem Function / Sub-Orders
54 #define PSF_ORDER_PRSSD 0x18
55 #define PSF_ORDER_SSC 0x1D
58 * Size that is reportet for large volumes in the old 16-bit no_cyl field
60 #define LV_COMPAT_CYL 0xFFFE
63 #define FCX_MAX_DATA_FACTOR 65536
64 #define DASD_ECKD_RCD_DATA_SIZE 256
67 /*****************************************************************************
68 * SECTION: Type Definitions
69 ****************************************************************************/
77 } __attribute__ ((packed));
82 } __attribute__ ((packed));
88 } __attribute__ ((packed));
94 } __attribute__ ((packed));
100 } __attribute__ ((packed));
103 __u8 skip_control[14];
105 __u8 physical_addr[3];
107 struct ch_t track_addr;
111 } __attribute__ ((packed));
113 struct DE_eckd_data {
115 unsigned char perm:2; /* Permissions on this extent */
116 unsigned char reserved:1;
117 unsigned char seek:2; /* Seek control */
118 unsigned char auth:2; /* Access authorization */
119 unsigned char pci:1; /* PCI Fetch mode */
120 } __attribute__ ((packed)) mask;
122 unsigned char mode:2; /* Architecture mode */
123 unsigned char ckd:1; /* CKD Conversion */
124 unsigned char operation:3; /* Operation mode */
125 unsigned char cfw:1; /* Cache fast write */
126 unsigned char dfw:1; /* DASD fast write */
127 } __attribute__ ((packed)) attributes;
128 __u16 blk_size; /* Blocksize */
130 __u8 ga_additional; /* Global Attributes Additional */
131 __u8 ga_extended; /* Global Attributes Extended */
134 unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
135 __u8 ep_format; /* Extended Parameter format byte */
136 __u8 ep_prio; /* Extended Parameter priority I/O byte */
137 __u8 ep_reserved1; /* Extended Parameter Reserved */
138 __u8 ep_rec_per_track; /* Number of records on a track */
139 __u8 ep_reserved[4]; /* Extended Parameter Reserved */
140 } __attribute__ ((packed));
142 struct LO_eckd_data {
144 unsigned char orientation:2;
145 unsigned char operation:6;
146 } __attribute__ ((packed)) operation;
148 unsigned char last_bytes_used:1;
149 unsigned char reserved:6;
150 unsigned char read_count_suffix:1;
151 } __attribute__ ((packed)) auxiliary;
154 struct ch_t seek_addr;
155 struct chr_t search_arg;
158 } __attribute__ ((packed));
160 struct LRE_eckd_data {
162 unsigned char orientation:2;
163 unsigned char operation:6;
164 } __attribute__ ((packed)) operation;
166 unsigned char length_valid:1;
167 unsigned char length_scope:1;
168 unsigned char imbedded_ccw_valid:1;
169 unsigned char check_bytes:2;
170 unsigned char imbedded_count_valid:1;
171 unsigned char reserved:1;
172 unsigned char read_count_suffix:1;
173 } __attribute__ ((packed)) auxiliary;
176 struct ch_t seek_addr;
177 struct chr_t search_arg;
181 __u8 extended_operation;
182 __u16 extended_parameter_length;
183 __u8 extended_parameter[0];
184 } __attribute__ ((packed));
186 /* Prefix data for format 0x00 and 0x01 */
187 struct PFX_eckd_data {
188 unsigned char format;
190 unsigned char define_extent:1;
191 unsigned char time_stamp:1;
192 unsigned char verify_base:1;
193 unsigned char hyper_pav:1;
194 unsigned char reserved:4;
195 } __attribute__ ((packed)) validity;
200 struct DE_eckd_data define_extent;
201 struct LRE_eckd_data locate_record;
202 } __attribute__ ((packed));
204 struct dasd_eckd_characteristics {
207 unsigned char support:2;
208 unsigned char async:1;
209 unsigned char reserved:1;
210 unsigned char cache_info:1;
211 unsigned char model:3;
212 } __attribute__ ((packed)) cu_model;
216 unsigned char mult_burst:1;
217 unsigned char RT_in_LR:1;
218 unsigned char reserved1:1;
219 unsigned char RD_IN_LR:1;
220 unsigned char reserved2:4;
221 unsigned char reserved3:8;
222 unsigned char defect_wr:1;
223 unsigned char XRC_supported:1;
224 unsigned char reserved4:1;
225 unsigned char striping:1;
226 unsigned char reserved5:4;
228 unsigned char reserved6:2;
229 unsigned char cache:1;
230 unsigned char dual_copy:1;
232 unsigned char reset_alleg:1;
233 unsigned char sense_down:1;
234 } __attribute__ ((packed)) facilities;
240 __u8 byte_per_track[3];
248 } __attribute__ ((packed)) f_0x01;
255 } __attribute__ ((packed)) f_0x02;
256 } __attribute__ ((packed)) factors;
276 } __attribute__ ((packed));
278 /* elements of the configuration data */
288 } __attribute__ ((packed)) flags;
294 __u8 HDA_manufacturer[3];
295 __u8 HDA_location[2];
299 } __attribute__ ((packed));
305 } __attribute__ ((packed)) flags;
308 __u8 res2[4]; /* byte 4- 7 */
309 __u8 sua_flags; /* byte 8 */
310 __u8 base_unit_addr; /* byte 9 */
311 __u8 res3[22]; /* byte 10-31 */
312 } __attribute__ ((packed));
318 } __attribute__ ((packed)) flags;
321 __u8 res2[4]; /* byte 4- 7 */
322 __u8 uit[16]; /* byte 8-23 */
323 __u8 res3[8]; /* byte 24-31 */
324 } __attribute__ ((packed));
330 } __attribute__ ((packed)) flags;
335 } __attribute__ ((packed)) timeout;
339 } __attribute__ ((packed));
341 struct dasd_rssd_features {
343 } __attribute__((packed));
347 * Perform Subsystem Function - Prepare for Read Subsystem Data
349 struct dasd_psf_prssd_data {
352 unsigned char reserved[4];
353 unsigned char suborder;
354 unsigned char varies[5];
355 } __attribute__ ((packed));
358 * Perform Subsystem Function - Set Subsystem Characteristics
360 struct dasd_psf_ssc_data {
363 unsigned char cu_type[4];
364 unsigned char suborder;
365 unsigned char reserved[59];
366 } __attribute__((packed));
370 * some structures and definitions for alias handling
372 struct dasd_unit_address_configuration {
377 } __attribute__((packed));
380 #define MAX_DEVICES_PER_LCU 256
382 /* flags on the LCU */
383 #define NEED_UAC_UPDATE 0x01
384 #define UPDATE_PENDING 0x02
386 enum pavtype {NO_PAV, BASE_PAV, HYPER_PAV};
390 struct list_head serverlist;
394 struct alias_server {
395 struct list_head server;
397 struct list_head lculist;
400 struct summary_unit_check_work_data {
402 struct dasd_device *device;
403 struct work_struct worker;
406 struct read_uac_work_data {
407 struct dasd_device *device;
408 struct delayed_work dwork;
412 struct list_head lcu;
417 struct list_head grouplist;
418 struct list_head active_devices;
419 struct list_head inactive_devices;
420 struct dasd_unit_address_configuration *uac;
421 struct summary_unit_check_work_data suc_data;
422 struct read_uac_work_data ruac_data;
423 struct dasd_ccw_req *rsu_cqr;
424 struct completion lcu_setup;
427 struct alias_pav_group {
428 struct list_head group;
430 struct alias_lcu *lcu;
431 struct list_head baselist;
432 struct list_head aliaslist;
433 struct dasd_device *next;
436 struct dasd_eckd_private {
437 struct dasd_eckd_characteristics rdc_data;
440 /* pointers to specific parts in the conf_data */
441 struct dasd_ned *ned;
442 struct dasd_sneq *sneq;
443 struct vd_sneq *vdsneq;
444 struct dasd_gneq *gneq;
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;
464 int dasd_alias_make_device_known_to_lcu(struct dasd_device *);
465 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *);
466 int dasd_alias_add_device(struct dasd_device *);
467 int dasd_alias_remove_device(struct dasd_device *);
468 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
469 void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
470 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
471 void dasd_alias_lcu_setup_complete(struct dasd_device *);
472 void dasd_alias_wait_for_lcu_setup(struct dasd_device *);
473 int dasd_alias_update_add_device(struct dasd_device *);
474 #endif /* DASD_ECKD_H */