ispvar.h revision 52347
150477Speter/* $FreeBSD: head/sys/dev/isp/ispvar.h 52347 1999-10-17 18:45:31Z mjacob $ */
235388Smjacob/*
335388Smjacob * Soft Definitions for for Qlogic ISP SCSI adapters.
435388Smjacob *
548484Smjacob * Copyright (c) 1997, 1998, 1999 by Matthew Jacob
635388Smjacob * NASA/Ames Research Center
735388Smjacob * All rights reserved.
852347Smjacob *
935388Smjacob * Redistribution and use in source and binary forms, with or without
1035388Smjacob * modification, are permitted provided that the following conditions
1135388Smjacob * are met:
1235388Smjacob * 1. Redistributions of source code must retain the above copyright
1335388Smjacob *    notice immediately at the beginning of the file, without modification,
1435388Smjacob *    this list of conditions, and the following disclaimer.
1535388Smjacob * 2. Redistributions in binary form must reproduce the above copyright
1635388Smjacob *    notice, this list of conditions and the following disclaimer in the
1735388Smjacob *    documentation and/or other materials provided with the distribution.
1835388Smjacob * 3. The name of the author may not be used to endorse or promote products
1935388Smjacob *    derived from this software without specific prior written permission.
2035388Smjacob *
2135388Smjacob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2235388Smjacob * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2335388Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2435388Smjacob * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
2535388Smjacob * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2635388Smjacob * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2735388Smjacob * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2835388Smjacob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2935388Smjacob * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3035388Smjacob * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3135388Smjacob * SUCH DAMAGE.
3235388Smjacob *
3335388Smjacob */
3435388Smjacob
3535388Smjacob#ifndef	_ISPVAR_H
3635388Smjacob#define	_ISPVAR_H
3735388Smjacob
3844819Smjacob#if defined(__NetBSD__) || defined(__OpenBSD__)
3935388Smjacob#include <dev/ic/ispmbox.h>
4035388Smjacob#endif
4135388Smjacob#ifdef	__FreeBSD__
4235388Smjacob#include <dev/isp/ispmbox.h>
4335388Smjacob#endif
4435388Smjacob#ifdef	__linux__
4542131Smjacob#include "ispmbox.h"
4635388Smjacob#endif
4735388Smjacob
4839235Sgibbs#define	ISP_CORE_VERSION_MAJOR	1
4952347Smjacob#define	ISP_CORE_VERSION_MINOR	10
5039235Sgibbs
5135388Smjacob/*
5243420Smjacob * Vector for bus specific code to provide specific services.
5335388Smjacob */
5435388Smjacobstruct ispsoftc;
5535388Smjacobstruct ispmdvec {
5635388Smjacob	u_int16_t	(*dv_rd_reg) __P((struct ispsoftc *, int));
5735388Smjacob	void		(*dv_wr_reg) __P((struct ispsoftc *, int, u_int16_t));
5835388Smjacob	int		(*dv_mbxdma) __P((struct ispsoftc *));
5935388Smjacob	int		(*dv_dmaset) __P((struct ispsoftc *,
6035388Smjacob		ISP_SCSI_XFER_T *, ispreq_t *, u_int8_t *, u_int8_t));
6135388Smjacob	void		(*dv_dmaclr)
6235388Smjacob		__P((struct ispsoftc *, ISP_SCSI_XFER_T *, u_int32_t));
6335388Smjacob	void		(*dv_reset0) __P((struct ispsoftc *));
6435388Smjacob	void		(*dv_reset1) __P((struct ispsoftc *));
6535388Smjacob	void		(*dv_dregs) __P((struct ispsoftc *));
6635388Smjacob	const u_int16_t *dv_ispfw;	/* ptr to f/w */
6735388Smjacob	u_int16_t 	dv_fwlen;	/* length of f/w */
6835388Smjacob	u_int16_t	dv_codeorg;	/* code ORG for f/w */
6949909Smjacob	u_int32_t	dv_fwrev;	/* f/w revision */
7035388Smjacob	/*
7135388Smjacob	 * Initial values for conf1 register
7235388Smjacob	 */
7335388Smjacob	u_int16_t	dv_conf1;
7435388Smjacob	u_int16_t	dv_clock;	/* clock frequency */
7535388Smjacob};
7635388Smjacob
7735388Smjacob#define	MAX_TARGETS	16
7844819Smjacob#ifdef	ISP2100_FABRIC
7944819Smjacob#define	MAX_FC_TARG	256
8044819Smjacob#else
8135388Smjacob#define	MAX_FC_TARG	126
8244819Smjacob#endif
8335388Smjacob
8449909Smjacob#define	ISP_MAX_TARGETS(isp)	(IS_FC(isp)? MAX_FC_TARG : MAX_TARGETS)
8549909Smjacob#ifdef	ISP2100_SCCLUN
8649909Smjacob#define	_ISP_FC_LUN(isp)	65536
8749909Smjacob#else
8849909Smjacob#define	_ISP_FC_LUN(isp)	16
8949909Smjacob#endif
9049909Smjacob#define	_ISP_SCSI_LUN(isp)	\
9152347Smjacob	((ISP_FW_REVX(isp->isp_fwrev) >= ISP_FW_REV(7, 55, 0))? 32 : 8)
9249909Smjacob#define	ISP_MAX_LUNS(isp)	\
9349909Smjacob	(IS_FC(isp)? _ISP_FC_LUN(isp) : _ISP_SCSI_LUN(isp))
9449909Smjacob
9552347Smjacob/* this is the size of a queue entry (request and response) */
9639235Sgibbs#define	QENTRY_LEN			64
9752347Smjacob/* both request and result queue length must be a power of two */
9839235Sgibbs#define	RQUEST_QUEUE_LEN		MAXISPREQUEST
9952347Smjacob/* I've seen wierdnesses with the result queue < 64 */
10052347Smjacob#if	MAXISPREQUEST > 64
10144819Smjacob#define	RESULT_QUEUE_LEN		(MAXISPREQUEST/2)
10252347Smjacob#else
10352347Smjacob#define	RESULT_QUEUE_LEN		MAXISPREQUEST
10452347Smjacob#endif
10539235Sgibbs#define	ISP_QUEUE_ENTRY(q, idx)		((q) + ((idx) * QENTRY_LEN))
10639235Sgibbs#define	ISP_QUEUE_SIZE(n)		((n) * QENTRY_LEN)
10739235Sgibbs#define	ISP_NXT_QENTRY(idx, qlen)	(((idx) + 1) & ((qlen)-1))
10852347Smjacob#define	ISP_QAVAIL(in, out, qlen)	\
10939235Sgibbs	((in == out)? (qlen - 1) : ((in > out)? \
11052347Smjacob	((qlen - 1) - (in - out)) : (out - in - 1)))
11135388Smjacob/*
11246968Smjacob * SCSI Specific Host Adapter Parameters- per bus, per target
11335388Smjacob */
11435388Smjacob
11535388Smjacobtypedef struct {
11646968Smjacob	u_int		isp_gotdparms		: 1,
11752347Smjacob			isp_req_ack_active_neg	: 1,
11852347Smjacob			isp_data_line_active_neg: 1,
11935388Smjacob			isp_cmd_dma_burst_enable: 1,
12035388Smjacob			isp_data_dma_burst_enabl: 1,
12142461Smjacob			isp_fifo_threshold	: 3,
12243420Smjacob			isp_ultramode		: 1,
12335388Smjacob			isp_diffmode		: 1,
12445040Smjacob			isp_lvdmode		: 1,
12546968Smjacob						: 1,
12635388Smjacob			isp_initiator_id	: 4,
12752347Smjacob			isp_async_data_setup	: 4;
12852347Smjacob	u_int16_t	isp_selection_timeout;
12952347Smjacob	u_int16_t	isp_max_queue_depth;
13035388Smjacob	u_int8_t	isp_tag_aging;
13152347Smjacob	u_int8_t	isp_bus_reset_delay;
13252347Smjacob	u_int8_t	isp_retry_count;
13352347Smjacob	u_int8_t	isp_retry_delay;
13435388Smjacob	struct {
13546968Smjacob		u_int	dev_enable	:	1,	/* ignored */
13646968Smjacob					:	1,
13743420Smjacob			dev_update	:	1,
13843420Smjacob			dev_refresh	:	1,
13945040Smjacob			exc_throttle	:	8,
14045040Smjacob			cur_offset	:	4,
14145040Smjacob			sync_offset	:	4;
14245040Smjacob		u_int8_t	cur_period;	/* current sync period */
14345040Smjacob		u_int8_t	sync_period;	/* goal sync period */
14445040Smjacob		u_int16_t	dev_flags;	/* goal device flags */
14545040Smjacob		u_int16_t	cur_dflags;	/* current device flags */
14635388Smjacob	} isp_devparam[MAX_TARGETS];
14746968Smjacob} sdparam;
14835388Smjacob
14935388Smjacob/*
15035388Smjacob * Device Flags
15135388Smjacob */
15239235Sgibbs#define	DPARM_DISC	0x8000
15339235Sgibbs#define	DPARM_PARITY	0x4000
15439235Sgibbs#define	DPARM_WIDE	0x2000
15539235Sgibbs#define	DPARM_SYNC	0x1000
15639235Sgibbs#define	DPARM_TQING	0x0800
15739235Sgibbs#define	DPARM_ARQ	0x0400
15839235Sgibbs#define	DPARM_QFRZ	0x0200
15939235Sgibbs#define	DPARM_RENEG	0x0100
16039235Sgibbs#define	DPARM_NARROW	0x0080	/* Possibly only available with >= 7.55 fw */
16139235Sgibbs#define	DPARM_ASYNC	0x0040	/* Possibly only available with >= 7.55 fw */
16243793Smjacob#define	DPARM_DEFAULT	(0xFF00 & ~DPARM_QFRZ)
16339235Sgibbs#define	DPARM_SAFE_DFLT	(DPARM_DEFAULT & ~(DPARM_WIDE|DPARM_SYNC|DPARM_TQING))
16435388Smjacob
16539235Sgibbs
16645040Smjacob/* technically, not really correct, as they need to be rated based upon clock */
16745040Smjacob#define	ISP_40M_SYNCPARMS	0x080a
16852347Smjacob#define	ISP_20M_SYNCPARMS	0x080c
16952347Smjacob#define	ISP_10M_SYNCPARMS	0x0c19
17052347Smjacob#define	ISP_08M_SYNCPARMS	0x0c25
17152347Smjacob#define	ISP_05M_SYNCPARMS	0x0c32
17252347Smjacob#define	ISP_04M_SYNCPARMS	0x0c41
17335388Smjacob
17435388Smjacob/*
17535388Smjacob * Fibre Channel Specifics
17635388Smjacob */
17752347Smjacob#define	FL_PORT_ID		0x7e	/* FL_Port Special ID */
17852347Smjacob#define	FC_PORT_ID		0x7f	/* Fabric Controller Special ID */
17952347Smjacob#define	FC_SNS_ID		0x80	/* SNS Server Special ID */
18052347Smjacob
18135388Smjacobtypedef struct {
18252347Smjacob	u_int32_t		isp_fwoptions	: 16,
18348484Smjacob						: 7,
18448484Smjacob				loop_seen_once	: 1,
18548484Smjacob				isp_loopstate	: 3,	/* Current Loop State */
18648484Smjacob				isp_fwstate	: 3,	/* ISP F/W state */
18748484Smjacob				isp_gotdparms	: 1,
18848484Smjacob				isp_onfabric	: 1;
18939235Sgibbs	u_int8_t		isp_loopid;	/* hard loop id */
19039235Sgibbs	u_int8_t		isp_alpa;	/* ALPA */
19152347Smjacob	volatile u_int16_t	isp_lipseq;	/* LIP sequence # */
19248484Smjacob	u_int32_t		isp_portid;
19339235Sgibbs	u_int8_t		isp_execthrottle;
19452347Smjacob	u_int8_t		isp_retry_delay;
19552347Smjacob	u_int8_t		isp_retry_count;
19652347Smjacob	u_int8_t		isp_reserved;
19739235Sgibbs	u_int16_t		isp_maxalloc;
19839235Sgibbs	u_int16_t		isp_maxfrmlen;
19948484Smjacob	u_int64_t		isp_nodewwn;
20048484Smjacob	u_int64_t		isp_portwwn;
20135388Smjacob	/*
20248484Smjacob	 * Port Data Base. This is indexed by 'target', which is invariate.
20348484Smjacob	 * However, elements within can move around due to loop changes,
20448484Smjacob	 * so the actual loop ID passed to the F/W is in this structure.
20548484Smjacob	 * The first time the loop is seen up, loopid will match the index
20648484Smjacob	 * (except for fabric nodes which are above mapped above FC_SNS_ID
20748484Smjacob	 * and are completely virtual), but subsequent LIPs can cause things
20848484Smjacob	 * to move around.
20944819Smjacob	 */
21048484Smjacob	struct lportdb {
21152347Smjacob		u_int
21248484Smjacob					loopid	: 8,
21348484Smjacob						: 4,
21448484Smjacob					fabdev	: 1,
21548484Smjacob					roles	: 2,
21648484Smjacob					valid	: 1;
21752347Smjacob		u_int32_t		portid;
21848484Smjacob		u_int64_t		node_wwn;
21948484Smjacob		u_int64_t		port_wwn;
22052347Smjacob	} portdb[MAX_FC_TARG], tport[FL_PORT_ID];
22144819Smjacob
22244819Smjacob	/*
22335388Smjacob	 * Scratch DMA mapped in area to fetch Port Database stuff, etc.
22435388Smjacob	 */
22548195Smjacob	caddr_t			isp_scratch;
22635388Smjacob	u_int32_t		isp_scdma;
22735388Smjacob} fcparam;
22835388Smjacob
22948484Smjacob#define	FW_CONFIG_WAIT		0
23048484Smjacob#define	FW_WAIT_AL_PA		1
23148484Smjacob#define	FW_WAIT_LOGIN		2
23248484Smjacob#define	FW_READY		3
23348484Smjacob#define	FW_LOSS_OF_SYNC		4
23448484Smjacob#define	FW_ERROR		5
23548484Smjacob#define	FW_REINIT		6
23648484Smjacob#define	FW_NON_PART		7
23735388Smjacob
23848484Smjacob#define	LOOP_NIL		0
23948484Smjacob#define	LOOP_LIP_RCVD		1
24048484Smjacob#define	LOOP_PDB_RCVD		2
24148484Smjacob#define	LOOP_READY		7
24235388Smjacob
24342131Smjacob/*
24435388Smjacob * Soft Structure per host adapter
24535388Smjacob */
24635388Smjacobstruct ispsoftc {
24735388Smjacob	/*
24835388Smjacob	 * Platform (OS) specific data
24935388Smjacob	 */
25035388Smjacob	struct isposinfo	isp_osinfo;
25135388Smjacob
25235388Smjacob	/*
25335388Smjacob	 * Pointer to bus specific data
25435388Smjacob	 */
25535388Smjacob	struct ispmdvec *	isp_mdvec;
25635388Smjacob
25735388Smjacob	/*
25846968Smjacob	 * Mostly nonvolatile state.
25935388Smjacob	 */
26035388Smjacob
26146968Smjacob	u_int		isp_clock	: 8,
26239235Sgibbs			isp_confopts	: 8,
26346968Smjacob			isp_fast_mttr	: 1,
26446968Smjacob					: 1,
26544819Smjacob			isp_used	: 1,
26639235Sgibbs			isp_dblev	: 3,
26735388Smjacob			isp_dogactive	: 1,
26839235Sgibbs			isp_bustype	: 1,	/* BUS Implementation */
26939235Sgibbs			isp_type	: 8;	/* HBA Type and Revision */
27035388Smjacob
27145282Smjacob	u_int16_t		isp_fwrev[3];	/* Running F/W revision */
27245282Smjacob	u_int16_t		isp_romfw_rev[3]; /* 'ROM' F/W revision */
27352347Smjacob	u_int16_t		isp_maxcmds;	/* max active I/O cmds */
27439235Sgibbs	void * 			isp_param;
27539235Sgibbs
27635388Smjacob	/*
27739235Sgibbs	 * Volatile state
27835388Smjacob	 */
27935388Smjacob
28052347Smjacob	volatile u_int		:	9,
28139235Sgibbs		isp_state	:	3,
28246968Smjacob		isp_sendmarker	:	2,	/* send a marker entry */
28346968Smjacob		isp_update	:	2,	/* update parameters */
28452347Smjacob		isp_nactive	:	16;	/* how many commands active */
28539235Sgibbs
28652347Smjacob	volatile u_int16_t	isp_reqodx;	/* index of last ISP pickup */
28752347Smjacob	volatile u_int16_t	isp_reqidx;	/* index of next request */
28852347Smjacob	volatile u_int16_t	isp_residx;	/* index of next result */
28952347Smjacob	volatile u_int16_t	isp_lasthdls;	/* last handle seed */
29035388Smjacob
29135388Smjacob	/*
29252347Smjacob	 * Active commands are stored here, found by handle functions.
29335388Smjacob	 */
29452347Smjacob	ISP_SCSI_XFER_T **isp_xflist;
29535388Smjacob
29635388Smjacob	/*
29752347Smjacob	 * request/result queue pointers and dma handles for them.
29835388Smjacob	 */
29948195Smjacob	caddr_t			isp_rquest;
30048195Smjacob	caddr_t			isp_result;
30135388Smjacob	u_int32_t		isp_rquest_dma;
30235388Smjacob	u_int32_t		isp_result_dma;
30335388Smjacob};
30435388Smjacob
30549909Smjacob#define	SDPARAM(isp)	((sdparam *) (isp)->isp_param)
30649909Smjacob#define	FCPARAM(isp)	((fcparam *) (isp)->isp_param)
30749909Smjacob
30835388Smjacob/*
30935388Smjacob * ISP States
31035388Smjacob */
31135388Smjacob#define	ISP_NILSTATE	0
31235388Smjacob#define	ISP_RESETSTATE	1
31335388Smjacob#define	ISP_INITSTATE	2
31435388Smjacob#define	ISP_RUNSTATE	3
31535388Smjacob
31635388Smjacob/*
31735388Smjacob * ISP Configuration Options
31835388Smjacob */
31935388Smjacob#define	ISP_CFG_NORELOAD	0x80	/* don't download f/w */
32043793Smjacob#define	ISP_CFG_NONVRAM		0x40	/* ignore NVRAM */
32148484Smjacob#define	ISP_CFG_FULL_DUPLEX	0x01	/* Fibre Channel Only */
32235388Smjacob
32345282Smjacob#define	ISP_FW_REV(maj, min, mic)	((maj << 24) | (min << 16) | mic)
32446968Smjacob#define	ISP_FW_REVX(xp)	((xp[0]<<24) | (xp[1] << 16) | xp[2])
32539235Sgibbs
32635388Smjacob/*
32739235Sgibbs * Bus (implementation) types
32835388Smjacob */
32939235Sgibbs#define	ISP_BT_PCI		0	/* PCI Implementations */
33039235Sgibbs#define	ISP_BT_SBUS		1	/* SBus Implementations */
33139235Sgibbs
33239235Sgibbs/*
33339235Sgibbs * Chip Types
33439235Sgibbs */
33535388Smjacob#define	ISP_HA_SCSI		0xf
33639235Sgibbs#define	ISP_HA_SCSI_UNKNOWN	0x1
33739235Sgibbs#define	ISP_HA_SCSI_1020	0x2
33839235Sgibbs#define	ISP_HA_SCSI_1020A	0x3
33939235Sgibbs#define	ISP_HA_SCSI_1040	0x4
34039235Sgibbs#define	ISP_HA_SCSI_1040A	0x5
34139235Sgibbs#define	ISP_HA_SCSI_1040B	0x6
34245282Smjacob#define	ISP_HA_SCSI_1040C	0x7
34345040Smjacob#define	ISP_HA_SCSI_1080	0xd
34445040Smjacob#define	ISP_HA_SCSI_12X0	0xe
34535388Smjacob#define	ISP_HA_FC		0xf0
34635388Smjacob#define	ISP_HA_FC_2100		0x10
34748484Smjacob#define	ISP_HA_FC_2200		0x20
34835388Smjacob
34944819Smjacob#define	IS_SCSI(isp)	(isp->isp_type & ISP_HA_SCSI)
35044819Smjacob#define	IS_1080(isp)	(isp->isp_type == ISP_HA_SCSI_1080)
35145040Smjacob#define	IS_12X0(isp)	(isp->isp_type == ISP_HA_SCSI_12X0)
35244819Smjacob#define	IS_FC(isp)	(isp->isp_type & ISP_HA_FC)
35344819Smjacob
35435388Smjacob/*
35543420Smjacob * Macros to read, write ISP registers through bus specific code.
35635388Smjacob */
35735388Smjacob
35835388Smjacob#define	ISP_READ(isp, reg)	\
35935388Smjacob	(*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg))
36035388Smjacob
36135388Smjacob#define	ISP_WRITE(isp, reg, val)	\
36235388Smjacob	(*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), (val))
36335388Smjacob
36435388Smjacob#define	ISP_MBOXDMASETUP(isp)	\
36535388Smjacob	(*(isp)->isp_mdvec->dv_mbxdma)((isp))
36635388Smjacob
36735388Smjacob#define	ISP_DMASETUP(isp, xs, req, iptrp, optr)	\
36835388Smjacob	(*(isp)->isp_mdvec->dv_dmaset)((isp), (xs), (req), (iptrp), (optr))
36935388Smjacob
37052347Smjacob#define	ISP_DMAFREE(isp, xs, hndl)	\
37135388Smjacob	if ((isp)->isp_mdvec->dv_dmaclr) \
37252347Smjacob	    (*(isp)->isp_mdvec->dv_dmaclr)((isp), (xs), (hndl))
37335388Smjacob
37435388Smjacob#define	ISP_RESET0(isp)	\
37535388Smjacob	if ((isp)->isp_mdvec->dv_reset0) (*(isp)->isp_mdvec->dv_reset0)((isp))
37635388Smjacob#define	ISP_RESET1(isp)	\
37735388Smjacob	if ((isp)->isp_mdvec->dv_reset1) (*(isp)->isp_mdvec->dv_reset1)((isp))
37835388Smjacob#define	ISP_DUMPREGS(isp)	\
37935388Smjacob	if ((isp)->isp_mdvec->dv_dregs) (*(isp)->isp_mdvec->dv_dregs)((isp))
38035388Smjacob
38135388Smjacob#define	ISP_SETBITS(isp, reg, val)	\
38235388Smjacob (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) | (val))
38335388Smjacob
38435388Smjacob#define	ISP_CLRBITS(isp, reg, val)	\
38535388Smjacob (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) & ~(val))
38635388Smjacob
38735388Smjacob/*
38835388Smjacob * Function Prototypes
38935388Smjacob */
39035388Smjacob
39135388Smjacob/*
39239235Sgibbs * Reset Hardware. Totally. Assumes that you'll follow this with
39339235Sgibbs * a call to isp_init.
39435388Smjacob */
39535388Smjacobvoid isp_reset __P((struct ispsoftc *));
39635388Smjacob
39735388Smjacob/*
39835388Smjacob * Initialize Hardware to known state
39935388Smjacob */
40035388Smjacobvoid isp_init __P((struct ispsoftc *));
40135388Smjacob
40235388Smjacob/*
40339235Sgibbs * Reset the ISP and call completion for any orphaned commands.
40439235Sgibbs */
40539235Sgibbsvoid isp_restart __P((struct ispsoftc *));
40639235Sgibbs
40739235Sgibbs/*
40835388Smjacob * Interrupt Service Routine
40935388Smjacob */
41035388Smjacobint isp_intr __P((void *));
41135388Smjacob
41235388Smjacob/*
41335388Smjacob * Command Entry Point
41435388Smjacob */
41539235Sgibbsint32_t ispscsicmd __P((ISP_SCSI_XFER_T *));
41635388Smjacob
41739235Sgibbs/*
41843420Smjacob * Platform Dependent to External to Internal Control Function
41939235Sgibbs *
42048484Smjacob * Assumes all locks are held and that no reentrancy issues need be dealt with.
42139235Sgibbs *
42239235Sgibbs */
42339235Sgibbstypedef enum {
42448484Smjacob	ISPCTL_RESET_BUS,		/* Reset Bus */
42548484Smjacob	ISPCTL_RESET_DEV,		/* Reset Device */
42648484Smjacob	ISPCTL_ABORT_CMD,		/* Abort Command */
42748484Smjacob	ISPCTL_UPDATE_PARAMS,		/* Update Operating Parameters */
42848484Smjacob	ISPCTL_FCLINK_TEST		/* Test FC Link Status */
42939235Sgibbs} ispctl_t;
43039235Sgibbsint isp_control __P((struct ispsoftc *, ispctl_t, void *));
43139235Sgibbs
43243420Smjacob
43339235Sgibbs/*
43443420Smjacob * Platform Dependent to Internal to External Control Function
43543420Smjacob * (each platform must provide such a function)
43643420Smjacob *
43748484Smjacob * Assumes all locks are held and that no reentrancy issues need be dealt with.
43843420Smjacob *
43943420Smjacob */
44043420Smjacob
44143420Smjacobtypedef enum {
44243793Smjacob	ISPASYNC_NEW_TGT_PARAMS,
44348484Smjacob	ISPASYNC_BUS_RESET,		/* Bus Was Reset */
44448484Smjacob	ISPASYNC_LOOP_DOWN,		/* FC Loop Down */
44548484Smjacob	ISPASYNC_LOOP_UP,		/* FC Loop Up */
44648484Smjacob	ISPASYNC_PDB_CHANGED,		/* FC Port Data Base Changed */
44748484Smjacob	ISPASYNC_CHANGE_NOTIFY,		/* FC SNS Change Notification */
44848484Smjacob	ISPASYNC_FABRIC_DEV,		/* FC New Fabric Device */
44943420Smjacob} ispasync_t;
45043420Smjacobint isp_async __P((struct ispsoftc *, ispasync_t, void *));
45143420Smjacob
45243420Smjacob/*
45339235Sgibbs * lost command routine (XXXX IN TRANSITION XXXX)
45439235Sgibbs */
45539235Sgibbsvoid isp_lostcmd __P((struct ispsoftc *, ISP_SCSI_XFER_T *));
45639235Sgibbs
45735388Smjacob#endif	/* _ISPVAR_H */
458