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