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#define DASD_FEATURE_DEFAULT 0x00
78#define DASD_FEATURE_READONLY 0x01
79#define DASD_FEATURE_USEDIAG 0x02
80#define DASD_FEATURE_INITIAL_ONLINE 0x04
81#define DASD_FEATURE_ERPLOG 0x08
82#define DASD_FEATURE_FAILFAST 0x10
83#define DASD_FEATURE_FAILONSLCK 0x20
84#define DASD_FEATURE_USERAW 0x40
85
86#define DASD_PARTN_BITS 2
87
88
89
90
91
92typedef struct dasd_information_t {
93 unsigned int devno;
94 unsigned int real_devno;
95 unsigned int schid;
96 unsigned int cu_type : 16;
97 unsigned int cu_model : 8;
98 unsigned int dev_type : 16;
99 unsigned int dev_model : 8;
100 unsigned int open_count;
101 unsigned int req_queue_len;
102 unsigned int chanq_len;
103 char type[4];
104 unsigned int status;
105 unsigned int label_block;
106 unsigned int FBA_layout;
107 unsigned int characteristics_size;
108 unsigned int confdata_size;
109 char characteristics[64];
110 char configuration_data[256];
111} dasd_information_t;
112
113
114
115
116typedef struct dasd_rssd_perf_stats_t {
117 unsigned char invalid:1;
118 unsigned char format:3;
119 unsigned char data_format:4;
120 unsigned char unit_address;
121 unsigned short device_status;
122 unsigned int nr_read_normal;
123 unsigned int nr_read_normal_hits;
124 unsigned int nr_write_normal;
125 unsigned int nr_write_fast_normal_hits;
126 unsigned int nr_read_seq;
127 unsigned int nr_read_seq_hits;
128 unsigned int nr_write_seq;
129 unsigned int nr_write_fast_seq_hits;
130 unsigned int nr_read_cache;
131 unsigned int nr_read_cache_hits;
132 unsigned int nr_write_cache;
133 unsigned int nr_write_fast_cache_hits;
134 unsigned int nr_inhibit_cache;
135 unsigned int nr_bybass_cache;
136 unsigned int nr_seq_dasd_to_cache;
137 unsigned int nr_dasd_to_cache;
138 unsigned int nr_cache_to_dasd;
139 unsigned int nr_delayed_fast_write;
140 unsigned int nr_normal_fast_write;
141 unsigned int nr_seq_fast_write;
142 unsigned int nr_cache_miss;
143 unsigned char status2;
144 unsigned int nr_quick_write_promotes;
145 unsigned char reserved;
146 unsigned short ssid;
147 unsigned char reseved2[96];
148} __attribute__((packed)) dasd_rssd_perf_stats_t;
149
150
151
152
153
154typedef struct dasd_profile_info_t {
155 unsigned int dasd_io_reqs;
156 unsigned int dasd_io_sects;
157 unsigned int dasd_io_secs[32];
158 unsigned int dasd_io_times[32];
159 unsigned int dasd_io_timps[32];
160 unsigned int dasd_io_time1[32];
161 unsigned int dasd_io_time2[32];
162 unsigned int dasd_io_time2ps[32];
163 unsigned int dasd_io_time3[32];
164 unsigned int dasd_io_nr_req[32];
165} dasd_profile_info_t;
166
167
168
169
170
171typedef struct format_data_t {
172 unsigned int start_unit;
173 unsigned int stop_unit;
174 unsigned int blksize;
175 unsigned int intensity;
176} format_data_t;
177
178
179
180
181
182
183
184
185#define DASD_FMT_INT_FMT_R0 1
186#define DASD_FMT_INT_FMT_HA 2
187#define DASD_FMT_INT_INVAL 4
188#define DASD_FMT_INT_COMPAT 8
189
190
191
192
193
194
195typedef struct format_check_t {
196
197 struct format_data_t expect;
198
199
200 unsigned int result;
201 unsigned int unit;
202 unsigned int rec;
203 unsigned int num_records;
204 unsigned int blksize;
205 unsigned int key_length;
206} format_check_t;
207
208
209
210#define DASD_FMT_ERR_TOO_FEW_RECORDS 1
211
212#define DASD_FMT_ERR_TOO_MANY_RECORDS 2
213
214#define DASD_FMT_ERR_BLKSIZE 3
215
216
217#define DASD_FMT_ERR_RECORD_ID 4
218
219#define DASD_FMT_ERR_KEY_LENGTH 5
220
221
222
223
224
225
226typedef struct attrib_data_t {
227 unsigned char operation:3;
228 unsigned char reserved:5;
229 __u16 nr_cyl;
230 __u8 reserved2[29];
231} __attribute__ ((packed)) attrib_data_t;
232
233
234#define DASD_NORMAL_CACHE 0x0
235#define DASD_BYPASS_CACHE 0x1
236#define DASD_INHIBIT_LOAD 0x2
237#define DASD_SEQ_ACCESS 0x3
238#define DASD_SEQ_PRESTAGE 0x4
239#define DASD_REC_ACCESS 0x5
240
241
242
243
244typedef struct dasd_symmio_parms {
245 unsigned char reserved[8];
246 unsigned long long psf_data;
247 unsigned long long rssd_result;
248 int psf_data_len;
249 int rssd_result_len;
250} __attribute__ ((packed)) dasd_symmio_parms_t;
251
252
253
254
255struct dasd_snid_data {
256 struct {
257 __u8 group:2;
258 __u8 reserve:2;
259 __u8 mode:1;
260 __u8 res:3;
261 } __attribute__ ((packed)) path_state;
262 __u8 pgid[11];
263} __attribute__ ((packed));
264
265struct dasd_snid_ioctl_data {
266 struct dasd_snid_data data;
267 __u8 path_mask;
268} __attribute__ ((packed));
269
270
271
272
273
274
275
276
277
278
279
280
281#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)
282
283#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)
284
285#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2)
286#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3)
287#define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4)
288
289#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)
290
291#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
292
293#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)
294
295#define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)
296
297#define BIODASDALLOWIO _IO(DASD_IOCTL_LETTER, 241)
298
299
300
301#define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int)
302
303#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
304
305#define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t)
306
307#define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
308
309#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
310
311#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)
312
313
314
315#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)
316
317#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
318
319
320#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
321
322#define BIODASDCHECKFMT _IOWR(DASD_IOCTL_LETTER, 2, format_check_t)
323
324#define BIODASDSYMMIO _IOWR(DASD_IOCTL_LETTER, 240, dasd_symmio_parms_t)
325
326#endif
327
328