1 /* $FreeBSD$ */ 2 /* 3 * Copyright (c) 2000-2001 LSI Logic Corporation. 4 * 5 * 6 * Name: MPI_FC.H 7 * Title: MPI Fibre Channel messages and structures 8 * Creation Date: June 12, 2000 9 * 10 * MPI Version: 01.02.02 11 * 12 * Version History 13 * --------------- 14 * 15 * Date Version Description 16 * -------- -------- ------------------------------------------------------ 17 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 18 * 06-06-00 01.00.01 Update version number for 1.0 release. 19 * 06-12-00 01.00.02 Added _MSG_FC_ABORT_REPLY structure. 20 * 11-02-00 01.01.01 Original release for post 1.0 work 21 * 12-04-00 01.01.02 Added messages for Common Transport Send and 22 * Primitive Send. 23 * 01-09-01 01.01.03 Modifed some of the new flags to have an MPI prefix 24 * and modified the FcPrimitiveSend flags. 25 * 01-25-01 01.01.04 Move InitiatorIndex in LinkServiceRsp reply to a larger 26 * field. 27 * Added FC_ABORT_TYPE_CT_SEND_REQUEST and 28 * FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request. 29 * Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND. 30 * 02-20-01 01.01.05 Started using MPI_POINTER. 31 * 03-27-01 01.01.06 Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY 32 * and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED. 33 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. 34 * Added structure offset comments. 35 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. 36 * 08-08-01 01.02.01 Original release for v1.2 work. 37 * 09-28-01 01.02.02 Change name of reserved field in 38 * MSG_LINK_SERVICE_RSP_REPLY. 39 * -------------------------------------------------------------------------- 40 */ 41 42 #ifndef MPI_FC_H 43 #define MPI_FC_H 44 45 46 /***************************************************************************** 47 * 48 * F C T a r g e t M o d e M e s s a g e s 49 * 50 *****************************************************************************/ 51 52 /****************************************************************************/ 53 /* Link Service Buffer Post messages */ 54 /****************************************************************************/ 55 56 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REQUEST 57 { 58 U8 BufferPostFlags; /* 00h */ 59 U8 BufferCount; /* 01h */ 60 U8 ChainOffset; /* 02h */ 61 U8 Function; /* 03h */ 62 U16 Reserved; /* 04h */ 63 U8 Reserved1; /* 06h */ 64 U8 MsgFlags; /* 07h */ 65 U32 MsgContext; /* 08h */ 66 SGE_TRANS_SIMPLE_UNION SGL; 67 } MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 68 MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 69 LinkServiceBufferPostRequest_t, MPI_POINTER pLinkServiceBufferPostRequest_t; 70 71 #define LINK_SERVICE_BUFFER_POST_FLAGS_PORT_MASK (0x01) 72 73 typedef struct _WWNFORMAT 74 { 75 U32 PortNameHigh; /* 00h */ 76 U32 PortNameLow; /* 04h */ 77 U32 NodeNameHigh; /* 08h */ 78 U32 NodeNameLow; /* 0Ch */ 79 } WWNFORMAT, 80 WwnFormat_t; 81 82 /* Link Service Buffer Post Reply */ 83 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REPLY 84 { 85 U8 Flags; /* 00h */ 86 U8 Reserved; /* 01h */ 87 U8 MsgLength; /* 02h */ 88 U8 Function; /* 03h */ 89 U16 Reserved1; /* 04h */ 90 U8 PortNumber; /* 06h */ 91 U8 MsgFlags; /* 07h */ 92 U32 MsgContext; /* 08h */ 93 U16 Reserved2; /* 0Ch */ 94 U16 IOCStatus; /* 0Eh */ 95 U32 IOCLogInfo; /* 10h */ 96 U32 TransferLength; /* 14h */ 97 U32 TransactionContext; /* 18h */ 98 U32 Rctl_Did; /* 1Ch */ 99 U32 Csctl_Sid; /* 20h */ 100 U32 Type_Fctl; /* 24h */ 101 U16 SeqCnt; /* 28h */ 102 U8 Dfctl; /* 2Ah */ 103 U8 SeqId; /* 2Bh */ 104 U16 Rxid; /* 2Ch */ 105 U16 Oxid; /* 2Eh */ 106 U32 Parameter; /* 30h */ 107 WWNFORMAT Wwn; /* 34h */ 108 } MSG_LINK_SERVICE_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REPLY, 109 LinkServiceBufferPostReply_t, MPI_POINTER pLinkServiceBufferPostReply_t; 110 111 #define MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED (0x80) 112 113 #define MPI_FC_DID_MASK (0x00FFFFFF) 114 #define MPI_FC_DID_SHIFT (0) 115 #define MPI_FC_RCTL_MASK (0xFF000000) 116 #define MPI_FC_RCTL_SHIFT (24) 117 #define MPI_FC_SID_MASK (0x00FFFFFF) 118 #define MPI_FC_SID_SHIFT (0) 119 #define MPI_FC_CSCTL_MASK (0xFF000000) 120 #define MPI_FC_CSCTL_SHIFT (24) 121 #define MPI_FC_FCTL_MASK (0x00FFFFFF) 122 #define MPI_FC_FCTL_SHIFT (0) 123 #define MPI_FC_TYPE_MASK (0xFF000000) 124 #define MPI_FC_TYPE_SHIFT (24) 125 126 /* obsolete name for the above */ 127 #define FCP_TARGET_DID_MASK (0x00FFFFFF) 128 #define FCP_TARGET_DID_SHIFT (0) 129 #define FCP_TARGET_RCTL_MASK (0xFF000000) 130 #define FCP_TARGET_RCTL_SHIFT (24) 131 #define FCP_TARGET_SID_MASK (0x00FFFFFF) 132 #define FCP_TARGET_SID_SHIFT (0) 133 #define FCP_TARGET_CSCTL_MASK (0xFF000000) 134 #define FCP_TARGET_CSCTL_SHIFT (24) 135 #define FCP_TARGET_FCTL_MASK (0x00FFFFFF) 136 #define FCP_TARGET_FCTL_SHIFT (0) 137 #define FCP_TARGET_TYPE_MASK (0xFF000000) 138 #define FCP_TARGET_TYPE_SHIFT (24) 139 140 141 /****************************************************************************/ 142 /* Link Service Response messages */ 143 /****************************************************************************/ 144 145 typedef struct _MSG_LINK_SERVICE_RSP_REQUEST 146 { 147 U8 RspFlags; /* 00h */ 148 U8 RspLength; /* 01h */ 149 U8 ChainOffset; /* 02h */ 150 U8 Function; /* 03h */ 151 U16 Reserved1; /* 04h */ 152 U8 Reserved2; /* 06h */ 153 U8 MsgFlags; /* 07h */ 154 U32 MsgContext; /* 08h */ 155 U32 Rctl_Did; /* 0Ch */ 156 U32 Csctl_Sid; /* 10h */ 157 U32 Type_Fctl; /* 14h */ 158 U16 SeqCnt; /* 18h */ 159 U8 Dfctl; /* 1Ah */ 160 U8 SeqId; /* 1Bh */ 161 U16 Rxid; /* 1Ch */ 162 U16 Oxid; /* 1Eh */ 163 U32 Parameter; /* 20h */ 164 SGE_SIMPLE_UNION SGL; /* 24h */ 165 } MSG_LINK_SERVICE_RSP_REQUEST, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REQUEST, 166 LinkServiceRspRequest_t, MPI_POINTER pLinkServiceRspRequest_t; 167 168 #define LINK_SERVICE_RSP_FLAGS_IMMEDIATE (0x80) 169 #define LINK_SERVICE_RSP_FLAGS_PORT_MASK (0x01) 170 171 172 /* Link Service Response Reply */ 173 typedef struct _MSG_LINK_SERVICE_RSP_REPLY 174 { 175 U16 Reserved; /* 00h */ 176 U8 MsgLength; /* 02h */ 177 U8 Function; /* 03h */ 178 U16 Reserved1; /* 04h */ 179 U8 Reserved_0100_InitiatorIndex; /* 06h */ /* obsolete InitiatorIndex */ 180 U8 MsgFlags; /* 07h */ 181 U32 MsgContext; /* 08h */ 182 U16 Reserved3; /* 0Ch */ 183 U16 IOCStatus; /* 0Eh */ 184 U32 IOCLogInfo; /* 10h */ 185 U32 InitiatorIndex; /* 14h */ 186 } MSG_LINK_SERVICE_RSP_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REPLY, 187 LinkServiceRspReply_t, MPI_POINTER pLinkServiceRspReply_t; 188 189 190 /****************************************************************************/ 191 /* Extended Link Service Send messages */ 192 /****************************************************************************/ 193 194 typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST 195 { 196 U8 SendFlags; /* 00h */ 197 U8 Reserved; /* 01h */ 198 U8 ChainOffset; /* 02h */ 199 U8 Function; /* 03h */ 200 U32 MsgFlags_Did; /* 04h */ 201 U32 MsgContext; /* 08h */ 202 U32 ElsCommandCode; /* 0Ch */ 203 SGE_SIMPLE_UNION SGL; /* 10h */ 204 } MSG_EXLINK_SERVICE_SEND_REQUEST, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REQUEST, 205 ExLinkServiceSendRequest_t, MPI_POINTER pExLinkServiceSendRequest_t; 206 207 #define EX_LINK_SERVICE_SEND_DID_MASK (0x00FFFFFF) 208 #define EX_LINK_SERVICE_SEND_DID_SHIFT (0) 209 #define EX_LINK_SERVICE_SEND_MSGFLAGS_MASK (0xFF000000) 210 #define EX_LINK_SERVICE_SEND_MSGFLAGS_SHIFT (24) 211 212 213 /* Extended Link Service Send Reply */ 214 typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY 215 { 216 U16 Reserved; /* 00h */ 217 U8 MsgLength; /* 02h */ 218 U8 Function; /* 03h */ 219 U16 Reserved1; /* 04h */ 220 U8 Reserved2; /* 06h */ 221 U8 MsgFlags; /* 07h */ 222 U32 MsgContext; /* 08h */ 223 U16 Reserved3; /* 0Ch */ 224 U16 IOCStatus; /* 0Eh */ 225 U32 IOCLogInfo; /* 10h */ 226 U32 ResponseLength; /* 14h */ 227 } MSG_EXLINK_SERVICE_SEND_REPLY, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REPLY, 228 ExLinkServiceSendReply_t, MPI_POINTER pExLinkServiceSendReply_t; 229 230 /****************************************************************************/ 231 /* FC Abort messages */ 232 /****************************************************************************/ 233 234 typedef struct _MSG_FC_ABORT_REQUEST 235 { 236 U8 AbortFlags; /* 00h */ 237 U8 AbortType; /* 01h */ 238 U8 ChainOffset; /* 02h */ 239 U8 Function; /* 03h */ 240 U16 Reserved1; /* 04h */ 241 U8 Reserved2; /* 06h */ 242 U8 MsgFlags; /* 07h */ 243 U32 MsgContext; /* 08h */ 244 U32 TransactionContextToAbort; /* 0Ch */ 245 } MSG_FC_ABORT_REQUEST, MPI_POINTER PTR_MSG_FC_ABORT_REQUEST, 246 FcAbortRequest_t, MPI_POINTER pFcAbortRequest_t; 247 248 #define FC_ABORT_FLAG_PORT_MASK (0x01) 249 250 #define FC_ABORT_TYPE_ALL_FC_BUFFERS (0x00) 251 #define FC_ABORT_TYPE_EXACT_FC_BUFFER (0x01) 252 #define FC_ABORT_TYPE_CT_SEND_REQUEST (0x02) 253 #define FC_ABORT_TYPE_EXLINKSEND_REQUEST (0x03) 254 255 /* FC Abort Reply */ 256 typedef struct _MSG_FC_ABORT_REPLY 257 { 258 U16 Reserved; /* 00h */ 259 U8 MsgLength; /* 02h */ 260 U8 Function; /* 03h */ 261 U16 Reserved1; /* 04h */ 262 U8 Reserved2; /* 06h */ 263 U8 MsgFlags; /* 07h */ 264 U32 MsgContext; /* 08h */ 265 U16 Reserved3; /* 0Ch */ 266 U16 IOCStatus; /* 0Eh */ 267 U32 IOCLogInfo; /* 10h */ 268 } MSG_FC_ABORT_REPLY, MPI_POINTER PTR_MSG_FC_ABORT_REPLY, 269 FcAbortReply_t, MPI_POINTER pFcAbortReply_t; 270 271 272 /****************************************************************************/ 273 /* FC Common Transport Send messages */ 274 /****************************************************************************/ 275 276 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST 277 { 278 U8 SendFlags; /* 00h */ 279 U8 Reserved; /* 01h */ 280 U8 ChainOffset; /* 02h */ 281 U8 Function; /* 03h */ 282 U32 MsgFlags_Did; /* 04h */ 283 U32 MsgContext; /* 08h */ 284 U16 CTCommandCode; /* 0Ch */ 285 U8 FsType; /* 0Eh */ 286 U8 Reserved1; /* 0Fh */ 287 SGE_SIMPLE_UNION SGL; /* 10h */ 288 } MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 289 MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 290 FcCommonTransportSendRequest_t, MPI_POINTER pFcCommonTransportSendRequest_t; 291 292 #define MPI_FC_CT_SEND_DID_MASK (0x00FFFFFF) 293 #define MPI_FC_CT_SEND_DID_SHIFT (0) 294 #define MPI_FC_CT_SEND_MSGFLAGS_MASK (0xFF000000) 295 #define MPI_FC_CT_SEND_MSGFLAGS_SHIFT (24) 296 297 298 /* FC Common Transport Send Reply */ 299 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REPLY 300 { 301 U16 Reserved; /* 00h */ 302 U8 MsgLength; /* 02h */ 303 U8 Function; /* 03h */ 304 U16 Reserved1; /* 04h */ 305 U8 Reserved2; /* 06h */ 306 U8 MsgFlags; /* 07h */ 307 U32 MsgContext; /* 08h */ 308 U16 Reserved3; /* 0Ch */ 309 U16 IOCStatus; /* 0Eh */ 310 U32 IOCLogInfo; /* 10h */ 311 U32 ResponseLength; /* 14h */ 312 } MSG_FC_COMMON_TRANSPORT_SEND_REPLY, MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REPLY, 313 FcCommonTransportSendReply_t, MPI_POINTER pFcCommonTransportSendReply_t; 314 315 316 /****************************************************************************/ 317 /* FC Primitive Send messages */ 318 /****************************************************************************/ 319 320 typedef struct _MSG_FC_PRIMITIVE_SEND_REQUEST 321 { 322 U8 SendFlags; /* 00h */ 323 U8 Reserved; /* 01h */ 324 U8 ChainOffset; /* 02h */ 325 U8 Function; /* 03h */ 326 U16 Reserved1; /* 04h */ 327 U8 Reserved2; /* 06h */ 328 U8 MsgFlags; /* 07h */ 329 U32 MsgContext; /* 08h */ 330 U8 FcPrimitive[4]; /* 0Ch */ 331 } MSG_FC_PRIMITIVE_SEND_REQUEST, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REQUEST, 332 FcPrimitiveSendRequest_t, MPI_POINTER pFcPrimitiveSendRequest_t; 333 334 #define MPI_FC_PRIM_SEND_FLAGS_PORT_MASK (0x01) 335 #define MPI_FC_PRIM_SEND_FLAGS_RESET_LINK (0x04) 336 #define MPI_FC_PRIM_SEND_FLAGS_STOP_SEND (0x08) 337 #define MPI_FC_PRIM_SEND_FLAGS_SEND_ONCE (0x10) 338 #define MPI_FC_PRIM_SEND_FLAGS_SEND_AROUND (0x20) 339 #define MPI_FC_PRIM_SEND_FLAGS_UNTIL_FULL (0x40) 340 #define MPI_FC_PRIM_SEND_FLAGS_FOREVER (0x80) 341 342 /* FC Primitive Send Reply */ 343 typedef struct _MSG_FC_PRIMITIVE_SEND_REPLY 344 { 345 U8 SendFlags; /* 00h */ 346 U8 Reserved; /* 01h */ 347 U8 MsgLength; /* 02h */ 348 U8 Function; /* 03h */ 349 U16 Reserved1; /* 04h */ 350 U8 Reserved2; /* 06h */ 351 U8 MsgFlags; /* 07h */ 352 U32 MsgContext; /* 08h */ 353 U16 Reserved3; /* 0Ch */ 354 U16 IOCStatus; /* 0Eh */ 355 U32 IOCLogInfo; /* 10h */ 356 } MSG_FC_PRIMITIVE_SEND_REPLY, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REPLY, 357 FcPrimitiveSendReply_t, MPI_POINTER pFcPrimitiveSendReply_t; 358 359 #endif 360 361