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

📄 mptbase.h

📁 上传linux-jx2410的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* *  linux/drivers/message/fusion/mptbase.h *      High performance SCSI + LAN / Fibre Channel device drivers. *      For use with PCI chip/adapter(s): *          LSIFC9xx/LSI409xx Fibre Channel *      running LSI Logic Fusion MPT (Message Passing Technology) firmware. * *  Credits: *     (see mptbase.c) * *  Copyright (c) 1999-2001 LSI Logic Corporation *  Originally By: Steven J. Ralston *  (mailto:Steve.Ralston@lsil.com) * *  $Id: mptbase.h,v 1.1.1.1 2004/02/04 12:56:22 laputa Exp $ *//*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*//*    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; version 2 of the License.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    NO WARRANTY    THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR    CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT    LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is    solely responsible for determining the appropriateness of using and    distributing the Program and assumes all risks associated with its    exercise of rights under this Agreement, including but not limited to    the risks and costs of program errors, damage to or loss of data,    programs or equipment, and unavailability or interruption of operations.    DISCLAIMER OF LIABILITY    NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL    DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE    USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#ifndef MPTBASE_H_INCLUDED#define MPTBASE_H_INCLUDED/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/#include "linux_compat.h"	/* linux-2.2.x (vs. -2.4.x) tweaks */#include "lsi/mpi_type.h"#include "lsi/mpi.h"		/* Fusion MPI(nterface) basic defs */#include "lsi/mpi_ioc.h"	/* Fusion MPT IOC(ontroller) defs */#include "lsi/mpi_cnfg.h"	/* IOC configuration support */#include "lsi/mpi_init.h"	/* SCSI Host (initiator) protocol support */#include "lsi/mpi_lan.h"	/* LAN over FC protocol support */#include "lsi/mpi_fc.h"		/* Fibre Channel (lowlevel) support */#include "lsi/mpi_targ.h"	/* SCSI/FCP Target protcol support */#include "lsi/fc_log.h"/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/#ifndef MODULEAUTHOR#define MODULEAUTHOR	"LSI Logic Corporation"#endif#ifndef COPYRIGHT#define COPYRIGHT	"Copyright (c) 1999-2001 " MODULEAUTHOR#endif#define MPT_LINUX_VERSION_COMMON	"1.02.02"#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-1.02.02"#define WHAT_MAGIC_STRING		"@" "(" "#" ")"#define show_mptmod_ver(s,ver)  \	printk(KERN_INFO "%s %s\n", s, ver);/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*//* *  Fusion MPT(linux) driver configurable stuff... */#define MPT_MAX_ADAPTERS		16#define MPT_MAX_PROTOCOL_DRIVERS	8#define MPT_MAX_FC_DEVICES		255#define MPT_MISCDEV_BASENAME		"mptctl"#define MPT_MISCDEV_PATHNAME		"/dev/" MPT_MISCDEV_BASENAME#define MPT_PROCFS_MPTBASEDIR		"mpt"						/* chg it to "driver/fusion" ? */#define MPT_PROCFS_SUMMARY_NODE		MPT_PROCFS_MPTBASEDIR "/summary"#define MPT_PROCFS_SUMMARY_PATHNAME	"/proc/" MPT_PROCFS_SUMMARY_NODE#define MPT_FW_REV_MAGIC_ID_STRING	"FwRev="#ifdef __KERNEL__	/* { */#define  MPT_MAX_REQ_DEPTH		1023#define  MPT_REQ_DEPTH			256#define  MPT_MIN_REQ_DEPTH		128#define  MPT_MAX_REPLY_DEPTH		MPT_MAX_REQ_DEPTH#define  MPT_REPLY_DEPTH		128#define  MPT_MIN_REPLY_DEPTH		8#define  MPT_MAX_REPLIES_PER_ISR	32#define  MPT_MAX_FRAME_SIZE		128#define  MPT_REQ_SIZE			128#define  MPT_REPLY_SIZE			128#define  MPT_SG_BUCKETS_PER_HUNK	1#ifdef MODULE#define  MPT_REQ_DEPTH_RANGE_STR	__MODULE_STRING(MPT_MIN_REQ_DEPTH) "-" __MODULE_STRING(MPT_MAX_REQ_DEPTH)#define  MPT_REPLY_DEPTH_RANGE_STR	__MODULE_STRING(MPT_MIN_REPLY_DEPTH) "-" __MODULE_STRING(MPT_MAX_REPLY_DEPTH)#define  MPT_REPLY_SIZE_RANGE_STR	__MODULE_STRING(MPT_MIN_REPLY_SIZE) "-" __MODULE_STRING(MPT_MAX_FRAME_SIZE)#endif/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*//* *  MPT protocol driver defs... */typedef enum {	MPTBASE_DRIVER,		/* MPT base class */	MPTCTL_DRIVER,		/* MPT ioctl class */	MPTSCSIH_DRIVER,	/* MPT SCSI host (initiator) class */	MPTLAN_DRIVER,		/* MPT LAN class */	MPTSTM_DRIVER,		/* MPT SCSI target mode class */	MPTUNKNOWN_DRIVER} MPT_DRIVER_CLASS;/* *  MPT adapter / port / bus / device info structures... */typedef union _MPT_FRAME_TRACKER {	struct {		struct _MPT_FRAME_HDR	*forw;		struct _MPT_FRAME_HDR	*back;		u32			 arg1;		void			*argp1;	} linkage;	/*	 * NOTE: On non-32-bit systems, where pointers are LARGE,	 * using the linkage pointers destroys our sacred MsgContext	 * field contents.  But we don't care anymore because these	 * are now reset in mpt_put_msg_frame() just prior to sending	 * a request off to the IOC.	 */	struct {		u32 __hdr[2];		/*		 * The following _MUST_ match the location of the		 * MsgContext field in the MPT message headers.		 */		union {			u32		 MsgContext;			struct {				u16	 req_idx;	/* Request index */				u8	 cb_idx;	/* callback function index */				u8	 rsvd;			} fld;		} msgctxu;	} hwhdr;} MPT_FRAME_TRACKER;/* *  We might want to view/access a frame as: *    1) generic request header *    2) SCSIIORequest *    3) SCSIIOReply *    4) MPIDefaultReply *    5) frame tracker */typedef struct _MPT_FRAME_HDR {	union {		MPIHeader_t		hdr;		SCSIIORequest_t		scsireq;		SCSIIOReply_t		sreply;		MPIDefaultReply_t	reply;		MPT_FRAME_TRACKER	frame;	} u;} MPT_FRAME_HDR;typedef struct _MPT_Q_TRACKER {	MPT_FRAME_HDR	*head;	MPT_FRAME_HDR	*tail;} MPT_Q_TRACKER;typedef struct _MPT_SGL_HDR {	SGESimple32_t	 sge[1];} MPT_SGL_HDR;typedef struct _MPT_SGL64_HDR {	SGESimple64_t	 sge[1];} MPT_SGL64_HDR;typedef struct _Q_ITEM {	struct _Q_ITEM	*forw;	struct _Q_ITEM	*back;} Q_ITEM;typedef struct _Q_TRACKER {	struct _Q_ITEM	*head;	struct _Q_ITEM	*tail;} Q_TRACKER;/* *  Chip-specific stuff... */typedef enum {	FC909 = 0x0909,	FC919 = 0x0919,	FC929 = 0x0929,	C1030 = 0x1030,	FCUNK = 0xFBAD} CHIP_TYPE;/* *  System interface register set */typedef struct _SYSIF_REGS{	u32	Doorbell;	/* 00     System<->IOC Doorbell reg  */	u32	WriteSequence;	/* 04     Write Sequence register    */	u32	Diagnostic;	/* 08     Diagnostic register        */	u32	TestBase;	/* 0C     Test Base Address          */	u32	Reserved1[8];	/* 10-2F  reserved for future use    */	u32	IntStatus;	/* 30     Interrupt Status           */	u32	IntMask;	/* 34     Interrupt Mask             */	u32	Reserved2[2];	/* 38-3F  reserved for future use    */	u32	RequestFifo;	/* 40     Request Post/Free FIFO     */	u32	ReplyFifo;	/* 44     Reply   Post/Free FIFO     */	u32	Reserved3[2];	/* 48-4F  reserved for future use    */	u32	HostIndex;	/* 50     Host Index register        */	u32	Reserved4[15];	/* 54-8F                             */	u32	Fubar;		/* 90     For Fubar usage            */	u32	Reserved5[27];	/* 94-FF                             */} SYSIF_REGS;/* * NOTE: Use MPI_{DOORBELL,WRITESEQ,DIAG}_xxx defs in lsi/mpi.h * in conjunction with SYSIF_REGS accesses! */typedef struct _MPT_ADAPTER{	struct _MPT_ADAPTER	*forw;	struct _MPT_ADAPTER	*back;	int			 id;		/* Unique adapter id {0,1,2,...} */	int			 pci_irq;	char			 name[32];	/* "iocN"             */	char			*prod_name;	/* "LSIFC9x9"         */	u32			 mem_phys;	/* == f4020000 (mmap) */	volatile SYSIF_REGS	*chip;		/* == c8817000 (mmap) */	CHIP_TYPE		 chip_type;	int			 mem_size;	int			 alloc_total;	u32			 last_state;	int			 active;	int			 sod_reset;	unsigned long		 last_kickstart;	u8			*reply_alloc;		/* Reply frames alloc ptr */	dma_addr_t		 reply_alloc_dma;	MPT_FRAME_HDR		*reply_frames;		/* Reply frames - rounded up! */	dma_addr_t		 reply_frames_dma;	int			 reply_depth;	int			 reply_sz;		/* We (host driver) get to manage our own RequestQueue! */	u8			*req_alloc;		/* Request frames alloc ptr */	dma_addr_t		 req_alloc_dma;	MPT_FRAME_HDR		*req_frames;		/* Request msg frames for PULL mode! */	dma_addr_t		 req_frames_dma;	int			 req_depth;	int			 req_sz;	MPT_Q_TRACKER		 FreeQ;	spinlock_t		 FreeQlock;		/* Pool of SCSI sense buffers for commands coming from		 * the SCSI mid-layer.  We have one 256 byte sense buffer

⌨️ 快捷键说明

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