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 struct dasd_eckd_confdata
{
237 unsigned char identifier
:2;
238 unsigned char token_id
:1;
239 unsigned char sno_valid
:1;
240 unsigned char subst_sno
:1;
241 unsigned char recNED
:1;
242 unsigned char emuNED
:1;
243 unsigned char reserved
:1;
244 } __attribute__ ((packed
)) flags
;
248 unsigned char dev_type
[6];
249 unsigned char dev_model
[3];
250 unsigned char HDA_manufacturer
[3];
251 unsigned char HDA_location
[2];
252 unsigned char HDA_seqno
[12];
255 } __attribute__ ((packed
)) ned1
;
259 unsigned char identifier
:2;
260 unsigned char token_id
:1;
261 unsigned char sno_valid
:1;
262 unsigned char subst_sno
:1;
263 unsigned char recNED
:1;
264 unsigned char emuNED
:1;
265 unsigned char reserved
:1;
266 } __attribute__ ((packed
)) flags
;
269 unsigned char dev_type
[6];
270 unsigned char dev_model
[3];
271 unsigned char DASD_manufacturer
[3];
272 unsigned char DASD_location
[2];
273 unsigned char DASD_seqno
[12];
275 } __attribute__ ((packed
)) ned
;
277 unsigned char flags
; /* byte 0 */
278 unsigned char res1
; /* byte 1 */
279 __u16 format
; /* byte 2-3 */
280 unsigned char res2
[4]; /* byte 4-7 */
281 unsigned char sua_flags
; /* byte 8 */
282 __u8 base_unit_addr
; /* byte 9 */
283 unsigned char res3
[22]; /* byte 10-31 */
284 } __attribute__ ((packed
)) sneq
;
285 } __attribute__ ((packed
)) ned2
;
288 unsigned char identifier
:2;
289 unsigned char token_id
:1;
290 unsigned char sno_valid
:1;
291 unsigned char subst_sno
:1;
292 unsigned char recNED
:1;
293 unsigned char emuNED
:1;
294 unsigned char reserved
:1;
295 } __attribute__ ((packed
)) flags
;
298 unsigned char cont_type
[6];
299 unsigned char cont_model
[3];
300 unsigned char cont_manufacturer
[3];
301 unsigned char cont_location
[2];
302 unsigned char cont_seqno
[12];
304 } __attribute__ ((packed
)) ned3
;
307 unsigned char identifier
:2;
308 unsigned char token_id
:1;
309 unsigned char sno_valid
:1;
310 unsigned char subst_sno
:1;
311 unsigned char recNED
:1;
312 unsigned char emuNED
:1;
313 unsigned char reserved
:1;
314 } __attribute__ ((packed
)) flags
;
317 unsigned char cont_type
[6];
318 unsigned char empty
[3];
319 unsigned char cont_manufacturer
[3];
320 unsigned char cont_location
[2];
321 unsigned char cont_seqno
[12];
323 } __attribute__ ((packed
)) ned4
;
324 unsigned char ned5
[32];
325 unsigned char ned6
[32];
326 unsigned char ned7
[32];
329 unsigned char identifier
:2;
330 unsigned char reserved
:6;
331 } __attribute__ ((packed
)) flags
;
339 unsigned char reserved
:5;
340 unsigned char scluster
:1;
341 } __attribute__ ((packed
)) spathID
;
348 unsigned char parallel
:1;
349 unsigned char escon
:1;
350 unsigned char reserved
:1;
351 unsigned char ficon
:1;
352 unsigned char reserved2
:4;
353 } __attribute__ ((packed
)) protocol_type
;
355 unsigned char PID_in_236
:1;
356 unsigned char reserved
:7;
357 } __attribute__ ((packed
)) format_flags
;
358 __u8 log_dev_address
;
359 unsigned char reserved2
[12];
360 } __attribute__ ((packed
)) neq
;
361 } __attribute__ ((packed
));
363 struct dasd_eckd_path
{
369 struct dasd_rssd_features
{
371 } __attribute__((packed
));
375 * Perform Subsystem Function - Prepare for Read Subsystem Data
377 struct dasd_psf_prssd_data
{
380 unsigned char reserved
[4];
381 unsigned char suborder
;
382 unsigned char varies
[9];
383 } __attribute__ ((packed
));
386 * Perform Subsystem Function - Set Subsystem Characteristics
388 struct dasd_psf_ssc_data
{
391 unsigned char cu_type
[4];
392 unsigned char suborder
;
393 unsigned char reserved
[59];
394 } __attribute__((packed
));
398 * some structures and definitions for alias handling
400 struct dasd_unit_address_configuration
{
405 } __attribute__((packed
));
408 #define MAX_DEVICES_PER_LCU 256
410 /* flags on the LCU */
411 #define NEED_UAC_UPDATE 0x01
412 #define UPDATE_PENDING 0x02
414 enum pavtype
{NO_PAV
, BASE_PAV
, HYPER_PAV
};
418 struct list_head serverlist
;
422 struct alias_server
{
423 struct list_head server
;
425 struct list_head lculist
;
428 struct summary_unit_check_work_data
{
430 struct dasd_device
*device
;
431 struct work_struct worker
;
434 struct read_uac_work_data
{
435 struct dasd_device
*device
;
436 struct delayed_work dwork
;
440 struct list_head lcu
;
445 struct list_head grouplist
;
446 struct list_head active_devices
;
447 struct list_head inactive_devices
;
448 struct dasd_unit_address_configuration
*uac
;
449 struct summary_unit_check_work_data suc_data
;
450 struct read_uac_work_data ruac_data
;
451 struct dasd_ccw_req
*rsu_cqr
;
454 struct alias_pav_group
{
455 struct list_head group
;
457 struct alias_lcu
*lcu
;
458 struct list_head baselist
;
459 struct list_head aliaslist
;
460 struct dasd_device
*next
;
464 struct dasd_eckd_private
{
465 struct dasd_eckd_characteristics rdc_data
;
466 struct dasd_eckd_confdata conf_data
;
467 struct dasd_eckd_path path_data
;
468 struct eckd_count count_area
[5];
471 struct attrib_data_t attrib
; /* e.g. cache operations */
472 struct dasd_rssd_features features
;
474 /* alias managemnet */
476 struct alias_pav_group
*pavgroup
;
477 struct alias_lcu
*lcu
;
483 int dasd_alias_make_device_known_to_lcu(struct dasd_device
*);
484 void dasd_alias_disconnect_device_from_lcu(struct dasd_device
*);
485 int dasd_alias_add_device(struct dasd_device
*);
486 int dasd_alias_remove_device(struct dasd_device
*);
487 struct dasd_device
*dasd_alias_get_start_dev(struct dasd_device
*);
488 void dasd_alias_handle_summary_unit_check(struct dasd_device
*, struct irb
*);
489 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req
*);
491 #endif /* DASD_ECKD_H */