Deleted Added
full compact
ispvar.h (84241) ispvar.h (87635)
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 84241 2001-10-01 03:45:54Z mjacob $ */
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 87635 2001-12-11 00:18:45Z mjacob $ */
2/*
3 * Soft Definitions for for Qlogic ISP SCSI adapters.
4 *
5 * Copyright (c) 1997, 1998, 1999, 2000 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

49#include "ispmbox.h"
50#ifdef ISP_TARGET_MODE
51#include "isp_target.h"
52#include "isp_tpublic.h"
53#endif
54#endif
55
56#define ISP_CORE_VERSION_MAJOR 2
2/*
3 * Soft Definitions for for Qlogic ISP SCSI adapters.
4 *
5 * Copyright (c) 1997, 1998, 1999, 2000 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

49#include "ispmbox.h"
50#ifdef ISP_TARGET_MODE
51#include "isp_target.h"
52#include "isp_tpublic.h"
53#endif
54#endif
55
56#define ISP_CORE_VERSION_MAJOR 2
57#define ISP_CORE_VERSION_MINOR 4
57#define ISP_CORE_VERSION_MINOR 5
58
59/*
60 * Vector for bus specific code to provide specific services.
61 */
62struct ispsoftc;
63struct ispmdvec {
64 int (*dv_rd_isr)
65 (struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);

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

155#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN)
156#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1))
157#define ISP_QFREE(in, out, qlen) \
158 ((in == out)? (qlen - 1) : ((in > out)? \
159 ((qlen - 1) - (in - out)) : (out - in - 1)))
160#define ISP_QAVAIL(isp) \
161 ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp))
162
58
59/*
60 * Vector for bus specific code to provide specific services.
61 */
62struct ispsoftc;
63struct ispmdvec {
64 int (*dv_rd_isr)
65 (struct ispsoftc *, u_int16_t *, u_int16_t *, u_int16_t *);

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

155#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN)
156#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1))
157#define ISP_QFREE(in, out, qlen) \
158 ((in == out)? (qlen - 1) : ((in > out)? \
159 ((qlen - 1) - (in - out)) : (out - in - 1)))
160#define ISP_QAVAIL(isp) \
161 ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp))
162
163#define ISP_ADD_REQUEST(isp, iptr) \
164 MEMORYBARRIER(isp, SYNC_REQUEST, iptr, QENTRY_LEN); \
165 WRITE_REQUEST_QUEUE_IN_POINTER(isp, iptr); \
166 isp->isp_reqidx = iptr
163#define ISP_ADD_REQUEST(isp, nxti) \
164 MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \
165 WRITE_REQUEST_QUEUE_IN_POINTER(isp, nxti); \
166 isp->isp_reqidx = nxti
167
168/*
169 * SCSI Specific Host Adapter Parameters- per bus, per target
170 */
171
172typedef struct {
173 u_int isp_gotdparms : 1,
174 isp_req_ack_active_neg : 1,

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

345 u_int16_t isp_fwrev[3]; /* Loaded F/W revision */
346 u_int16_t isp_romfw_rev[3]; /* PROM F/W revision */
347 u_int16_t isp_maxcmds; /* max possible I/O cmds */
348 u_int8_t isp_type; /* HBA Chip Type */
349 u_int8_t isp_revision; /* HBA Chip H/W Revision */
350 u_int32_t isp_maxluns; /* maximum luns supported */
351
352 u_int32_t isp_clock : 8, /* input clock */
167
168/*
169 * SCSI Specific Host Adapter Parameters- per bus, per target
170 */
171
172typedef struct {
173 u_int isp_gotdparms : 1,
174 isp_req_ack_active_neg : 1,

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

345 u_int16_t isp_fwrev[3]; /* Loaded F/W revision */
346 u_int16_t isp_romfw_rev[3]; /* PROM F/W revision */
347 u_int16_t isp_maxcmds; /* max possible I/O cmds */
348 u_int8_t isp_type; /* HBA Chip Type */
349 u_int8_t isp_revision; /* HBA Chip H/W Revision */
350 u_int32_t isp_maxluns; /* maximum luns supported */
351
352 u_int32_t isp_clock : 8, /* input clock */
353 : 6,
354 isp_role : 2,
355 : 1,
353 : 5,
354 isp_failed : 1, /* board failed */
355 isp_open : 1, /* opened (ioctl) */
356 isp_touched : 1, /* board ever seen? */
357 isp_bustype : 1, /* SBus or PCI */
358 isp_loaded_fw : 1, /* loaded firmware */
356 isp_touched : 1, /* board ever seen? */
357 isp_bustype : 1, /* SBus or PCI */
358 isp_loaded_fw : 1, /* loaded firmware */
359 isp_role : 2, /* roles supported */
359 isp_dblev : 12; /* debug log mask */
360
361 u_int32_t isp_confopts; /* config options */
362
363 u_int16_t isp_rqstinrp; /* register for REQINP */
364 u_int16_t isp_rqstoutrp; /* register for REQOUTP */
365 u_int16_t isp_respinrp; /* register for RESINP */
366 u_int16_t isp_respoutrp; /* register for RESOUTP */

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

371 u_int64_t isp_intcnt; /* total int count */
372 u_int64_t isp_intbogus; /* spurious int count */
373
374 /*
375 * Volatile state
376 */
377
378 volatile u_int32_t
360 isp_dblev : 12; /* debug log mask */
361
362 u_int32_t isp_confopts; /* config options */
363
364 u_int16_t isp_rqstinrp; /* register for REQINP */
365 u_int16_t isp_rqstoutrp; /* register for REQOUTP */
366 u_int16_t isp_respinrp; /* register for RESINP */
367 u_int16_t isp_respoutrp; /* register for RESOUTP */

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

372 u_int64_t isp_intcnt; /* total int count */
373 u_int64_t isp_intbogus; /* spurious int count */
374
375 /*
376 * Volatile state
377 */
378
379 volatile u_int32_t
379 isp_mboxbsy : 8, /* mailbox command active */
380 : 1,
380 isp_obits : 8, /* mailbox command output */
381 isp_mboxbsy : 1, /* mailbox command active */
381 isp_state : 3,
382 isp_sendmarker : 2, /* send a marker entry */
383 isp_update : 2, /* update parameters */
384 isp_nactive : 16; /* how many commands active */
385 volatile u_int16_t isp_reqodx; /* index of last ISP pickup */
386 volatile u_int16_t isp_reqidx; /* index of next request */
387 volatile u_int16_t isp_residx; /* index of next result */
388 volatile u_int16_t isp_lasthdls; /* last handle seed */

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

476
477/*
478 * Bus (implementation) types
479 */
480#define ISP_BT_PCI 0 /* PCI Implementations */
481#define ISP_BT_SBUS 1 /* SBus Implementations */
482
483/*
382 isp_state : 3,
383 isp_sendmarker : 2, /* send a marker entry */
384 isp_update : 2, /* update parameters */
385 isp_nactive : 16; /* how many commands active */
386 volatile u_int16_t isp_reqodx; /* index of last ISP pickup */
387 volatile u_int16_t isp_reqidx; /* index of next request */
388 volatile u_int16_t isp_residx; /* index of next result */
389 volatile u_int16_t isp_lasthdls; /* last handle seed */

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

477
478/*
479 * Bus (implementation) types
480 */
481#define ISP_BT_PCI 0 /* PCI Implementations */
482#define ISP_BT_SBUS 1 /* SBus Implementations */
483
484/*
485 * If we have not otherwise defined SBus support away make sure
486 * it is defined here such that the code is included as default
487 */
488#ifndef ISP_SBUS_SUPPORTED
489#define ISP_SBUS_SUPPORTED 1
490#endif
491
492/*
484 * Chip Types
485 */
486#define ISP_HA_SCSI 0xf
487#define ISP_HA_SCSI_UNKNOWN 0x1
488#define ISP_HA_SCSI_1020 0x2
489#define ISP_HA_SCSI_1020A 0x3
490#define ISP_HA_SCSI_1040 0x4
491#define ISP_HA_SCSI_1040A 0x5

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

651 * ISPASYNC_PROMENADE has an argument that is a pointer to an integer which
652 * is an index into the portdb in the softc ('target'). Whether that entrie's
653 * valid tag is set or not says whether something has arrived or departed.
654 * The name refers to a favorite pastime of many city dwellers- watching
655 * people come and go, talking of Michaelangelo, and so on..
656 *
657 * ISPASYNC_UNHANDLED_RESPONSE gives outer layers a chance to parse a
658 * response queue entry not otherwise handled. The outer layer should
493 * Chip Types
494 */
495#define ISP_HA_SCSI 0xf
496#define ISP_HA_SCSI_UNKNOWN 0x1
497#define ISP_HA_SCSI_1020 0x2
498#define ISP_HA_SCSI_1020A 0x3
499#define ISP_HA_SCSI_1040 0x4
500#define ISP_HA_SCSI_1040A 0x5

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

660 * ISPASYNC_PROMENADE has an argument that is a pointer to an integer which
661 * is an index into the portdb in the softc ('target'). Whether that entrie's
662 * valid tag is set or not says whether something has arrived or departed.
663 * The name refers to a favorite pastime of many city dwellers- watching
664 * people come and go, talking of Michaelangelo, and so on..
665 *
666 * ISPASYNC_UNHANDLED_RESPONSE gives outer layers a chance to parse a
667 * response queue entry not otherwise handled. The outer layer should
659 * return non-zero if it handled it. The 'arg' points to a (possibly only
660 * partially) massaged response queue entry (see the platform's
661 * ISP_UNSWIZZLE_RESPONSE macro).
668 * return non-zero if it handled it. The 'arg' points to an unmassaged
669 * response queue entry.
662 */
663
664typedef enum {
665 ISPASYNC_NEW_TGT_PARAMS, /* New Target Parameters Negotiated */
666 ISPASYNC_BUS_RESET, /* Bus Was Reset */
667 ISPASYNC_LOOP_DOWN, /* FC Loop Down */
668 ISPASYNC_LOOP_UP, /* FC Loop Up */
669 ISPASYNC_LIP, /* LIP Received */

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

814 * in fcparam.isp_{node,port}wwn reflect the values
815 * read from NVRAM (possibly corrected for card botches).
816 * Each platform can take that information and override
817 * it or ignore and return the Node and Port WWNs to be
818 * used when sending the Qlogic f/w the Initialization Control
819 * Block.
820 *
821 * (XXX these do endian specific transformations- in transition XXX)
670 */
671
672typedef enum {
673 ISPASYNC_NEW_TGT_PARAMS, /* New Target Parameters Negotiated */
674 ISPASYNC_BUS_RESET, /* Bus Was Reset */
675 ISPASYNC_LOOP_DOWN, /* FC Loop Down */
676 ISPASYNC_LOOP_UP, /* FC Loop Up */
677 ISPASYNC_LIP, /* LIP Received */

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

822 * in fcparam.isp_{node,port}wwn reflect the values
823 * read from NVRAM (possibly corrected for card botches).
824 * Each platform can take that information and override
825 * it or ignore and return the Node and Port WWNs to be
826 * used when sending the Qlogic f/w the Initialization Control
827 * Block.
828 *
829 * (XXX these do endian specific transformations- in transition XXX)
822 * ISP_SWIZZLE_ICB
823 * ISP_UNSWIZZLE_AND_COPY_PDBP
824 * ISP_SWIZZLE_CONTINUATION
825 * ISP_SWIZZLE_REQUEST
826 * ISP_UNSWIZZLE_RESPONSE
827 * ISP_SWIZZLE_SNS_REQ
828 * ISP_UNSWIZZLE_SNS_RSP
829 * ISP_SWIZZLE_NVRAM_WORD
830 *
831 * ISP_IOXPUT_8(struct ispsoftc *, u_int8_t srcval, u_int8_t *dstptr)
832 * ISP_IOXPUT_16(struct ispsoftc *, u_int16_t srcval, u_int16_t *dstptr)
833 * ISP_IOXPUT_32(struct ispsoftc *, u_int32_t srcval, u_int32_t *dstptr)
834 *
835 * ISP_IOXGET_8(struct ispsoftc *, u_int8_t *srcptr, u_int8_t dstrval)
836 * ISP_IOXGET_16(struct ispsoftc *, u_int16_t *srcptr, u_int16_t dstrval)
837 * ISP_IOXGET_32(struct ispsoftc *, u_int32_t *srcptr, u_int32_t dstrval)
838 *
839 * ISP_SWIZZLE_NVRAM_WORD(struct ispsoftc *, u_int16_t *)
830 */
831
832#endif /* _ISPVAR_H */
840 */
841
842#endif /* _ISPVAR_H */