Deleted Added
sdiff udiff text old ( 146073 ) new ( 154704 )
full compact
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 146073 2005-05-11 00:22:17Z 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
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice immediately at the beginning of the file, without modification,
13 * this list of conditions, and the following disclaimer.

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

20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#ifndef _ISPVAR_H
32#define _ISPVAR_H
33
34#if defined(__NetBSD__) || defined(__OpenBSD__)
35#include <dev/ic/ispmbox.h>
36#ifdef ISP_TARGET_MODE

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

169#define ISP_ADD_REQUEST(isp, nxti) \
170 MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \
171 WRITE_REQUEST_QUEUE_IN_POINTER(isp, nxti); \
172 isp->isp_reqidx = nxti
173
174/*
175 * SCSI Specific Host Adapter Parameters- per bus, per target
176 */
177
178typedef struct {
179 u_int isp_gotdparms : 1,
180 isp_req_ack_active_neg : 1,
181 isp_data_line_active_neg: 1,
182 isp_cmd_dma_burst_enable: 1,
183 isp_data_dma_burst_enabl: 1,
184 isp_fifo_threshold : 3,
185 isp_ultramode : 1,

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

225#define DPARM_QFRZ 0x0200
226#define DPARM_RENEG 0x0100
227#define DPARM_NARROW 0x0080
228#define DPARM_ASYNC 0x0040
229#define DPARM_PPR 0x0020
230#define DPARM_DEFAULT (0xFF00 & ~DPARM_QFRZ)
231#define DPARM_SAFE_DFLT (DPARM_DEFAULT & ~(DPARM_WIDE|DPARM_SYNC|DPARM_TQING))
232
233
234/* technically, not really correct, as they need to be rated based upon clock */
235#define ISP_80M_SYNCPARMS 0x0c09
236#define ISP_40M_SYNCPARMS 0x0c0a
237#define ISP_20M_SYNCPARMS 0x0c0c
238#define ISP_20M_SYNCPARMS_1040 0x080c
239#define ISP_10M_SYNCPARMS 0x0c19
240#define ISP_08M_SYNCPARMS 0x0c25
241#define ISP_05M_SYNCPARMS 0x0c32

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

249#define FC_SNS_ID 0x80 /* SNS Server Special ID */
250
251/* #define ISP_USE_GA_NXT 1 */ /* Use GA_NXT with switches */
252#ifndef GA_NXT_MAX
253#define GA_NXT_MAX 256
254#endif
255
256typedef struct {
257 u_int32_t isp_fwoptions : 16,
258 isp_gbspeed : 2,
259 isp_iid_set : 1,
260 loop_seen_once : 1,
261 isp_loopstate : 4, /* Current Loop State */
262 isp_fwstate : 3, /* ISP F/W state */
263 isp_gotdparms : 1,
264 isp_topo : 3,
265 isp_onfabric : 1;
266 u_int8_t isp_iid; /* 'initiator' id */
267 u_int8_t isp_loopid; /* hard loop id */
268 u_int8_t isp_alpa; /* ALPA */
269 u_int32_t isp_portid;
270 volatile u_int16_t isp_lipseq; /* LIP sequence # */
271 u_int16_t isp_fwattr; /* firmware attributes */
272 u_int8_t isp_execthrottle;
273 u_int8_t isp_retry_delay;
274 u_int8_t isp_retry_count;
275 u_int8_t isp_reserved;
276 u_int16_t isp_maxalloc;
277 u_int16_t isp_maxfrmlen;
278 u_int64_t isp_nodewwn;
279 u_int64_t isp_portwwn;
280 /*
281 * Port Data Base. This is indexed by 'target', which is invariate.
282 * However, elements within can move around due to loop changes,
283 * so the actual loop ID passed to the F/W is in this structure.
284 * The first time the loop is seen up, loopid will match the index
285 * (except for fabric nodes which are above mapped above FC_SNS_ID
286 * and are completely virtual), but subsequent LIPs can cause things
287 * to move around.
288 */
289 struct lportdb {
290 u_int32_t
291 port_type : 8,
292 loopid : 8,
293 fc4_type : 4,
294 last_fabric_dev : 1,
295 : 2,
296 relogin : 1,
297 force_logout : 1,
298 was_fabric_dev : 1,
299 fabric_dev : 1,
300 loggedin : 1,
301 roles : 2,
302 valid : 1;
303 u_int32_t portid;
304 u_int64_t node_wwn;
305 u_int64_t port_wwn;
306 } portdb[MAX_FC_TARG], tport[FC_PORT_ID];
307
308 /*
309 * Scratch DMA mapped in area to fetch Port Database stuff, etc.
310 */
311 caddr_t isp_scratch;

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

409 isp_update : 2, /* update parameters */
410 isp_nactive : 16; /* how many commands active */
411 volatile u_int16_t isp_reqodx; /* index of last ISP pickup */
412 volatile u_int16_t isp_reqidx; /* index of next request */
413 volatile u_int16_t isp_residx; /* index of next result */
414 volatile u_int16_t isp_resodx; /* index of next result */
415 volatile u_int16_t isp_rspbsy;
416 volatile u_int16_t isp_lasthdls; /* last handle seed */
417 volatile u_int16_t isp_mboxtmp[MAX_MAILBOX];
418 volatile u_int16_t isp_lastmbxcmd; /* last mbox command sent */
419 volatile u_int16_t isp_mbxwrk0;
420 volatile u_int16_t isp_mbxwrk1;
421 volatile u_int16_t isp_mbxwrk2;
422 void * isp_mbxworkp;
423
424 /*
425 * Active commands are stored here, indexed by handle functions.

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

549#define ISP_HA_SCSI_1280 0xa
550#define ISP_HA_SCSI_10160 0xb
551#define ISP_HA_SCSI_12160 0xc
552#define ISP_HA_FC 0xf0
553#define ISP_HA_FC_2100 0x10
554#define ISP_HA_FC_2200 0x20
555#define ISP_HA_FC_2300 0x30
556#define ISP_HA_FC_2312 0x40
557
558#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI)
559#define IS_1240(isp) (isp->isp_type == ISP_HA_SCSI_1240)
560#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080)
561#define IS_1280(isp) (isp->isp_type == ISP_HA_SCSI_1280)
562#define IS_10160(isp) (isp->isp_type == ISP_HA_SCSI_10160)
563#define IS_12160(isp) (isp->isp_type == ISP_HA_SCSI_12160)
564

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

569#define IS_ULTRA3(isp) (IS_1X160(isp))
570
571#define IS_FC(isp) ((isp)->isp_type & ISP_HA_FC)
572#define IS_2100(isp) ((isp)->isp_type == ISP_HA_FC_2100)
573#define IS_2200(isp) ((isp)->isp_type == ISP_HA_FC_2200)
574#define IS_23XX(isp) ((isp)->isp_type >= ISP_HA_FC_2300)
575#define IS_2300(isp) ((isp)->isp_type == ISP_HA_FC_2300)
576#define IS_2312(isp) ((isp)->isp_type == ISP_HA_FC_2312)
577
578/*
579 * DMA cookie macros
580 */
581#ifdef ISP_DAC_SUPPORTRED
582#define DMA_WD3(x) (((x) >> 48) & 0xffff)
583#define DMA_WD2(x) (((x) >> 32) & 0xffff)
584#else

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

737 ISPASYNC_BUS_RESET, /* Bus Was Reset */
738 ISPASYNC_LOOP_DOWN, /* FC Loop Down */
739 ISPASYNC_LOOP_UP, /* FC Loop Up */
740 ISPASYNC_LIP, /* LIP Received */
741 ISPASYNC_LOOP_RESET, /* Loop Reset Received */
742 ISPASYNC_CHANGE_NOTIFY, /* FC Change Notification */
743 ISPASYNC_FABRIC_DEV, /* FC Fabric Device Arrival */
744 ISPASYNC_PROMENADE, /* FC Objects coming && going */
745 ISPASYNC_TARGET_MESSAGE, /* target message */
746 ISPASYNC_TARGET_EVENT, /* target asynchronous event */
747 ISPASYNC_TARGET_ACTION, /* other target command action */
748 ISPASYNC_CONF_CHANGE, /* Platform Configuration Change */
749 ISPASYNC_UNHANDLED_RESPONSE, /* Unhandled Response Entry */
750 ISPASYNC_FW_CRASH, /* Firmware has crashed */
751 ISPASYNC_FW_DUMPED, /* Firmware crashdump taken */
752 ISPASYNC_FW_RESTARTED /* Firmware has been restarted */
753} ispasync_t;
754int isp_async(struct ispsoftc *, ispasync_t, void *);
755

--- 156 unchanged lines hidden ---