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
51 /*****************************************************************************
52 * SECTION: Type Definitions
53 ****************************************************************************/
61 } __attribute__ ((packed
));
66 } __attribute__ ((packed
));
72 } __attribute__ ((packed
));
78 } __attribute__ ((packed
));
84 } __attribute__ ((packed
));
87 __u8 skip_control
[14];
89 __u8 physical_addr
[3];
91 struct ch_t track_addr
;
95 } __attribute__ ((packed
));
99 unsigned char perm
:2; /* Permissions on this extent */
100 unsigned char reserved
:1;
101 unsigned char seek
:2; /* Seek control */
102 unsigned char auth
:2; /* Access authorization */
103 unsigned char pci
:1; /* PCI Fetch mode */
104 } __attribute__ ((packed
)) mask
;
106 unsigned char mode
:2; /* Architecture mode */
107 unsigned char ckd
:1; /* CKD Conversion */
108 unsigned char operation
:3; /* Operation mode */
109 unsigned char cfw
:1; /* Cache fast write */
110 unsigned char dfw
:1; /* DASD fast write */
111 } __attribute__ ((packed
)) attributes
;
112 __u16 blk_size
; /* Blocksize */
114 __u8 ga_additional
; /* Global Attributes Additional */
115 __u8 ga_extended
; /* Global Attributes Extended */
118 unsigned long long ep_sys_time
; /* Ext Parameter - System Time Stamp */
119 __u8 ep_format
; /* Extended Parameter format byte */
120 __u8 ep_prio
; /* Extended Parameter priority I/O byte */
121 __u8 ep_reserved
[6]; /* Extended Parameter Reserved */
122 } __attribute__ ((packed
));
124 struct LO_eckd_data
{
126 unsigned char orientation
:2;
127 unsigned char operation
:6;
128 } __attribute__ ((packed
)) operation
;
130 unsigned char last_bytes_used
:1;
131 unsigned char reserved
:6;
132 unsigned char read_count_suffix
:1;
133 } __attribute__ ((packed
)) auxiliary
;
136 struct ch_t seek_addr
;
137 struct chr_t search_arg
;
140 } __attribute__ ((packed
));
142 /* Prefix data for format 0x00 and 0x01 */
143 struct PFX_eckd_data
{
144 unsigned char format
;
146 unsigned char define_extend
:1;
147 unsigned char time_stamp
:1;
148 unsigned char verify_base
:1;
149 unsigned char hyper_pav
:1;
150 unsigned char reserved
:4;
151 } __attribute__ ((packed
)) validity
;
156 struct DE_eckd_data define_extend
;
157 struct LO_eckd_data locate_record
;
158 __u8 LO_extended_data
[4];
159 } __attribute__ ((packed
));
161 struct dasd_eckd_characteristics
{
164 unsigned char support
:2;
165 unsigned char async
:1;
166 unsigned char reserved
:1;
167 unsigned char cache_info
:1;
168 unsigned char model
:3;
169 } __attribute__ ((packed
)) cu_model
;
173 unsigned char mult_burst
:1;
174 unsigned char RT_in_LR
:1;
175 unsigned char reserved1
:1;
176 unsigned char RD_IN_LR
:1;
177 unsigned char reserved2
:4;
178 unsigned char reserved3
:8;
179 unsigned char defect_wr
:1;
180 unsigned char XRC_supported
:1;
181 unsigned char reserved4
:1;
182 unsigned char striping
:1;
183 unsigned char reserved5
:4;
185 unsigned char reserved6
:2;
186 unsigned char cache
:1;
187 unsigned char dual_copy
:1;
189 unsigned char reset_alleg
:1;
190 unsigned char sense_down
:1;
191 } __attribute__ ((packed
)) facilities
;
197 __u8 byte_per_track
[3];
205 } __attribute__ ((packed
)) f_0x01
;
212 } __attribute__ ((packed
)) f_0x02
;
213 } __attribute__ ((packed
)) factors
;
232 } __attribute__ ((packed
));
234 /* elements of the configuration data */
244 } __attribute__ ((packed
)) flags
;
250 __u8 HDA_manufacturer
[3];
251 __u8 HDA_location
[2];
255 } __attribute__ ((packed
));
261 } __attribute__ ((packed
)) flags
;
264 __u8 res2
[4]; /* byte 4- 7 */
265 __u8 sua_flags
; /* byte 8 */
266 __u8 base_unit_addr
; /* byte 9 */
267 __u8 res3
[22]; /* byte 10-31 */
268 } __attribute__ ((packed
));
274 } __attribute__ ((packed
)) flags
;
277 __u8 res2
[4]; /* byte 4- 7 */
278 __u8 uit
[16]; /* byte 8-23 */
279 __u8 res3
[8]; /* byte 24-31 */
280 } __attribute__ ((packed
));
286 } __attribute__ ((packed
)) flags
;
290 } __attribute__ ((packed
));
292 struct dasd_eckd_path
{
298 struct dasd_rssd_features
{
300 } __attribute__((packed
));
304 * Perform Subsystem Function - Prepare for Read Subsystem Data
306 struct dasd_psf_prssd_data
{
309 unsigned char reserved
[4];
310 unsigned char suborder
;
311 unsigned char varies
[5];
312 } __attribute__ ((packed
));
315 * Perform Subsystem Function - Set Subsystem Characteristics
317 struct dasd_psf_ssc_data
{
320 unsigned char cu_type
[4];
321 unsigned char suborder
;
322 unsigned char reserved
[59];
323 } __attribute__((packed
));
327 * some structures and definitions for alias handling
329 struct dasd_unit_address_configuration
{
334 } __attribute__((packed
));
337 #define MAX_DEVICES_PER_LCU 256
339 /* flags on the LCU */
340 #define NEED_UAC_UPDATE 0x01
341 #define UPDATE_PENDING 0x02
343 enum pavtype
{NO_PAV
, BASE_PAV
, HYPER_PAV
};
347 struct list_head serverlist
;
351 struct alias_server
{
352 struct list_head server
;
354 struct list_head lculist
;
357 struct summary_unit_check_work_data
{
359 struct dasd_device
*device
;
360 struct work_struct worker
;
363 struct read_uac_work_data
{
364 struct dasd_device
*device
;
365 struct delayed_work dwork
;
369 struct list_head lcu
;
374 struct list_head grouplist
;
375 struct list_head active_devices
;
376 struct list_head inactive_devices
;
377 struct dasd_unit_address_configuration
*uac
;
378 struct summary_unit_check_work_data suc_data
;
379 struct read_uac_work_data ruac_data
;
380 struct dasd_ccw_req
*rsu_cqr
;
383 struct alias_pav_group
{
384 struct list_head group
;
386 struct alias_lcu
*lcu
;
387 struct list_head baselist
;
388 struct list_head aliaslist
;
389 struct dasd_device
*next
;
393 struct dasd_eckd_private
{
394 struct dasd_eckd_characteristics rdc_data
;
397 /* pointers to specific parts in the conf_data */
398 struct dasd_ned
*ned
;
399 struct dasd_sneq
*sneq
;
400 struct vd_sneq
*vdsneq
;
401 struct dasd_gneq
*gneq
;
403 struct dasd_eckd_path path_data
;
404 struct eckd_count count_area
[5];
407 struct attrib_data_t attrib
; /* e.g. cache operations */
408 struct dasd_rssd_features features
;
410 /* alias managemnet */
412 struct alias_pav_group
*pavgroup
;
413 struct alias_lcu
*lcu
;
419 int dasd_alias_make_device_known_to_lcu(struct dasd_device
*);
420 void dasd_alias_disconnect_device_from_lcu(struct dasd_device
*);
421 int dasd_alias_add_device(struct dasd_device
*);
422 int dasd_alias_remove_device(struct dasd_device
*);
423 struct dasd_device
*dasd_alias_get_start_dev(struct dasd_device
*);
424 void dasd_alias_handle_summary_unit_check(struct dasd_device
*, struct irb
*);
425 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req
*);
427 #endif /* DASD_ECKD_H */