blob: fc8b26d06fad7df1954ece4d7341d08f74d08bb5 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _I2O_DEV_H
20#define _I2O_DEV_H
21#define MAX_I2O_CONTROLLERS 32
22#include <linux/ioctl.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/types.h>
24#define I2O_MAGIC_NUMBER 'i'
Tao Baod7db5942015-01-28 10:07:51 -080025#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER, 0, __u8[MAX_I2O_CONTROLLERS])
26#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER, 1, struct i2o_cmd_hrtlct)
Tao Baod7db5942015-01-28 10:07:51 -080027#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER, 2, struct i2o_cmd_hrtlct)
28#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER, 3, struct i2o_cmd_psetget)
29#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER, 4, struct i2o_cmd_psetget)
30#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER, 5, struct i2o_sw_xfer)
Tao Baod7db5942015-01-28 10:07:51 -080031#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER, 6, struct i2o_sw_xfer)
32#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER, 7, struct i2o_sw_xfer)
33#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER, 8, __u32)
34#define I2OHTML _IOWR(I2O_MAGIC_NUMBER, 9, struct i2o_html)
Tao Baod7db5942015-01-28 10:07:51 -080035#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER, 10, struct i2o_evt_id)
36#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER, 11, struct i2o_evt_info)
37#define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER, 12, struct i2o_cmd_passthru)
38#define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER, 12, struct i2o_cmd_passthru32)
Ben Cheng655a7c02013-10-16 16:09:24 -070039struct i2o_cmd_passthru32 {
Tao Baod7db5942015-01-28 10:07:51 -080040 unsigned int iop;
41 __u32 msg;
Ben Cheng655a7c02013-10-16 16:09:24 -070042};
Ben Cheng655a7c02013-10-16 16:09:24 -070043struct i2o_cmd_passthru {
Tao Baod7db5942015-01-28 10:07:51 -080044 unsigned int iop;
45 void __user * msg;
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
Ben Cheng655a7c02013-10-16 16:09:24 -070047struct i2o_cmd_hrtlct {
Tao Baod7db5942015-01-28 10:07:51 -080048 unsigned int iop;
49 void __user * resbuf;
50 unsigned int __user * reslen;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52struct i2o_cmd_psetget {
Tao Baod7db5942015-01-28 10:07:51 -080053 unsigned int iop;
54 unsigned int tid;
Tao Baod7db5942015-01-28 10:07:51 -080055 void __user * opbuf;
56 unsigned int oplen;
57 void __user * resbuf;
58 unsigned int __user * reslen;
Ben Cheng655a7c02013-10-16 16:09:24 -070059};
60struct i2o_sw_xfer {
Tao Baod7db5942015-01-28 10:07:51 -080061 unsigned int iop;
62 unsigned char flags;
Tao Baod7db5942015-01-28 10:07:51 -080063 unsigned char sw_type;
64 unsigned int sw_id;
65 void __user * buf;
66 unsigned int __user * swlen;
Tao Baod7db5942015-01-28 10:07:51 -080067 unsigned int __user * maxfrag;
68 unsigned int __user * curfrag;
Ben Cheng655a7c02013-10-16 16:09:24 -070069};
70struct i2o_html {
Tao Baod7db5942015-01-28 10:07:51 -080071 unsigned int iop;
72 unsigned int tid;
73 unsigned int page;
74 void __user * resbuf;
Tao Baod7db5942015-01-28 10:07:51 -080075 unsigned int __user * reslen;
76 void __user * qbuf;
77 unsigned int qlen;
Ben Cheng655a7c02013-10-16 16:09:24 -070078};
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define I2O_EVT_Q_LEN 32
80struct i2o_evt_id {
Tao Baod7db5942015-01-28 10:07:51 -080081 unsigned int iop;
82 unsigned int tid;
Tao Baod7db5942015-01-28 10:07:51 -080083 unsigned int evt_mask;
Ben Cheng655a7c02013-10-16 16:09:24 -070084};
85#define I2O_EVT_DATA_SIZE 88
86struct i2o_evt_info {
Tao Baod7db5942015-01-28 10:07:51 -080087 struct i2o_evt_id id;
88 unsigned char evt_data[I2O_EVT_DATA_SIZE];
89 unsigned int data_size;
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
Ben Cheng655a7c02013-10-16 16:09:24 -070091struct i2o_evt_get {
Tao Baod7db5942015-01-28 10:07:51 -080092 struct i2o_evt_info info;
93 int pending;
94 int lost;
Ben Cheng655a7c02013-10-16 16:09:24 -070095};
96typedef struct i2o_sg_io_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080097 unsigned int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070098} i2o_sg_io_hdr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define I2O_BUS_LOCAL 0
100#define I2O_BUS_ISA 1
101#define I2O_BUS_EISA 2
102#define I2O_BUS_PCI 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define I2O_BUS_PCMCIA 5
104#define I2O_BUS_NUBUS 6
105#define I2O_BUS_CARDBUS 7
106#define I2O_BUS_UNKNOWN 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -0700107typedef struct _i2o_pci_bus {
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u8 PciFunctionNumber;
109 __u8 PciDeviceNumber;
110 __u8 PciBusNumber;
Tao Baod7db5942015-01-28 10:07:51 -0800111 __u8 reserved;
112 __u16 PciVendorID;
113 __u16 PciDeviceID;
Ben Cheng655a7c02013-10-16 16:09:24 -0700114} i2o_pci_bus;
Ben Cheng655a7c02013-10-16 16:09:24 -0700115typedef struct _i2o_local_bus {
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u16 LbBaseIOPort;
117 __u16 reserved;
118 __u32 LbBaseMemoryAddress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700119} i2o_local_bus;
120typedef struct _i2o_isa_bus {
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u16 IsaBaseIOPort;
122 __u8 CSN;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u8 reserved;
124 __u32 IsaBaseMemoryAddress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700125} i2o_isa_bus;
126typedef struct _i2o_eisa_bus_info {
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u16 EisaBaseIOPort;
128 __u8 reserved;
129 __u8 EisaSlotNumber;
130 __u32 EisaBaseMemoryAddress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700131} i2o_eisa_bus;
132typedef struct _i2o_mca_bus {
Tao Baod7db5942015-01-28 10:07:51 -0800133 __u16 McaBaseIOPort;
134 __u8 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800135 __u8 McaSlotNumber;
136 __u32 McaBaseMemoryAddress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700137} i2o_mca_bus;
138typedef struct _i2o_other_bus {
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u16 BaseIOPort;
140 __u16 reserved;
141 __u32 BaseMemoryAddress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700142} i2o_other_bus;
Ben Cheng655a7c02013-10-16 16:09:24 -0700143typedef struct _i2o_hrt_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u32 adapter_id;
145 __u32 parent_tid : 12;
146 __u32 state : 4;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u32 bus_num : 8;
148 __u32 bus_type : 8;
149 union {
150 i2o_pci_bus pci_bus;
Tao Baod7db5942015-01-28 10:07:51 -0800151 i2o_local_bus local_bus;
152 i2o_isa_bus isa_bus;
153 i2o_eisa_bus eisa_bus;
154 i2o_mca_bus mca_bus;
Tao Baod7db5942015-01-28 10:07:51 -0800155 i2o_other_bus other_bus;
156 } bus;
Ben Cheng655a7c02013-10-16 16:09:24 -0700157} i2o_hrt_entry;
158typedef struct _i2o_hrt {
Tao Baod7db5942015-01-28 10:07:51 -0800159 __u16 num_entries;
160 __u8 entry_len;
161 __u8 hrt_version;
162 __u32 change_ind;
Tao Baod7db5942015-01-28 10:07:51 -0800163 i2o_hrt_entry hrt_entry[1];
Ben Cheng655a7c02013-10-16 16:09:24 -0700164} i2o_hrt;
165typedef struct _i2o_lct_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800166 __u32 entry_size : 16;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u32 tid : 12;
168 __u32 reserved : 4;
169 __u32 change_ind;
170 __u32 device_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800171 __u32 class_id : 12;
172 __u32 version : 4;
173 __u32 vendor_id : 16;
174 __u32 sub_class;
Tao Baod7db5942015-01-28 10:07:51 -0800175 __u32 user_tid : 12;
176 __u32 parent_tid : 12;
177 __u32 bios_info : 8;
178 __u8 identity_tag[8];
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u32 event_capabilities;
Ben Cheng655a7c02013-10-16 16:09:24 -0700180} i2o_lct_entry;
181typedef struct _i2o_lct {
Tao Baod7db5942015-01-28 10:07:51 -0800182 __u32 table_size : 16;
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u32 boot_tid : 12;
184 __u32 lct_ver : 4;
185 __u32 iop_flags;
186 __u32 change_ind;
Tao Baod7db5942015-01-28 10:07:51 -0800187 i2o_lct_entry lct_entry[1];
Ben Cheng655a7c02013-10-16 16:09:24 -0700188} i2o_lct;
189typedef struct _i2o_status_block {
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u16 org_id;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u16 reserved;
192 __u16 iop_id : 12;
193 __u16 reserved1 : 4;
194 __u16 host_unit_id;
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u16 segment_number : 12;
196 __u16 i2o_version : 4;
197 __u8 iop_state;
198 __u8 msg_type;
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u16 inbound_frame_size;
200 __u8 init_code;
201 __u8 reserved2;
202 __u32 max_inbound_frames;
Tao Baod7db5942015-01-28 10:07:51 -0800203 __u32 cur_inbound_frames;
204 __u32 max_outbound_frames;
205 char product_id[24];
206 __u32 expected_lct_size;
Tao Baod7db5942015-01-28 10:07:51 -0800207 __u32 iop_capabilities;
208 __u32 desired_mem_size;
209 __u32 current_mem_size;
210 __u32 current_mem_base;
Tao Baod7db5942015-01-28 10:07:51 -0800211 __u32 desired_io_size;
212 __u32 current_io_size;
213 __u32 current_io_base;
214 __u32 reserved3 : 24;
Tao Baod7db5942015-01-28 10:07:51 -0800215 __u32 cmd_status : 8;
Ben Cheng655a7c02013-10-16 16:09:24 -0700216} i2o_status_block;
217#define I2O_EVT_IND_STATE_CHANGE 0x80000000
218#define I2O_EVT_IND_GENERAL_WARNING 0x40000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000
220#define I2O_EVT_IND_LOCK_RELEASE 0x10000000
221#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000
222#define I2O_EVT_IND_DEVICE_RESET 0x04000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700223#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000
224#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000
225#define I2O_EVT_IND_VENDOR_EVT 0x00800000
226#define I2O_EVT_IND_DEVICE_STATE 0x00400000
Ben Cheng655a7c02013-10-16 16:09:24 -0700227#define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001
228#define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002
229#define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004
230#define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -0700231#define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010
232#define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020
233#define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040
234#define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080
Ben Cheng655a7c02013-10-16 16:09:24 -0700235#define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100
236#define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200
237#define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400
238#define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001
Ben Cheng655a7c02013-10-16 16:09:24 -0700239#define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002
240#define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004
241#define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008
242#define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010
Ben Cheng655a7c02013-10-16 16:09:24 -0700243#define I2O_EVT_STATE_CHANGE_NORMAL 0x00
244#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01
245#define I2O_EVT_STATE_CHANGE_RESTART 0x02
246#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700247#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04
248#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05
249#define I2O_EVT_STATE_CHANGE_FAILED 0x10
250#define I2O_EVT_STATE_CHANGE_FAULTED 0x11
Ben Cheng655a7c02013-10-16 16:09:24 -0700251#define I2O_EVT_GEN_WARNING_NORMAL 0x00
252#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01
253#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02
254#define I2O_EVT_CAPABILITY_OTHER 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700255#define I2O_EVT_CAPABILITY_CHANGED 0x02
256#define I2O_EVT_SENSOR_STATE_CHANGED 0x01
257#define I2O_CLASS_VERSION_10 0x00
258#define I2O_CLASS_VERSION_11 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700259#define I2O_CLASS_EXECUTIVE 0x000
260#define I2O_CLASS_DDM 0x001
261#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
262#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
Ben Cheng655a7c02013-10-16 16:09:24 -0700263#define I2O_CLASS_LAN 0x020
264#define I2O_CLASS_WAN 0x030
265#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
266#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
Ben Cheng655a7c02013-10-16 16:09:24 -0700267#define I2O_CLASS_SCSI_PERIPHERAL 0x051
268#define I2O_CLASS_ATE_PORT 0x060
269#define I2O_CLASS_ATE_PERIPHERAL 0x061
270#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
Ben Cheng655a7c02013-10-16 16:09:24 -0700271#define I2O_CLASS_FLOPPY_DEVICE 0x071
272#define I2O_CLASS_BUS_ADAPTER 0x080
273#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
274#define I2O_CLASS_PEER_TRANSPORT 0x091
Ben Cheng655a7c02013-10-16 16:09:24 -0700275#define I2O_CLASS_END 0xfff
276#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
277#define I2O_SUBCLASS_i960 0x001
278#define I2O_SUBCLASS_HDM 0x020
Ben Cheng655a7c02013-10-16 16:09:24 -0700279#define I2O_SUBCLASS_ISM 0x021
280#define I2O_PARAMS_FIELD_GET 0x0001
281#define I2O_PARAMS_LIST_GET 0x0002
282#define I2O_PARAMS_MORE_GET 0x0003
Ben Cheng655a7c02013-10-16 16:09:24 -0700283#define I2O_PARAMS_SIZE_GET 0x0004
284#define I2O_PARAMS_TABLE_GET 0x0005
285#define I2O_PARAMS_FIELD_SET 0x0006
286#define I2O_PARAMS_LIST_SET 0x0007
Ben Cheng655a7c02013-10-16 16:09:24 -0700287#define I2O_PARAMS_ROW_ADD 0x0008
288#define I2O_PARAMS_ROW_DELETE 0x0009
289#define I2O_PARAMS_TABLE_CLEAR 0x000A
290#define I2O_SNFORMAT_UNKNOWN 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700291#define I2O_SNFORMAT_BINARY 1
292#define I2O_SNFORMAT_ASCII 2
293#define I2O_SNFORMAT_UNICODE 3
294#define I2O_SNFORMAT_LAN48_MAC 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700295#define I2O_SNFORMAT_WAN 5
296#define I2O_SNFORMAT_LAN64_MAC 6
297#define I2O_SNFORMAT_DDM 7
298#define I2O_SNFORMAT_IEEE_REG64 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700299#define I2O_SNFORMAT_IEEE_REG128 9
300#define I2O_SNFORMAT_UNKNOWN2 0xff
301#define ADAPTER_STATE_INITIALIZING 0x01
302#define ADAPTER_STATE_RESET 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700303#define ADAPTER_STATE_HOLD 0x04
304#define ADAPTER_STATE_READY 0x05
305#define ADAPTER_STATE_OPERATIONAL 0x08
306#define ADAPTER_STATE_FAILED 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700307#define ADAPTER_STATE_FAULTED 0x11
308#define I2O_SOFTWARE_MODULE_IRTOS 0x11
309#define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
310#define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
Ben Cheng655a7c02013-10-16 16:09:24 -0700311#define I2O_VENDOR_DPT 0x001b
312#define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
313#define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
314#define I2O_DPT_FLASH_FRAG_SIZE 0x10000
Ben Cheng655a7c02013-10-16 16:09:24 -0700315#define I2O_DPT_FLASH_READ 0x0101
316#define I2O_DPT_FLASH_WRITE 0x0102
317#endif