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_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_SSC 0x1D
59 * Size that is reportet for large volumes in the old 16-bit no_cyl field
61 #define LV_COMPAT_CYL 0xFFFE
64 #define FCX_MAX_DATA_FACTOR 65536
65 #define DASD_ECKD_RCD_DATA_SIZE 256
68 /*****************************************************************************
69 * SECTION: Type Definitions
70 ****************************************************************************/
78 } __attribute__ ((packed
));
83 } __attribute__ ((packed
));
89 } __attribute__ ((packed
));
95 } __attribute__ ((packed
));
101 } __attribute__ ((packed
));
104 __u8 skip_control
[14];
106 __u8 physical_addr
[3];
108 struct ch_t track_addr
;
112 } __attribute__ ((packed
));
114 struct DE_eckd_data
{
116 unsigned char perm
:2; /* Permissions on this extent */
117 unsigned char reserved
:1;
118 unsigned char seek
:2; /* Seek control */
119 unsigned char auth
:2; /* Access authorization */
120 unsigned char pci
:1; /* PCI Fetch mode */
121 } __attribute__ ((packed
)) mask
;
123 unsigned char mode
:2; /* Architecture mode */
124 unsigned char ckd
:1; /* CKD Conversion */
125 unsigned char operation
:3; /* Operation mode */
126 unsigned char cfw
:1; /* Cache fast write */
127 unsigned char dfw
:1; /* DASD fast write */
128 } __attribute__ ((packed
)) attributes
;
129 __u16 blk_size
; /* Blocksize */
131 __u8 ga_additional
; /* Global Attributes Additional */
132 __u8 ga_extended
; /* Global Attributes Extended */
135 unsigned long long ep_sys_time
; /* Ext Parameter - System Time Stamp */
136 __u8 ep_format
; /* Extended Parameter format byte */
137 __u8 ep_prio
; /* Extended Parameter priority I/O byte */
138 __u8 ep_reserved1
; /* Extended Parameter Reserved */
139 __u8 ep_rec_per_track
; /* Number of records on a track */
140 __u8 ep_reserved
[4]; /* Extended Parameter Reserved */
141 } __attribute__ ((packed
));
143 struct LO_eckd_data
{
145 unsigned char orientation
:2;
146 unsigned char operation
:6;
147 } __attribute__ ((packed
)) operation
;
149 unsigned char last_bytes_used
:1;
150 unsigned char reserved
:6;
151 unsigned char read_count_suffix
:1;
152 } __attribute__ ((packed
)) auxiliary
;
155 struct ch_t seek_addr
;
156 struct chr_t search_arg
;
159 } __attribute__ ((packed
));
161 struct LRE_eckd_data
{
163 unsigned char orientation
:2;
164 unsigned char operation
:6;
165 } __attribute__ ((packed
)) operation
;
167 unsigned char length_valid
:1;
168 unsigned char length_scope
:1;
169 unsigned char imbedded_ccw_valid
:1;
170 unsigned char check_bytes
:2;
171 unsigned char imbedded_count_valid
:1;
172 unsigned char reserved
:1;
173 unsigned char read_count_suffix
:1;
174 } __attribute__ ((packed
)) auxiliary
;
177 struct ch_t seek_addr
;
178 struct chr_t search_arg
;
182 __u8 extended_operation
;
183 __u16 extended_parameter_length
;
184 __u8 extended_parameter
[0];
185 } __attribute__ ((packed
));
187 /* Prefix data for format 0x00 and 0x01 */
188 struct PFX_eckd_data
{
189 unsigned char format
;
191 unsigned char define_extent
:1;
192 unsigned char time_stamp
:1;
193 unsigned char verify_base
:1;
194 unsigned char hyper_pav
:1;
195 unsigned char reserved
:4;
196 } __attribute__ ((packed
)) validity
;
201 struct DE_eckd_data define_extent
;
202 struct LRE_eckd_data locate_record
;
203 } __attribute__ ((packed
));
205 struct dasd_eckd_characteristics
{
208 unsigned char support
:2;
209 unsigned char async
:1;
210 unsigned char reserved
:1;
211 unsigned char cache_info
:1;
212 unsigned char model
:3;
213 } __attribute__ ((packed
)) cu_model
;
217 unsigned char mult_burst
:1;
218 unsigned char RT_in_LR
:1;
219 unsigned char reserved1
:1;
220 unsigned char RD_IN_LR
:1;
221 unsigned char reserved2
:4;
222 unsigned char reserved3
:8;
223 unsigned char defect_wr
:1;
224 unsigned char XRC_supported
:1;
225 unsigned char reserved4
:1;
226 unsigned char striping
:1;
227 unsigned char reserved5
:4;
229 unsigned char reserved6
:2;
230 unsigned char cache
:1;
231 unsigned char dual_copy
:1;
233 unsigned char reset_alleg
:1;
234 unsigned char sense_down
:1;
235 } __attribute__ ((packed
)) facilities
;
241 __u8 byte_per_track
[3];
249 } __attribute__ ((packed
)) f_0x01
;
256 } __attribute__ ((packed
)) f_0x02
;
257 } __attribute__ ((packed
)) factors
;
277 } __attribute__ ((packed
));
279 /* elements of the configuration data */
289 } __attribute__ ((packed
)) flags
;
295 __u8 HDA_manufacturer
[3];
296 __u8 HDA_location
[2];
300 } __attribute__ ((packed
));
306 } __attribute__ ((packed
)) flags
;
309 __u8 res2
[4]; /* byte 4- 7 */
310 __u8 sua_flags
; /* byte 8 */
311 __u8 base_unit_addr
; /* byte 9 */
312 __u8 res3
[22]; /* byte 10-31 */
313 } __attribute__ ((packed
));
319 } __attribute__ ((packed
)) flags
;
322 __u8 res2
[4]; /* byte 4- 7 */
323 __u8 uit
[16]; /* byte 8-23 */
324 __u8 res3
[8]; /* byte 24-31 */
325 } __attribute__ ((packed
));
331 } __attribute__ ((packed
)) flags
;
336 } __attribute__ ((packed
)) timeout
;
340 } __attribute__ ((packed
));
342 struct dasd_rssd_features
{
344 } __attribute__((packed
));
348 * Perform Subsystem Function - Prepare for Read Subsystem Data
350 struct dasd_psf_prssd_data
{
353 unsigned char reserved
[4];
354 unsigned char suborder
;
355 unsigned char varies
[5];
356 } __attribute__ ((packed
));
359 * Perform Subsystem Function - Set Subsystem Characteristics
361 struct dasd_psf_ssc_data
{
364 unsigned char cu_type
[4];
365 unsigned char suborder
;
366 unsigned char reserved
[59];
367 } __attribute__((packed
));
371 * some structures and definitions for alias handling
373 struct dasd_unit_address_configuration
{
378 } __attribute__((packed
));
381 #define MAX_DEVICES_PER_LCU 256
383 /* flags on the LCU */
384 #define NEED_UAC_UPDATE 0x01
385 #define UPDATE_PENDING 0x02
387 enum pavtype
{NO_PAV
, BASE_PAV
, HYPER_PAV
};
391 struct list_head serverlist
;
395 struct alias_server
{
396 struct list_head server
;
398 struct list_head lculist
;
401 struct summary_unit_check_work_data
{
403 struct dasd_device
*device
;
404 struct work_struct worker
;
407 struct read_uac_work_data
{
408 struct dasd_device
*device
;
409 struct delayed_work dwork
;
413 struct list_head lcu
;
418 struct list_head grouplist
;
419 struct list_head active_devices
;
420 struct list_head inactive_devices
;
421 struct dasd_unit_address_configuration
*uac
;
422 struct summary_unit_check_work_data suc_data
;
423 struct read_uac_work_data ruac_data
;
424 struct dasd_ccw_req
*rsu_cqr
;
425 struct completion lcu_setup
;
428 struct alias_pav_group
{
429 struct list_head group
;
431 struct alias_lcu
*lcu
;
432 struct list_head baselist
;
433 struct list_head aliaslist
;
434 struct dasd_device
*next
;
437 struct dasd_eckd_private
{
438 struct dasd_eckd_characteristics rdc_data
;
441 /* pointers to specific parts in the conf_data */
442 struct dasd_ned
*ned
;
443 struct dasd_sneq
*sneq
;
444 struct vd_sneq
*vdsneq
;
445 struct dasd_gneq
*gneq
;
447 struct eckd_count count_area
[5];
450 struct attrib_data_t attrib
; /* e.g. cache operations */
451 struct dasd_rssd_features features
;
454 /* alias managemnet */
456 struct alias_pav_group
*pavgroup
;
457 struct alias_lcu
*lcu
;
465 int dasd_alias_make_device_known_to_lcu(struct dasd_device
*);
466 void dasd_alias_disconnect_device_from_lcu(struct dasd_device
*);
467 int dasd_alias_add_device(struct dasd_device
*);
468 int dasd_alias_remove_device(struct dasd_device
*);
469 struct dasd_device
*dasd_alias_get_start_dev(struct dasd_device
*);
470 void dasd_alias_handle_summary_unit_check(struct dasd_device
*, struct irb
*);
471 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req
*);
472 void dasd_alias_lcu_setup_complete(struct dasd_device
*);
473 void dasd_alias_wait_for_lcu_setup(struct dasd_device
*);
474 int dasd_alias_update_add_device(struct dasd_device
*);
475 #endif /* DASD_ECKD_H */