⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isp_target.h

📁 这个linux源代码是很全面的~基本完整了~使用c编译的~由于时间问题我没有亲自测试~但就算用来做参考资料也是非常好的
💻 H
📖 第 1 页 / 共 2 页
字号:
/* @(#)isp_target.h 1.14 *//* * Qlogic Target Mode Structure and Flag Definitions * * Copyright (c) 1997, 1998 * Patrick Stirling * pms@psconsult.com * All rights reserved. * * Additional Copyright (c) 1999, 2000, 2001 * Matthew Jacob * mjacob@feral.com * All rights reserved. * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice immediately at the beginning of the file, without modification, *    this list of conditions, and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */#ifndef	_ISP_TARGET_H#define	_ISP_TARGET_H/* * Defines for all entry types */#define QLTM_SVALID	0x80#define	QLTM_SENSELEN	18/* * Structure for Enable Lun and Modify Lun queue entries */typedef struct {	isphdr_t	le_header;	u_int32_t	le_reserved;	u_int8_t	le_lun;	u_int8_t	le_rsvd;	u_int8_t	le_ops;		/* Modify LUN only */	u_int8_t	le_tgt;		/* Not for FC */	u_int32_t	le_flags;	/* Not for FC */	u_int8_t	le_status;	u_int8_t	le_reserved2;	u_int8_t	le_cmd_count;	u_int8_t	le_in_count;	u_int8_t	le_cdb6len;	/* Not for FC */	u_int8_t	le_cdb7len;	/* Not for FC */	u_int16_t	le_timeout;	u_int16_t	le_reserved3[20];} lun_entry_t;/* * le_flags values */#define LUN_TQAE	0x00000002	/* bit1  Tagged Queue Action Enable */#define LUN_DSSM	0x01000000	/* bit24 Disable Sending SDP Message */#define	LUN_DISAD	0x02000000	/* bit25 Disable autodisconnect */#define LUN_DM		0x40000000	/* bit30 Disconnects Mandatory *//* * le_ops values */#define LUN_CCINCR	0x01	/* increment command count */#define LUN_CCDECR	0x02	/* decrement command count */#define LUN_ININCR	0x40	/* increment immed. notify count */#define LUN_INDECR	0x80	/* decrement immed. notify count *//* * le_status values */#define	LUN_OK		0x01	/* we be rockin' */#define LUN_ERR		0x04	/* request completed with error */#define LUN_INVAL	0x06	/* invalid request */#define LUN_NOCAP	0x16	/* can't provide requested capability */#define LUN_ENABLED	0x3E	/* LUN already enabled *//* * Immediate Notify Entry structure */#define IN_MSGLEN	8	/* 8 bytes */#define IN_RSVDLEN	8	/* 8 words */typedef struct {	isphdr_t	in_header;	u_int32_t	in_reserved;	u_int8_t	in_lun;		/* lun */	u_int8_t	in_iid;		/* initiator */	u_int8_t	in_reserved2;	u_int8_t	in_tgt;		/* target */	u_int32_t	in_flags;	u_int8_t	in_status;	u_int8_t	in_rsvd2;	u_int8_t	in_tag_val;	/* tag value */	u_int8_t	in_tag_type;	/* tag type */	u_int16_t	in_seqid;	/* sequence id */	u_int8_t	in_msg[IN_MSGLEN];	/* SCSI message bytes */	u_int16_t	in_reserved3[IN_RSVDLEN];	u_int8_t	in_sense[QLTM_SENSELEN];/* suggested sense data */} in_entry_t;typedef struct {	isphdr_t	in_header;	u_int32_t	in_reserved;	u_int8_t	in_lun;		/* lun */	u_int8_t	in_iid;		/* initiator */	u_int16_t	in_scclun;	u_int32_t	in_reserved2;	u_int16_t	in_status;	u_int16_t	in_task_flags;	u_int16_t	in_seqid;	/* sequence id */} in_fcentry_t;/* * Values for the in_status field */#define	IN_REJECT	0x0D	/* Message Reject message received */#define IN_RESET	0x0E	/* Bus Reset occurred */#define IN_NO_RCAP	0x16	/* requested capability not available */#define IN_IDE_RECEIVED	0x33	/* Initiator Detected Error msg received */#define IN_RSRC_UNAVAIL	0x34	/* resource unavailable */#define IN_MSG_RECEIVED	0x36	/* SCSI message received */#define	IN_ABORT_TASK	0x20	/* task named in RX_ID is being aborted (FC) */#define	IN_PORT_LOGOUT	0x29	/* port has logged out (FC) */#define	IN_PORT_CHANGED	0x2A	/* port changed */#define	IN_GLOBAL_LOGO	0x2E	/* all ports logged out */#define	IN_NO_NEXUS	0x3B	/* Nexus not established *//* * Values for the in_task_flags field- should only get one at a time! */#define	TASK_FLAGS_ABORT_TASK		(1<<9)#define	TASK_FLAGS_CLEAR_TASK_SET	(1<<10)#define	TASK_FLAGS_TARGET_RESET		(1<<13)#define	TASK_FLAGS_CLEAR_ACA		(1<<14)#define	TASK_FLAGS_TERMINATE_TASK	(1<<15)#ifndef	MSG_ABORT_TAG#define	MSG_ABORT_TAG		0x06#endif#ifndef	MSG_CLEAR_QUEUE#define	MSG_CLEAR_QUEUE		0x0e#endif#ifndef	MSG_BUS_DEV_RESET#define	MSG_BUS_DEV_RESET	0x0b#endif#ifndef	MSG_REL_RECOVERY#define	MSG_REL_RECOVERY	0x10#endif#ifndef	MSG_TERM_IO_PROC#define	MSG_TERM_IO_PROC	0x11#endif/* * Notify Acknowledge Entry structure */#define NA_RSVDLEN	22typedef struct {	isphdr_t	na_header;	u_int32_t	na_reserved;	u_int8_t	na_lun;		/* lun */	u_int8_t	na_iid;		/* initiator */	u_int8_t	na_reserved2;	u_int8_t	na_tgt;		/* target */	u_int32_t	na_flags;	u_int8_t	na_status;	u_int8_t	na_event;	u_int16_t	na_seqid;	/* sequence id */	u_int16_t	na_reserved3[NA_RSVDLEN];} na_entry_t;/* * Value for the na_event field */#define NA_RST_CLRD	0x80	/* Clear an async event notification */#define	NA_OK		0x01	/* Notify Acknowledge Succeeded */#define	NA_INVALID	0x06	/* Invalid Notify Acknowledge */#define	NA2_RSVDLEN	21typedef struct {	isphdr_t	na_header;	u_int32_t	na_reserved;	u_int8_t	na_lun;		/* lun */	u_int8_t	na_iid;		/* initiator */	u_int16_t	na_scclun;	u_int16_t	na_flags;	u_int16_t	na_reserved2;	u_int16_t	na_status;	u_int16_t	na_task_flags;	u_int16_t	na_seqid;	/* sequence id */	u_int16_t	na_reserved3[NA2_RSVDLEN];} na_fcentry_t;#define	NAFC_RCOUNT	0x80	/* increment resource count */#define NAFC_RST_CLRD	0x20	/* Clear LIP Reset *//* * Accept Target I/O Entry structure */#define ATIO_CDBLEN	26typedef struct {	isphdr_t	at_header;	u_int16_t	at_reserved;	u_int16_t	at_handle;	u_int8_t	at_lun;		/* lun */	u_int8_t	at_iid;		/* initiator */	u_int8_t	at_cdblen; 	/* cdb length */	u_int8_t	at_tgt;		/* target */	u_int32_t	at_flags;	u_int8_t	at_status;	/* firmware status */	u_int8_t	at_scsi_status;	/* scsi status */	u_int8_t	at_tag_val;	/* tag value */	u_int8_t	at_tag_type;	/* tag type */	u_int8_t	at_cdb[ATIO_CDBLEN];	/* received CDB */	u_int8_t	at_sense[QLTM_SENSELEN];/* suggested sense data */} at_entry_t;/* * at_flags values */#define AT_NODISC	0x00008000	/* disconnect disabled */#define AT_TQAE		0x00000002	/* Tagged Queue Action enabled *//* * at_status values */#define AT_PATH_INVALID	0x07	/* ATIO sent to firmware for disabled lun */#define	AT_RESET	0x0E	/* SCSI Bus Reset Occurred */#define AT_PHASE_ERROR	0x14	/* Bus phase sequence error */#define AT_NOCAP	0x16	/* Requested capability not available */#define AT_BDR_MSG	0x17	/* Bus Device Reset msg received */#define AT_CDB		0x3D	/* CDB received *//* * Macros to create and fetch and test concatenated handle and tag value macros */#define	AT_MAKE_TAGID(tid, aep)						\	tid = ((aep)->at_handle << 16);					\	if ((aep)->at_flags & AT_TQAE)					\		(tid) |= ((aep)->at_tag_val + 1)#define	CT_MAKE_TAGID(tid, ct)						\	tid = ((ct)->ct_fwhandle << 16);				\	if ((ct)->ct_flags & CT_TQAE)					\		(tid) |= ((ct)->ct_tag_val + 1)#define	AT_HAS_TAG(val)		((val) & 0xffff)#define	AT_GET_TAG(val)		AT_HAS_TAG(val) - 1#define	AT_GET_HANDLE(val)	((val) >> 16)/* * Accept Target I/O Entry structure, Type 2 */#define ATIO2_CDBLEN	16typedef struct {	isphdr_t	at_header;	u_int32_t	at_reserved;	u_int8_t	at_lun;		/* lun or reserved */	u_int8_t	at_iid;		/* initiator */	u_int16_t	at_rxid; 	/* response ID */	u_int16_t	at_flags;	u_int16_t	at_status;	/* firmware status */	u_int8_t	at_reserved1;	u_int8_t	at_taskcodes;	u_int8_t	at_taskflags;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -