0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef DASD_H
0016 #define DASD_H
0017 #include <linux/types.h>
0018 #include <linux/ioctl.h>
0019
0020 #define DASD_IOCTL_LETTER 'D'
0021
0022 #define DASD_API_VERSION 6
0023
0024
0025
0026
0027
0028
0029 typedef struct dasd_information2_t {
0030 unsigned int devno;
0031 unsigned int real_devno;
0032 unsigned int schid;
0033 unsigned int cu_type : 16;
0034 unsigned int cu_model : 8;
0035 unsigned int dev_type : 16;
0036 unsigned int dev_model : 8;
0037 unsigned int open_count;
0038 unsigned int req_queue_len;
0039 unsigned int chanq_len;
0040 char type[4];
0041 unsigned int status;
0042 unsigned int label_block;
0043 unsigned int FBA_layout;
0044 unsigned int characteristics_size;
0045 unsigned int confdata_size;
0046 char characteristics[64];
0047 char configuration_data[256];
0048 unsigned int format;
0049 unsigned int features;
0050 unsigned int reserved0;
0051 unsigned int reserved1;
0052 unsigned int reserved2;
0053 unsigned int reserved3;
0054 unsigned int reserved4;
0055 unsigned int reserved5;
0056 unsigned int reserved6;
0057 unsigned int reserved7;
0058 } dasd_information2_t;
0059
0060
0061
0062
0063
0064
0065
0066 #define DASD_FORMAT_NONE 0
0067 #define DASD_FORMAT_LDL 1
0068 #define DASD_FORMAT_CDL 2
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 #define DASD_FEATURE_READONLY 0x001
0083 #define DASD_FEATURE_USEDIAG 0x002
0084 #define DASD_FEATURE_INITIAL_ONLINE 0x004
0085 #define DASD_FEATURE_ERPLOG 0x008
0086 #define DASD_FEATURE_FAILFAST 0x010
0087 #define DASD_FEATURE_FAILONSLCK 0x020
0088 #define DASD_FEATURE_USERAW 0x040
0089 #define DASD_FEATURE_DISCARD 0x080
0090 #define DASD_FEATURE_PATH_AUTODISABLE 0x100
0091 #define DASD_FEATURE_DEFAULT DASD_FEATURE_PATH_AUTODISABLE
0092
0093 #define DASD_PARTN_BITS 2
0094
0095
0096
0097
0098
0099 typedef struct dasd_information_t {
0100 unsigned int devno;
0101 unsigned int real_devno;
0102 unsigned int schid;
0103 unsigned int cu_type : 16;
0104 unsigned int cu_model : 8;
0105 unsigned int dev_type : 16;
0106 unsigned int dev_model : 8;
0107 unsigned int open_count;
0108 unsigned int req_queue_len;
0109 unsigned int chanq_len;
0110 char type[4];
0111 unsigned int status;
0112 unsigned int label_block;
0113 unsigned int FBA_layout;
0114 unsigned int characteristics_size;
0115 unsigned int confdata_size;
0116 char characteristics[64];
0117 char configuration_data[256];
0118 } dasd_information_t;
0119
0120
0121
0122
0123 typedef struct dasd_rssd_perf_stats_t {
0124 unsigned char invalid:1;
0125 unsigned char format:3;
0126 unsigned char data_format:4;
0127 unsigned char unit_address;
0128 unsigned short device_status;
0129 unsigned int nr_read_normal;
0130 unsigned int nr_read_normal_hits;
0131 unsigned int nr_write_normal;
0132 unsigned int nr_write_fast_normal_hits;
0133 unsigned int nr_read_seq;
0134 unsigned int nr_read_seq_hits;
0135 unsigned int nr_write_seq;
0136 unsigned int nr_write_fast_seq_hits;
0137 unsigned int nr_read_cache;
0138 unsigned int nr_read_cache_hits;
0139 unsigned int nr_write_cache;
0140 unsigned int nr_write_fast_cache_hits;
0141 unsigned int nr_inhibit_cache;
0142 unsigned int nr_bybass_cache;
0143 unsigned int nr_seq_dasd_to_cache;
0144 unsigned int nr_dasd_to_cache;
0145 unsigned int nr_cache_to_dasd;
0146 unsigned int nr_delayed_fast_write;
0147 unsigned int nr_normal_fast_write;
0148 unsigned int nr_seq_fast_write;
0149 unsigned int nr_cache_miss;
0150 unsigned char status2;
0151 unsigned int nr_quick_write_promotes;
0152 unsigned char reserved;
0153 unsigned short ssid;
0154 unsigned char reseved2[96];
0155 } __attribute__((packed)) dasd_rssd_perf_stats_t;
0156
0157
0158
0159
0160
0161 typedef struct dasd_profile_info_t {
0162 unsigned int dasd_io_reqs;
0163 unsigned int dasd_io_sects;
0164 unsigned int dasd_io_secs[32];
0165 unsigned int dasd_io_times[32];
0166 unsigned int dasd_io_timps[32];
0167 unsigned int dasd_io_time1[32];
0168 unsigned int dasd_io_time2[32];
0169 unsigned int dasd_io_time2ps[32];
0170 unsigned int dasd_io_time3[32];
0171 unsigned int dasd_io_nr_req[32];
0172 } dasd_profile_info_t;
0173
0174
0175
0176
0177
0178 typedef struct format_data_t {
0179 unsigned int start_unit;
0180 unsigned int stop_unit;
0181 unsigned int blksize;
0182 unsigned int intensity;
0183 } format_data_t;
0184
0185
0186
0187
0188
0189
0190
0191
0192 #define DASD_FMT_INT_FMT_R0 1
0193 #define DASD_FMT_INT_FMT_HA 2
0194 #define DASD_FMT_INT_INVAL 4
0195 #define DASD_FMT_INT_COMPAT 8
0196 #define DASD_FMT_INT_FMT_NOR0 16
0197 #define DASD_FMT_INT_ESE_FULL 32
0198
0199
0200
0201
0202
0203
0204 typedef struct format_check_t {
0205
0206 struct format_data_t expect;
0207
0208
0209 unsigned int result;
0210 unsigned int unit;
0211 unsigned int rec;
0212 unsigned int num_records;
0213 unsigned int blksize;
0214 unsigned int key_length;
0215 } format_check_t;
0216
0217
0218
0219 #define DASD_FMT_ERR_TOO_FEW_RECORDS 1
0220
0221 #define DASD_FMT_ERR_TOO_MANY_RECORDS 2
0222
0223 #define DASD_FMT_ERR_BLKSIZE 3
0224
0225
0226 #define DASD_FMT_ERR_RECORD_ID 4
0227
0228 #define DASD_FMT_ERR_KEY_LENGTH 5
0229
0230
0231
0232
0233
0234
0235 typedef struct attrib_data_t {
0236 unsigned char operation:3;
0237 unsigned char reserved:5;
0238 __u16 nr_cyl;
0239 __u8 reserved2[29];
0240 } __attribute__ ((packed)) attrib_data_t;
0241
0242
0243 #define DASD_NORMAL_CACHE 0x0
0244 #define DASD_BYPASS_CACHE 0x1
0245 #define DASD_INHIBIT_LOAD 0x2
0246 #define DASD_SEQ_ACCESS 0x3
0247 #define DASD_SEQ_PRESTAGE 0x4
0248 #define DASD_REC_ACCESS 0x5
0249
0250
0251
0252
0253 typedef struct dasd_symmio_parms {
0254 unsigned char reserved[8];
0255 unsigned long long psf_data;
0256 unsigned long long rssd_result;
0257 int psf_data_len;
0258 int rssd_result_len;
0259 } __attribute__ ((packed)) dasd_symmio_parms_t;
0260
0261
0262
0263
0264 struct dasd_snid_data {
0265 struct {
0266 __u8 group:2;
0267 __u8 reserve:2;
0268 __u8 mode:1;
0269 __u8 res:3;
0270 } __attribute__ ((packed)) path_state;
0271 __u8 pgid[11];
0272 } __attribute__ ((packed));
0273
0274 struct dasd_snid_ioctl_data {
0275 struct dasd_snid_data data;
0276 __u8 path_mask;
0277 } __attribute__ ((packed));
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290 #define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)
0291
0292 #define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)
0293
0294 #define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2)
0295 #define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3)
0296 #define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4)
0297
0298 #define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)
0299
0300 #define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
0301
0302 #define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)
0303
0304 #define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)
0305
0306 #define BIODASDALLOWIO _IO(DASD_IOCTL_LETTER, 241)
0307
0308
0309
0310 #define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int)
0311
0312 #define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
0313
0314 #define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t)
0315
0316 #define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
0317
0318 #define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)
0319
0320 #define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)
0321
0322
0323
0324 #define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)
0325
0326 #define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
0327
0328 #define BIODASDRAS _IOW(DASD_IOCTL_LETTER, 3, format_data_t)
0329
0330
0331 #define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
0332
0333 #define BIODASDCHECKFMT _IOWR(DASD_IOCTL_LETTER, 2, format_check_t)
0334
0335 #define BIODASDSYMMIO _IOWR(DASD_IOCTL_LETTER, 240, dasd_symmio_parms_t)
0336
0337 #endif
0338