ispvar.h (146073) | ispvar.h (154704) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 146073 2005-05-11 00:22:17Z mjacob $ */ | 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 * | 2/*- 3 * Soft Definitions for for Qlogic ISP SCSI adapters. 4 * |
5 * Copyright (c) 1997, 1998, 1999, 2000 by Matthew Jacob | 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. | 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 */ | 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 */ |
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 | 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 |
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 { | 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 { |
257 u_int32_t isp_fwoptions : 16, 258 isp_gbspeed : 2, | 254 u_int32_t : 13, 255 isp_gbspeed : 3, 256 : 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; | 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; |
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 # */ | 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 */ |
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 { | 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 { |
290 u_int32_t 291 port_type : 8, 292 loopid : 8, | 288 u_int32_t loopid : 16, 289 : 2, |
293 fc4_type : 4, 294 last_fabric_dev : 1, | 290 fc4_type : 4, 291 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, | 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, |
|
302 valid : 1; | 299 valid : 1; |
303 u_int32_t portid; | 300 u_int32_t port_type : 8, 301 portid : 24; |
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 */ | 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 */ |
417 volatile u_int16_t isp_mboxtmp[MAX_MAILBOX]; | 415 volatile u_int16_t isp_mboxtmp[MAILBOX_STORAGE]; |
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 | 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 |
|
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) | 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) |
|
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 */ | 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 */ |
745 ISPASYNC_TARGET_MESSAGE, /* target message */ 746 ISPASYNC_TARGET_EVENT, /* target asynchronous event */ 747 ISPASYNC_TARGET_ACTION, /* other target command action */ | 748 ISPASYNC_TARGET_NOTIFY, /* target asynchronous notification event */ 749 ISPASYNC_TARGET_ACTION, /* target action requested */ |
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 --- | 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 --- |