1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef DASD_H
16 #define DASD_H
17 #include <linux/types.h>
18 #include <linux/ioctl.h>
19
20 #define DASD_IOCTL_LETTER 'D'
21
22 #define DASD_API_VERSION 6
23
24
25
26
27
28
29 typedef struct dasd_information2_t {
30 unsigned int devno;
31 unsigned int real_devno;
32 unsigned int schid;
33 unsigned int cu_type : 16;
34 unsigned int cu_model : 8;
35 unsigned int dev_type : 16;
36 unsigned int dev_model : 8;
37 unsigned int open_count;
38 unsigned int req_queue_len;
39 unsigned int chanq_len;
40 char type[4];
41 unsigned int status;
42 unsigned int label_block;
43 unsigned int FBA_layout;
44 unsigned int characteristics_size;
45 unsigned int confdata_size;
46 char characteristics[64];
47 char configuration_data[256];
48 unsigned int format;
49 unsigned int features;
50 unsigned int reserved0;
51 unsigned int reserved1;
52 unsigned int reserved2;
53 unsigned int reserved3;
54 unsigned int reserved4;
55 unsigned int reserved5;
56 unsigned int reserved6;
57 unsigned int reserved7;
58 } dasd_information2_t;
59
60
61
62
63
64
65
66 #define DASD_FORMAT_NONE 0
67 #define DASD_FORMAT_LDL 1
68 #define DASD_FORMAT_CDL 2
69
70
71
72
73
74
75
76
77
78
79
80
81
82 #define DASD_FEATURE_READONLY 0x001
83 #define DASD_FEATURE_USEDIAG 0x002
84 #define DASD_FEATURE_INITIAL_ONLINE 0x004
85 #define DASD_FEATURE_ERPLOG 0x008
86 #define DASD_FEATURE_FAILFAST 0x010
87 #define DASD_FEATURE_FAILONSLCK 0x020
88 #define DASD_FEATURE_USERAW 0x040
89 #define DASD_FEATURE_DISCARD 0x080
90 #define DASD_FEATURE_PATH_AUTODISABLE 0x100
91 #define DASD_FEATURE_DEFAULT DASD_FEATURE_PATH_AUTODISABLE
92
93 #define DASD_PARTN_BITS 2
94
95
96
97
98
99 typedef struct dasd_information_t {
100 unsigned int devno;
101 unsigned int real_devno;
102 unsigned int schid;
103 unsigned int cu_type : 16;
104 unsigned int cu_model : 8;
105 unsigned int dev_type : 16;
106 unsigned int dev_model : 8;
107 unsigned int open_count;
108 unsigned int req_queue_len;
109 unsigned int chanq_len;
110 char type[4];
111 unsigned int status;
112 unsigned int label_block;
113 unsigned int FBA_layout;
114 unsigned int characteristics_size;
115 unsigned int confdata_size;
116 char characteristics[64];
117 char configuration_data[256];
118 } dasd_information_t;
119
120
121
122
123 typedef struct dasd_rssd_perf_stats_t {
124 unsigned char invalid:1;
125 unsigned char format:3;
126 unsigned char data_format:4;
127 unsigned char unit_address;
128 unsigned short device_status;
129 unsigned int nr_read_normal;
130 unsigned int nr_read_normal_hits;
131 unsigned int nr_write_normal;
132 unsigned int nr_write_fast_normal_hits;
133 unsigned int nr_read_seq;
134 unsigned int nr_read_seq_hits;
135 unsigned int nr_write_seq;
136 unsigned int nr_write_fast_seq_hits;
137 unsigned int nr_read_cache;
138 unsigned int nr_read_cache_hits;
139 unsigned int nr_write_cache;
140 unsigned int nr_write_fast_cache_hits;
141 unsigned int nr_inhibit_cache;
142 unsigned int nr_bybass_cache;
143 unsigned int nr_seq_dasd_to_cache;
144 unsigned int nr_dasd_to_cache;
145 unsigned int nr_cache_to_dasd;
146 unsigned int nr_delayed_fast_write;
147 unsigned int nr_normal_fast_write;
148 unsigned int nr_seq_fast_write;
149 unsigned int nr_cache_miss;
150 unsigned char status2;
151 unsigned int nr_quick_write_promotes;
152 unsigned char reserved;
153 unsigned short ssid;
154 unsigned char reseved2[96];
155 } __attribute__((packed)) dasd_rssd_perf_stats_t;
156
157
158
159
160
161 typedef struct dasd_profile_info_t {
162 unsigned int dasd_io_reqs;
163 unsigned int dasd_io_sects;
164 unsigned int dasd_io_secs[32];
165 unsigned int dasd_io_times[32];
166 unsigned int dasd_io_timps[32];
167 unsigned int dasd_io_time1[32];
168 unsigned int dasd_io_time2[32];
169 unsigned int dasd_io_time2ps[32];
170 unsigned int dasd_io_time3[32];
171 unsigned int dasd_io_nr_req[32];
172 } dasd_profile_info_t;
173
174
175
176
177
178 typedef struct format_data_t {
179 unsigned int start_unit;
180 unsigned int stop_unit;
181 unsigned int blksize;
182 unsigned int intensity;
183 } format_data_t;
184
185
186
187
188
189
190
191
192 #define DASD_FMT_INT_FMT_R0 1
193 #define DASD_FMT_INT_FMT_HA 2
194 #define DASD_FMT_INT_INVAL 4
195 #define DASD_FMT_INT_COMPAT 8
196 #define DASD_FMT_INT_FMT_NOR0 16
197 #define DASD_FMT_INT_ESE_FULL 32
198
199
200
201
202
203
204 typedef struct format_check_t {
205
206 struct format_data_t expect;
207
208
209 unsigned int result;
210 unsigned int unit;
211 unsigned int rec;
212 unsigned int num_records;
213 unsigned int blksize;
214 unsigned int key_length;
215 } format_check_t;
216
217
218
219 #define DASD_FMT_ERR_TOO_FEW_RECORDS 1
220
221 #define DASD_FMT_ERR_TOO_MANY_RECORDS 2
222
223 #define DASD_FMT_ERR_BLKSIZE 3
224
225
226 #define DASD_FMT_ERR_RECORD_ID 4
227
228 #define DASD_FMT_ERR_KEY_LENGTH 5
229
230
231
232
233
234
235 typedef struct attrib_data_t {
236 unsigned char operation:3;
237 unsigned char reserved:5;
238 __u16 nr_cyl;
239 __u8 reserved2[29];
240 } __attribute__ ((packed)) attrib_data_t;
241
242
243 #define DASD_NORMAL_CACHE 0x0
244 #define DASD_BYPASS_CACHE 0x1
245 #define DASD_INHIBIT_LOAD 0x2
246 #define DASD_SEQ_ACCESS 0x3
247 #define DASD_SEQ_PRESTAGE 0x4
248 #define DASD_REC_ACCESS 0x5
249
250
251
252
253 typedef struct dasd_symmio_parms {
254 unsigned char reserved[8];
255 unsigned long long psf_data;
256 unsigned long long rssd_result;
257 int psf_data_len;
258 int rssd_result_len;
259 } __attribute__ ((packed)) dasd_symmio_parms_t;
260
261
262
263
264 struct dasd_snid_data {
265 struct {
266 __u8 group:2;
267 __u8 reserve:2;
268 __u8 mode:1;
269 __u8 res:3;
270 } __attribute__ ((packed)) path_state;
271 __u8 pgid[11];
272 } __attribute__ ((packed));
273
274 struct dasd_snid_ioctl_data {
275 struct dasd_snid_data data;
276 __u8 path_mask;
277 } __attribute__ ((packed));
278
279
280
281
282
283
284
285
286
287
288
289
290 #define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)
291
292 #define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)
293
294 #define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2)
295 #define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3)
296 #define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4)
297
298 #define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)
299
300 #define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
301
302 #define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)
303
304 #define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)
305
306 #define BIODASDALLOWIO _IO(DASD_IOCTL_LETTER, 241)
307
308
309
310 #define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int)
311
312 #define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
313
314 #define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t)
315
316 #define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
317
318 #define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
319
320 #define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)
321
322
323
324 #define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)
325
326 #define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
327
328 #define BIODASDRAS _IOW(DASD_IOCTL_LETTER, 3, format_data_t)
329
330
331 #define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
332
333 #define BIODASDCHECKFMT _IOWR(DASD_IOCTL_LETTER, 2, format_check_t)
334
335 #define BIODASDSYMMIO _IOWR(DASD_IOCTL_LETTER, 240, dasd_symmio_parms_t)
336
337 #endif
338