emlxs_iocb.h revision 825277341c15b6b0d2c4b8b622ae7b1d2bdc0390
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Emulex. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _EMLXS_IOCB_H
#define _EMLXS_IOCB_H
#ifdef __cplusplus
extern "C" {
#endif
/* ==== IOCB Commands ==== */
#define CMD_RCV_SEQUENCE_CX 0x01
#define CMD_XMIT_SEQUENCE_CR 0x02
#define CMD_XMIT_SEQUENCE_CX 0x03
#define CMD_XMIT_BCAST_CN 0x04
#define CMD_XMIT_BCAST_CX 0x05
#define CMD_QUE_RING_BUF_CN 0x06
#define CMD_QUE_XRI_BUF_CX 0x07
#define CMD_IOCB_CONTINUE_CN 0x08
#define CMD_RET_XRI_BUF_CX 0x09
#define CMD_ELS_REQUEST_CR 0x0A
#define CMD_ELS_REQUEST_CX 0x0B
#define CMD_RCV_ELS_REQ_CX 0x0D
#define CMD_ABORT_XRI_CN 0x0E
#define CMD_ABORT_XRI_CX 0x0F
#define CMD_CLOSE_XRI_CN 0x10
#define CMD_CLOSE_XRI_CX 0x11
#define CMD_CREATE_XRI_CR 0x12
#define CMD_CREATE_XRI_CX 0x13
#define CMD_GET_RPI_CN 0x14
#define CMD_XMIT_ELS_RSP_CX 0x15
#define CMD_GET_RPI_CR 0x16
#define CMD_XRI_ABORTED_CX 0x17
#define CMD_FCP_IWRITE_CR 0x18
#define CMD_FCP_IWRITE_CX 0x19
#define CMD_FCP_IREAD_CR 0x1A
#define CMD_FCP_IREAD_CX 0x1B
#define CMD_FCP_ICMND_CR 0x1C
#define CMD_FCP_ICMND_CX 0x1D
#define CMD_ADAPTER_MSG 0x20
#define CMD_ADAPTER_DUMP 0x22
/* LP3000 gasket IOCB Command Set */
#define CMD_BPL_IWRITE_CR 0x48
#define CMD_BPL_IWRITE_CX 0x49
#define CMD_BPL_IREAD_CR 0x4A
#define CMD_BPL_IREAD_CX 0x4B
#define CMD_BPL_ICMND_CR 0x4C
#define CMD_BPL_ICMND_CX 0x4D
#define CMD_ASYNC_STATUS 0x7C
/* SLI_2 IOCB Command Set */
#define CMD_RCV_SEQUENCE64_CX 0x81
#define CMD_XMIT_SEQUENCE64_CR 0x82
#define CMD_XMIT_SEQUENCE64_CX 0x83
#define CMD_XMIT_BCAST64_CN 0x84
#define CMD_XMIT_BCAST64_CX 0x85
#define CMD_QUE_RING_BUF64_CN 0x86
#define CMD_QUE_XRI_BUF64_CX 0x87
#define CMD_IOCB_CONTINUE64_CN 0x88
#define CMD_RET_XRI_BUF64_CX 0x89
#define CMD_ELS_REQUEST64_CR 0x8A
#define CMD_ELS_REQUEST64_CX 0x8B
#define CMD_RCV_ELS_REQ64_CX 0x8D
#define CMD_XMIT_ELS_RSP64_CX 0x95
#define CMD_XMIT_BLS_RSP64_CX 0x97
#define CMD_FCP_IWRITE64_CR 0x98
#define CMD_FCP_IWRITE64_CX 0x99
#define CMD_FCP_IREAD64_CR 0x9A
#define CMD_FCP_IREAD64_CX 0x9B
#define CMD_FCP_ICMND64_CR 0x9C
#define CMD_FCP_ICMND64_CX 0x9D
#define CMD_RCV_SEQ_LIST64_CX 0xC1
#define CMD_GEN_REQUEST64_CR 0xC2
#define CMD_GEN_REQUEST64_CX 0xC3
#define CMD_QUE_RING_LIST64_CN 0xC6
/*
* Begin Structure Definitions for IOCB Commands
*/
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
/* statAction FBSY reason codes */
/* statAction PBSY action codes */
/* statRsn LS_RJT reason codes defined in LS_RJT structure */
/* statRsn P_BSY reason codes */
/* statRsn BA_RJT reason codes */
/* LS_RJT reason explanation defined in LS_RJT structure */
/* BA_RJT reason explanation */
/* Local Reject errors */
#define IOERR_SUCCESS 0x00
#define IOERR_MISSING_CONTINUE 0x01
#define IOERR_SEQUENCE_TIMEOUT 0x02
#define IOERR_INTERNAL_ERROR 0x03
#define IOERR_INVALID_RPI 0x04
#define IOERR_NO_XRI 0x05
#define IOERR_ILLEGAL_COMMAND 0x06
#define IOERR_XCHG_DROPPED 0x07
#define IOERR_ILLEGAL_FIELD 0x08
/* RESERVED 0x09 */
/* RESERVED 0x0A */
#define IOERR_RCV_BUFFER_WAITING 0x0B
/* RESERVED 0x0C */
#define IOERR_TX_DMA_FAILED 0x0D
#define IOERR_RX_DMA_FAILED 0x0E
#define IOERR_ILLEGAL_FRAME 0x0F
/* RESERVED 0x10 */
#define IOERR_NO_RESOURCES 0x11
/* RESERVED 0x12 */
#define IOERR_ILLEGAL_LENGTH 0x13
#define IOERR_UNSUPPORTED_FEATURE 0x14
#define IOERR_ABORT_IN_PROGRESS 0x15
#define IOERR_ABORT_REQUESTED 0x16
#define IOERR_RCV_BUFFER_TIMEOUT 0x17
#define IOERR_LOOP_OPEN_FAILURE 0x18
#define IOERR_RING_RESET 0x19
#define IOERR_LINK_DOWN 0x1A
#define IOERR_CORRUPTED_DATA 0x1B
#define IOERR_CORRUPTED_RPI 0x1C
#define IOERR_OUT_OF_ORDER_DATA 0x1D
#define IOERR_OUT_OF_ORDER_ACK 0x1E
#define IOERR_DUP_FRAME 0x1F
#define IOERR_BAD_HOST_ADDRESS 0x21
#define IOERR_RCV_HDRBUF_WAITING 0x22
#define IOERR_MISSING_HDR_BUFFER 0x23
#define IOERR_MSEQ_CHAIN_CORRUPTED 0x24
#define IOERR_ABORTMULT_REQUESTED 0x25
/* RESERVED 0x26 */
/* RESERVED 0x27 */
#define IOERR_BUFFER_SHORTAGE 0x28
#define IOERR_XRIBUF_WAITING 0x29
/* RESERVED 0x2A */
#define IOERR_MISSING_HBQ_ENTRY 0x2B
#define IOERR_ABORT_EXT_REQ 0x2C
#define IOERR_CLOSE_EXT_REQ 0x2D
/* RESERVED 0x2E */
/* RESERVED 0x2F */
#define IOERR_XRIBUF_MISSING 0x30
#define IOERR_ASSI_RSP_SUPPRESSED 0x31
/* RESERVED 0x32 - 0x3F */
#define IOERR_ROFFSET_INVAL 0x40
#define IOERR_ROFFSET_MISSING 0x41
#define IOERR_INSUF_BUFFER 0x42
#define IOERR_MISSING_SI 0x43
#define IOERR_MISSING_ES 0x44
#define IOERR_INCOMP_XFER 0x45
/* RESERVED 0x46 - 0xFF */
/* Driver defined */
#define IOERR_ABORT_TIMEOUT 0xF0
} PARM_ERR;
typedef union
{
struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} hcsw;
} WORD5;
/* IOCB Command template for a generic response */
typedef struct
{
} GENERIC_RSP;
/* IOCB Command template for XMIT / XMIT_BCAST / RCV_SEQUENCE / XMIT_ELS */
typedef struct
{
/* IOCB Command template for ELS_REQUEST */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} ELS_REQUEST;
/* IOCB Command template for RCV_ELS_REQ */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} RCV_ELS_REQ;
/* IOCB Command template for ABORT / CLOSE_XRI */
typedef struct
{
#define ABORT_TYPE_ABTX 0x00000000
#define ABORT_TYPE_ABTS 0x00000001
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} AC_XRI;
/* IOCB Command template for GET_RPI */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} GET_RPI;
/* IOCB Command template for all FCP Initiator commands */
typedef struct
{
} FCPI_FIELDS;
/* IOCB Command template for all FCP Target commands */
typedef struct
{
} FCPT_FIELDS;
/* SLI-2 IOCB structure definitions */
/* IOCB Command template for 64 bit XMIT / XMIT_BCAST / XMIT_ELS */
typedef struct
{
/* IOCB Command template for 64 bit RCV_SEQUENCE64 */
typedef struct
{
/* IOCB Command template for ELS_REQUEST64 */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
/* IOCB Command template for ASYNC_STATUS */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
} ASYNC_STATUS;
/* IOCB Command template for QUE_RING_LIST64 */
typedef struct
{
/* IOCB Command template for GEN_REQUEST64 */
typedef struct
{
/* IOCB Command template for RCV_ELS_REQ64 */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
/* IOCB Command template for all 64 bit FCP Initiator commands */
typedef struct
{
/* IOCB Command template for all 64 bit FCP Target commands */
typedef struct
{
/* IOCB Command template for all 64 bit FCP Target commands */
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
} AUTO_TRSP;
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
/*
* IOCB Command Extension template for
* CMD_RCV_ELS64_CX (0xB7) or CMD_RCV_SEQ64_CX (0xB5)
*/
typedef struct
{
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
typedef volatile struct emlxs_iocb
{ /* IOCB structure */
union
{
/* template */
/* template */
/* template */
/* template */
/* SLI-2 structures */
/* cont BDE_64s */
/* template */
/* template */
/* template */
/* Initiator template */
/* template */
/* template */
} un;
union
{
struct
{
#ifdef EMLXS_BIG_ENDIAN
/* word6 */
/* word6 */
#endif
#ifdef EMLXS_LITTLE_ENDIAN
/* word6 */
/* word6 */
#endif
} t1;
struct
{
#ifdef EMLXS_BIG_ENDIAN
/* word6 */
/* word6 */
/* word6 */
#endif
#ifdef EMLXS_LITTLE_ENDIAN
/* word6 */
/* word6 */
/* word6 */
#endif
} t2;
} un1;
#define IOCB_DELAYXMIT_MSK 0x3000
union
{
struct
{
#ifdef EMLXS_BIG_ENDIAN
/* word 7 */
#endif
#ifdef EMLXS_LITTLE_ENDIAN
/* word 7 */
#endif
} t1;
struct
{
#ifdef EMLXS_BIG_ENDIAN
/* word 7 */
#endif
#ifdef EMLXS_LITTLE_ENDIAN
/* word 7 */
#endif
} t2;
} un2;
/* 32 bytes at this point */
/* SLI4 */
union
{
/* for SLI-3 */
} unsli3;
/* 128 bytes at this point */
/* FCP ELS cmds - ulpRsvByte */
#define PARM_UNUSED 0 /* PU field (Word 4) not used */
#define CLASS1 0 /* Class 1 */
#define IOSTAT_FCP_RSP_ERROR 0x1
#define IOSTAT_REMOTE_STOP 0x2
#define IOSTAT_LOCAL_REJECT 0x3
#define IOSTAT_NPORT_RJT 0x4
#define IOSTAT_FABRIC_RJT 0x5
#define IOSTAT_NPORT_BSY 0x6
#define IOSTAT_FABRIC_BSY 0x7
#define IOSTAT_INTERMED_RSP 0x8
#define IOSTAT_LS_RJT 0x9
#define IOSTAT_RESERVED_A 0xA
#define IOSTAT_CMD_REJECT 0xB
#define IOSTAT_FCP_TGT_LENCHK 0xC
#define IOSTAT_RESERVED_D 0xD
#define IOSTAT_RESERVED_E 0xE
#define IOSTAT_NEED_BUFF_ENTRY 0xF
/* Special error codes */
} emlxs_iocb_t;
typedef emlxs_iocb_t IOCB;
typedef struct emlxs_iocbq
{
struct emlxs_iocbq *next;
void *port; /* Board info pointer */
void *channel; /* IO Channel pointer */
void *node; /* Node pointer */
void *sbp; /* Pkt pointer */
#define IOCB_POOL_ALLOCATED 0x00000001
#define IOCB_PRIORITY 0x00000002
#define IOCB_SPECIAL 0x00000004
#define IOCB_FCP_CMD 0x00000008
typedef emlxs_iocbq_t IOCBQ;
#ifdef __cplusplus
}
#endif
#endif /* _EMLXS_IOCB_H */