2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #ifndef _SYS_MPI_INIT_H
7 #define _SYS_MPI_INIT_H
9 #pragma ident "%Z%%M% %I% %E% SMI"
16 * SCSI Initiator Messages
20 * SCSI IO messages and assocaited structures
22 typedef struct msg_scsi_io_request
{
28 uint8_t SenseBufferLength
;
36 uint32_t SenseBufferLowAddr
;
38 } msg_scsi_io_request_t
;
40 /* SCSIO MsgFlags bits */
42 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH 0x01
43 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 0x00
44 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 0x01
45 #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION 0x02
46 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST 0x00
47 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC 0x02
52 #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING 0x0000FFFF
53 #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING 0xFFFF0000
54 #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING 0x0000FFFF
55 #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING 0xFFFF0000
56 #define MPI_SCSIIO_LUN_LEVEL_1_WORD 0xFF00
57 #define MPI_SCSIIO_LUN_LEVEL_1_DWORD 0x0000FF00
62 #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK 0x03000000
63 #define MPI_SCSIIO_CONTROL_NODATATRANSFER 0x00000000
64 #define MPI_SCSIIO_CONTROL_WRITE 0x01000000
65 #define MPI_SCSIIO_CONTROL_READ 0x02000000
67 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK 0x3C000000
68 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT 26
70 #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK 0x00000700
71 #define MPI_SCSIIO_CONTROL_SIMPLEQ 0x00000000
72 #define MPI_SCSIIO_CONTROL_HEADOFQ 0x00000100
73 #define MPI_SCSIIO_CONTROL_ORDEREDQ 0x00000200
74 #define MPI_SCSIIO_CONTROL_ACAQ 0x00000400
75 #define MPI_SCSIIO_CONTROL_UNTAGGED 0x00000500
76 #define MPI_SCSIIO_CONTROL_NO_DISCONNECT 0x00000700
78 #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK 0x00FF0000
79 #define MPI_SCSIIO_CONTROL_OBSOLETE 0x00800000
80 #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV 0x00400000
81 #define MPI_SCSIIO_CONTROL_TARGET_RESET 0x00200000
82 #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV 0x00100000
83 #define MPI_SCSIIO_CONTROL_RESERVED 0x00080000
84 #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV 0x00040000
85 #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET 0x00020000
86 #define MPI_SCSIIO_CONTROL_RESERVED2 0x00010000
90 * SCSIIO reply structure
92 typedef struct msg_scsi_io_reply
{
98 uint8_t SenseBufferLength
;
106 uint32_t TransferCount
;
108 uint32_t ResponseInfo
;
111 } msg_scsi_io_reply_t
;
114 * SCSIIO Reply SCSIStatus values (SAM-2 status codes)
116 #define MPI_SCSI_STATUS_SUCCESS 0x00
117 #define MPI_SCSI_STATUS_CHECK_CONDITION 0x02
118 #define MPI_SCSI_STATUS_CONDITION_MET 0x04
119 #define MPI_SCSI_STATUS_BUSY 0x08
120 #define MPI_SCSI_STATUS_INTERMEDIATE 0x10
121 #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET 0x14
122 #define MPI_SCSI_STATUS_RESERVATION_CONFLICT 0x18
123 #define MPI_SCSI_STATUS_COMMAND_TERMINATED 0x22
124 #define MPI_SCSI_STATUS_TASK_SET_FULL 0x28
125 #define MPI_SCSI_STATUS_ACA_ACTIVE 0x30
128 * SCSIIO Reply SCSIState values
130 #define MPI_SCSI_STATE_AUTOSENSE_VALID 0x01
131 #define MPI_SCSI_STATE_AUTOSENSE_FAILED 0x02
132 #define MPI_SCSI_STATE_NO_SCSI_STATUS 0x04
133 #define MPI_SCSI_STATE_TERMINATED 0x08
134 #define MPI_SCSI_STATE_RESPONSE_INFO_VALID 0x10
135 #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED 0x20
138 * SCSIIO Reply ResponseInfo values
139 * (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes)
141 #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE 0x00000000
142 #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR 0x01000000
143 #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID 0x02000000
144 #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR 0x03000000
145 #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED 0x04000000
146 #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED 0x05000000
147 #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE 0x06000000
150 * SCSI Task Management messages
152 typedef struct msg_scsi_task_mgmt
{
163 uint32_t Reserved2
[7];
164 uint32_t TaskMsgContext
;
165 } msg_scsi_task_mgmt_t
;
170 #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK 0x00000001
171 #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET 0x00000002
172 #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET 0x00000003
173 #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS 0x00000004
174 #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET 0x00000005
179 #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION 0x00000000
180 #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION 0x00000002
181 #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION 0x00000004
183 /* SCSI Task Management Reply */
185 typedef struct msg_scsi_task_mgmt_reply
{
195 uint8_t Reserved2
[2];
198 uint32_t TerminationCount
;
199 } msg_scsi_task_mgmt_reply_t
;
202 * SCSI enclosure processor messages
204 typedef struct msg_sep_request
{
217 #define MPI_SEP_REQ_ACTION_WRITE_STATUS 0x00
218 #define MPI_SEP_REQ_ACTION_READ_STATUS 0x01
220 #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR 0x00000001
221 #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY 0x00000002
222 #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING 0x00000004
228 #endif /* _SYS_MPI_INIT_H */