Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dasd_eckd.h
Go to the documentation of this file.
1 /*
2  * Author(s)......: Holger Smolinski <[email protected]>
3  * Horst Hummel <[email protected]>
4  * Bugreports.to..: <[email protected]>
5  * Copyright IBM Corp. 1999, 2000
6  *
7  */
8 
9 #ifndef DASD_ECKD_H
10 #define DASD_ECKD_H
11 
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
50 
51 /*
52  * Perform Subsystem Function / Sub-Orders
53  */
54 #define PSF_ORDER_PRSSD 0x18
55 #define PSF_ORDER_SSC 0x1D
56 
57 /*
58  * Size that is reportet for large volumes in the old 16-bit no_cyl field
59  */
60 #define LV_COMPAT_CYL 0xFFFE
61 
62 
63 #define FCX_MAX_DATA_FACTOR 65536
64 #define DASD_ECKD_RCD_DATA_SIZE 256
65 
66 
67 /*****************************************************************************
68  * SECTION: Type Definitions
69  ****************************************************************************/
70 
71 struct eckd_count {
77 } __attribute__ ((packed));
78 
79 struct ch_t {
82 } __attribute__ ((packed));
83 
84 struct chs_t {
88 } __attribute__ ((packed));
89 
90 struct chr_t {
94 } __attribute__ ((packed));
95 
96 struct geom_t {
100 } __attribute__ ((packed));
101 
102 struct eckd_home {
107  struct ch_t track_addr;
111 } __attribute__ ((packed));
113 struct DE_eckd_data {
114  struct {
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));
141 
143  struct {
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;
158 } __attribute__ ((packed));
161  struct {
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;
175  __u8 count;
176  struct ch_t seek_addr;
177  struct chr_t search_arg;
178  __u8 sector;
179  __u16 length;
184 } __attribute__ ((packed));
185 
186 /* Prefix data for format 0x00 and 0x01 */
188  unsigned char format;
189  struct {
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;
201  struct LRE_eckd_data locate_record;
202 } __attribute__ ((packed));
206  struct {
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;
215  struct {
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;
227  unsigned char cfw:1;
228  unsigned char reserved6:2;
229  unsigned char cache:1;
230  unsigned char dual_copy:1;
231  unsigned char dfw:1;
232  unsigned char reset_alleg:1;
233  unsigned char sense_down:1;
234  } __attribute__ ((packed)) facilities;
243  union {
244  struct {
248  } __attribute__ ((packed)) f_0x01;
255  } __attribute__ ((packed)) f_0x02;
256  } __attribute__ ((packed)) factors;
276 } __attribute__ ((packed));
278 /* elements of the configuration data */
280  struct {
287  __u8 reserved:1;
288  } __attribute__ ((packed)) flags;
290  __u8 dev_class;
291  __u8 reserved;
297  __u8 ID;
299 } __attribute__ ((packed));
300 
302  struct {
304  __u8 reserved:6;
305  } __attribute__ ((packed)) flags;
307  __u16 format;
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));
315  struct {
317  __u8 reserved:6;
318  } __attribute__ ((packed)) flags;
319  __u8 res1;
320  __u16 format;
321  __u8 res2[4]; /* byte 4- 7 */
322  __u8 uit[16]; /* byte 8-23 */
323  __u8 res3[8]; /* byte 24-31 */
324 } __attribute__ ((packed));
325 
327  struct {
329  __u8 reserved:6;
330  } __attribute__ ((packed)) flags;
331  __u8 reserved[5];
335  } __attribute__ ((packed)) timeout;
336  __u8 reserved3;
338  __u8 reserved2[22];
339 } __attribute__ ((packed));
340 
342  char feature[256];
343 } __attribute__((packed));
345 
346 /*
347  * Perform Subsystem Function - Prepare for Read Subsystem Data
348  */
350  unsigned char order;
351  unsigned char flags;
352  unsigned char reserved[4];
353  unsigned char suborder;
354  unsigned char varies[5];
355 } __attribute__ ((packed));
357 /*
358  * Perform Subsystem Function - Set Subsystem Characteristics
359  */
361  unsigned char order;
362  unsigned char flags;
363  unsigned char cu_type[4];
364  unsigned char suborder;
365  unsigned char reserved[59];
366 } __attribute__((packed));
367 
368 
369 /*
370  * some structures and definitions for alias handling
371  */
373  struct {
374  char ua_type;
375  char base_ua;
376  } unit[256];
377 } __attribute__((packed));
378 
380 #define MAX_DEVICES_PER_LCU 256
381 
382 /* flags on the LCU */
383 #define NEED_UAC_UPDATE 0x01
384 #define UPDATE_PENDING 0x02
385 
387 
388 
389 struct alias_root {
390  struct list_head serverlist;
392 };
393 
394 struct alias_server {
395  struct list_head server;
396  struct dasd_uid uid;
397  struct list_head lculist;
398 };
399 
401  char reason;
404 };
405 
408  struct delayed_work dwork;
409 };
410 
411 struct alias_lcu {
412  struct list_head lcu;
413  struct dasd_uid uid;
414  enum pavtype pav;
415  char flags;
417  struct list_head grouplist;
418  struct list_head active_devices;
419  struct list_head inactive_devices;
422  struct read_uac_work_data ruac_data;
424  struct completion lcu_setup;
425 };
426 
428  struct list_head group;
429  struct dasd_uid uid;
430  struct alias_lcu *lcu;
431  struct list_head baselist;
432  struct list_head aliaslist;
433  struct dasd_device *next;
434 };
435 
437  struct dasd_eckd_characteristics rdc_data;
439  int conf_len;
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;
445 
446  struct eckd_count count_area[5];
448  int uses_cdl;
449  struct attrib_data_t attrib; /* e.g. cache operations */
452 
453  /* alias managemnet */
454  struct dasd_uid uid;
456  struct alias_lcu *lcu;
457  int count;
458 
460 };
461 
462 
463 
466 int dasd_alias_add_device(struct dasd_device *);
469 void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
474 #endif /* DASD_ECKD_H */