1/* $FreeBSD: head/sys/dev/isp/ispvar.h 154704 2006-01-23 06:23:37Z mjacob $ */ |
2/*- 3 * Soft Definitions for for Qlogic ISP SCSI adapters. 4 * |
5 * Copyright (c) 1997-2006 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#ifndef _ISPVAR_H 31#define _ISPVAR_H 32 33#if defined(__NetBSD__) || defined(__OpenBSD__) 34#include <dev/ic/ispmbox.h> 35#ifdef ISP_TARGET_MODE --- 132 unchanged lines hidden (view full) --- 168#define ISP_ADD_REQUEST(isp, nxti) \ 169 MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \ 170 WRITE_REQUEST_QUEUE_IN_POINTER(isp, nxti); \ 171 isp->isp_reqidx = nxti 172 173/* 174 * SCSI Specific Host Adapter Parameters- per bus, per target 175 */ |
176typedef struct { 177 u_int isp_gotdparms : 1, 178 isp_req_ack_active_neg : 1, 179 isp_data_line_active_neg: 1, 180 isp_cmd_dma_burst_enable: 1, 181 isp_data_dma_burst_enabl: 1, 182 isp_fifo_threshold : 3, 183 isp_ultramode : 1, --- 39 unchanged lines hidden (view full) --- 223#define DPARM_QFRZ 0x0200 224#define DPARM_RENEG 0x0100 225#define DPARM_NARROW 0x0080 226#define DPARM_ASYNC 0x0040 227#define DPARM_PPR 0x0020 228#define DPARM_DEFAULT (0xFF00 & ~DPARM_QFRZ) 229#define DPARM_SAFE_DFLT (DPARM_DEFAULT & ~(DPARM_WIDE|DPARM_SYNC|DPARM_TQING)) 230 |
231/* technically, not really correct, as they need to be rated based upon clock */ 232#define ISP_80M_SYNCPARMS 0x0c09 233#define ISP_40M_SYNCPARMS 0x0c0a 234#define ISP_20M_SYNCPARMS 0x0c0c 235#define ISP_20M_SYNCPARMS_1040 0x080c 236#define ISP_10M_SYNCPARMS 0x0c19 237#define ISP_08M_SYNCPARMS 0x0c25 238#define ISP_05M_SYNCPARMS 0x0c32 --- 7 unchanged lines hidden (view full) --- 246#define FC_SNS_ID 0x80 /* SNS Server Special ID */ 247 248/* #define ISP_USE_GA_NXT 1 */ /* Use GA_NXT with switches */ 249#ifndef GA_NXT_MAX 250#define GA_NXT_MAX 256 251#endif 252 253typedef struct { |
254 u_int32_t : 13, 255 isp_gbspeed : 3, 256 : 2, |
257 isp_iid_set : 1, 258 loop_seen_once : 1, 259 isp_loopstate : 4, /* Current Loop State */ 260 isp_fwstate : 3, /* ISP F/W state */ 261 isp_gotdparms : 1, 262 isp_topo : 3, 263 isp_onfabric : 1; |
264 u_int32_t : 8, 265 isp_portid : 24; /* S_ID */ 266 u_int16_t isp_fwoptions; 267 u_int16_t isp_iid; /* 'initiator' id */ 268 u_int16_t isp_loopid; /* hard loop id */ |
269 u_int16_t isp_fwattr; /* firmware attributes */ 270 u_int8_t isp_execthrottle; 271 u_int8_t isp_retry_delay; 272 u_int8_t isp_retry_count; 273 u_int8_t isp_reserved; 274 u_int16_t isp_maxalloc; 275 u_int16_t isp_maxfrmlen; 276 u_int64_t isp_nodewwn; 277 u_int64_t isp_portwwn; 278 /* 279 * Port Data Base. This is indexed by 'target', which is invariate. 280 * However, elements within can move around due to loop changes, 281 * so the actual loop ID passed to the F/W is in this structure. 282 * The first time the loop is seen up, loopid will match the index 283 * (except for fabric nodes which are above mapped above FC_SNS_ID 284 * and are completely virtual), but subsequent LIPs can cause things 285 * to move around. 286 */ 287 struct lportdb { |
288 u_int32_t loopid : 16, 289 : 2, |
290 fc4_type : 4, 291 last_fabric_dev : 1, |
292 relogin : 1, 293 force_logout : 1, 294 was_fabric_dev : 1, 295 fabric_dev : 1, 296 loggedin : 1, 297 roles : 2, |
298 tvalid : 1, |
299 valid : 1; |
300 u_int32_t port_type : 8, 301 portid : 24; |
302 u_int64_t node_wwn; 303 u_int64_t port_wwn; 304 } portdb[MAX_FC_TARG], tport[FC_PORT_ID]; 305 306 /* 307 * Scratch DMA mapped in area to fetch Port Database stuff, etc. 308 */ 309 caddr_t isp_scratch; --- 97 unchanged lines hidden (view full) --- 407 isp_update : 2, /* update parameters */ 408 isp_nactive : 16; /* how many commands active */ 409 volatile u_int16_t isp_reqodx; /* index of last ISP pickup */ 410 volatile u_int16_t isp_reqidx; /* index of next request */ 411 volatile u_int16_t isp_residx; /* index of next result */ 412 volatile u_int16_t isp_resodx; /* index of next result */ 413 volatile u_int16_t isp_rspbsy; 414 volatile u_int16_t isp_lasthdls; /* last handle seed */ |
415 volatile u_int16_t isp_mboxtmp[MAILBOX_STORAGE]; |
416 volatile u_int16_t isp_lastmbxcmd; /* last mbox command sent */ 417 volatile u_int16_t isp_mbxwrk0; 418 volatile u_int16_t isp_mbxwrk1; 419 volatile u_int16_t isp_mbxwrk2; 420 void * isp_mbxworkp; 421 422 /* 423 * Active commands are stored here, indexed by handle functions. --- 123 unchanged lines hidden (view full) --- 547#define ISP_HA_SCSI_1280 0xa 548#define ISP_HA_SCSI_10160 0xb 549#define ISP_HA_SCSI_12160 0xc 550#define ISP_HA_FC 0xf0 551#define ISP_HA_FC_2100 0x10 552#define ISP_HA_FC_2200 0x20 553#define ISP_HA_FC_2300 0x30 554#define ISP_HA_FC_2312 0x40 |
555#define ISP_HA_FC_2322 0x50 556#define ISP_HA_FC_2400 0x60 557#define ISP_HA_FC_2422 0x61 |
558 559#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI) 560#define IS_1240(isp) (isp->isp_type == ISP_HA_SCSI_1240) 561#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080) 562#define IS_1280(isp) (isp->isp_type == ISP_HA_SCSI_1280) 563#define IS_10160(isp) (isp->isp_type == ISP_HA_SCSI_10160) 564#define IS_12160(isp) (isp->isp_type == ISP_HA_SCSI_12160) 565 --- 4 unchanged lines hidden (view full) --- 570#define IS_ULTRA3(isp) (IS_1X160(isp)) 571 572#define IS_FC(isp) ((isp)->isp_type & ISP_HA_FC) 573#define IS_2100(isp) ((isp)->isp_type == ISP_HA_FC_2100) 574#define IS_2200(isp) ((isp)->isp_type == ISP_HA_FC_2200) 575#define IS_23XX(isp) ((isp)->isp_type >= ISP_HA_FC_2300) 576#define IS_2300(isp) ((isp)->isp_type == ISP_HA_FC_2300) 577#define IS_2312(isp) ((isp)->isp_type == ISP_HA_FC_2312) |
578#define IS_2322(isp) ((isp)->isp_type == ISP_HA_FC_2322) 579#define IS_24XX(isp) ((isp)->isp_type >= ISP_HA_FC_2400) |
580 581/* 582 * DMA cookie macros 583 */ 584#ifdef ISP_DAC_SUPPORTRED 585#define DMA_WD3(x) (((x) >> 48) & 0xffff) 586#define DMA_WD2(x) (((x) >> 32) & 0xffff) 587#else --- 152 unchanged lines hidden (view full) --- 740 ISPASYNC_BUS_RESET, /* Bus Was Reset */ 741 ISPASYNC_LOOP_DOWN, /* FC Loop Down */ 742 ISPASYNC_LOOP_UP, /* FC Loop Up */ 743 ISPASYNC_LIP, /* LIP Received */ 744 ISPASYNC_LOOP_RESET, /* Loop Reset Received */ 745 ISPASYNC_CHANGE_NOTIFY, /* FC Change Notification */ 746 ISPASYNC_FABRIC_DEV, /* FC Fabric Device Arrival */ 747 ISPASYNC_PROMENADE, /* FC Objects coming && going */ |
748 ISPASYNC_TARGET_NOTIFY, /* target asynchronous notification event */ 749 ISPASYNC_TARGET_ACTION, /* target action requested */ |
750 ISPASYNC_CONF_CHANGE, /* Platform Configuration Change */ 751 ISPASYNC_UNHANDLED_RESPONSE, /* Unhandled Response Entry */ 752 ISPASYNC_FW_CRASH, /* Firmware has crashed */ 753 ISPASYNC_FW_DUMPED, /* Firmware crashdump taken */ 754 ISPASYNC_FW_RESTARTED /* Firmware has been restarted */ 755} ispasync_t; 756int isp_async(struct ispsoftc *, ispasync_t, void *); 757 --- 156 unchanged lines hidden --- |