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