0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef _I2O_DEV_H
0022 #define _I2O_DEV_H
0023
0024
0025 #define MAX_I2O_CONTROLLERS 32
0026
0027 #include <linux/ioctl.h>
0028 #include <linux/types.h>
0029
0030
0031
0032
0033 #define I2O_MAGIC_NUMBER 'i'
0034 #define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
0035 #define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
0036 #define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
0037 #define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
0038 #define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget)
0039 #define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
0040 #define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
0041 #define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
0042 #define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
0043 #define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
0044 #define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
0045 #define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
0046 #define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
0047 #define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru32)
0048
0049 struct i2o_cmd_passthru32 {
0050 unsigned int iop;
0051 __u32 msg;
0052 };
0053
0054 struct i2o_cmd_passthru {
0055 unsigned int iop;
0056 void __user *msg;
0057 };
0058
0059 struct i2o_cmd_hrtlct {
0060 unsigned int iop;
0061 void __user *resbuf;
0062 unsigned int __user *reslen;
0063 };
0064
0065 struct i2o_cmd_psetget {
0066 unsigned int iop;
0067 unsigned int tid;
0068 void __user *opbuf;
0069 unsigned int oplen;
0070 void __user *resbuf;
0071 unsigned int __user *reslen;
0072 };
0073
0074 struct i2o_sw_xfer {
0075 unsigned int iop;
0076 unsigned char flags;
0077 unsigned char sw_type;
0078 unsigned int sw_id;
0079 void __user *buf;
0080 unsigned int __user *swlen;
0081 unsigned int __user *maxfrag;
0082 unsigned int __user *curfrag;
0083 };
0084
0085 struct i2o_html {
0086 unsigned int iop;
0087 unsigned int tid;
0088 unsigned int page;
0089 void __user *resbuf;
0090 unsigned int __user *reslen;
0091 void __user *qbuf;
0092 unsigned int qlen;
0093 };
0094
0095 #define I2O_EVT_Q_LEN 32
0096
0097 struct i2o_evt_id {
0098 unsigned int iop;
0099 unsigned int tid;
0100 unsigned int evt_mask;
0101 };
0102
0103
0104 #define I2O_EVT_DATA_SIZE 88
0105
0106 struct i2o_evt_info {
0107 struct i2o_evt_id id;
0108 unsigned char evt_data[I2O_EVT_DATA_SIZE];
0109 unsigned int data_size;
0110 };
0111
0112 struct i2o_evt_get {
0113 struct i2o_evt_info info;
0114 int pending;
0115 int lost;
0116 };
0117
0118 typedef struct i2o_sg_io_hdr {
0119 unsigned int flags;
0120 } i2o_sg_io_hdr_t;
0121
0122
0123
0124
0125 #define I2O_BUS_LOCAL 0
0126 #define I2O_BUS_ISA 1
0127 #define I2O_BUS_EISA 2
0128
0129 #define I2O_BUS_PCI 4
0130 #define I2O_BUS_PCMCIA 5
0131 #define I2O_BUS_NUBUS 6
0132 #define I2O_BUS_CARDBUS 7
0133 #define I2O_BUS_UNKNOWN 0x80
0134
0135 typedef struct _i2o_pci_bus {
0136 __u8 PciFunctionNumber;
0137 __u8 PciDeviceNumber;
0138 __u8 PciBusNumber;
0139 __u8 reserved;
0140 __u16 PciVendorID;
0141 __u16 PciDeviceID;
0142 } i2o_pci_bus;
0143
0144 typedef struct _i2o_local_bus {
0145 __u16 LbBaseIOPort;
0146 __u16 reserved;
0147 __u32 LbBaseMemoryAddress;
0148 } i2o_local_bus;
0149
0150 typedef struct _i2o_isa_bus {
0151 __u16 IsaBaseIOPort;
0152 __u8 CSN;
0153 __u8 reserved;
0154 __u32 IsaBaseMemoryAddress;
0155 } i2o_isa_bus;
0156
0157 typedef struct _i2o_eisa_bus_info {
0158 __u16 EisaBaseIOPort;
0159 __u8 reserved;
0160 __u8 EisaSlotNumber;
0161 __u32 EisaBaseMemoryAddress;
0162 } i2o_eisa_bus;
0163
0164 typedef struct _i2o_mca_bus {
0165 __u16 McaBaseIOPort;
0166 __u8 reserved;
0167 __u8 McaSlotNumber;
0168 __u32 McaBaseMemoryAddress;
0169 } i2o_mca_bus;
0170
0171 typedef struct _i2o_other_bus {
0172 __u16 BaseIOPort;
0173 __u16 reserved;
0174 __u32 BaseMemoryAddress;
0175 } i2o_other_bus;
0176
0177 typedef struct _i2o_hrt_entry {
0178 __u32 adapter_id;
0179 __u32 parent_tid:12;
0180 __u32 state:4;
0181 __u32 bus_num:8;
0182 __u32 bus_type:8;
0183 union {
0184 i2o_pci_bus pci_bus;
0185 i2o_local_bus local_bus;
0186 i2o_isa_bus isa_bus;
0187 i2o_eisa_bus eisa_bus;
0188 i2o_mca_bus mca_bus;
0189 i2o_other_bus other_bus;
0190 } bus;
0191 } i2o_hrt_entry;
0192
0193 typedef struct _i2o_hrt {
0194 __u16 num_entries;
0195 __u8 entry_len;
0196 __u8 hrt_version;
0197 __u32 change_ind;
0198 i2o_hrt_entry hrt_entry[1];
0199 } i2o_hrt;
0200
0201 typedef struct _i2o_lct_entry {
0202 __u32 entry_size:16;
0203 __u32 tid:12;
0204 __u32 reserved:4;
0205 __u32 change_ind;
0206 __u32 device_flags;
0207 __u32 class_id:12;
0208 __u32 version:4;
0209 __u32 vendor_id:16;
0210 __u32 sub_class;
0211 __u32 user_tid:12;
0212 __u32 parent_tid:12;
0213 __u32 bios_info:8;
0214 __u8 identity_tag[8];
0215 __u32 event_capabilities;
0216 } i2o_lct_entry;
0217
0218 typedef struct _i2o_lct {
0219 __u32 table_size:16;
0220 __u32 boot_tid:12;
0221 __u32 lct_ver:4;
0222 __u32 iop_flags;
0223 __u32 change_ind;
0224 i2o_lct_entry lct_entry[1];
0225 } i2o_lct;
0226
0227 typedef struct _i2o_status_block {
0228 __u16 org_id;
0229 __u16 reserved;
0230 __u16 iop_id:12;
0231 __u16 reserved1:4;
0232 __u16 host_unit_id;
0233 __u16 segment_number:12;
0234 __u16 i2o_version:4;
0235 __u8 iop_state;
0236 __u8 msg_type;
0237 __u16 inbound_frame_size;
0238 __u8 init_code;
0239 __u8 reserved2;
0240 __u32 max_inbound_frames;
0241 __u32 cur_inbound_frames;
0242 __u32 max_outbound_frames;
0243 char product_id[24];
0244 __u32 expected_lct_size;
0245 __u32 iop_capabilities;
0246 __u32 desired_mem_size;
0247 __u32 current_mem_size;
0248 __u32 current_mem_base;
0249 __u32 desired_io_size;
0250 __u32 current_io_size;
0251 __u32 current_io_base;
0252 __u32 reserved3:24;
0253 __u32 cmd_status:8;
0254 } i2o_status_block;
0255
0256
0257 #define I2O_EVT_IND_STATE_CHANGE 0x80000000
0258 #define I2O_EVT_IND_GENERAL_WARNING 0x40000000
0259 #define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000
0260 #define I2O_EVT_IND_LOCK_RELEASE 0x10000000
0261 #define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000
0262 #define I2O_EVT_IND_DEVICE_RESET 0x04000000
0263 #define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000
0264 #define I2O_EVT_IND_FIELD_MODIFIED 0x01000000
0265 #define I2O_EVT_IND_VENDOR_EVT 0x00800000
0266 #define I2O_EVT_IND_DEVICE_STATE 0x00400000
0267
0268
0269 #define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001
0270 #define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002
0271 #define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004
0272 #define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008
0273 #define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010
0274 #define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020
0275 #define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040
0276 #define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080
0277 #define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100
0278 #define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200
0279 #define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400
0280
0281
0282 #define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001
0283 #define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002
0284 #define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004
0285 #define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008
0286 #define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010
0287
0288
0289 #define I2O_EVT_STATE_CHANGE_NORMAL 0x00
0290 #define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01
0291 #define I2O_EVT_STATE_CHANGE_RESTART 0x02
0292 #define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03
0293 #define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04
0294 #define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05
0295 #define I2O_EVT_STATE_CHANGE_FAILED 0x10
0296 #define I2O_EVT_STATE_CHANGE_FAULTED 0x11
0297
0298 #define I2O_EVT_GEN_WARNING_NORMAL 0x00
0299 #define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01
0300 #define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02
0301
0302 #define I2O_EVT_CAPABILITY_OTHER 0x01
0303 #define I2O_EVT_CAPABILITY_CHANGED 0x02
0304
0305 #define I2O_EVT_SENSOR_STATE_CHANGED 0x01
0306
0307
0308
0309
0310
0311
0312
0313
0314 #define I2O_CLASS_VERSION_10 0x00
0315 #define I2O_CLASS_VERSION_11 0x01
0316
0317
0318
0319
0320
0321 #define I2O_CLASS_EXECUTIVE 0x000
0322 #define I2O_CLASS_DDM 0x001
0323 #define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
0324 #define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
0325 #define I2O_CLASS_LAN 0x020
0326 #define I2O_CLASS_WAN 0x030
0327 #define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
0328 #define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
0329 #define I2O_CLASS_SCSI_PERIPHERAL 0x051
0330 #define I2O_CLASS_ATE_PORT 0x060
0331 #define I2O_CLASS_ATE_PERIPHERAL 0x061
0332 #define I2O_CLASS_FLOPPY_CONTROLLER 0x070
0333 #define I2O_CLASS_FLOPPY_DEVICE 0x071
0334 #define I2O_CLASS_BUS_ADAPTER 0x080
0335 #define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
0336 #define I2O_CLASS_PEER_TRANSPORT 0x091
0337 #define I2O_CLASS_END 0xfff
0338
0339
0340
0341
0342
0343 #define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
0344
0345
0346
0347
0348
0349 #define I2O_SUBCLASS_i960 0x001
0350 #define I2O_SUBCLASS_HDM 0x020
0351 #define I2O_SUBCLASS_ISM 0x021
0352
0353
0354
0355 #define I2O_PARAMS_FIELD_GET 0x0001
0356 #define I2O_PARAMS_LIST_GET 0x0002
0357 #define I2O_PARAMS_MORE_GET 0x0003
0358 #define I2O_PARAMS_SIZE_GET 0x0004
0359 #define I2O_PARAMS_TABLE_GET 0x0005
0360 #define I2O_PARAMS_FIELD_SET 0x0006
0361 #define I2O_PARAMS_LIST_SET 0x0007
0362 #define I2O_PARAMS_ROW_ADD 0x0008
0363 #define I2O_PARAMS_ROW_DELETE 0x0009
0364 #define I2O_PARAMS_TABLE_CLEAR 0x000A
0365
0366
0367
0368
0369
0370
0371 #define I2O_SNFORMAT_UNKNOWN 0
0372 #define I2O_SNFORMAT_BINARY 1
0373 #define I2O_SNFORMAT_ASCII 2
0374 #define I2O_SNFORMAT_UNICODE 3
0375 #define I2O_SNFORMAT_LAN48_MAC 4
0376 #define I2O_SNFORMAT_WAN 5
0377
0378
0379
0380
0381
0382 #define I2O_SNFORMAT_LAN64_MAC 6
0383 #define I2O_SNFORMAT_DDM 7
0384 #define I2O_SNFORMAT_IEEE_REG64 8
0385 #define I2O_SNFORMAT_IEEE_REG128 9
0386 #define I2O_SNFORMAT_UNKNOWN2 0xff
0387
0388
0389
0390
0391
0392 #define ADAPTER_STATE_INITIALIZING 0x01
0393 #define ADAPTER_STATE_RESET 0x02
0394 #define ADAPTER_STATE_HOLD 0x04
0395 #define ADAPTER_STATE_READY 0x05
0396 #define ADAPTER_STATE_OPERATIONAL 0x08
0397 #define ADAPTER_STATE_FAILED 0x10
0398 #define ADAPTER_STATE_FAULTED 0x11
0399
0400
0401
0402
0403 #define I2O_SOFTWARE_MODULE_IRTOS 0x11
0404 #define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
0405 #define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
0406
0407
0408
0409
0410 #define I2O_VENDOR_DPT 0x001b
0411
0412
0413
0414
0415 #define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
0416 #define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
0417
0418 #define I2O_DPT_FLASH_FRAG_SIZE 0x10000
0419 #define I2O_DPT_FLASH_READ 0x0101
0420 #define I2O_DPT_FLASH_WRITE 0x0102
0421
0422 #endif