Deleted Added
sdiff udiff text old ( 43793 ) new ( 44819 )
full compact
1/* $Id: ispvar.h,v 1.9 1999/01/30 07:29:00 mjacob Exp $ */
2/* release_02_05_99 */
3/*
4 * Soft Definitions for for Qlogic ISP SCSI adapters.
5 *
6 *---------------------------------------
7 * Copyright (c) 1997, 1998 by Matthew Jacob
8 * NASA/Ames Research Center
9 * All rights reserved.
10 *---------------------------------------

--- 21 unchanged lines hidden (view full) ---

32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 */
36
37#ifndef _ISPVAR_H
38#define _ISPVAR_H
39
40#ifdef __NetBSD__
41#include <dev/ic/ispmbox.h>
42#endif
43#ifdef __FreeBSD__
44#include <dev/isp/ispmbox.h>
45#endif
46#ifdef __linux__
47#include "ispmbox.h"
48#endif

--- 23 unchanged lines hidden (view full) ---

72 /*
73 * Initial values for conf1 register
74 */
75 u_int16_t dv_conf1;
76 u_int16_t dv_clock; /* clock frequency */
77};
78
79#define MAX_TARGETS 16
80#define MAX_FC_TARG 126
81#define DEFAULT_LOOPID 113
82
83/* queue length must be a power of two */
84#define QENTRY_LEN 64
85#define RQUEST_QUEUE_LEN MAXISPREQUEST
86#define RESULT_QUEUE_LEN (MAXISPREQUEST/4)
87#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN))
88#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN)
89#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1))
90#define ISP_QAVAIL(in, out, qlen) \
91 ((in == out)? (qlen - 1) : ((in > out)? \
92 ((qlen - 1) - (in - out)) : (out - in - 1)))
93/*
94 * SCSI Specific Host Adapter Parameters

--- 64 unchanged lines hidden (view full) ---

159 u_int8_t isp_execthrottle;
160 u_int8_t isp_retry_delay;
161 u_int8_t isp_retry_count;
162 u_int8_t isp_fwstate; /* ISP F/W state */
163 u_int16_t isp_maxalloc;
164 u_int16_t isp_maxfrmlen;
165 u_int16_t isp_fwoptions;
166 /*
167 * Scratch DMA mapped in area to fetch Port Database stuff, etc.
168 */
169 volatile caddr_t isp_scratch;
170 u_int32_t isp_scdma;
171} fcparam;
172
173#define ISP2100_SCRLEN 0x100
174

--- 57 unchanged lines hidden (view full) ---

232 struct ispmdvec * isp_mdvec;
233
234 /*
235 * Mostly nonvolatile state, debugging, etc..
236 */
237
238 u_int : 8,
239 isp_confopts : 8,
240 : 2,
241 isp_dblev : 3,
242 isp_gotdparms : 1,
243 isp_dogactive : 1,
244 isp_bustype : 1, /* BUS Implementation */
245 isp_type : 8; /* HBA Type and Revision */
246
247 u_int16_t isp_fwrev; /* Running F/W revision */
248 u_int16_t isp_romfw_rev; /* 'ROM' F/W revision */
249 void * isp_param;
250
251 /*
252 * Volatile state
253 */
254
255 volatile u_int
256 : 19,
257 isp_state : 3,
258 isp_sendmarker : 1, /* send a marker entry */
259 isp_update : 1, /* update paramters */
260 isp_nactive : 9; /* how many commands active */
261
262 /*
263 * Result and Request Queue indices.
264 */
265 volatile u_int8_t isp_reqodx; /* index of last ISP pickup */
266 volatile u_int8_t isp_reqidx; /* index of next request */
267 volatile u_int8_t isp_residx; /* index of next result */

--- 68 unchanged lines hidden (view full) ---

336 */
337#define ISP_HA_SCSI 0xf
338#define ISP_HA_SCSI_UNKNOWN 0x1
339#define ISP_HA_SCSI_1020 0x2
340#define ISP_HA_SCSI_1020A 0x3
341#define ISP_HA_SCSI_1040 0x4
342#define ISP_HA_SCSI_1040A 0x5
343#define ISP_HA_SCSI_1040B 0x6
344#define ISP_HA_FC 0xf0
345#define ISP_HA_FC_2100 0x10
346
347/*
348 * Macros to read, write ISP registers through bus specific code.
349 */
350
351#define ISP_READ(isp, reg) \
352 (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg))
353
354#define ISP_WRITE(isp, reg, val) \

--- 64 unchanged lines hidden (view full) ---

419 * Second argument is an index into xflist array.
420 * Assumes all locks must be held already.
421 */
422typedef enum {
423 ISPCTL_RESET_BUS,
424 ISPCTL_RESET_DEV,
425 ISPCTL_ABORT_CMD,
426 ISPCTL_UPDATE_PARAMS,
427} ispctl_t;
428int isp_control __P((struct ispsoftc *, ispctl_t, void *));
429
430
431/*
432 * Platform Dependent to Internal to External Control Function
433 * (each platform must provide such a function)
434 *
435 * For: Announcing Target Paramter Changes (arg is target)
436 *
437 * Assumes all locks are held.
438 */
439
440typedef enum {
441 ISPASYNC_NEW_TGT_PARAMS,
442 ISPASYNC_LOOP_DOWN, /* Obvious FC only */
443 ISPASYNC_LOOP_UP /* Obvious FC only */
444} ispasync_t;
445int isp_async __P((struct ispsoftc *, ispasync_t, void *));
446
447/*
448 * lost command routine (XXXX IN TRANSITION XXXX)
449 */
450void isp_lostcmd __P((struct ispsoftc *, ISP_SCSI_XFER_T *));
451
452
453#endif /* _ISPVAR_H */