mpiireg.h revision 1.1.2.2 1 1.1.2.2 pgoyette /* $NetBSD: mpiireg.h,v 1.1.2.2 2018/11/26 01:52:32 pgoyette Exp $ */
2 1.1.2.2 pgoyette /* OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp */
3 1.1.2.2 pgoyette /*
4 1.1.2.2 pgoyette * Copyright (c) 2010 Mike Belopuhov <mkb (at) crypt.org.ru>
5 1.1.2.2 pgoyette * Copyright (c) 2009 James Giannoules
6 1.1.2.2 pgoyette * Copyright (c) 2005 - 2010 David Gwynne <dlg (at) openbsd.org>
7 1.1.2.2 pgoyette * Copyright (c) 2005 - 2010 Marco Peereboom <marco (at) openbsd.org>
8 1.1.2.2 pgoyette *
9 1.1.2.2 pgoyette * Permission to use, copy, modify, and distribute this software for any
10 1.1.2.2 pgoyette * purpose with or without fee is hereby granted, provided that the above
11 1.1.2.2 pgoyette * copyright notice and this permission notice appear in all copies.
12 1.1.2.2 pgoyette *
13 1.1.2.2 pgoyette * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 1.1.2.2 pgoyette * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 1.1.2.2 pgoyette * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 1.1.2.2 pgoyette * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 1.1.2.2 pgoyette * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 1.1.2.2 pgoyette * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 1.1.2.2 pgoyette * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 1.1.2.2 pgoyette */
21 1.1.2.2 pgoyette
22 1.1.2.2 pgoyette #define MPII_DOORBELL (0x00)
23 1.1.2.2 pgoyette /* doorbell read bits */
24 1.1.2.2 pgoyette #define MPII_DOORBELL_STATE (0xf<<28) /* ioc state */
25 1.1.2.2 pgoyette #define MPII_DOORBELL_STATE_RESET (0x0<<28)
26 1.1.2.2 pgoyette #define MPII_DOORBELL_STATE_READY (0x1<<28)
27 1.1.2.2 pgoyette #define MPII_DOORBELL_STATE_OPER (0x2<<28)
28 1.1.2.2 pgoyette #define MPII_DOORBELL_STATE_FAULT (0x4<<28)
29 1.1.2.2 pgoyette #define MPII_DOORBELL_INUSE (0x1<<27) /* doorbell used */
30 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT (0x7<<24) /* last to reset ioc */
31 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_NOONE (0x0<<24) /* not initialized */
32 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_SYSBIOS (0x1<<24) /* system bios */
33 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_ROMBIOS (0x2<<24) /* rom bios */
34 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_PCIPEER (0x3<<24) /* pci peer */
35 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_DRIVER (0x4<<24) /* host driver */
36 1.1.2.2 pgoyette #define MPII_DOORBELL_WHOINIT_MANUFACT (0x5<<24) /* manufacturing */
37 1.1.2.2 pgoyette #define MPII_DOORBELL_FAULT (0xffff<<0) /* fault code */
38 1.1.2.2 pgoyette /* doorbell write bits */
39 1.1.2.2 pgoyette #define MPII_DOORBELL_FUNCTION_SHIFT (24)
40 1.1.2.2 pgoyette #define MPII_DOORBELL_FUNCTION_MASK (0xff << MPII_DOORBELL_FUNCTION_SHIFT)
41 1.1.2.2 pgoyette #define MPII_DOORBELL_FUNCTION(x) \
42 1.1.2.2 pgoyette (((x) << MPII_DOORBELL_FUNCTION_SHIFT) & MPII_DOORBELL_FUNCTION_MASK)
43 1.1.2.2 pgoyette #define MPII_DOORBELL_DWORDS_SHIFT 16
44 1.1.2.2 pgoyette #define MPII_DOORBELL_DWORDS_MASK (0xff << MPII_DOORBELL_DWORDS_SHIFT)
45 1.1.2.2 pgoyette #define MPII_DOORBELL_DWORDS(x) \
46 1.1.2.2 pgoyette (((x) << MPII_DOORBELL_DWORDS_SHIFT) & MPII_DOORBELL_DWORDS_MASK)
47 1.1.2.2 pgoyette #define MPII_DOORBELL_DATA_MASK (0xffff)
48 1.1.2.2 pgoyette
49 1.1.2.2 pgoyette #define MPII_WRITESEQ (0x04)
50 1.1.2.2 pgoyette #define MPII_WRITESEQ_KEY_VALUE_MASK (0x0000000f) /* key value */
51 1.1.2.2 pgoyette #define MPII_WRITESEQ_FLUSH (0x00)
52 1.1.2.2 pgoyette #define MPII_WRITESEQ_1 (0x0f)
53 1.1.2.2 pgoyette #define MPII_WRITESEQ_2 (0x04)
54 1.1.2.2 pgoyette #define MPII_WRITESEQ_3 (0x0b)
55 1.1.2.2 pgoyette #define MPII_WRITESEQ_4 (0x02)
56 1.1.2.2 pgoyette #define MPII_WRITESEQ_5 (0x07)
57 1.1.2.2 pgoyette #define MPII_WRITESEQ_6 (0x0d)
58 1.1.2.2 pgoyette
59 1.1.2.2 pgoyette #define MPII_HOSTDIAG (0x08)
60 1.1.2.2 pgoyette #define MPII_HOSTDIAG_BDS_MASK (0x00001800) /* boot device select */
61 1.1.2.2 pgoyette #define MPII_HOSTDIAG_BDS_DEFAULT (0<<11) /* default address map, flash */
62 1.1.2.2 pgoyette #define MPII_HOSTDIAG_BDS_HCDW (1<<11) /* host code and data window */
63 1.1.2.2 pgoyette #define MPII_HOSTDIAG_CLEARFBS (1<<10) /* clear flash bad sig */
64 1.1.2.2 pgoyette #define MPII_HOSTDIAG_FORCE_HCB_ONBOOT (1<<9) /* force host controlled boot */
65 1.1.2.2 pgoyette #define MPII_HOSTDIAG_HCB_MODE (1<<8) /* host controlled boot mode */
66 1.1.2.2 pgoyette #define MPII_HOSTDIAG_DWRE (1<<7) /* diag reg write enabled */
67 1.1.2.2 pgoyette #define MPII_HOSTDIAG_FBS (1<<6) /* flash bad sig */
68 1.1.2.2 pgoyette #define MPII_HOSTDIAG_RESET_HIST (1<<5) /* reset history */
69 1.1.2.2 pgoyette #define MPII_HOSTDIAG_DIAGWR_EN (1<<4) /* diagnostic write enabled */
70 1.1.2.2 pgoyette #define MPII_HOSTDIAG_RESET_ADAPTER (1<<2) /* reset adapter */
71 1.1.2.2 pgoyette #define MPII_HOSTDIAG_HOLD_IOC_RESET (1<<1) /* hold ioc in reset */
72 1.1.2.2 pgoyette #define MPII_HOSTDIAG_DIAGMEM_EN (1<<0) /* diag mem enable */
73 1.1.2.2 pgoyette
74 1.1.2.2 pgoyette #define MPII_DIAGRWDATA (0x10)
75 1.1.2.2 pgoyette
76 1.1.2.2 pgoyette #define MPII_DIAGRWADDRLOW (0x14)
77 1.1.2.2 pgoyette
78 1.1.2.2 pgoyette #define MPII_DIAGRWADDRHIGH (0x18)
79 1.1.2.2 pgoyette
80 1.1.2.2 pgoyette #define MPII_INTR_STATUS (0x30)
81 1.1.2.2 pgoyette #define MPII_INTR_STATUS_SYS2IOCDB (1<<31) /* ioc written to by host */
82 1.1.2.2 pgoyette #define MPII_INTR_STATUS_RESET (1<<30) /* physical ioc reset */
83 1.1.2.2 pgoyette #define MPII_INTR_STATUS_REPLY (1<<3) /* reply message interrupt */
84 1.1.2.2 pgoyette #define MPII_INTR_STATUS_IOC2SYSDB (1<<0) /* ioc write to doorbell */
85 1.1.2.2 pgoyette
86 1.1.2.2 pgoyette #define MPII_INTR_MASK (0x34)
87 1.1.2.2 pgoyette #define MPII_INTR_MASK_RESET (1<<30) /* ioc reset intr mask */
88 1.1.2.2 pgoyette #define MPII_INTR_MASK_REPLY (1<<3) /* reply message intr mask */
89 1.1.2.2 pgoyette #define MPII_INTR_MASK_DOORBELL (1<<0) /* doorbell interrupt mask */
90 1.1.2.2 pgoyette
91 1.1.2.2 pgoyette #define MPII_DCR_DATA (0x38)
92 1.1.2.2 pgoyette
93 1.1.2.2 pgoyette #define MPII_DCR_ADDRESS (0x3c)
94 1.1.2.2 pgoyette
95 1.1.2.2 pgoyette #define MPII_REPLY_FREE_HOST_INDEX (0x48)
96 1.1.2.2 pgoyette
97 1.1.2.2 pgoyette #define MPII_REPLY_POST_HOST_INDEX (0x6c)
98 1.1.2.2 pgoyette
99 1.1.2.2 pgoyette #define MPII_HCB_SIZE (0x74)
100 1.1.2.2 pgoyette
101 1.1.2.2 pgoyette #define MPII_HCB_ADDRESS_LOW (0x78)
102 1.1.2.2 pgoyette #define MPII_HCB_ADDRESS_HIGH (0x7c)
103 1.1.2.2 pgoyette
104 1.1.2.2 pgoyette #define MPII_REQ_DESCR_POST_LOW (0xc0)
105 1.1.2.2 pgoyette #define MPII_REQ_DESCR_POST_HIGH (0xc4)
106 1.1.2.2 pgoyette
107 1.1.2.2 pgoyette /*
108 1.1.2.2 pgoyette * Scatter Gather Lists
109 1.1.2.2 pgoyette */
110 1.1.2.2 pgoyette
111 1.1.2.2 pgoyette #define MPII_SGE_FL_LAST (0x1<<31) /* last element in segment */
112 1.1.2.2 pgoyette #define MPII_SGE_FL_EOB (0x1<<30) /* last element of buffer */
113 1.1.2.2 pgoyette #define MPII_SGE_FL_TYPE (0x3<<28) /* element type */
114 1.1.2.2 pgoyette #define MPII_SGE_FL_TYPE_SIMPLE (0x1<<28) /* simple element */
115 1.1.2.2 pgoyette #define MPII_SGE_FL_TYPE_CHAIN (0x3<<28) /* chain element */
116 1.1.2.2 pgoyette #define MPII_SGE_FL_TYPE_XACTCTX (0x0<<28) /* transaction context */
117 1.1.2.2 pgoyette #define MPII_SGE_FL_LOCAL (0x1<<27) /* local address */
118 1.1.2.2 pgoyette #define MPII_SGE_FL_DIR (0x1<<26) /* direction */
119 1.1.2.2 pgoyette #define MPII_SGE_FL_DIR_OUT (0x1<<26)
120 1.1.2.2 pgoyette #define MPII_SGE_FL_DIR_IN (0x0<<26)
121 1.1.2.2 pgoyette #define MPII_SGE_FL_SIZE (0x1<<25) /* address size */
122 1.1.2.2 pgoyette #define MPII_SGE_FL_SIZE_32 (0x0<<25)
123 1.1.2.2 pgoyette #define MPII_SGE_FL_SIZE_64 (0x1<<25)
124 1.1.2.2 pgoyette #define MPII_SGE_FL_EOL (0x1<<24) /* end of list */
125 1.1.2.2 pgoyette
126 1.1.2.2 pgoyette struct mpii_sge {
127 1.1.2.2 pgoyette u_int32_t sg_hdr;
128 1.1.2.2 pgoyette u_int32_t sg_lo_addr;
129 1.1.2.2 pgoyette u_int32_t sg_hi_addr;
130 1.1.2.2 pgoyette } __packed;
131 1.1.2.2 pgoyette
132 1.1.2.2 pgoyette struct mpii_fw_tce {
133 1.1.2.2 pgoyette u_int8_t reserved1;
134 1.1.2.2 pgoyette u_int8_t context_size;
135 1.1.2.2 pgoyette u_int8_t details_length;
136 1.1.2.2 pgoyette u_int8_t flags;
137 1.1.2.2 pgoyette
138 1.1.2.2 pgoyette u_int32_t reserved2;
139 1.1.2.2 pgoyette
140 1.1.2.2 pgoyette u_int32_t image_offset;
141 1.1.2.2 pgoyette
142 1.1.2.2 pgoyette u_int32_t image_size;
143 1.1.2.2 pgoyette } __packed;
144 1.1.2.2 pgoyette
145 1.1.2.2 pgoyette /*
146 1.1.2.2 pgoyette * Messages
147 1.1.2.2 pgoyette */
148 1.1.2.2 pgoyette
149 1.1.2.2 pgoyette /* functions */
150 1.1.2.2 pgoyette #define MPII_FUNCTION_SCSI_IO_REQUEST (0x00)
151 1.1.2.2 pgoyette #define MPII_FUNCTION_SCSI_TASK_MGMT (0x01)
152 1.1.2.2 pgoyette #define MPII_FUNCTION_IOC_INIT (0x02)
153 1.1.2.2 pgoyette #define MPII_FUNCTION_IOC_FACTS (0x03)
154 1.1.2.2 pgoyette #define MPII_FUNCTION_CONFIG (0x04)
155 1.1.2.2 pgoyette #define MPII_FUNCTION_PORT_FACTS (0x05)
156 1.1.2.2 pgoyette #define MPII_FUNCTION_PORT_ENABLE (0x06)
157 1.1.2.2 pgoyette #define MPII_FUNCTION_EVENT_NOTIFICATION (0x07)
158 1.1.2.2 pgoyette #define MPII_FUNCTION_EVENT_ACK (0x08)
159 1.1.2.2 pgoyette #define MPII_FUNCTION_FW_DOWNLOAD (0x09)
160 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_CMD_BUFFER_POST (0x0a)
161 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_ASSIST (0x0b)
162 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_STATUS_SEND (0x0c)
163 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_MODE_ABORT (0x0d)
164 1.1.2.2 pgoyette #define MPII_FUNCTION_FW_UPLOAD (0x12)
165 1.1.2.2 pgoyette
166 1.1.2.2 pgoyette #define MPII_FUNCTION_RAID_ACTION (0x15)
167 1.1.2.2 pgoyette #define MPII_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16)
168 1.1.2.2 pgoyette
169 1.1.2.2 pgoyette #define MPII_FUNCTION_TOOLBOX (0x17)
170 1.1.2.2 pgoyette
171 1.1.2.2 pgoyette #define MPII_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18)
172 1.1.2.2 pgoyette
173 1.1.2.2 pgoyette #define MPII_FUNCTION_SMP_PASSTHROUGH (0x1a)
174 1.1.2.2 pgoyette #define MPII_FUNCTION_SAS_IO_UNIT_CONTROL (0x1b)
175 1.1.2.2 pgoyette #define MPII_FUNCTION_SATA_PASSTHROUGH (0x1c)
176 1.1.2.2 pgoyette
177 1.1.2.2 pgoyette #define MPII_FUNCTION_DIAG_BUFFER_POST (0x1d)
178 1.1.2.2 pgoyette #define MPII_FUNCTION_DIAG_RELEASE (0x1e)
179 1.1.2.2 pgoyette
180 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24)
181 1.1.2.2 pgoyette #define MPII_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25)
182 1.1.2.2 pgoyette
183 1.1.2.2 pgoyette #define MPII_FUNCTION_IOC_MESSAGE_UNIT_RESET (0x40)
184 1.1.2.2 pgoyette #define MPII_FUNCTION_IO_UNIT_RESET (0x41)
185 1.1.2.2 pgoyette #define MPII_FUNCTION_HANDSHAKE (0x42)
186 1.1.2.2 pgoyette
187 1.1.2.2 pgoyette /* Common IOCStatus values for all replies */
188 1.1.2.2 pgoyette #define MPII_IOCSTATUS_MASK (0x7fff)
189 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SUCCESS (0x0000)
190 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INVALID_FUNCTION (0x0001)
191 1.1.2.2 pgoyette #define MPII_IOCSTATUS_BUSY (0x0002)
192 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INVALID_SGL (0x0003)
193 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INTERNAL_ERROR (0x0004)
194 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INVALID_VPID (0x0005)
195 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006)
196 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INVALID_FIELD (0x0007)
197 1.1.2.2 pgoyette #define MPII_IOCSTATUS_INVALID_STATE (0x0008)
198 1.1.2.2 pgoyette #define MPII_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009)
199 1.1.2.2 pgoyette /* Config IOCStatus values */
200 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020)
201 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021)
202 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022)
203 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_INVALID_DATA (0x0023)
204 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024)
205 1.1.2.2 pgoyette #define MPII_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025)
206 1.1.2.2 pgoyette /* SCSIIO Reply initiator values */
207 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_RECOVERED_ERROR (0x0040)
208 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_INVALID_DEVHANDLE (0x0042)
209 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_DEVICE_NOT_THERE (0x0043)
210 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_DATA_OVERRUN (0x0044)
211 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_DATA_UNDERRUN (0x0045)
212 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_IO_DATA_ERROR (0x0046)
213 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_PROTOCOL_ERROR (0x0047)
214 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_TASK_TERMINATED (0x0048)
215 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_RESIDUAL_MISMATCH (0x0049)
216 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_TASK_MGMT_FAILED (0x004a)
217 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_IOC_TERMINATED (0x004b)
218 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SCSI_EXT_TERMINATED (0x004c)
219 1.1.2.2 pgoyette /* For use by SCSI Initiator and SCSI Target end-to-end data protection */
220 1.1.2.2 pgoyette #define MPII_IOCSTATUS_EEDP_GUARD_ERROR (0x004d)
221 1.1.2.2 pgoyette #define MPII_IOCSTATUS_EEDP_REF_TAG_ERROR (0x004e)
222 1.1.2.2 pgoyette #define MPII_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004f)
223 1.1.2.2 pgoyette /* SCSI (SPI & FCP) target values */
224 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062)
225 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_ABORTED (0x0063)
226 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064)
227 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_NO_CONNECTION (0x0065)
228 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006a)
229 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006d)
230 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006e)
231 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006f)
232 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT (0x0070)
233 1.1.2.2 pgoyette #define MPII_IOCSTATUS_TARGET_NAK_RECEIVED (0x0071)
234 1.1.2.2 pgoyette /* Serial Attached SCSI values */
235 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
236 1.1.2.2 pgoyette #define MPII_IOCSTATUS_SAS_SMP_DATA_OVERRUN (0x0091)
237 1.1.2.2 pgoyette /* Diagnostic Tools values */
238 1.1.2.2 pgoyette #define MPII_IOCSTATUS_DIAGNOSTIC_RELEASED (0x00a0)
239 1.1.2.2 pgoyette
240 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE (0xf<<28)
241 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE_NONE (0x0<<28)
242 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE_SCSI (0x1<<28)
243 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE_FC (0x2<<28)
244 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE_SAS (0x3<<28)
245 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_TYPE_ISCSI (0x4<<28)
246 1.1.2.2 pgoyette #define MPII_REP_IOCLOGINFO_DATA (0x0fffffff)
247 1.1.2.2 pgoyette
248 1.1.2.2 pgoyette /* event notification types */
249 1.1.2.2 pgoyette #define MPII_EVENT_NONE (0x00)
250 1.1.2.2 pgoyette #define MPII_EVENT_LOG_DATA (0x01)
251 1.1.2.2 pgoyette #define MPII_EVENT_STATE_CHANGE (0x02)
252 1.1.2.2 pgoyette #define MPII_EVENT_HARD_RESET_RECEIVED (0x05)
253 1.1.2.2 pgoyette #define MPII_EVENT_EVENT_CHANGE (0x0a)
254 1.1.2.2 pgoyette #define MPII_EVENT_TASK_SET_FULL (0x0e)
255 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0f)
256 1.1.2.2 pgoyette #define MPII_EVENT_IR_OPERATION_STATUS (0x14)
257 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISCOVERY (0x16)
258 1.1.2.2 pgoyette #define MPII_EVENT_SAS_BROADCAST_PRIMITIVE (0x17)
259 1.1.2.2 pgoyette #define MPII_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x18)
260 1.1.2.2 pgoyette #define MPII_EVENT_SAS_INIT_TABLE_OVERFLOW (0x19)
261 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPOLOGY_CHANGE_LIST (0x1c)
262 1.1.2.2 pgoyette #define MPII_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE (0x1d)
263 1.1.2.2 pgoyette #define MPII_EVENT_IR_VOLUME (0x1e)
264 1.1.2.2 pgoyette #define MPII_EVENT_IR_PHYSICAL_DISK (0x1f)
265 1.1.2.2 pgoyette #define MPII_EVENT_IR_CONFIGURATION_CHANGE_LIST (0x20)
266 1.1.2.2 pgoyette #define MPII_EVENT_LOG_ENTRY_ADDED (0x21)
267 1.1.2.2 pgoyette
268 1.1.2.2 pgoyette /* messages */
269 1.1.2.2 pgoyette
270 1.1.2.2 pgoyette #define MPII_WHOINIT_NOONE (0x00)
271 1.1.2.2 pgoyette #define MPII_WHOINIT_SYSTEM_BIOS (0x01)
272 1.1.2.2 pgoyette #define MPII_WHOINIT_ROM_BIOS (0x02)
273 1.1.2.2 pgoyette #define MPII_WHOINIT_PCI_PEER (0x03)
274 1.1.2.2 pgoyette #define MPII_WHOINIT_HOST_DRIVER (0x04)
275 1.1.2.2 pgoyette #define MPII_WHOINIT_MANUFACTURER (0x05)
276 1.1.2.2 pgoyette
277 1.1.2.2 pgoyette /* default messages */
278 1.1.2.2 pgoyette
279 1.1.2.2 pgoyette struct mpii_msg_request {
280 1.1.2.2 pgoyette u_int8_t reserved1;
281 1.1.2.2 pgoyette u_int8_t reserved2;
282 1.1.2.2 pgoyette u_int8_t chain_offset;
283 1.1.2.2 pgoyette u_int8_t function;
284 1.1.2.2 pgoyette
285 1.1.2.2 pgoyette u_int8_t reserved3;
286 1.1.2.2 pgoyette u_int8_t reserved4;
287 1.1.2.2 pgoyette u_int8_t reserved5;
288 1.1.2.2 pgoyette u_int8_t msg_flags;
289 1.1.2.2 pgoyette
290 1.1.2.2 pgoyette u_int8_t vp_id;
291 1.1.2.2 pgoyette u_int8_t vf_id;
292 1.1.2.2 pgoyette u_int16_t reserved6;
293 1.1.2.2 pgoyette } __packed;
294 1.1.2.2 pgoyette
295 1.1.2.2 pgoyette struct mpii_msg_reply {
296 1.1.2.2 pgoyette u_int16_t reserved1;
297 1.1.2.2 pgoyette u_int8_t msg_length;
298 1.1.2.2 pgoyette u_int8_t function;
299 1.1.2.2 pgoyette
300 1.1.2.2 pgoyette u_int16_t reserved2;
301 1.1.2.2 pgoyette u_int8_t reserved3;
302 1.1.2.2 pgoyette u_int8_t msg_flags;
303 1.1.2.2 pgoyette
304 1.1.2.2 pgoyette u_int8_t vp_id;
305 1.1.2.2 pgoyette u_int8_t vf_if;
306 1.1.2.2 pgoyette u_int16_t reserved4;
307 1.1.2.2 pgoyette
308 1.1.2.2 pgoyette u_int16_t reserved5;
309 1.1.2.2 pgoyette u_int16_t ioc_status;
310 1.1.2.2 pgoyette
311 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
312 1.1.2.2 pgoyette } __packed;
313 1.1.2.2 pgoyette
314 1.1.2.2 pgoyette /* ioc init */
315 1.1.2.2 pgoyette
316 1.1.2.2 pgoyette struct mpii_msg_iocinit_request {
317 1.1.2.2 pgoyette u_int8_t whoinit;
318 1.1.2.2 pgoyette u_int8_t reserved1;
319 1.1.2.2 pgoyette u_int8_t chain_offset;
320 1.1.2.2 pgoyette u_int8_t function;
321 1.1.2.2 pgoyette
322 1.1.2.2 pgoyette u_int16_t reserved2;
323 1.1.2.2 pgoyette u_int8_t reserved3;
324 1.1.2.2 pgoyette u_int8_t msg_flags;
325 1.1.2.2 pgoyette
326 1.1.2.2 pgoyette u_int8_t vp_id;
327 1.1.2.2 pgoyette u_int8_t vf_id;
328 1.1.2.2 pgoyette u_int16_t reserved4;
329 1.1.2.2 pgoyette
330 1.1.2.2 pgoyette u_int8_t msg_version_min;
331 1.1.2.2 pgoyette u_int8_t msg_version_maj;
332 1.1.2.2 pgoyette u_int8_t hdr_version_unit;
333 1.1.2.2 pgoyette u_int8_t hdr_version_dev;
334 1.1.2.2 pgoyette
335 1.1.2.2 pgoyette u_int32_t reserved5;
336 1.1.2.2 pgoyette
337 1.1.2.2 pgoyette u_int32_t reserved6;
338 1.1.2.2 pgoyette
339 1.1.2.2 pgoyette u_int16_t reserved7;
340 1.1.2.2 pgoyette u_int16_t system_request_frame_size;
341 1.1.2.2 pgoyette
342 1.1.2.2 pgoyette u_int16_t reply_descriptor_post_queue_depth;
343 1.1.2.2 pgoyette u_int16_t reply_free_queue_depth;
344 1.1.2.2 pgoyette
345 1.1.2.2 pgoyette u_int32_t sense_buffer_address_high;
346 1.1.2.2 pgoyette
347 1.1.2.2 pgoyette u_int32_t system_reply_address_high;
348 1.1.2.2 pgoyette
349 1.1.2.2 pgoyette u_int64_t system_request_frame_base_address;
350 1.1.2.2 pgoyette
351 1.1.2.2 pgoyette u_int64_t reply_descriptor_post_queue_address;
352 1.1.2.2 pgoyette
353 1.1.2.2 pgoyette u_int64_t reply_free_queue_address;
354 1.1.2.2 pgoyette
355 1.1.2.2 pgoyette u_int64_t timestamp;
356 1.1.2.2 pgoyette } __packed;
357 1.1.2.2 pgoyette
358 1.1.2.2 pgoyette struct mpii_msg_iocinit_reply {
359 1.1.2.2 pgoyette u_int8_t whoinit;
360 1.1.2.2 pgoyette u_int8_t reserved1;
361 1.1.2.2 pgoyette u_int8_t msg_length;
362 1.1.2.2 pgoyette u_int8_t function;
363 1.1.2.2 pgoyette
364 1.1.2.2 pgoyette u_int16_t reserved2;
365 1.1.2.2 pgoyette u_int8_t reserved3;
366 1.1.2.2 pgoyette u_int8_t msg_flags;
367 1.1.2.2 pgoyette
368 1.1.2.2 pgoyette u_int8_t vp_id;
369 1.1.2.2 pgoyette u_int8_t vf_id;
370 1.1.2.2 pgoyette u_int16_t reserved4;
371 1.1.2.2 pgoyette
372 1.1.2.2 pgoyette u_int16_t reserved5;
373 1.1.2.2 pgoyette u_int16_t ioc_status;
374 1.1.2.2 pgoyette
375 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
376 1.1.2.2 pgoyette } __packed;
377 1.1.2.2 pgoyette
378 1.1.2.2 pgoyette struct mpii_msg_iocfacts_request {
379 1.1.2.2 pgoyette u_int16_t reserved1;
380 1.1.2.2 pgoyette u_int8_t chain_offset;
381 1.1.2.2 pgoyette u_int8_t function;
382 1.1.2.2 pgoyette
383 1.1.2.2 pgoyette u_int16_t reserved2;
384 1.1.2.2 pgoyette u_int8_t reserved3;
385 1.1.2.2 pgoyette u_int8_t msg_flags;
386 1.1.2.2 pgoyette
387 1.1.2.2 pgoyette u_int8_t vp_id;
388 1.1.2.2 pgoyette u_int8_t vf_id;
389 1.1.2.2 pgoyette u_int16_t reserved4;
390 1.1.2.2 pgoyette } __packed;
391 1.1.2.2 pgoyette
392 1.1.2.2 pgoyette struct mpii_msg_iocfacts_reply {
393 1.1.2.2 pgoyette u_int8_t msg_version_min;
394 1.1.2.2 pgoyette u_int8_t msg_version_maj;
395 1.1.2.2 pgoyette u_int8_t msg_length;
396 1.1.2.2 pgoyette u_int8_t function;
397 1.1.2.2 pgoyette
398 1.1.2.2 pgoyette u_int8_t header_version_dev;
399 1.1.2.2 pgoyette u_int8_t header_version_unit;
400 1.1.2.2 pgoyette u_int8_t ioc_number;
401 1.1.2.2 pgoyette u_int8_t msg_flags;
402 1.1.2.2 pgoyette
403 1.1.2.2 pgoyette u_int8_t vp_id;
404 1.1.2.2 pgoyette u_int8_t vf_id;
405 1.1.2.2 pgoyette u_int16_t reserved1;
406 1.1.2.2 pgoyette
407 1.1.2.2 pgoyette u_int16_t ioc_exceptions;
408 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (1<<0)
409 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (1<<1)
410 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (1<<2)
411 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_MANUFACT_CHECKSUM_FAIL (1<<3)
412 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED (1<<4)
413 1.1.2.2 pgoyette #define MPII_IOCFACTS_EXCEPT_IR_FOREIGN_CONFIG_MAC (1<<8)
414 1.1.2.2 pgoyette /* XXX JPG BOOT_STATUS in bits[7:5] */
415 1.1.2.2 pgoyette /* XXX JPG all these #defines need to be fixed up */
416 1.1.2.2 pgoyette u_int16_t ioc_status;
417 1.1.2.2 pgoyette
418 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
419 1.1.2.2 pgoyette
420 1.1.2.2 pgoyette u_int8_t max_chain_depth;
421 1.1.2.2 pgoyette u_int8_t whoinit;
422 1.1.2.2 pgoyette u_int8_t number_of_ports;
423 1.1.2.2 pgoyette u_int8_t reserved2;
424 1.1.2.2 pgoyette
425 1.1.2.2 pgoyette u_int16_t request_credit;
426 1.1.2.2 pgoyette u_int16_t product_id;
427 1.1.2.2 pgoyette
428 1.1.2.2 pgoyette u_int32_t ioc_capabilities;
429 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_EVENT_REPLAY (1<<13)
430 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_INTEGRATED_RAID (1<<12)
431 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_TLR (1<<11)
432 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_MULTICAST (1<<8)
433 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_BIDIRECTIONAL_TARGET (1<<7)
434 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_EEDP (1<<6)
435 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (1<<4)
436 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (1<<3)
437 1.1.2.2 pgoyette #define MPII_IOCFACTS_CAPABILITY_TASK_SET_FULL_HANDLING (1<<2)
438 1.1.2.2 pgoyette
439 1.1.2.2 pgoyette u_int8_t fw_version_dev;
440 1.1.2.2 pgoyette u_int8_t fw_version_unit;
441 1.1.2.2 pgoyette u_int8_t fw_version_min;
442 1.1.2.2 pgoyette u_int8_t fw_version_maj;
443 1.1.2.2 pgoyette
444 1.1.2.2 pgoyette u_int16_t ioc_request_frame_size;
445 1.1.2.2 pgoyette u_int16_t reserved3;
446 1.1.2.2 pgoyette
447 1.1.2.2 pgoyette u_int16_t max_initiators;
448 1.1.2.2 pgoyette u_int16_t max_targets;
449 1.1.2.2 pgoyette
450 1.1.2.2 pgoyette u_int16_t max_sas_expanders;
451 1.1.2.2 pgoyette u_int16_t max_enclosures;
452 1.1.2.2 pgoyette
453 1.1.2.2 pgoyette u_int16_t protocol_flags;
454 1.1.2.2 pgoyette u_int16_t high_priority_credit;
455 1.1.2.2 pgoyette
456 1.1.2.2 pgoyette u_int16_t max_reply_descriptor_post_queue_depth;
457 1.1.2.2 pgoyette u_int8_t reply_frame_size;
458 1.1.2.2 pgoyette u_int8_t max_volumes;
459 1.1.2.2 pgoyette
460 1.1.2.2 pgoyette u_int16_t max_dev_handle;
461 1.1.2.2 pgoyette u_int16_t max_persistent_entries;
462 1.1.2.2 pgoyette
463 1.1.2.2 pgoyette u_int32_t reserved4;
464 1.1.2.2 pgoyette } __packed;
465 1.1.2.2 pgoyette
466 1.1.2.2 pgoyette struct mpii_msg_portfacts_request {
467 1.1.2.2 pgoyette u_int16_t reserved1;
468 1.1.2.2 pgoyette u_int8_t chain_offset;
469 1.1.2.2 pgoyette u_int8_t function;
470 1.1.2.2 pgoyette
471 1.1.2.2 pgoyette u_int16_t reserved2;
472 1.1.2.2 pgoyette u_int8_t port_number;
473 1.1.2.2 pgoyette u_int8_t msg_flags;
474 1.1.2.2 pgoyette
475 1.1.2.2 pgoyette u_int8_t vp_id;
476 1.1.2.2 pgoyette u_int8_t vf_id;
477 1.1.2.2 pgoyette u_int16_t reserved3;
478 1.1.2.2 pgoyette } __packed;
479 1.1.2.2 pgoyette
480 1.1.2.2 pgoyette struct mpii_msg_portfacts_reply {
481 1.1.2.2 pgoyette u_int16_t reserved1;
482 1.1.2.2 pgoyette u_int8_t msg_length;
483 1.1.2.2 pgoyette u_int8_t function;
484 1.1.2.2 pgoyette
485 1.1.2.2 pgoyette u_int16_t reserved2;
486 1.1.2.2 pgoyette u_int8_t port_number;
487 1.1.2.2 pgoyette u_int8_t msg_flags;
488 1.1.2.2 pgoyette
489 1.1.2.2 pgoyette u_int8_t vp_id;
490 1.1.2.2 pgoyette u_int8_t vf_id;
491 1.1.2.2 pgoyette u_int16_t reserved3;
492 1.1.2.2 pgoyette
493 1.1.2.2 pgoyette u_int16_t reserved4;
494 1.1.2.2 pgoyette u_int16_t ioc_status;
495 1.1.2.2 pgoyette
496 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
497 1.1.2.2 pgoyette
498 1.1.2.2 pgoyette u_int8_t reserved5;
499 1.1.2.2 pgoyette u_int8_t port_type;
500 1.1.2.2 pgoyette #define MPII_PORTFACTS_PORTTYPE_INACTIVE (0x00)
501 1.1.2.2 pgoyette #define MPII_PORTFACTS_PORTTYPE_FC (0x10)
502 1.1.2.2 pgoyette #define MPII_PORTFACTS_PORTTYPE_ISCSI (0x20)
503 1.1.2.2 pgoyette #define MPII_PORTFACTS_PORTTYPE_SAS_PHYSICAL (0x30)
504 1.1.2.2 pgoyette #define MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL (0x31)
505 1.1.2.2 pgoyette u_int16_t reserved6;
506 1.1.2.2 pgoyette
507 1.1.2.2 pgoyette u_int16_t max_posted_cmd_buffers;
508 1.1.2.2 pgoyette u_int16_t reserved7;
509 1.1.2.2 pgoyette } __packed;
510 1.1.2.2 pgoyette
511 1.1.2.2 pgoyette struct mpii_msg_portenable_request {
512 1.1.2.2 pgoyette u_int16_t reserved1;
513 1.1.2.2 pgoyette u_int8_t chain_offset;
514 1.1.2.2 pgoyette u_int8_t function;
515 1.1.2.2 pgoyette
516 1.1.2.2 pgoyette u_int8_t reserved2;
517 1.1.2.2 pgoyette u_int8_t port_flags;
518 1.1.2.2 pgoyette u_int8_t reserved3;
519 1.1.2.2 pgoyette u_int8_t msg_flags;
520 1.1.2.2 pgoyette
521 1.1.2.2 pgoyette u_int8_t vp_id;
522 1.1.2.2 pgoyette u_int8_t vf_id;
523 1.1.2.2 pgoyette u_int16_t reserved4;
524 1.1.2.2 pgoyette } __packed;
525 1.1.2.2 pgoyette
526 1.1.2.2 pgoyette struct mpii_msg_portenable_reply {
527 1.1.2.2 pgoyette u_int16_t reserved1;
528 1.1.2.2 pgoyette u_int8_t msg_length;
529 1.1.2.2 pgoyette u_int8_t function;
530 1.1.2.2 pgoyette
531 1.1.2.2 pgoyette u_int8_t reserved2;
532 1.1.2.2 pgoyette u_int8_t port_flags;
533 1.1.2.2 pgoyette u_int8_t reserved3;
534 1.1.2.2 pgoyette u_int8_t msg_flags;
535 1.1.2.2 pgoyette
536 1.1.2.2 pgoyette u_int8_t vp_id;
537 1.1.2.2 pgoyette u_int8_t vf_id;
538 1.1.2.2 pgoyette u_int16_t reserved4;
539 1.1.2.2 pgoyette
540 1.1.2.2 pgoyette u_int16_t reserved5;
541 1.1.2.2 pgoyette u_int16_t ioc_status;
542 1.1.2.2 pgoyette
543 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
544 1.1.2.2 pgoyette } __packed;
545 1.1.2.2 pgoyette
546 1.1.2.2 pgoyette struct mpii_msg_event_request {
547 1.1.2.2 pgoyette u_int16_t reserved1;
548 1.1.2.2 pgoyette u_int8_t chain_offset;
549 1.1.2.2 pgoyette u_int8_t function;
550 1.1.2.2 pgoyette
551 1.1.2.2 pgoyette u_int16_t reserved2;
552 1.1.2.2 pgoyette u_int8_t reserved3;
553 1.1.2.2 pgoyette u_int8_t msg_flags;
554 1.1.2.2 pgoyette
555 1.1.2.2 pgoyette u_int8_t vp_id;
556 1.1.2.2 pgoyette u_int8_t vf_id;
557 1.1.2.2 pgoyette u_int16_t reserved4;
558 1.1.2.2 pgoyette
559 1.1.2.2 pgoyette u_int32_t reserved5;
560 1.1.2.2 pgoyette
561 1.1.2.2 pgoyette u_int32_t reserved6;
562 1.1.2.2 pgoyette
563 1.1.2.2 pgoyette u_int32_t event_masks[4];
564 1.1.2.2 pgoyette
565 1.1.2.2 pgoyette u_int16_t sas_broadcase_primitive_masks;
566 1.1.2.2 pgoyette u_int16_t reserved7;
567 1.1.2.2 pgoyette
568 1.1.2.2 pgoyette u_int32_t reserved8;
569 1.1.2.2 pgoyette } __packed;
570 1.1.2.2 pgoyette
571 1.1.2.2 pgoyette struct mpii_msg_event_reply {
572 1.1.2.2 pgoyette u_int16_t event_data_length;
573 1.1.2.2 pgoyette u_int8_t msg_length;
574 1.1.2.2 pgoyette u_int8_t function;
575 1.1.2.2 pgoyette
576 1.1.2.2 pgoyette u_int16_t reserved1;
577 1.1.2.2 pgoyette u_int8_t ack_required;
578 1.1.2.2 pgoyette #define MPII_EVENT_ACK_REQUIRED (0x01)
579 1.1.2.2 pgoyette u_int8_t msg_flags;
580 1.1.2.2 pgoyette #define MPII_EVENT_FLAGS_REPLY_KEPT (1<<7)
581 1.1.2.2 pgoyette
582 1.1.2.2 pgoyette u_int8_t vp_id;
583 1.1.2.2 pgoyette u_int8_t vf_id;
584 1.1.2.2 pgoyette u_int16_t reserved2;
585 1.1.2.2 pgoyette
586 1.1.2.2 pgoyette u_int16_t reserved3;
587 1.1.2.2 pgoyette u_int16_t ioc_status;
588 1.1.2.2 pgoyette
589 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
590 1.1.2.2 pgoyette
591 1.1.2.2 pgoyette u_int16_t event;
592 1.1.2.2 pgoyette u_int16_t reserved4;
593 1.1.2.2 pgoyette
594 1.1.2.2 pgoyette u_int32_t event_context;
595 1.1.2.2 pgoyette
596 1.1.2.2 pgoyette /* event data follows */
597 1.1.2.2 pgoyette } __packed;
598 1.1.2.2 pgoyette
599 1.1.2.2 pgoyette struct mpii_msg_eventack_request {
600 1.1.2.2 pgoyette u_int16_t reserved1;
601 1.1.2.2 pgoyette u_int8_t chain_offset;
602 1.1.2.2 pgoyette u_int8_t function;
603 1.1.2.2 pgoyette
604 1.1.2.2 pgoyette u_int8_t reserved2[3];
605 1.1.2.2 pgoyette u_int8_t msg_flags;
606 1.1.2.2 pgoyette
607 1.1.2.2 pgoyette u_int8_t vp_id;
608 1.1.2.2 pgoyette u_int8_t vf_id;
609 1.1.2.2 pgoyette u_int16_t reserved3;
610 1.1.2.2 pgoyette
611 1.1.2.2 pgoyette u_int16_t event;
612 1.1.2.2 pgoyette u_int16_t reserved4;
613 1.1.2.2 pgoyette
614 1.1.2.2 pgoyette u_int32_t event_context;
615 1.1.2.2 pgoyette } __packed;
616 1.1.2.2 pgoyette
617 1.1.2.2 pgoyette struct mpii_msg_eventack_reply {
618 1.1.2.2 pgoyette u_int16_t reserved1;
619 1.1.2.2 pgoyette u_int8_t msg_length;
620 1.1.2.2 pgoyette u_int8_t function;
621 1.1.2.2 pgoyette
622 1.1.2.2 pgoyette u_int8_t reserved2[3];
623 1.1.2.2 pgoyette u_int8_t msg_flags;
624 1.1.2.2 pgoyette
625 1.1.2.2 pgoyette u_int8_t vp_id;
626 1.1.2.2 pgoyette u_int8_t vf_id;
627 1.1.2.2 pgoyette u_int16_t reserved3;
628 1.1.2.2 pgoyette
629 1.1.2.2 pgoyette u_int16_t reserved4;
630 1.1.2.2 pgoyette u_int16_t ioc_status;
631 1.1.2.2 pgoyette
632 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
633 1.1.2.2 pgoyette } __packed;
634 1.1.2.2 pgoyette
635 1.1.2.2 pgoyette struct mpii_msg_fwupload_request {
636 1.1.2.2 pgoyette u_int8_t image_type;
637 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_IOC_FW (0x00)
638 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_FW (0x01)
639 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_BACKUP (0x05)
640 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_MANUFACTURING (0x06)
641 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_CONFIG_1 (0x07)
642 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_CONFIG_2 (0x08)
643 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_MEGARAID (0x09)
644 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_NV_COMPLETE (0x0a)
645 1.1.2.2 pgoyette #define MPII_FWUPLOAD_IMAGETYPE_COMMON_BOOT_BLOCK (0x0b)
646 1.1.2.2 pgoyette u_int8_t reserved1;
647 1.1.2.2 pgoyette u_int8_t chain_offset;
648 1.1.2.2 pgoyette u_int8_t function;
649 1.1.2.2 pgoyette
650 1.1.2.2 pgoyette u_int8_t reserved2[3];
651 1.1.2.2 pgoyette u_int8_t msg_flags;
652 1.1.2.2 pgoyette
653 1.1.2.2 pgoyette u_int8_t vp_id;
654 1.1.2.2 pgoyette u_int8_t vf_id;
655 1.1.2.2 pgoyette u_int16_t reserved3;
656 1.1.2.2 pgoyette
657 1.1.2.2 pgoyette u_int32_t reserved4;
658 1.1.2.2 pgoyette
659 1.1.2.2 pgoyette u_int32_t reserved5;
660 1.1.2.2 pgoyette
661 1.1.2.2 pgoyette struct mpii_fw_tce tce;
662 1.1.2.2 pgoyette
663 1.1.2.2 pgoyette /* followed by an sgl */
664 1.1.2.2 pgoyette } __packed;
665 1.1.2.2 pgoyette
666 1.1.2.2 pgoyette struct mpii_msg_fwupload_reply {
667 1.1.2.2 pgoyette u_int8_t image_type;
668 1.1.2.2 pgoyette u_int8_t reserved1;
669 1.1.2.2 pgoyette u_int8_t msg_length;
670 1.1.2.2 pgoyette u_int8_t function;
671 1.1.2.2 pgoyette
672 1.1.2.2 pgoyette u_int8_t reserved2[3];
673 1.1.2.2 pgoyette u_int8_t msg_flags;
674 1.1.2.2 pgoyette
675 1.1.2.2 pgoyette u_int8_t vp_id;
676 1.1.2.2 pgoyette u_int8_t vf_id;
677 1.1.2.2 pgoyette u_int16_t reserved3;
678 1.1.2.2 pgoyette
679 1.1.2.2 pgoyette u_int16_t reserved4;
680 1.1.2.2 pgoyette u_int16_t ioc_status;
681 1.1.2.2 pgoyette
682 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
683 1.1.2.2 pgoyette
684 1.1.2.2 pgoyette u_int32_t actual_image_size;
685 1.1.2.2 pgoyette } __packed;
686 1.1.2.2 pgoyette
687 1.1.2.2 pgoyette struct mpii_msg_scsi_io {
688 1.1.2.2 pgoyette u_int16_t dev_handle;
689 1.1.2.2 pgoyette u_int8_t chain_offset;
690 1.1.2.2 pgoyette u_int8_t function;
691 1.1.2.2 pgoyette
692 1.1.2.2 pgoyette u_int16_t reserved1;
693 1.1.2.2 pgoyette u_int8_t reserved2;
694 1.1.2.2 pgoyette u_int8_t msg_flags;
695 1.1.2.2 pgoyette
696 1.1.2.2 pgoyette u_int8_t vp_id;
697 1.1.2.2 pgoyette u_int8_t vf_id;
698 1.1.2.2 pgoyette u_int16_t reserved3;
699 1.1.2.2 pgoyette
700 1.1.2.2 pgoyette u_int32_t sense_buffer_low_address;
701 1.1.2.2 pgoyette
702 1.1.2.2 pgoyette u_int16_t sgl_flags;
703 1.1.2.2 pgoyette u_int8_t sense_buffer_length;
704 1.1.2.2 pgoyette u_int8_t reserved4;
705 1.1.2.2 pgoyette
706 1.1.2.2 pgoyette u_int8_t sgl_offset0;
707 1.1.2.2 pgoyette u_int8_t sgl_offset1;
708 1.1.2.2 pgoyette u_int8_t sgl_offset2;
709 1.1.2.2 pgoyette u_int8_t sgl_offset3;
710 1.1.2.2 pgoyette
711 1.1.2.2 pgoyette u_int32_t skip_count;
712 1.1.2.2 pgoyette
713 1.1.2.2 pgoyette u_int32_t data_length;
714 1.1.2.2 pgoyette
715 1.1.2.2 pgoyette u_int32_t bidirectional_data_length;
716 1.1.2.2 pgoyette
717 1.1.2.2 pgoyette u_int16_t io_flags;
718 1.1.2.2 pgoyette u_int16_t eedp_flags;
719 1.1.2.2 pgoyette
720 1.1.2.2 pgoyette u_int32_t eedp_block_size;
721 1.1.2.2 pgoyette
722 1.1.2.2 pgoyette u_int32_t secondary_reference_tag;
723 1.1.2.2 pgoyette
724 1.1.2.2 pgoyette u_int16_t secondary_application_tag;
725 1.1.2.2 pgoyette u_int16_t application_tag_translation_mask;
726 1.1.2.2 pgoyette
727 1.1.2.2 pgoyette u_int16_t lun[4];
728 1.1.2.2 pgoyette
729 1.1.2.2 pgoyette /* the following 16 bits are defined in MPI2 as the control field */
730 1.1.2.2 pgoyette u_int8_t reserved5;
731 1.1.2.2 pgoyette u_int8_t tagging;
732 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_SIMPLE_Q (0x0)
733 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_HEAD_OF_Q (0x1)
734 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_ORDERED_Q (0x2)
735 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_ACA_Q (0x4)
736 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_UNTAGGED (0x5)
737 1.1.2.2 pgoyette #define MPII_SCSIIO_ATTR_NO_DISCONNECT (0x7)
738 1.1.2.2 pgoyette u_int8_t reserved6;
739 1.1.2.2 pgoyette u_int8_t direction;
740 1.1.2.2 pgoyette #define MPII_SCSIIO_DIR_NONE (0x0)
741 1.1.2.2 pgoyette #define MPII_SCSIIO_DIR_WRITE (0x1)
742 1.1.2.2 pgoyette #define MPII_SCSIIO_DIR_READ (0x2)
743 1.1.2.2 pgoyette
744 1.1.2.2 pgoyette #define MPII_CDB_LEN (32)
745 1.1.2.2 pgoyette u_int8_t cdb[MPII_CDB_LEN];
746 1.1.2.2 pgoyette
747 1.1.2.2 pgoyette /* followed by an sgl */
748 1.1.2.2 pgoyette } __packed;
749 1.1.2.2 pgoyette
750 1.1.2.2 pgoyette struct mpii_msg_scsi_io_error {
751 1.1.2.2 pgoyette u_int16_t dev_handle;
752 1.1.2.2 pgoyette u_int8_t msg_length;
753 1.1.2.2 pgoyette u_int8_t function;
754 1.1.2.2 pgoyette
755 1.1.2.2 pgoyette u_int16_t reserved1;
756 1.1.2.2 pgoyette u_int8_t reserved2;
757 1.1.2.2 pgoyette u_int8_t msg_flags;
758 1.1.2.2 pgoyette
759 1.1.2.2 pgoyette u_int8_t vp_id;
760 1.1.2.2 pgoyette u_int8_t vf_id;
761 1.1.2.2 pgoyette u_int16_t reserved3;
762 1.1.2.2 pgoyette
763 1.1.2.2 pgoyette u_int8_t scsi_status;
764 1.1.2.2 pgoyette
765 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_SUCCESS (0x00)
766 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_CHECK_COND (0x02)
767 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_BUSY (0x04)
768 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE (0x08)
769 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE_CONDMET (0x10)
770 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_RESERVATION_CONFLICT (0x14)
771 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_CMD_TERM (0x22)
772 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_TASK_SET_FULL (0x28)
773 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_ACA_ACTIVE (0x30)
774 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATUS_TASK_ABORTED (0x40)
775 1.1.2.2 pgoyette
776 1.1.2.2 pgoyette u_int8_t scsi_state;
777 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_AUTOSENSE_VALID (1<<0)
778 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_AUTOSENSE_FAILED (1<<1)
779 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_NO_SCSI_STATUS (1<<2)
780 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_TERMINATED (1<<3)
781 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_RESPONSE_INFO_VALID (1<<4)
782 1.1.2.2 pgoyette #define MPII_SCSIIO_ERR_STATE_QUEUE_TAG_REJECTED (0xffff)
783 1.1.2.2 pgoyette u_int16_t ioc_status;
784 1.1.2.2 pgoyette
785 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
786 1.1.2.2 pgoyette
787 1.1.2.2 pgoyette u_int32_t transfer_count;
788 1.1.2.2 pgoyette
789 1.1.2.2 pgoyette u_int32_t sense_count;
790 1.1.2.2 pgoyette
791 1.1.2.2 pgoyette u_int32_t response_info;
792 1.1.2.2 pgoyette
793 1.1.2.2 pgoyette u_int16_t task_tag;
794 1.1.2.2 pgoyette u_int16_t reserved4;
795 1.1.2.2 pgoyette
796 1.1.2.2 pgoyette u_int32_t bidirectional_transfer_count;
797 1.1.2.2 pgoyette
798 1.1.2.2 pgoyette u_int32_t reserved5;
799 1.1.2.2 pgoyette
800 1.1.2.2 pgoyette u_int32_t reserved6;
801 1.1.2.2 pgoyette } __packed;
802 1.1.2.2 pgoyette
803 1.1.2.2 pgoyette struct mpii_request_descr {
804 1.1.2.2 pgoyette u_int8_t request_flags;
805 1.1.2.2 pgoyette #define MPII_REQ_DESCR_TYPE_MASK (0x0e)
806 1.1.2.2 pgoyette #define MPII_REQ_DESCR_SCSI_IO (0x00)
807 1.1.2.2 pgoyette #define MPII_REQ_DESCR_SCSI_TARGET (0x02)
808 1.1.2.2 pgoyette #define MPII_REQ_DESCR_HIGH_PRIORITY (0x06)
809 1.1.2.2 pgoyette #define MPII_REQ_DESCR_DEFAULT (0x08)
810 1.1.2.2 pgoyette u_int8_t vf_id;
811 1.1.2.2 pgoyette u_int16_t smid;
812 1.1.2.2 pgoyette
813 1.1.2.2 pgoyette u_int16_t lmid;
814 1.1.2.2 pgoyette u_int16_t dev_handle;
815 1.1.2.2 pgoyette } __packed;
816 1.1.2.2 pgoyette
817 1.1.2.2 pgoyette struct mpii_reply_descr {
818 1.1.2.2 pgoyette u_int8_t reply_flags;
819 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_TYPE_MASK (0x0f)
820 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_SCSI_IO_SUCCESS (0x00)
821 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_ADDRESS_REPLY (0x01)
822 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_TARGET_ASSIST_SUCCESS (0x02)
823 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_TARGET_COMMAND_BUFFER (0x03)
824 1.1.2.2 pgoyette #define MPII_REPLY_DESCR_UNUSED (0x0f)
825 1.1.2.2 pgoyette u_int8_t vf_id;
826 1.1.2.2 pgoyette u_int16_t smid;
827 1.1.2.2 pgoyette
828 1.1.2.2 pgoyette union {
829 1.1.2.2 pgoyette u_int32_t data;
830 1.1.2.2 pgoyette u_int32_t frame_addr; /* Address Reply */
831 1.1.2.2 pgoyette };
832 1.1.2.2 pgoyette } __packed;
833 1.1.2.2 pgoyette
834 1.1.2.2 pgoyette struct mpii_request_header {
835 1.1.2.2 pgoyette u_int16_t function_dependent1;
836 1.1.2.2 pgoyette u_int8_t chain_offset;
837 1.1.2.2 pgoyette u_int8_t function;
838 1.1.2.2 pgoyette
839 1.1.2.2 pgoyette u_int16_t function_dependent2;
840 1.1.2.2 pgoyette u_int8_t function_dependent3;
841 1.1.2.2 pgoyette u_int8_t message_flags;
842 1.1.2.2 pgoyette
843 1.1.2.2 pgoyette u_int8_t vp_id;
844 1.1.2.2 pgoyette u_int8_t vf_id;
845 1.1.2.2 pgoyette u_int16_t reserved;
846 1.1.2.2 pgoyette } __packed;
847 1.1.2.2 pgoyette
848 1.1.2.2 pgoyette struct mpii_msg_scsi_task_request {
849 1.1.2.2 pgoyette u_int16_t dev_handle;
850 1.1.2.2 pgoyette u_int8_t chain_offset;
851 1.1.2.2 pgoyette u_int8_t function;
852 1.1.2.2 pgoyette
853 1.1.2.2 pgoyette u_int8_t reserved1;
854 1.1.2.2 pgoyette u_int8_t task_type;
855 1.1.2.2 pgoyette #define MPII_SCSI_TASK_ABORT_TASK (0x01)
856 1.1.2.2 pgoyette #define MPII_SCSI_TASK_ABRT_TASK_SET (0x02)
857 1.1.2.2 pgoyette #define MPII_SCSI_TASK_TARGET_RESET (0x03)
858 1.1.2.2 pgoyette #define MPII_SCSI_TASK_RESET_BUS (0x04)
859 1.1.2.2 pgoyette #define MPII_SCSI_TASK_LOGICAL_UNIT_RESET (0x05)
860 1.1.2.2 pgoyette u_int8_t reserved2;
861 1.1.2.2 pgoyette u_int8_t msg_flags;
862 1.1.2.2 pgoyette
863 1.1.2.2 pgoyette u_int8_t vp_id;
864 1.1.2.2 pgoyette u_int8_t vf_id;
865 1.1.2.2 pgoyette u_int16_t reserved3;
866 1.1.2.2 pgoyette
867 1.1.2.2 pgoyette u_int16_t lun[4];
868 1.1.2.2 pgoyette
869 1.1.2.2 pgoyette u_int32_t reserved4[7];
870 1.1.2.2 pgoyette
871 1.1.2.2 pgoyette u_int16_t task_mid;
872 1.1.2.2 pgoyette u_int16_t reserved5;
873 1.1.2.2 pgoyette } __packed;
874 1.1.2.2 pgoyette
875 1.1.2.2 pgoyette struct mpii_msg_scsi_task_reply {
876 1.1.2.2 pgoyette u_int16_t dev_handle;
877 1.1.2.2 pgoyette u_int8_t msg_length;
878 1.1.2.2 pgoyette u_int8_t function;
879 1.1.2.2 pgoyette
880 1.1.2.2 pgoyette u_int8_t response_code;
881 1.1.2.2 pgoyette u_int8_t task_type;
882 1.1.2.2 pgoyette u_int8_t reserved1;
883 1.1.2.2 pgoyette u_int8_t msg_flags;
884 1.1.2.2 pgoyette
885 1.1.2.2 pgoyette u_int8_t vp_id;
886 1.1.2.2 pgoyette u_int8_t vf_id;
887 1.1.2.2 pgoyette u_int16_t reserved2;
888 1.1.2.2 pgoyette
889 1.1.2.2 pgoyette u_int16_t reserved3;
890 1.1.2.2 pgoyette u_int16_t ioc_status;
891 1.1.2.2 pgoyette
892 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
893 1.1.2.2 pgoyette
894 1.1.2.2 pgoyette u_int32_t termination_count;
895 1.1.2.2 pgoyette } __packed;
896 1.1.2.2 pgoyette
897 1.1.2.2 pgoyette struct mpii_msg_sas_oper_request {
898 1.1.2.2 pgoyette u_int8_t operation;
899 1.1.2.2 pgoyette #define MPII_SAS_OP_CLEAR_PERSISTENT (0x02)
900 1.1.2.2 pgoyette #define MPII_SAS_OP_PHY_LINK_RESET (0x06)
901 1.1.2.2 pgoyette #define MPII_SAS_OP_PHY_HARD_RESET (0x07)
902 1.1.2.2 pgoyette #define MPII_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
903 1.1.2.2 pgoyette #define MPII_SAS_OP_SEND_PRIMITIVE (0x0a)
904 1.1.2.2 pgoyette #define MPII_SAS_OP_FORCE_FULL_DISCOVERY (0x0b)
905 1.1.2.2 pgoyette #define MPII_SAS_OP_TRANSMIT_PORT_SELECT (0x0c)
906 1.1.2.2 pgoyette #define MPII_SAS_OP_REMOVE_DEVICE (0x0d)
907 1.1.2.2 pgoyette #define MPII_SAS_OP_LOOKUP_MAPPING (0x0e)
908 1.1.2.2 pgoyette #define MPII_SAS_OP_SET_IOC_PARAM (0x0f)
909 1.1.2.2 pgoyette u_int8_t reserved1;
910 1.1.2.2 pgoyette u_int8_t chain_offset;
911 1.1.2.2 pgoyette u_int8_t function;
912 1.1.2.2 pgoyette
913 1.1.2.2 pgoyette u_int16_t dev_handle;
914 1.1.2.2 pgoyette u_int8_t ioc_param;
915 1.1.2.2 pgoyette u_int8_t msg_flags;
916 1.1.2.2 pgoyette
917 1.1.2.2 pgoyette u_int8_t vp_id;
918 1.1.2.2 pgoyette u_int8_t vf_id;
919 1.1.2.2 pgoyette u_int16_t reserved2;
920 1.1.2.2 pgoyette
921 1.1.2.2 pgoyette u_int16_t reserved3;
922 1.1.2.2 pgoyette u_int8_t phy_num;
923 1.1.2.2 pgoyette u_int8_t prim_flags;
924 1.1.2.2 pgoyette
925 1.1.2.2 pgoyette u_int32_t primitive;
926 1.1.2.2 pgoyette
927 1.1.2.2 pgoyette u_int8_t lookup_method;
928 1.1.2.2 pgoyette #define MPII_SAS_LOOKUP_METHOD_SAS_ADDR (0x01)
929 1.1.2.2 pgoyette #define MPII_SAS_LOOKUP_METHOD_SAS_ENCL (0x02)
930 1.1.2.2 pgoyette #define MPII_SAS_LOOKUP_METHOD_SAS_DEVNAME (0x03)
931 1.1.2.2 pgoyette u_int8_t reserved4;
932 1.1.2.2 pgoyette u_int16_t slot_num;
933 1.1.2.2 pgoyette
934 1.1.2.2 pgoyette u_int64_t lookup_addr;
935 1.1.2.2 pgoyette
936 1.1.2.2 pgoyette u_int32_t ioc_param_value;
937 1.1.2.2 pgoyette
938 1.1.2.2 pgoyette u_int64_t reserved5;
939 1.1.2.2 pgoyette } __packed;
940 1.1.2.2 pgoyette
941 1.1.2.2 pgoyette struct mpii_msg_sas_oper_reply {
942 1.1.2.2 pgoyette u_int8_t operation;
943 1.1.2.2 pgoyette u_int8_t reserved1;
944 1.1.2.2 pgoyette u_int8_t chain_offset;
945 1.1.2.2 pgoyette u_int8_t function;
946 1.1.2.2 pgoyette
947 1.1.2.2 pgoyette u_int16_t dev_handle;
948 1.1.2.2 pgoyette u_int8_t ioc_param;
949 1.1.2.2 pgoyette u_int8_t msg_flags;
950 1.1.2.2 pgoyette
951 1.1.2.2 pgoyette u_int8_t vp_id;
952 1.1.2.2 pgoyette u_int8_t vf_id;
953 1.1.2.2 pgoyette u_int16_t reserved2;
954 1.1.2.2 pgoyette
955 1.1.2.2 pgoyette u_int16_t reserved3;
956 1.1.2.2 pgoyette u_int16_t ioc_status;
957 1.1.2.2 pgoyette
958 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
959 1.1.2.2 pgoyette } __packed;
960 1.1.2.2 pgoyette
961 1.1.2.2 pgoyette struct mpii_msg_raid_action_request {
962 1.1.2.2 pgoyette u_int8_t action;
963 1.1.2.2 pgoyette #define MPII_RAID_ACTION_CHANGE_VOL_WRITE_CACHE (0x17)
964 1.1.2.2 pgoyette u_int8_t reserved1;
965 1.1.2.2 pgoyette u_int8_t chain_offset;
966 1.1.2.2 pgoyette u_int8_t function;
967 1.1.2.2 pgoyette
968 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
969 1.1.2.2 pgoyette u_int8_t phys_disk_num;
970 1.1.2.2 pgoyette u_int8_t msg_flags;
971 1.1.2.2 pgoyette
972 1.1.2.2 pgoyette u_int8_t vp_id;
973 1.1.2.2 pgoyette u_int8_t vf_if;
974 1.1.2.2 pgoyette u_int16_t reserved2;
975 1.1.2.2 pgoyette
976 1.1.2.2 pgoyette u_int32_t reserved3;
977 1.1.2.2 pgoyette
978 1.1.2.2 pgoyette u_int32_t action_data;
979 1.1.2.2 pgoyette #define MPII_RAID_VOL_WRITE_CACHE_MASK (0x03)
980 1.1.2.2 pgoyette #define MPII_RAID_VOL_WRITE_CACHE_DISABLE (0x01)
981 1.1.2.2 pgoyette #define MPII_RAID_VOL_WRITE_CACHE_ENABLE (0x02)
982 1.1.2.2 pgoyette
983 1.1.2.2 pgoyette struct mpii_sge action_sge;
984 1.1.2.2 pgoyette } __packed;
985 1.1.2.2 pgoyette
986 1.1.2.2 pgoyette struct mpii_msg_raid_action_reply {
987 1.1.2.2 pgoyette u_int8_t action;
988 1.1.2.2 pgoyette u_int8_t reserved1;
989 1.1.2.2 pgoyette u_int8_t chain_offset;
990 1.1.2.2 pgoyette u_int8_t function;
991 1.1.2.2 pgoyette
992 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
993 1.1.2.2 pgoyette u_int8_t phys_disk_num;
994 1.1.2.2 pgoyette u_int8_t msg_flags;
995 1.1.2.2 pgoyette
996 1.1.2.2 pgoyette u_int8_t vp_id;
997 1.1.2.2 pgoyette u_int8_t vf_if;
998 1.1.2.2 pgoyette u_int16_t reserved2;
999 1.1.2.2 pgoyette
1000 1.1.2.2 pgoyette u_int16_t reserved3;
1001 1.1.2.2 pgoyette u_int16_t ioc_status;
1002 1.1.2.2 pgoyette
1003 1.1.2.2 pgoyette u_int32_t action_data[5];
1004 1.1.2.2 pgoyette } __packed;
1005 1.1.2.2 pgoyette
1006 1.1.2.2 pgoyette struct mpii_cfg_hdr {
1007 1.1.2.2 pgoyette u_int8_t page_version;
1008 1.1.2.2 pgoyette u_int8_t page_length;
1009 1.1.2.2 pgoyette u_int8_t page_number;
1010 1.1.2.2 pgoyette u_int8_t page_type;
1011 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_ATTRIBUTE (0xf0)
1012 1.1.2.2 pgoyette #define MPI2_CONFIG_PAGEATTR_READ_ONLY (0x00)
1013 1.1.2.2 pgoyette #define MPI2_CONFIG_PAGEATTR_CHANGEABLE (0x10)
1014 1.1.2.2 pgoyette #define MPI2_CONFIG_PAGEATTR_PERSISTENT (0x20)
1015 1.1.2.2 pgoyette
1016 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_MASK (0x0f)
1017 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_IO_UNIT (0x00)
1018 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_IOC (0x01)
1019 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_BIOS (0x02)
1020 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_RAID_VOL (0x08)
1021 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_MANUFACTURING (0x09)
1022 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_RAID_PD (0x0a)
1023 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_EXTENDED (0x0f)
1024 1.1.2.2 pgoyette } __packed;
1025 1.1.2.2 pgoyette
1026 1.1.2.2 pgoyette struct mpii_ecfg_hdr {
1027 1.1.2.2 pgoyette u_int8_t page_version;
1028 1.1.2.2 pgoyette u_int8_t reserved1;
1029 1.1.2.2 pgoyette u_int8_t page_number;
1030 1.1.2.2 pgoyette u_int8_t page_type;
1031 1.1.2.2 pgoyette
1032 1.1.2.2 pgoyette u_int16_t ext_page_length;
1033 1.1.2.2 pgoyette u_int8_t ext_page_type;
1034 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_SAS_DEVICE (0x12)
1035 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_RAID_CONFIG (0x16)
1036 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_PAGE_TYPE_DRIVER_MAPPING (0x17)
1037 1.1.2.2 pgoyette u_int8_t reserved2;
1038 1.1.2.2 pgoyette } __packed;
1039 1.1.2.2 pgoyette
1040 1.1.2.2 pgoyette struct mpii_msg_config_request {
1041 1.1.2.2 pgoyette u_int8_t action;
1042 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_HEADER (0x00)
1043 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_READ_CURRENT (0x01)
1044 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_WRITE_CURRENT (0x02)
1045 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_DEFAULT (0x03)
1046 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_WRITE_NVRAM (0x04)
1047 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_READ_DEFAULT (0x05)
1048 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_ACTION_PAGE_READ_NVRAM (0x06)
1049 1.1.2.2 pgoyette u_int8_t sgl_flags;
1050 1.1.2.2 pgoyette u_int8_t chain_offset;
1051 1.1.2.2 pgoyette u_int8_t function;
1052 1.1.2.2 pgoyette
1053 1.1.2.2 pgoyette u_int16_t ext_page_len;
1054 1.1.2.2 pgoyette u_int8_t ext_page_type;
1055 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_EXTPAGE_TYPE_SAS_IO_UNIT (0x10)
1056 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_EXTPAGE_TYPE_SAS_EXPANDER (0x11)
1057 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_EXTPAGE_TYPE_SAS_DEVICE (0x12)
1058 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_EXTPAGE_TYPE_SAS_PHY (0x13)
1059 1.1.2.2 pgoyette #define MPII_CONFIG_REQ_EXTPAGE_TYPE_LOG (0x14)
1060 1.1.2.2 pgoyette #define MPI2_CONFIG_EXTPAGETYPE_ENCLOSURE (0x15)
1061 1.1.2.2 pgoyette #define MPI2_CONFIG_EXTPAGETYPE_RAID_CONFIG (0x16)
1062 1.1.2.2 pgoyette #define MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING (0x17)
1063 1.1.2.2 pgoyette #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT (0x18)
1064 1.1.2.2 pgoyette u_int8_t msg_flags;
1065 1.1.2.2 pgoyette
1066 1.1.2.2 pgoyette u_int8_t vp_id;
1067 1.1.2.2 pgoyette u_int8_t vf_id;
1068 1.1.2.2 pgoyette u_int16_t reserved1;
1069 1.1.2.2 pgoyette
1070 1.1.2.2 pgoyette u_int32_t reserved2[2];
1071 1.1.2.2 pgoyette
1072 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1073 1.1.2.2 pgoyette
1074 1.1.2.2 pgoyette u_int32_t page_address;
1075 1.1.2.2 pgoyette /* XXX lots of defns here */
1076 1.1.2.2 pgoyette
1077 1.1.2.2 pgoyette struct mpii_sge page_buffer;
1078 1.1.2.2 pgoyette } __packed;
1079 1.1.2.2 pgoyette
1080 1.1.2.2 pgoyette struct mpii_msg_config_reply {
1081 1.1.2.2 pgoyette u_int8_t action;
1082 1.1.2.2 pgoyette u_int8_t sgl_flags;
1083 1.1.2.2 pgoyette u_int8_t msg_length;
1084 1.1.2.2 pgoyette u_int8_t function;
1085 1.1.2.2 pgoyette
1086 1.1.2.2 pgoyette u_int16_t ext_page_length;
1087 1.1.2.2 pgoyette u_int8_t ext_page_type;
1088 1.1.2.2 pgoyette u_int8_t msg_flags;
1089 1.1.2.2 pgoyette
1090 1.1.2.2 pgoyette u_int8_t vp_id;
1091 1.1.2.2 pgoyette u_int8_t vf_id;
1092 1.1.2.2 pgoyette u_int16_t reserved1;
1093 1.1.2.2 pgoyette
1094 1.1.2.2 pgoyette u_int16_t reserved2;
1095 1.1.2.2 pgoyette u_int16_t ioc_status;
1096 1.1.2.2 pgoyette
1097 1.1.2.2 pgoyette u_int32_t ioc_loginfo;
1098 1.1.2.2 pgoyette
1099 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1100 1.1.2.2 pgoyette } __packed;
1101 1.1.2.2 pgoyette
1102 1.1.2.2 pgoyette struct mpii_cfg_manufacturing_pg0 {
1103 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1104 1.1.2.2 pgoyette
1105 1.1.2.2 pgoyette char chip_name[16];
1106 1.1.2.2 pgoyette char chip_revision[8];
1107 1.1.2.2 pgoyette char board_name[16];
1108 1.1.2.2 pgoyette char board_assembly[16];
1109 1.1.2.2 pgoyette char board_tracer_number[16];
1110 1.1.2.2 pgoyette } __packed;
1111 1.1.2.2 pgoyette
1112 1.1.2.2 pgoyette struct mpii_cfg_ioc_pg1 {
1113 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1114 1.1.2.2 pgoyette
1115 1.1.2.2 pgoyette u_int32_t flags;
1116 1.1.2.2 pgoyette
1117 1.1.2.2 pgoyette u_int32_t coalescing_timeout;
1118 1.1.2.2 pgoyette #define MPII_CFG_IOC_1_REPLY_COALESCING (1<<0)
1119 1.1.2.2 pgoyette
1120 1.1.2.2 pgoyette u_int8_t coalescing_depth;
1121 1.1.2.2 pgoyette u_int8_t pci_slot_num;
1122 1.1.2.2 pgoyette u_int8_t pci_bus_num;
1123 1.1.2.2 pgoyette u_int8_t pci_domain_segment;
1124 1.1.2.2 pgoyette
1125 1.1.2.2 pgoyette u_int32_t reserved1;
1126 1.1.2.2 pgoyette
1127 1.1.2.2 pgoyette u_int32_t reserved2;
1128 1.1.2.2 pgoyette } __packed;
1129 1.1.2.2 pgoyette
1130 1.1.2.2 pgoyette struct mpii_cfg_ioc_pg3 {
1131 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1132 1.1.2.2 pgoyette
1133 1.1.2.2 pgoyette u_int8_t no_phys_disks;
1134 1.1.2.2 pgoyette u_int8_t reserved[3];
1135 1.1.2.2 pgoyette
1136 1.1.2.2 pgoyette /* followed by a list of mpii_cfg_raid_physdisk structs */
1137 1.1.2.2 pgoyette } __packed;
1138 1.1.2.2 pgoyette
1139 1.1.2.2 pgoyette struct mpii_cfg_ioc_pg8 {
1140 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1141 1.1.2.2 pgoyette
1142 1.1.2.2 pgoyette u_int8_t num_devs_per_enclosure;
1143 1.1.2.2 pgoyette u_int8_t reserved1;
1144 1.1.2.2 pgoyette u_int16_t reserved2;
1145 1.1.2.2 pgoyette
1146 1.1.2.2 pgoyette u_int16_t max_persistent_entries;
1147 1.1.2.2 pgoyette u_int16_t max_num_physical_mapped_ids;
1148 1.1.2.2 pgoyette
1149 1.1.2.2 pgoyette u_int16_t flags;
1150 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_DA_START_SLOT_1 (1<<5)
1151 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_RESERVED_TARGETID_0 (1<<4)
1152 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_MAPPING_MODE_MASK (0x0000000e)
1153 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_DEVICE_PERSISTENCE_MAPPING (0<<1)
1154 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_ENCLOSURE_SLOT_MAPPING (1<<1)
1155 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_DISABLE_PERSISTENT_MAPPING (1<<0)
1156 1.1.2.2 pgoyette #define MPII_IOC_PG8_FLAGS_ENABLE_PERSISTENT_MAPPING (0<<0)
1157 1.1.2.2 pgoyette u_int16_t reserved3;
1158 1.1.2.2 pgoyette
1159 1.1.2.2 pgoyette u_int16_t ir_volume_mapping_flags;
1160 1.1.2.2 pgoyette #define MPII_IOC_PG8_IRFLAGS_VOLUME_MAPPING_MODE_MASK (0x00000003)
1161 1.1.2.2 pgoyette #define MPII_IOC_PG8_IRFLAGS_LOW_VOLUME_MAPPING (0<<0)
1162 1.1.2.2 pgoyette #define MPII_IOC_PG8_IRFLAGS_HIGH_VOLUME_MAPPING (1<<0)
1163 1.1.2.2 pgoyette u_int16_t reserved4;
1164 1.1.2.2 pgoyette
1165 1.1.2.2 pgoyette u_int32_t reserved5;
1166 1.1.2.2 pgoyette } __packed;
1167 1.1.2.2 pgoyette
1168 1.1.2.2 pgoyette struct mpii_cfg_raid_physdisk {
1169 1.1.2.2 pgoyette u_int8_t phys_disk_id;
1170 1.1.2.2 pgoyette u_int8_t phys_disk_bus;
1171 1.1.2.2 pgoyette u_int8_t phys_disk_ioc;
1172 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1173 1.1.2.2 pgoyette } __packed;
1174 1.1.2.2 pgoyette
1175 1.1.2.2 pgoyette struct mpii_cfg_fc_port_pg0 {
1176 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1177 1.1.2.2 pgoyette
1178 1.1.2.2 pgoyette u_int32_t flags;
1179 1.1.2.2 pgoyette
1180 1.1.2.2 pgoyette u_int8_t mpii_port_nr;
1181 1.1.2.2 pgoyette u_int8_t link_type;
1182 1.1.2.2 pgoyette u_int8_t port_state;
1183 1.1.2.2 pgoyette u_int8_t reserved1;
1184 1.1.2.2 pgoyette
1185 1.1.2.2 pgoyette u_int32_t port_id;
1186 1.1.2.2 pgoyette
1187 1.1.2.2 pgoyette u_int64_t wwnn;
1188 1.1.2.2 pgoyette
1189 1.1.2.2 pgoyette u_int64_t wwpn;
1190 1.1.2.2 pgoyette
1191 1.1.2.2 pgoyette u_int32_t supported_service_class;
1192 1.1.2.2 pgoyette
1193 1.1.2.2 pgoyette u_int32_t supported_speeds;
1194 1.1.2.2 pgoyette
1195 1.1.2.2 pgoyette u_int32_t current_speed;
1196 1.1.2.2 pgoyette
1197 1.1.2.2 pgoyette u_int32_t max_frame_size;
1198 1.1.2.2 pgoyette
1199 1.1.2.2 pgoyette u_int64_t fabric_wwnn;
1200 1.1.2.2 pgoyette
1201 1.1.2.2 pgoyette u_int64_t fabric_wwpn;
1202 1.1.2.2 pgoyette
1203 1.1.2.2 pgoyette u_int32_t discovered_port_count;
1204 1.1.2.2 pgoyette
1205 1.1.2.2 pgoyette u_int32_t max_initiators;
1206 1.1.2.2 pgoyette
1207 1.1.2.2 pgoyette u_int8_t max_aliases_supported;
1208 1.1.2.2 pgoyette u_int8_t max_hard_aliases_supported;
1209 1.1.2.2 pgoyette u_int8_t num_current_aliases;
1210 1.1.2.2 pgoyette u_int8_t reserved2;
1211 1.1.2.2 pgoyette } __packed;
1212 1.1.2.2 pgoyette
1213 1.1.2.2 pgoyette struct mpii_cfg_fc_port_pg1 {
1214 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1215 1.1.2.2 pgoyette
1216 1.1.2.2 pgoyette u_int32_t flags;
1217 1.1.2.2 pgoyette
1218 1.1.2.2 pgoyette u_int64_t noseepromwwnn;
1219 1.1.2.2 pgoyette
1220 1.1.2.2 pgoyette u_int64_t noseepromwwpn;
1221 1.1.2.2 pgoyette
1222 1.1.2.2 pgoyette u_int8_t hard_alpa;
1223 1.1.2.2 pgoyette u_int8_t link_config;
1224 1.1.2.2 pgoyette u_int8_t topology_config;
1225 1.1.2.2 pgoyette u_int8_t alt_connector;
1226 1.1.2.2 pgoyette
1227 1.1.2.2 pgoyette u_int8_t num_req_aliases;
1228 1.1.2.2 pgoyette u_int8_t rr_tov;
1229 1.1.2.2 pgoyette u_int8_t initiator_dev_to;
1230 1.1.2.2 pgoyette u_int8_t initiator_lo_pend_to;
1231 1.1.2.2 pgoyette } __packed;
1232 1.1.2.2 pgoyette
1233 1.1.2.2 pgoyette struct mpii_cfg_fc_device_pg0 {
1234 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1235 1.1.2.2 pgoyette
1236 1.1.2.2 pgoyette u_int64_t wwnn;
1237 1.1.2.2 pgoyette
1238 1.1.2.2 pgoyette u_int64_t wwpn;
1239 1.1.2.2 pgoyette
1240 1.1.2.2 pgoyette u_int32_t port_id;
1241 1.1.2.2 pgoyette
1242 1.1.2.2 pgoyette u_int8_t protocol;
1243 1.1.2.2 pgoyette u_int8_t flags;
1244 1.1.2.2 pgoyette u_int16_t bb_credit;
1245 1.1.2.2 pgoyette
1246 1.1.2.2 pgoyette u_int16_t max_rx_frame_size;
1247 1.1.2.2 pgoyette u_int8_t adisc_hard_alpa;
1248 1.1.2.2 pgoyette u_int8_t port_nr;
1249 1.1.2.2 pgoyette
1250 1.1.2.2 pgoyette u_int8_t fc_ph_low_version;
1251 1.1.2.2 pgoyette u_int8_t fc_ph_high_version;
1252 1.1.2.2 pgoyette u_int8_t current_target_id;
1253 1.1.2.2 pgoyette u_int8_t current_bus;
1254 1.1.2.2 pgoyette } __packed;
1255 1.1.2.2 pgoyette
1256 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_ADDR_HANDLE (1<<28)
1257 1.1.2.2 pgoyette
1258 1.1.2.2 pgoyette struct mpii_cfg_raid_vol_pg0 {
1259 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1260 1.1.2.2 pgoyette
1261 1.1.2.2 pgoyette u_int16_t volume_handle;
1262 1.1.2.2 pgoyette u_int8_t volume_state;
1263 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_MISSING (0x00)
1264 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_FAILED (0x01)
1265 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_INITIALIZING (0x02)
1266 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_ONLINE (0x03)
1267 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_DEGRADED (0x04)
1268 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATE_OPTIMAL (0x05)
1269 1.1.2.2 pgoyette u_int8_t volume_type;
1270 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_TYPE_RAID0 (0x00)
1271 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_TYPE_RAID1E (0x01)
1272 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_TYPE_RAID1 (0x02)
1273 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_TYPE_RAID10 (0x05)
1274 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_TYPE_UNKNOWN (0xff)
1275 1.1.2.2 pgoyette
1276 1.1.2.2 pgoyette u_int32_t volume_status;
1277 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATUS_SCRUB (1<<20)
1278 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_STATUS_RESYNC (1<<16)
1279 1.1.2.2 pgoyette
1280 1.1.2.2 pgoyette u_int16_t volume_settings;
1281 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_SETTINGS_CACHE_MASK (0x3<<0)
1282 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_SETTINGS_CACHE_UNCHANGED (0x0<<0)
1283 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_SETTINGS_CACHE_DISABLED (0x1<<0)
1284 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_SETTINGS_CACHE_ENABLED (0x2<<0)
1285 1.1.2.2 pgoyette
1286 1.1.2.2 pgoyette u_int8_t hot_spare_pool;
1287 1.1.2.2 pgoyette u_int8_t reserved1;
1288 1.1.2.2 pgoyette
1289 1.1.2.2 pgoyette u_int64_t max_lba;
1290 1.1.2.2 pgoyette
1291 1.1.2.2 pgoyette u_int32_t stripe_size;
1292 1.1.2.2 pgoyette
1293 1.1.2.2 pgoyette u_int16_t block_size;
1294 1.1.2.2 pgoyette u_int16_t reserved2;
1295 1.1.2.2 pgoyette
1296 1.1.2.2 pgoyette u_int8_t phys_disk_types;
1297 1.1.2.2 pgoyette u_int8_t resync_rate;
1298 1.1.2.2 pgoyette u_int16_t data_scrub_rate;
1299 1.1.2.2 pgoyette
1300 1.1.2.2 pgoyette u_int8_t num_phys_disks;
1301 1.1.2.2 pgoyette u_int16_t reserved3;
1302 1.1.2.2 pgoyette u_int8_t inactive_status;
1303 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_UNKNOWN (0x00)
1304 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_STALE_META (0x01)
1305 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_FOREIGN_VOL (0x02)
1306 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_NO_RESOURCES (0x03)
1307 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_CLONED_VOL (0x04)
1308 1.1.2.2 pgoyette #define MPII_CFG_RAID_VOL_0_INACTIVE_INSUF_META (0x05)
1309 1.1.2.2 pgoyette
1310 1.1.2.2 pgoyette /* followed by a list of mpii_cfg_raid_vol_pg0_physdisk structs */
1311 1.1.2.2 pgoyette } __packed;
1312 1.1.2.2 pgoyette
1313 1.1.2.2 pgoyette struct mpii_cfg_raid_vol_pg0_physdisk {
1314 1.1.2.2 pgoyette u_int8_t raid_set_num;
1315 1.1.2.2 pgoyette u_int8_t phys_disk_map;
1316 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1317 1.1.2.2 pgoyette u_int8_t reserved;
1318 1.1.2.2 pgoyette } __packed;
1319 1.1.2.2 pgoyette
1320 1.1.2.2 pgoyette struct mpii_cfg_raid_vol_pg1 {
1321 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1322 1.1.2.2 pgoyette
1323 1.1.2.2 pgoyette u_int8_t volume_id;
1324 1.1.2.2 pgoyette u_int8_t volume_bus;
1325 1.1.2.2 pgoyette u_int8_t volume_ioc;
1326 1.1.2.2 pgoyette u_int8_t reserved1;
1327 1.1.2.2 pgoyette
1328 1.1.2.2 pgoyette u_int8_t guid[24];
1329 1.1.2.2 pgoyette
1330 1.1.2.2 pgoyette u_int8_t name[32];
1331 1.1.2.2 pgoyette
1332 1.1.2.2 pgoyette u_int64_t wwid;
1333 1.1.2.2 pgoyette
1334 1.1.2.2 pgoyette u_int32_t reserved2;
1335 1.1.2.2 pgoyette
1336 1.1.2.2 pgoyette u_int32_t reserved3;
1337 1.1.2.2 pgoyette } __packed;
1338 1.1.2.2 pgoyette
1339 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYS_DISK_ADDR_NUMBER (1<<28)
1340 1.1.2.2 pgoyette
1341 1.1.2.2 pgoyette struct mpii_cfg_raid_physdisk_pg0 {
1342 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1343 1.1.2.2 pgoyette
1344 1.1.2.2 pgoyette u_int16_t dev_handle;
1345 1.1.2.2 pgoyette u_int8_t reserved1;
1346 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1347 1.1.2.2 pgoyette
1348 1.1.2.2 pgoyette u_int8_t enc_id;
1349 1.1.2.2 pgoyette u_int8_t enc_bus;
1350 1.1.2.2 pgoyette u_int8_t hot_spare_pool;
1351 1.1.2.2 pgoyette u_int8_t enc_type;
1352 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_ENCTYPE_NONE (0x0)
1353 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_ENCTYPE_SAFTE (0x1)
1354 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_ENCTYPE_SES (0x2)
1355 1.1.2.2 pgoyette
1356 1.1.2.2 pgoyette u_int32_t reserved2;
1357 1.1.2.2 pgoyette
1358 1.1.2.2 pgoyette u_int8_t vendor_id[8];
1359 1.1.2.2 pgoyette
1360 1.1.2.2 pgoyette u_int8_t product_id[16];
1361 1.1.2.2 pgoyette
1362 1.1.2.2 pgoyette u_int8_t product_rev[4];
1363 1.1.2.2 pgoyette
1364 1.1.2.2 pgoyette u_int8_t serial[32];
1365 1.1.2.2 pgoyette
1366 1.1.2.2 pgoyette u_int32_t reserved3;
1367 1.1.2.2 pgoyette
1368 1.1.2.2 pgoyette u_int8_t phys_disk_state;
1369 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_NOTCONFIGURED (0x00)
1370 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_NOTCOMPATIBLE (0x01)
1371 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_OFFLINE (0x02)
1372 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_ONLINE (0x03)
1373 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_HOTSPARE (0x04)
1374 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_DEGRADED (0x05)
1375 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_REBUILDING (0x06)
1376 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATE_OPTIMAL (0x07)
1377 1.1.2.2 pgoyette u_int8_t offline_reason;
1378 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_MISSING (0x01)
1379 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_FAILED (0x03)
1380 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_INITIALIZING (0x04)
1381 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_REQUESTED (0x05)
1382 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_FAILEDREQ (0x06)
1383 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_OFFLINE_OTHER (0xff)
1384 1.1.2.2 pgoyette
1385 1.1.2.2 pgoyette u_int8_t incompat_reason;
1386 1.1.2.2 pgoyette u_int8_t phys_disk_attrs;
1387 1.1.2.2 pgoyette
1388 1.1.2.2 pgoyette u_int32_t phys_disk_status;
1389 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATUS_OUTOFSYNC (1<<0)
1390 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_0_STATUS_QUIESCED (1<<1)
1391 1.1.2.2 pgoyette
1392 1.1.2.2 pgoyette u_int64_t dev_max_lba;
1393 1.1.2.2 pgoyette
1394 1.1.2.2 pgoyette u_int64_t host_max_lba;
1395 1.1.2.2 pgoyette
1396 1.1.2.2 pgoyette u_int64_t coerced_max_lba;
1397 1.1.2.2 pgoyette
1398 1.1.2.2 pgoyette u_int16_t block_size;
1399 1.1.2.2 pgoyette u_int16_t reserved4;
1400 1.1.2.2 pgoyette
1401 1.1.2.2 pgoyette u_int32_t reserved5;
1402 1.1.2.2 pgoyette } __packed;
1403 1.1.2.2 pgoyette
1404 1.1.2.2 pgoyette struct mpii_cfg_raid_physdisk_pg1 {
1405 1.1.2.2 pgoyette struct mpii_cfg_hdr config_header;
1406 1.1.2.2 pgoyette
1407 1.1.2.2 pgoyette u_int8_t num_phys_disk_paths;
1408 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1409 1.1.2.2 pgoyette u_int16_t reserved1;
1410 1.1.2.2 pgoyette
1411 1.1.2.2 pgoyette u_int32_t reserved2;
1412 1.1.2.2 pgoyette
1413 1.1.2.2 pgoyette /* followed by mpii_cfg_raid_physdisk_path structs */
1414 1.1.2.2 pgoyette } __packed;
1415 1.1.2.2 pgoyette
1416 1.1.2.2 pgoyette struct mpii_cfg_raid_physdisk_path {
1417 1.1.2.2 pgoyette u_int8_t phys_disk_id;
1418 1.1.2.2 pgoyette u_int8_t phys_disk_bus;
1419 1.1.2.2 pgoyette u_int16_t reserved1;
1420 1.1.2.2 pgoyette
1421 1.1.2.2 pgoyette u_int64_t wwwid;
1422 1.1.2.2 pgoyette
1423 1.1.2.2 pgoyette u_int64_t owner_wwid;
1424 1.1.2.2 pgoyette
1425 1.1.2.2 pgoyette u_int8_t ownder_id;
1426 1.1.2.2 pgoyette u_int8_t reserved2;
1427 1.1.2.2 pgoyette u_int16_t flags;
1428 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_PATH_INVALID (1<<0)
1429 1.1.2.2 pgoyette #define MPII_CFG_RAID_PHYDISK_PATH_BROKEN (1<<1)
1430 1.1.2.2 pgoyette } __packed;
1431 1.1.2.2 pgoyette
1432 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_ADDR_NEXT (0<<28)
1433 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_ADDR_BUS (1<<28)
1434 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_ADDR_HANDLE (2<<28)
1435 1.1.2.2 pgoyette
1436 1.1.2.2 pgoyette struct mpii_cfg_sas_dev_pg0 {
1437 1.1.2.2 pgoyette struct mpii_ecfg_hdr config_header;
1438 1.1.2.2 pgoyette
1439 1.1.2.2 pgoyette u_int16_t slot;
1440 1.1.2.2 pgoyette u_int16_t enc_handle;
1441 1.1.2.2 pgoyette
1442 1.1.2.2 pgoyette u_int64_t sas_addr;
1443 1.1.2.2 pgoyette
1444 1.1.2.2 pgoyette u_int16_t parent_dev_handle;
1445 1.1.2.2 pgoyette u_int8_t phy_num;
1446 1.1.2.2 pgoyette u_int8_t access_status;
1447 1.1.2.2 pgoyette
1448 1.1.2.2 pgoyette u_int16_t dev_handle;
1449 1.1.2.2 pgoyette u_int8_t target;
1450 1.1.2.2 pgoyette u_int8_t bus;
1451 1.1.2.2 pgoyette
1452 1.1.2.2 pgoyette u_int32_t device_info;
1453 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_TYPE (0x7)
1454 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_TYPE_NONE (0x0)
1455 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_TYPE_END (0x1)
1456 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_TYPE_EDGE_EXPANDER (0x2)
1457 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_TYPE_FANOUT_EXPANDER (0x3)
1458 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SATA_HOST (1<<3)
1459 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SMP_INITIATOR (1<<4)
1460 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_STP_INITIATOR (1<<5)
1461 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SSP_INITIATOR (1<<6)
1462 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SATA_DEVICE (1<<7)
1463 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SMP_TARGET (1<<8)
1464 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_STP_TARGET (1<<9)
1465 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SSP_TARGET (1<<10)
1466 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_DIRECT_ATTACHED (1<<11)
1467 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_LSI_DEVICE (1<<12)
1468 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_ATAPI_DEVICE (1<<13)
1469 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_DEVINFO_SEP_DEVICE (1<<14)
1470 1.1.2.2 pgoyette
1471 1.1.2.2 pgoyette u_int16_t flags;
1472 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_DEV_PRESENT (1<<0)
1473 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_DEV_MAPPED (1<<1)
1474 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_DEV_MAPPED_PERSISTENT (1<<2)
1475 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_PORT_SELECTOR (1<<3)
1476 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_FUA (1<<4)
1477 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_NCQ (1<<5)
1478 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_SMART (1<<6)
1479 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_LBA48 (1<<7)
1480 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_UNSUPPORTED (1<<8)
1481 1.1.2.2 pgoyette #define MPII_CFG_SAS_DEV_0_FLAGS_SATA_SETTINGS (1<<9)
1482 1.1.2.2 pgoyette u_int8_t physical_port;
1483 1.1.2.2 pgoyette u_int8_t max_port_conn;
1484 1.1.2.2 pgoyette
1485 1.1.2.2 pgoyette u_int64_t device_name;
1486 1.1.2.2 pgoyette
1487 1.1.2.2 pgoyette u_int8_t port_groups;
1488 1.1.2.2 pgoyette u_int8_t dma_group;
1489 1.1.2.2 pgoyette u_int8_t ctrl_group;
1490 1.1.2.2 pgoyette u_int8_t reserved1;
1491 1.1.2.2 pgoyette
1492 1.1.2.2 pgoyette u_int64_t reserved2;
1493 1.1.2.2 pgoyette } __packed;
1494 1.1.2.2 pgoyette
1495 1.1.2.2 pgoyette #define MPII_CFG_RAID_CONFIG_ACTIVE_CONFIG (2<<28)
1496 1.1.2.2 pgoyette
1497 1.1.2.2 pgoyette struct mpii_cfg_raid_config_pg0 {
1498 1.1.2.2 pgoyette struct mpii_ecfg_hdr config_header;
1499 1.1.2.2 pgoyette
1500 1.1.2.2 pgoyette u_int8_t num_hot_spares;
1501 1.1.2.2 pgoyette u_int8_t num_phys_disks;
1502 1.1.2.2 pgoyette u_int8_t num_volumes;
1503 1.1.2.2 pgoyette u_int8_t config_num;
1504 1.1.2.2 pgoyette
1505 1.1.2.2 pgoyette u_int32_t flags;
1506 1.1.2.2 pgoyette #define MPII_CFG_RAID_CONFIG_0_FLAGS_NATIVE (0<<0)
1507 1.1.2.2 pgoyette #define MPII_CFG_RAID_CONFIG_0_FLAGS_FOREIGN (1<<0)
1508 1.1.2.2 pgoyette
1509 1.1.2.2 pgoyette u_int32_t config_guid[6];
1510 1.1.2.2 pgoyette
1511 1.1.2.2 pgoyette u_int32_t reserved1;
1512 1.1.2.2 pgoyette
1513 1.1.2.2 pgoyette u_int8_t num_elements;
1514 1.1.2.2 pgoyette u_int8_t reserved2[3];
1515 1.1.2.2 pgoyette
1516 1.1.2.2 pgoyette /* followed by struct mpii_raid_config_element structs */
1517 1.1.2.2 pgoyette } __packed;
1518 1.1.2.2 pgoyette
1519 1.1.2.2 pgoyette struct mpii_raid_config_element {
1520 1.1.2.2 pgoyette u_int16_t element_flags;
1521 1.1.2.2 pgoyette #define MPII_RAID_CONFIG_ELEMENT_FLAG_VOLUME (0x0)
1522 1.1.2.2 pgoyette #define MPII_RAID_CONFIG_ELEMENT_FLAG_VOLUME_PHYS_DISK (0x1)
1523 1.1.2.2 pgoyette #define MPII_RAID_CONFIG_ELEMENT_FLAG_HSP_PHYS_DISK (0x2)
1524 1.1.2.2 pgoyette #define MPII_RAID_CONFIG_ELEMENT_ONLINE_CE_PHYS_DISK (0x3)
1525 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
1526 1.1.2.2 pgoyette
1527 1.1.2.2 pgoyette u_int8_t hot_spare_pool;
1528 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1529 1.1.2.2 pgoyette u_int16_t phys_disk_dev_handle;
1530 1.1.2.2 pgoyette } __packed;
1531 1.1.2.2 pgoyette
1532 1.1.2.2 pgoyette struct mpii_cfg_dpm_pg0 {
1533 1.1.2.2 pgoyette struct mpii_ecfg_hdr config_header;
1534 1.1.2.2 pgoyette #define MPII_DPM_ADDRESS_FORM_MASK (0xf0000000)
1535 1.1.2.2 pgoyette #define MPII_DPM_ADDRESS_FORM_ENTRY_RANGE (0x00000000)
1536 1.1.2.2 pgoyette #define MPII_DPM_ADDRESS_ENTRY_COUNT_MASK (0x0fff0000)
1537 1.1.2.2 pgoyette #define MPII_DPM_ADDRESS_ENTRY_COUNT_SHIFT (16)
1538 1.1.2.2 pgoyette #define MPII_DPM_ADDRESS_START_ENTRY_MASK (0x0000ffff)
1539 1.1.2.2 pgoyette
1540 1.1.2.2 pgoyette /* followed by struct mpii_dpm_entry structs */
1541 1.1.2.2 pgoyette } __packed;
1542 1.1.2.2 pgoyette
1543 1.1.2.2 pgoyette struct mpii_dpm_entry {
1544 1.1.2.2 pgoyette u_int64_t physical_identifier;
1545 1.1.2.2 pgoyette
1546 1.1.2.2 pgoyette u_int16_t mapping_information;
1547 1.1.2.2 pgoyette u_int16_t device_index;
1548 1.1.2.2 pgoyette
1549 1.1.2.2 pgoyette u_int32_t physical_bits_mapping;
1550 1.1.2.2 pgoyette
1551 1.1.2.2 pgoyette u_int32_t reserved1;
1552 1.1.2.2 pgoyette } __packed;
1553 1.1.2.2 pgoyette
1554 1.1.2.2 pgoyette struct mpii_evt_sas_discovery {
1555 1.1.2.2 pgoyette u_int8_t flags;
1556 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DEV_CHANGE_MASK (1<<1)
1557 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DEV_CHANGE_NO_CHANGE (0<<1)
1558 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DEV_CHANGE_CHANGE (1<<1)
1559 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DISC_IN_PROG_MASK (1<<0)
1560 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DISC_NOT_IN_PROGRESS (1<<0)
1561 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_FLAGS_DISC_IN_PROGRESS (0<<0)
1562 1.1.2.2 pgoyette u_int8_t reason_code;
1563 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_REASON_CODE_STARTED (0x01)
1564 1.1.2.2 pgoyette #define MPII_EVENT_SAS_DISC_REASON_CODE_COMPLETED (0x02)
1565 1.1.2.2 pgoyette u_int8_t physical_port;
1566 1.1.2.2 pgoyette u_int8_t reserved1;
1567 1.1.2.2 pgoyette
1568 1.1.2.2 pgoyette u_int32_t discovery_status;
1569 1.1.2.2 pgoyette } __packed;
1570 1.1.2.2 pgoyette
1571 1.1.2.2 pgoyette struct mpii_evt_ir_status {
1572 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
1573 1.1.2.2 pgoyette u_int16_t reserved1;
1574 1.1.2.2 pgoyette
1575 1.1.2.2 pgoyette u_int8_t operation;
1576 1.1.2.2 pgoyette #define MPII_EVENT_IR_RAIDOP_RESYNC (0x00)
1577 1.1.2.2 pgoyette #define MPII_EVENT_IR_RAIDOP_OCE (0x01)
1578 1.1.2.2 pgoyette #define MPII_EVENT_IR_RAIDOP_CONS_CHECK (0x02)
1579 1.1.2.2 pgoyette #define MPII_EVENT_IR_RAIDOP_BG_INIT (0x03)
1580 1.1.2.2 pgoyette #define MPII_EVENT_IR_RAIDOP_MAKE_CONS (0x04)
1581 1.1.2.2 pgoyette u_int8_t percent;
1582 1.1.2.2 pgoyette u_int16_t reserved2;
1583 1.1.2.2 pgoyette
1584 1.1.2.2 pgoyette u_int32_t reserved3;
1585 1.1.2.2 pgoyette };
1586 1.1.2.2 pgoyette
1587 1.1.2.2 pgoyette struct mpii_evt_ir_volume {
1588 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
1589 1.1.2.2 pgoyette u_int8_t reason_code;
1590 1.1.2.2 pgoyette #define MPII_EVENT_IR_VOL_RC_SETTINGS_CHANGED (0x01)
1591 1.1.2.2 pgoyette #define MPII_EVENT_IR_VOL_RC_STATUS_CHANGED (0x02)
1592 1.1.2.2 pgoyette #define MPII_EVENT_IR_VOL_RC_STATE_CHANGED (0x03)
1593 1.1.2.2 pgoyette u_int8_t reserved1;
1594 1.1.2.2 pgoyette
1595 1.1.2.2 pgoyette u_int32_t new_value;
1596 1.1.2.2 pgoyette u_int32_t prev_value;
1597 1.1.2.2 pgoyette } __packed;
1598 1.1.2.2 pgoyette
1599 1.1.2.2 pgoyette struct mpii_evt_ir_physical_disk {
1600 1.1.2.2 pgoyette u_int16_t reserved1;
1601 1.1.2.2 pgoyette u_int8_t reason_code;
1602 1.1.2.2 pgoyette #define MPII_EVENT_IR_PD_RC_SETTINGS_CHANGED (0x01)
1603 1.1.2.2 pgoyette #define MPII_EVENT_IR_PD_RC_STATUS_FLAGS_CHANGED (0x02)
1604 1.1.2.2 pgoyette #define MPII_EVENT_IR_PD_RC_STATUS_CHANGED (0x03)
1605 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1606 1.1.2.2 pgoyette
1607 1.1.2.2 pgoyette u_int16_t phys_disk_dev_handle;
1608 1.1.2.2 pgoyette u_int16_t reserved2;
1609 1.1.2.2 pgoyette
1610 1.1.2.2 pgoyette u_int16_t slot;
1611 1.1.2.2 pgoyette u_int16_t enclosure_handle;
1612 1.1.2.2 pgoyette
1613 1.1.2.2 pgoyette u_int32_t new_value;
1614 1.1.2.2 pgoyette u_int32_t previous_value;
1615 1.1.2.2 pgoyette } __packed;
1616 1.1.2.2 pgoyette
1617 1.1.2.2 pgoyette struct mpii_evt_sas_tcl {
1618 1.1.2.2 pgoyette u_int16_t enclosure_handle;
1619 1.1.2.2 pgoyette u_int16_t expander_handle;
1620 1.1.2.2 pgoyette
1621 1.1.2.2 pgoyette u_int8_t num_phys;
1622 1.1.2.2 pgoyette u_int8_t reserved1[3];
1623 1.1.2.2 pgoyette
1624 1.1.2.2 pgoyette u_int8_t num_entries;
1625 1.1.2.2 pgoyette u_int8_t start_phy_num;
1626 1.1.2.2 pgoyette u_int8_t expn_status;
1627 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_ES_ADDED (0x01)
1628 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_ES_NOT_RESPONDING (0x02)
1629 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_ES_RESPONDING (0x03)
1630 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_ES_DELAY_NOT_RESPONDING (0x04)
1631 1.1.2.2 pgoyette u_int8_t physical_port;
1632 1.1.2.2 pgoyette
1633 1.1.2.2 pgoyette /* followed by num_entries number of struct mpii_evt_phy_entry */
1634 1.1.2.2 pgoyette } __packed;
1635 1.1.2.2 pgoyette
1636 1.1.2.2 pgoyette struct mpii_evt_phy_entry {
1637 1.1.2.2 pgoyette u_int16_t dev_handle;
1638 1.1.2.2 pgoyette u_int8_t link_rate;
1639 1.1.2.2 pgoyette u_int8_t phy_status;
1640 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_PS_RC_MASK (0x0f)
1641 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_PS_RC_ADDED (0x01)
1642 1.1.2.2 pgoyette #define MPII_EVENT_SAS_TOPO_PS_RC_MISSING (0x02)
1643 1.1.2.2 pgoyette } __packed;
1644 1.1.2.2 pgoyette
1645 1.1.2.2 pgoyette struct mpii_evt_ir_cfg_change_list {
1646 1.1.2.2 pgoyette u_int8_t num_elements;
1647 1.1.2.2 pgoyette u_int16_t reserved;
1648 1.1.2.2 pgoyette u_int8_t config_num;
1649 1.1.2.2 pgoyette
1650 1.1.2.2 pgoyette u_int32_t flags;
1651 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_CHANGE_LIST_FOREIGN (0x1)
1652 1.1.2.2 pgoyette
1653 1.1.2.2 pgoyette /* followed by num_elements struct mpii_evt_ir_cfg_elements */
1654 1.1.2.2 pgoyette } __packed;
1655 1.1.2.2 pgoyette
1656 1.1.2.2 pgoyette struct mpii_evt_ir_cfg_element {
1657 1.1.2.2 pgoyette u_int16_t element_flags;
1658 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_TYPE_MASK (0xf)
1659 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_TYPE_VOLUME (0x0)
1660 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_TYPE_VOLUME_DISK (0x1)
1661 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_TYPE_HOT_SPARE (0x2)
1662 1.1.2.2 pgoyette u_int16_t vol_dev_handle;
1663 1.1.2.2 pgoyette
1664 1.1.2.2 pgoyette u_int8_t reason_code;
1665 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_ADDED (0x01)
1666 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_REMOVED (0x02)
1667 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_NO_CHANGE (0x03)
1668 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_HIDE (0x04)
1669 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_UNHIDE (0x05)
1670 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_VOLUME_CREATED (0x06)
1671 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_VOLUME_DELETED (0x07)
1672 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_PD_CREATED (0x08)
1673 1.1.2.2 pgoyette #define MPII_EVT_IR_CFG_ELEMENT_RC_PD_DELETED (0x09)
1674 1.1.2.2 pgoyette u_int8_t phys_disk_num;
1675 1.1.2.2 pgoyette u_int16_t phys_disk_dev_handle;
1676 1.1.2.2 pgoyette } __packed;
1677