1 /* $FreeBSD$ */ 2 /*- 3 * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 12 * substantially similar to the "NO WARRANTY" disclaimer below 13 * ("Disclaimer") and any redistribution must be conditioned upon including 14 * a substantially similar Disclaimer requirement for further binary 15 * redistribution. 16 * 3. Neither the name of the LSI Logic Corporation nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT 30 * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * 32 * 33 * Name: MPI_FC.H 34 * Title: MPI Fibre Channel messages and structures 35 * Creation Date: June 12, 2000 36 * 37 * MPI_FC.H Version: 01.02.04 38 * 39 * Version History 40 * --------------- 41 * 42 * Date Version Description 43 * -------- -------- ------------------------------------------------------ 44 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 45 * 06-06-00 01.00.01 Update version number for 1.0 release. 46 * 06-12-00 01.00.02 Added _MSG_FC_ABORT_REPLY structure. 47 * 11-02-00 01.01.01 Original release for post 1.0 work 48 * 12-04-00 01.01.02 Added messages for Common Transport Send and 49 * Primitive Send. 50 * 01-09-01 01.01.03 Modifed some of the new flags to have an MPI prefix 51 * and modified the FcPrimitiveSend flags. 52 * 01-25-01 01.01.04 Move InitiatorIndex in LinkServiceRsp reply to a larger 53 * field. 54 * Added FC_ABORT_TYPE_CT_SEND_REQUEST and 55 * FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request. 56 * Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND. 57 * 02-20-01 01.01.05 Started using MPI_POINTER. 58 * 03-27-01 01.01.06 Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY 59 * and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED. 60 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. 61 * Added structure offset comments. 62 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. 63 * 08-08-01 01.02.01 Original release for v1.2 work. 64 * 09-28-01 01.02.02 Change name of reserved field in 65 * MSG_LINK_SERVICE_RSP_REPLY. 66 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests. 67 * 01-16-04 01.02.04 Added define for MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK. 68 * -------------------------------------------------------------------------- 69 */ 70 71 #ifndef MPI_FC_H 72 #define MPI_FC_H 73 74 75 /***************************************************************************** 76 * 77 * F C T a r g e t M o d e M e s s a g e s 78 * 79 *****************************************************************************/ 80 81 /****************************************************************************/ 82 /* Link Service Buffer Post messages */ 83 /****************************************************************************/ 84 85 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REQUEST 86 { 87 U8 BufferPostFlags; /* 00h */ 88 U8 BufferCount; /* 01h */ 89 U8 ChainOffset; /* 02h */ 90 U8 Function; /* 03h */ 91 U16 Reserved; /* 04h */ 92 U8 Reserved1; /* 06h */ 93 U8 MsgFlags; /* 07h */ 94 U32 MsgContext; /* 08h */ 95 SGE_TRANS_SIMPLE_UNION SGL; 96 } MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 97 MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 98 LinkServiceBufferPostRequest_t, MPI_POINTER pLinkServiceBufferPostRequest_t; 99 100 #define LINK_SERVICE_BUFFER_POST_FLAGS_PORT_MASK (0x01) 101 102 typedef struct _WWNFORMAT 103 { 104 U32 PortNameHigh; /* 00h */ 105 U32 PortNameLow; /* 04h */ 106 U32 NodeNameHigh; /* 08h */ 107 U32 NodeNameLow; /* 0Ch */ 108 } WWNFORMAT, 109 WwnFormat_t; 110 111 /* Link Service Buffer Post Reply */ 112 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REPLY 113 { 114 U8 Flags; /* 00h */ 115 U8 Reserved; /* 01h */ 116 U8 MsgLength; /* 02h */ 117 U8 Function; /* 03h */ 118 U16 Reserved1; /* 04h */ 119 U8 PortNumber; /* 06h */ 120 U8 MsgFlags; /* 07h */ 121 U32 MsgContext; /* 08h */ 122 U16 Reserved2; /* 0Ch */ 123 U16 IOCStatus; /* 0Eh */ 124 U32 IOCLogInfo; /* 10h */ 125 U32 TransferLength; /* 14h */ 126 U32 TransactionContext; /* 18h */ 127 U32 Rctl_Did; /* 1Ch */ 128 U32 Csctl_Sid; /* 20h */ 129 U32 Type_Fctl; /* 24h */ 130 U16 SeqCnt; /* 28h */ 131 U8 Dfctl; /* 2Ah */ 132 U8 SeqId; /* 2Bh */ 133 U16 Rxid; /* 2Ch */ 134 U16 Oxid; /* 2Eh */ 135 U32 Parameter; /* 30h */ 136 WWNFORMAT Wwn; /* 34h */ 137 } MSG_LINK_SERVICE_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REPLY, 138 LinkServiceBufferPostReply_t, MPI_POINTER pLinkServiceBufferPostReply_t; 139 140 #define MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED (0x80) 141 142 #define MPI_FC_DID_MASK (0x00FFFFFF) 143 #define MPI_FC_DID_SHIFT (0) 144 #define MPI_FC_RCTL_MASK (0xFF000000) 145 #define MPI_FC_RCTL_SHIFT (24) 146 #define MPI_FC_SID_MASK (0x00FFFFFF) 147 #define MPI_FC_SID_SHIFT (0) 148 #define MPI_FC_CSCTL_MASK (0xFF000000) 149 #define MPI_FC_CSCTL_SHIFT (24) 150 #define MPI_FC_FCTL_MASK (0x00FFFFFF) 151 #define MPI_FC_FCTL_SHIFT (0) 152 #define MPI_FC_TYPE_MASK (0xFF000000) 153 #define MPI_FC_TYPE_SHIFT (24) 154 155 /* obsolete name for the above */ 156 #define FCP_TARGET_DID_MASK (0x00FFFFFF) 157 #define FCP_TARGET_DID_SHIFT (0) 158 #define FCP_TARGET_RCTL_MASK (0xFF000000) 159 #define FCP_TARGET_RCTL_SHIFT (24) 160 #define FCP_TARGET_SID_MASK (0x00FFFFFF) 161 #define FCP_TARGET_SID_SHIFT (0) 162 #define FCP_TARGET_CSCTL_MASK (0xFF000000) 163 #define FCP_TARGET_CSCTL_SHIFT (24) 164 #define FCP_TARGET_FCTL_MASK (0x00FFFFFF) 165 #define FCP_TARGET_FCTL_SHIFT (0) 166 #define FCP_TARGET_TYPE_MASK (0xFF000000) 167 #define FCP_TARGET_TYPE_SHIFT (24) 168 169 170 /****************************************************************************/ 171 /* Link Service Response messages */ 172 /****************************************************************************/ 173 174 typedef struct _MSG_LINK_SERVICE_RSP_REQUEST 175 { 176 U8 RspFlags; /* 00h */ 177 U8 RspLength; /* 01h */ 178 U8 ChainOffset; /* 02h */ 179 U8 Function; /* 03h */ 180 U16 Reserved1; /* 04h */ 181 U8 Reserved2; /* 06h */ 182 U8 MsgFlags; /* 07h */ 183 U32 MsgContext; /* 08h */ 184 U32 Rctl_Did; /* 0Ch */ 185 U32 Csctl_Sid; /* 10h */ 186 U32 Type_Fctl; /* 14h */ 187 U16 SeqCnt; /* 18h */ 188 U8 Dfctl; /* 1Ah */ 189 U8 SeqId; /* 1Bh */ 190 U16 Rxid; /* 1Ch */ 191 U16 Oxid; /* 1Eh */ 192 U32 Parameter; /* 20h */ 193 SGE_SIMPLE_UNION SGL; /* 24h */ 194 } MSG_LINK_SERVICE_RSP_REQUEST, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REQUEST, 195 LinkServiceRspRequest_t, MPI_POINTER pLinkServiceRspRequest_t; 196 197 #define LINK_SERVICE_RSP_FLAGS_IMMEDIATE (0x80) 198 #define LINK_SERVICE_RSP_FLAGS_PORT_MASK (0x01) 199 200 201 /* Link Service Response Reply */ 202 typedef struct _MSG_LINK_SERVICE_RSP_REPLY 203 { 204 U16 Reserved; /* 00h */ 205 U8 MsgLength; /* 02h */ 206 U8 Function; /* 03h */ 207 U16 Reserved1; /* 04h */ 208 U8 Reserved_0100_InitiatorIndex; /* 06h */ /* obsolete InitiatorIndex */ 209 U8 MsgFlags; /* 07h */ 210 U32 MsgContext; /* 08h */ 211 U16 Reserved3; /* 0Ch */ 212 U16 IOCStatus; /* 0Eh */ 213 U32 IOCLogInfo; /* 10h */ 214 U32 InitiatorIndex; /* 14h */ 215 } MSG_LINK_SERVICE_RSP_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REPLY, 216 LinkServiceRspReply_t, MPI_POINTER pLinkServiceRspReply_t; 217 218 219 /****************************************************************************/ 220 /* Extended Link Service Send messages */ 221 /****************************************************************************/ 222 223 typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST 224 { 225 U8 SendFlags; /* 00h */ 226 U8 AliasIndex; /* 01h */ 227 U8 ChainOffset; /* 02h */ 228 U8 Function; /* 03h */ 229 U32 MsgFlags_Did; /* 04h */ 230 U32 MsgContext; /* 08h */ 231 U32 ElsCommandCode; /* 0Ch */ 232 SGE_SIMPLE_UNION SGL; /* 10h */ 233 } MSG_EXLINK_SERVICE_SEND_REQUEST, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REQUEST, 234 ExLinkServiceSendRequest_t, MPI_POINTER pExLinkServiceSendRequest_t; 235 236 #define EX_LINK_SERVICE_SEND_DID_MASK (0x00FFFFFF) 237 #define EX_LINK_SERVICE_SEND_DID_SHIFT (0) 238 #define EX_LINK_SERVICE_SEND_MSGFLAGS_MASK (0xFF000000) 239 #define EX_LINK_SERVICE_SEND_MSGFLAGS_SHIFT (24) 240 241 242 /* Extended Link Service Send Reply */ 243 typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY 244 { 245 U8 Reserved; /* 00h */ 246 U8 AliasIndex; /* 01h */ 247 U8 MsgLength; /* 02h */ 248 U8 Function; /* 03h */ 249 U16 Reserved1; /* 04h */ 250 U8 Reserved2; /* 06h */ 251 U8 MsgFlags; /* 07h */ 252 U32 MsgContext; /* 08h */ 253 U16 Reserved3; /* 0Ch */ 254 U16 IOCStatus; /* 0Eh */ 255 U32 IOCLogInfo; /* 10h */ 256 U32 ResponseLength; /* 14h */ 257 } MSG_EXLINK_SERVICE_SEND_REPLY, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REPLY, 258 ExLinkServiceSendReply_t, MPI_POINTER pExLinkServiceSendReply_t; 259 260 /****************************************************************************/ 261 /* FC Abort messages */ 262 /****************************************************************************/ 263 264 typedef struct _MSG_FC_ABORT_REQUEST 265 { 266 U8 AbortFlags; /* 00h */ 267 U8 AbortType; /* 01h */ 268 U8 ChainOffset; /* 02h */ 269 U8 Function; /* 03h */ 270 U16 Reserved1; /* 04h */ 271 U8 Reserved2; /* 06h */ 272 U8 MsgFlags; /* 07h */ 273 U32 MsgContext; /* 08h */ 274 U32 TransactionContextToAbort; /* 0Ch */ 275 } MSG_FC_ABORT_REQUEST, MPI_POINTER PTR_MSG_FC_ABORT_REQUEST, 276 FcAbortRequest_t, MPI_POINTER pFcAbortRequest_t; 277 278 #define FC_ABORT_FLAG_PORT_MASK (0x01) 279 280 #define FC_ABORT_TYPE_ALL_FC_BUFFERS (0x00) 281 #define FC_ABORT_TYPE_EXACT_FC_BUFFER (0x01) 282 #define FC_ABORT_TYPE_CT_SEND_REQUEST (0x02) 283 #define FC_ABORT_TYPE_EXLINKSEND_REQUEST (0x03) 284 285 /* FC Abort Reply */ 286 typedef struct _MSG_FC_ABORT_REPLY 287 { 288 U16 Reserved; /* 00h */ 289 U8 MsgLength; /* 02h */ 290 U8 Function; /* 03h */ 291 U16 Reserved1; /* 04h */ 292 U8 Reserved2; /* 06h */ 293 U8 MsgFlags; /* 07h */ 294 U32 MsgContext; /* 08h */ 295 U16 Reserved3; /* 0Ch */ 296 U16 IOCStatus; /* 0Eh */ 297 U32 IOCLogInfo; /* 10h */ 298 } MSG_FC_ABORT_REPLY, MPI_POINTER PTR_MSG_FC_ABORT_REPLY, 299 FcAbortReply_t, MPI_POINTER pFcAbortReply_t; 300 301 302 /****************************************************************************/ 303 /* FC Common Transport Send messages */ 304 /****************************************************************************/ 305 306 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST 307 { 308 U8 SendFlags; /* 00h */ 309 U8 AliasIndex; /* 01h */ 310 U8 ChainOffset; /* 02h */ 311 U8 Function; /* 03h */ 312 U32 MsgFlags_Did; /* 04h */ 313 U32 MsgContext; /* 08h */ 314 U16 CTCommandCode; /* 0Ch */ 315 U8 FsType; /* 0Eh */ 316 U8 Reserved1; /* 0Fh */ 317 SGE_SIMPLE_UNION SGL; /* 10h */ 318 } MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 319 MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 320 FcCommonTransportSendRequest_t, MPI_POINTER pFcCommonTransportSendRequest_t; 321 322 #define MPI_FC_CT_SEND_DID_MASK (0x00FFFFFF) 323 #define MPI_FC_CT_SEND_DID_SHIFT (0) 324 #define MPI_FC_CT_SEND_MSGFLAGS_MASK (0xFF000000) 325 #define MPI_FC_CT_SEND_MSGFLAGS_SHIFT (24) 326 327 328 /* FC Common Transport Send Reply */ 329 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REPLY 330 { 331 U8 Reserved; /* 00h */ 332 U8 AliasIndex; /* 01h */ 333 U8 MsgLength; /* 02h */ 334 U8 Function; /* 03h */ 335 U16 Reserved1; /* 04h */ 336 U8 Reserved2; /* 06h */ 337 U8 MsgFlags; /* 07h */ 338 U32 MsgContext; /* 08h */ 339 U16 Reserved3; /* 0Ch */ 340 U16 IOCStatus; /* 0Eh */ 341 U32 IOCLogInfo; /* 10h */ 342 U32 ResponseLength; /* 14h */ 343 } MSG_FC_COMMON_TRANSPORT_SEND_REPLY, MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REPLY, 344 FcCommonTransportSendReply_t, MPI_POINTER pFcCommonTransportSendReply_t; 345 346 347 /****************************************************************************/ 348 /* FC Primitive Send messages */ 349 /****************************************************************************/ 350 351 typedef struct _MSG_FC_PRIMITIVE_SEND_REQUEST 352 { 353 U8 SendFlags; /* 00h */ 354 U8 Reserved; /* 01h */ 355 U8 ChainOffset; /* 02h */ 356 U8 Function; /* 03h */ 357 U16 Reserved1; /* 04h */ 358 U8 Reserved2; /* 06h */ 359 U8 MsgFlags; /* 07h */ 360 U32 MsgContext; /* 08h */ 361 U8 FcPrimitive[4]; /* 0Ch */ 362 } MSG_FC_PRIMITIVE_SEND_REQUEST, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REQUEST, 363 FcPrimitiveSendRequest_t, MPI_POINTER pFcPrimitiveSendRequest_t; 364 365 #define MPI_FC_PRIM_SEND_FLAGS_PORT_MASK (0x01) 366 #define MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK (0x02) 367 #define MPI_FC_PRIM_SEND_FLAGS_RESET_LINK (0x04) 368 #define MPI_FC_PRIM_SEND_FLAGS_STOP_SEND (0x08) 369 #define MPI_FC_PRIM_SEND_FLAGS_SEND_ONCE (0x10) 370 #define MPI_FC_PRIM_SEND_FLAGS_SEND_AROUND (0x20) 371 #define MPI_FC_PRIM_SEND_FLAGS_UNTIL_FULL (0x40) 372 #define MPI_FC_PRIM_SEND_FLAGS_FOREVER (0x80) 373 374 /* FC Primitive Send Reply */ 375 typedef struct _MSG_FC_PRIMITIVE_SEND_REPLY 376 { 377 U8 SendFlags; /* 00h */ 378 U8 Reserved; /* 01h */ 379 U8 MsgLength; /* 02h */ 380 U8 Function; /* 03h */ 381 U16 Reserved1; /* 04h */ 382 U8 Reserved2; /* 06h */ 383 U8 MsgFlags; /* 07h */ 384 U32 MsgContext; /* 08h */ 385 U16 Reserved3; /* 0Ch */ 386 U16 IOCStatus; /* 0Eh */ 387 U32 IOCLogInfo; /* 10h */ 388 } MSG_FC_PRIMITIVE_SEND_REPLY, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REPLY, 389 FcPrimitiveSendReply_t, MPI_POINTER pFcPrimitiveSendReply_t; 390 391 #endif 392 393