ispvar.h (48195) | ispvar.h (48484) |
---|---|
1/* $Id: ispvar.h,v 1.14 1999/05/11 05:02:23 mjacob Exp $ */ 2/* release_5_11_99+ */ | 1/* $Id: ispvar.h,v 1.15 1999/06/24 16:34:00 mjacob Exp $ */ 2/* release_6_2_99 */ |
3/* 4 * Soft Definitions for for Qlogic ISP SCSI adapters. 5 * 6 *--------------------------------------- | 3/* 4 * Soft Definitions for for Qlogic ISP SCSI adapters. 5 * 6 *--------------------------------------- |
7 * Copyright (c) 1997, 1998 by Matthew Jacob | 7 * Copyright (c) 1997, 1998, 1999 by Matthew Jacob |
8 * NASA/Ames Research Center 9 * All rights reserved. 10 *--------------------------------------- 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice immediately at the beginning of the file, without modification, --- 27 unchanged lines hidden (view full) --- 43#ifdef __FreeBSD__ 44#include <dev/isp/ispmbox.h> 45#endif 46#ifdef __linux__ 47#include "ispmbox.h" 48#endif 49 50#define ISP_CORE_VERSION_MAJOR 1 | 8 * NASA/Ames Research Center 9 * All rights reserved. 10 *--------------------------------------- 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice immediately at the beginning of the file, without modification, --- 27 unchanged lines hidden (view full) --- 43#ifdef __FreeBSD__ 44#include <dev/isp/ispmbox.h> 45#endif 46#ifdef __linux__ 47#include "ispmbox.h" 48#endif 49 50#define ISP_CORE_VERSION_MAJOR 1 |
51#define ISP_CORE_VERSION_MINOR 8 | 51#define ISP_CORE_VERSION_MINOR 9 |
52 53/* 54 * Vector for bus specific code to provide specific services. 55 */ 56struct ispsoftc; 57struct ispmdvec { 58 u_int16_t (*dv_rd_reg) __P((struct ispsoftc *, int)); 59 void (*dv_wr_reg) __P((struct ispsoftc *, int, u_int16_t)); --- 17 unchanged lines hidden (view full) --- 77}; 78 79#define MAX_TARGETS 16 80#ifdef ISP2100_FABRIC 81#define MAX_FC_TARG 256 82#else 83#define MAX_FC_TARG 126 84#endif | 52 53/* 54 * Vector for bus specific code to provide specific services. 55 */ 56struct ispsoftc; 57struct ispmdvec { 58 u_int16_t (*dv_rd_reg) __P((struct ispsoftc *, int)); 59 void (*dv_wr_reg) __P((struct ispsoftc *, int, u_int16_t)); --- 17 unchanged lines hidden (view full) --- 77}; 78 79#define MAX_TARGETS 16 80#ifdef ISP2100_FABRIC 81#define MAX_FC_TARG 256 82#else 83#define MAX_FC_TARG 126 84#endif |
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 90#define RESULT_QUEUE_LEN (MAXISPREQUEST/2) 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)) --- 62 unchanged lines hidden (view full) --- 156#define ISP_08M_SYNCPARMS 0x0c25 157#define ISP_05M_SYNCPARMS 0x0c32 158#define ISP_04M_SYNCPARMS 0x0c41 159 160/* 161 * Fibre Channel Specifics 162 */ 163typedef struct { | 85 86/* queue length must be a power of two */ 87#define QENTRY_LEN 64 88#define RQUEST_QUEUE_LEN MAXISPREQUEST 89#define RESULT_QUEUE_LEN (MAXISPREQUEST/2) 90#define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN)) 91#define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN) 92#define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1)) --- 62 unchanged lines hidden (view full) --- 155#define ISP_08M_SYNCPARMS 0x0c25 156#define ISP_05M_SYNCPARMS 0x0c32 157#define ISP_04M_SYNCPARMS 0x0c41 158 159/* 160 * Fibre Channel Specifics 161 */ 162typedef struct { |
164 u_int8_t isp_gotdparms; 165 u_int8_t isp_reserved; | 163 u_int isp_fwoptions : 16, 164 : 7, 165 loop_seen_once : 1, 166 isp_loopstate : 3, /* Current Loop State */ 167 isp_fwstate : 3, /* ISP F/W state */ 168 isp_gotdparms : 1, 169 isp_onfabric : 1; |
166 u_int8_t isp_loopid; /* hard loop id */ 167 u_int8_t isp_alpa; /* ALPA */ | 170 u_int8_t isp_loopid; /* hard loop id */ 171 u_int8_t isp_alpa; /* ALPA */ |
172 u_int32_t isp_portid; |
|
168 u_int8_t isp_execthrottle; 169 u_int8_t isp_retry_delay; 170 u_int8_t isp_retry_count; | 173 u_int8_t isp_execthrottle; 174 u_int8_t isp_retry_delay; 175 u_int8_t isp_retry_count; |
171 u_int8_t isp_fwstate; /* ISP F/W state */ 172 u_int64_t isp_wwn; /* WWN of adapter */ | |
173 u_int16_t isp_maxalloc; 174 u_int16_t isp_maxfrmlen; | 176 u_int16_t isp_maxalloc; 177 u_int16_t isp_maxfrmlen; |
175 u_int16_t isp_fwoptions; | 178 u_int64_t isp_nodewwn; 179 u_int64_t isp_portwwn; |
176 /* | 180 /* |
177 * Port Data Base | 181 * Port Data Base. This is indexed by 'target', which is invariate. 182 * However, elements within can move around due to loop changes, 183 * so the actual loop ID passed to the F/W is in this structure. 184 * The first time the loop is seen up, loopid will match the index 185 * (except for fabric nodes which are above mapped above FC_SNS_ID 186 * and are completely virtual), but subsequent LIPs can cause things 187 * to move around. |
178 */ | 188 */ |
179 isp_pdb_t isp_pdb[MAX_FC_TARG]; | 189 struct lportdb { 190 u_int 191 loopid : 8, 192 : 4, 193 fabdev : 1, 194 roles : 2, 195 valid : 1; 196 u_int32_t portid; 197 u_int64_t node_wwn; 198 u_int64_t port_wwn; 199 } portdb[MAX_FC_TARG]; |
180 181 /* 182 * Scratch DMA mapped in area to fetch Port Database stuff, etc. 183 */ 184 caddr_t isp_scratch; 185 u_int32_t isp_scdma; 186} fcparam; 187 | 200 201 /* 202 * Scratch DMA mapped in area to fetch Port Database stuff, etc. 203 */ 204 caddr_t isp_scratch; 205 u_int32_t isp_scdma; 206} fcparam; 207 |
188#define ISP2100_SCRLEN 0x100 | 208#define FW_CONFIG_WAIT 0 209#define FW_WAIT_AL_PA 1 210#define FW_WAIT_LOGIN 2 211#define FW_READY 3 212#define FW_LOSS_OF_SYNC 4 213#define FW_ERROR 5 214#define FW_REINIT 6 215#define FW_NON_PART 7 |
189 | 216 |
190#define FW_CONFIG_WAIT 0x0000 191#define FW_WAIT_AL_PA 0x0001 192#define FW_WAIT_LOGIN 0x0002 193#define FW_READY 0x0003 194#define FW_LOSS_OF_SYNC 0x0004 195#define FW_ERROR 0x0005 196#define FW_REINIT 0x0006 197#define FW_NON_PART 0x0007 | 217#define LOOP_NIL 0 218#define LOOP_LIP_RCVD 1 219#define LOOP_PDB_RCVD 2 220#define LOOP_READY 7 |
198 | 221 |
222#define FL_PORT_ID 0x7e /* FL_Port Special ID */ 223#define FC_PORT_ID 0x7f /* Fabric Controller Special ID */ 224#define FC_SNS_ID 0x80 /* SNS Server Special ID */ 225 |
|
199#ifdef ISP_TARGET_MODE 200/* 201 * Some temporary Target Mode definitions 202 */ 203typedef struct tmd_cmd { 204 u_int8_t cd_iid; /* initiator */ 205 u_int8_t cd_tgt; /* target */ 206 u_int8_t cd_lun; /* LUN for this command */ --- 127 unchanged lines hidden (view full) --- 334#define ISP_INITSTATE 2 335#define ISP_RUNSTATE 3 336 337/* 338 * ISP Configuration Options 339 */ 340#define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ 341#define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ | 226#ifdef ISP_TARGET_MODE 227/* 228 * Some temporary Target Mode definitions 229 */ 230typedef struct tmd_cmd { 231 u_int8_t cd_iid; /* initiator */ 232 u_int8_t cd_tgt; /* target */ 233 u_int8_t cd_lun; /* LUN for this command */ --- 127 unchanged lines hidden (view full) --- 361#define ISP_INITSTATE 2 362#define ISP_RUNSTATE 3 363 364/* 365 * ISP Configuration Options 366 */ 367#define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ 368#define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ |
369#define ISP_CFG_FULL_DUPLEX 0x01 /* Fibre Channel Only */ |
|
342 343#define ISP_FW_REV(maj, min, mic) ((maj << 24) | (min << 16) | mic) 344#define ISP_FW_REVX(xp) ((xp[0]<<24) | (xp[1] << 16) | xp[2]) 345 346 347/* 348 * Bus (implementation) types 349 */ --- 10 unchanged lines hidden (view full) --- 360#define ISP_HA_SCSI_1040 0x4 361#define ISP_HA_SCSI_1040A 0x5 362#define ISP_HA_SCSI_1040B 0x6 363#define ISP_HA_SCSI_1040C 0x7 364#define ISP_HA_SCSI_1080 0xd 365#define ISP_HA_SCSI_12X0 0xe 366#define ISP_HA_FC 0xf0 367#define ISP_HA_FC_2100 0x10 | 370 371#define ISP_FW_REV(maj, min, mic) ((maj << 24) | (min << 16) | mic) 372#define ISP_FW_REVX(xp) ((xp[0]<<24) | (xp[1] << 16) | xp[2]) 373 374 375/* 376 * Bus (implementation) types 377 */ --- 10 unchanged lines hidden (view full) --- 388#define ISP_HA_SCSI_1040 0x4 389#define ISP_HA_SCSI_1040A 0x5 390#define ISP_HA_SCSI_1040B 0x6 391#define ISP_HA_SCSI_1040C 0x7 392#define ISP_HA_SCSI_1080 0xd 393#define ISP_HA_SCSI_12X0 0xe 394#define ISP_HA_FC 0xf0 395#define ISP_HA_FC_2100 0x10 |
396#define ISP_HA_FC_2200 0x20 |
|
368 369#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI) 370#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080) 371#define IS_12X0(isp) (isp->isp_type == ISP_HA_SCSI_12X0) 372#define IS_FC(isp) (isp->isp_type & ISP_HA_FC) 373 374/* 375 * Macros to read, write ISP registers through bus specific code. --- 56 unchanged lines hidden (view full) --- 432/* 433 * Command Entry Point 434 */ 435int32_t ispscsicmd __P((ISP_SCSI_XFER_T *)); 436 437/* 438 * Platform Dependent to External to Internal Control Function 439 * | 397 398#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI) 399#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080) 400#define IS_12X0(isp) (isp->isp_type == ISP_HA_SCSI_12X0) 401#define IS_FC(isp) (isp->isp_type & ISP_HA_FC) 402 403/* 404 * Macros to read, write ISP registers through bus specific code. --- 56 unchanged lines hidden (view full) --- 461/* 462 * Command Entry Point 463 */ 464int32_t ispscsicmd __P((ISP_SCSI_XFER_T *)); 465 466/* 467 * Platform Dependent to External to Internal Control Function 468 * |
440 * For: Aborting a running command - arg is an ISP_SCSI_XFER_T * 441 * Resetting a Device - arg is target to reset 442 * Resetting a BUS - arg is ignored 443 * Updating parameters - arg is ignored | 469 * Assumes all locks are held and that no reentrancy issues need be dealt with. |
444 * | 470 * |
445 * First argument is this instance's softc pointer. 446 * Second argument is an index into xflist array. 447 * Assumes all locks must be held already. | |
448 */ 449typedef enum { | 471 */ 472typedef enum { |
450 ISPCTL_RESET_BUS, 451 ISPCTL_RESET_DEV, 452 ISPCTL_ABORT_CMD, 453 ISPCTL_UPDATE_PARAMS, 454 ISPCTL_FCLINK_TEST | 473 ISPCTL_RESET_BUS, /* Reset Bus */ 474 ISPCTL_RESET_DEV, /* Reset Device */ 475 ISPCTL_ABORT_CMD, /* Abort Command */ 476 ISPCTL_UPDATE_PARAMS, /* Update Operating Parameters */ 477 ISPCTL_FCLINK_TEST /* Test FC Link Status */ |
455} ispctl_t; 456int isp_control __P((struct ispsoftc *, ispctl_t, void *)); 457 458 459/* 460 * Platform Dependent to Internal to External Control Function 461 * (each platform must provide such a function) 462 * | 478} ispctl_t; 479int isp_control __P((struct ispsoftc *, ispctl_t, void *)); 480 481 482/* 483 * Platform Dependent to Internal to External Control Function 484 * (each platform must provide such a function) 485 * |
463 * For: Announcing Target Paramter Changes (arg is target) | 486 * Assumes all locks are held and that no reentrancy issues need be dealt with. |
464 * | 487 * |
465 * Assumes all locks are held. | |
466 */ 467 468typedef enum { 469 ISPASYNC_NEW_TGT_PARAMS, | 488 */ 489 490typedef enum { 491 ISPASYNC_NEW_TGT_PARAMS, |
470 ISPASYNC_BUS_RESET, /* Bus Reset */ 471 ISPASYNC_LOOP_DOWN, /* Obvious FC only */ 472 ISPASYNC_LOOP_UP, /* "" */ 473 ISPASYNC_PDB_CHANGE_COMPLETE, /* "" */ 474 ISPASYNC_CHANGE_NOTIFY /* "" */ | 492 ISPASYNC_BUS_RESET, /* Bus Was Reset */ 493 ISPASYNC_LOOP_DOWN, /* FC Loop Down */ 494 ISPASYNC_LOOP_UP, /* FC Loop Up */ 495 ISPASYNC_PDB_CHANGED, /* FC Port Data Base Changed */ 496 ISPASYNC_CHANGE_NOTIFY, /* FC SNS Change Notification */ 497 ISPASYNC_FABRIC_DEV, /* FC New Fabric Device */ |
475} ispasync_t; 476int isp_async __P((struct ispsoftc *, ispasync_t, void *)); 477 478/* 479 * lost command routine (XXXX IN TRANSITION XXXX) 480 */ 481void isp_lostcmd __P((struct ispsoftc *, ISP_SCSI_XFER_T *)); 482 483 484#endif /* _ISPVAR_H */ | 498} ispasync_t; 499int isp_async __P((struct ispsoftc *, ispasync_t, void *)); 500 501/* 502 * lost command routine (XXXX IN TRANSITION XXXX) 503 */ 504void isp_lostcmd __P((struct ispsoftc *, ISP_SCSI_XFER_T *)); 505 506 507#endif /* _ISPVAR_H */ |