Deleted Added
full compact
ispvar.h (43793) ispvar.h (44819)
1/* $Id: ispvar.h,v 1.9 1999/01/30 07:29:00 mjacob Exp $ */
2/* release_02_05_99 */
1/* $Id: ispvar.h,v 1.10 1999/02/09 01:11:35 mjacob Exp $ */
2/* release_03_16_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
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__
40#if defined(__NetBSD__) || defined(__OpenBSD__)
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
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#ifdef ISP2100_FABRIC
81#define MAX_FC_TARG 256
82#else
80#define MAX_FC_TARG 126
83#define MAX_FC_TARG 126
84#endif
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
85#define DEFAULT_LOOPID 113
86
87/* queue length must be a power of two */
88#define QENTRY_LEN 64
89#define RQUEST_QUEUE_LEN MAXISPREQUEST
86#define RESULT_QUEUE_LEN (MAXISPREQUEST/4)
90#define RESULT_QUEUE_LEN (MAXISPREQUEST/2)
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 /*
91#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN))
92#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN)
93#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1))
94#define ISP_QAVAIL(in, out, qlen) \
95 ((in == out)? (qlen - 1) : ((in > out)? \
96 ((qlen - 1) - (in - out)) : (out - in - 1)))
97/*
98 * SCSI Specific Host Adapter Parameters

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

163 u_int8_t isp_execthrottle;
164 u_int8_t isp_retry_delay;
165 u_int8_t isp_retry_count;
166 u_int8_t isp_fwstate; /* ISP F/W state */
167 u_int16_t isp_maxalloc;
168 u_int16_t isp_maxfrmlen;
169 u_int16_t isp_fwoptions;
170 /*
171 * Port Data Base
172 */
173 isp_pdb_t isp_pdb[MAX_FC_TARG];
174
175 /*
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,
176 * Scratch DMA mapped in area to fetch Port Database stuff, etc.
177 */
178 volatile caddr_t isp_scratch;
179 u_int32_t isp_scdma;
180} fcparam;
181
182#define ISP2100_SCRLEN 0x100
183

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

241 struct ispmdvec * isp_mdvec;
242
243 /*
244 * Mostly nonvolatile state, debugging, etc..
245 */
246
247 u_int : 8,
248 isp_confopts : 8,
240 : 2,
249 : 1,
250 isp_used : 1,
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 */
251 isp_dblev : 3,
252 isp_gotdparms : 1,
253 isp_dogactive : 1,
254 isp_bustype : 1, /* BUS Implementation */
255 isp_type : 8; /* HBA Type and Revision */
256
257 u_int16_t isp_fwrev; /* Running F/W revision */
258 u_int16_t isp_romfw_rev; /* 'ROM' F/W revision */
259 void * isp_param;
260
261 /*
262 * Volatile state
263 */
264
265 volatile u_int
266 : 19,
267 isp_state : 3,
268 isp_sendmarker : 1, /* send a marker entry */
259 isp_update : 1, /* update paramters */
269 isp_update : 1, /* update parameters */
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
270 isp_nactive : 9; /* how many commands active */
271
272 /*
273 * Result and Request Queue indices.
274 */
275 volatile u_int8_t isp_reqodx; /* index of last ISP pickup */
276 volatile u_int8_t isp_reqidx; /* index of next request */
277 volatile u_int8_t isp_residx; /* index of next result */

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

346 */
347#define ISP_HA_SCSI 0xf
348#define ISP_HA_SCSI_UNKNOWN 0x1
349#define ISP_HA_SCSI_1020 0x2
350#define ISP_HA_SCSI_1020A 0x3
351#define ISP_HA_SCSI_1040 0x4
352#define ISP_HA_SCSI_1040A 0x5
353#define ISP_HA_SCSI_1040B 0x6
354#define ISP_HA_SCSI_1080 0xe
344#define ISP_HA_FC 0xf0
345#define ISP_HA_FC_2100 0x10
346
355#define ISP_HA_FC 0xf0
356#define ISP_HA_FC_2100 0x10
357
358#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI)
359#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080)
360#define IS_FC(isp) (isp->isp_type & ISP_HA_FC)
361
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,
362/*
363 * Macros to read, write ISP registers through bus specific code.
364 */
365
366#define ISP_READ(isp, reg) \
367 (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg))
368
369#define ISP_WRITE(isp, reg, val) \

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

434 * Second argument is an index into xflist array.
435 * Assumes all locks must be held already.
436 */
437typedef enum {
438 ISPCTL_RESET_BUS,
439 ISPCTL_RESET_DEV,
440 ISPCTL_ABORT_CMD,
441 ISPCTL_UPDATE_PARAMS,
442 ISPCTL_FCLINK_TEST
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,
443} ispctl_t;
444int isp_control __P((struct ispsoftc *, ispctl_t, void *));
445
446
447/*
448 * Platform Dependent to Internal to External Control Function
449 * (each platform must provide such a function)
450 *
451 * For: Announcing Target Paramter Changes (arg is target)
452 *
453 * Assumes all locks are held.
454 */
455
456typedef enum {
457 ISPASYNC_NEW_TGT_PARAMS,
458 ISPASYNC_BUS_RESET, /* Bus Reset */
442 ISPASYNC_LOOP_DOWN, /* Obvious FC only */
459 ISPASYNC_LOOP_DOWN, /* Obvious FC only */
443 ISPASYNC_LOOP_UP /* Obvious FC only */
460 ISPASYNC_LOOP_UP, /* "" */
461 ISPASYNC_PDB_CHANGE_COMPLETE, /* "" */
462 ISPASYNC_CHANGE_NOTIFY /* "" */
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 */
463} ispasync_t;
464int isp_async __P((struct ispsoftc *, ispasync_t, void *));
465
466/*
467 * lost command routine (XXXX IN TRANSITION XXXX)
468 */
469void isp_lostcmd __P((struct ispsoftc *, ISP_SCSI_XFER_T *));
470
471
472#endif /* _ISPVAR_H */