ispvar.h (237537) | ispvar.h (238869) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/ispvar.h 237537 2012-06-24 17:30:54Z mjacob $ */ | 1/* $FreeBSD: head/sys/dev/isp/ispvar.h 238869 2012-07-28 20:06:29Z mjacob $ */ |
2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 62 unchanged lines hidden (view full) --- 72 uint16_t dv_clock; /* clock frequency */ 73}; 74 75/* 76 * Overall parameters 77 */ 78#define MAX_TARGETS 16 79#ifndef MAX_FC_TARG | 2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 62 unchanged lines hidden (view full) --- 72 uint16_t dv_clock; /* clock frequency */ 73}; 74 75/* 76 * Overall parameters 77 */ 78#define MAX_TARGETS 16 79#ifndef MAX_FC_TARG |
80#define MAX_FC_TARG 512 | 80#define MAX_FC_TARG 256 |
81#endif 82#define ISP_MAX_TARGETS(isp) (IS_FC(isp)? MAX_FC_TARG : MAX_TARGETS) 83#define ISP_MAX_LUNS(isp) (isp)->isp_maxluns 84 85/* 86 * Macros to access ISP registers through bus specific layers- 87 * mostly wrappers to vector through the mdvec structure. 88 */ --- 306 unchanged lines hidden (view full) --- 395 396 /* 397 * The dev_map_idx, if nonzero, is the system virtual target ID (+1) 398 * as a cross-reference with the isp_dev_map. 399 * 400 * A device is 'autologin' if the firmware automatically logs into 401 * it (re-logins as needed). Basically, local private loop devices. 402 * | 81#endif 82#define ISP_MAX_TARGETS(isp) (IS_FC(isp)? MAX_FC_TARG : MAX_TARGETS) 83#define ISP_MAX_LUNS(isp) (isp)->isp_maxluns 84 85/* 86 * Macros to access ISP registers through bus specific layers- 87 * mostly wrappers to vector through the mdvec structure. 88 */ --- 306 unchanged lines hidden (view full) --- 395 396 /* 397 * The dev_map_idx, if nonzero, is the system virtual target ID (+1) 398 * as a cross-reference with the isp_dev_map. 399 * 400 * A device is 'autologin' if the firmware automatically logs into 401 * it (re-logins as needed). Basically, local private loop devices. 402 * |
403 * PRLI word 3 parameters contains role as well as other things. 404 * |
|
403 * The state is the current state of this entry. 404 * | 405 * The state is the current state of this entry. 406 * |
405 * Role is Initiator, Target, Both 406 * | |
407 * Portid is obvious, as are node && port WWNs. The new_role and 408 * new_portid is for when we are pending a change. 409 * 410 * The 'target_mode' tag means that this entry arrived via a 411 * target mode command and is immune from normal flushing rules. 412 * You should also never see anything with an initiator role 413 * with this set. 414 */ | 407 * Portid is obvious, as are node && port WWNs. The new_role and 408 * new_portid is for when we are pending a change. 409 * 410 * The 'target_mode' tag means that this entry arrived via a 411 * target mode command and is immune from normal flushing rules. 412 * You should also never see anything with an initiator role 413 * with this set. 414 */ |
415 uint16_t prli_word3; /* PRLI parameters */ 416 uint16_t new_prli_word3; /* Incoming new PRLI parameters */ |
|
415 uint16_t dev_map_idx : 12, 416 autologin : 1, /* F/W does PLOGI/PLOGO */ 417 state : 3; | 417 uint16_t dev_map_idx : 12, 418 autologin : 1, /* F/W does PLOGI/PLOGO */ 419 state : 3; |
418 uint32_t reserved : 5, | 420 uint32_t : 7, |
419 target_mode : 1, | 421 target_mode : 1, |
420 roles : 2, | |
421 portid : 24; 422 uint32_t | 422 portid : 24; 423 uint32_t |
424 : 6, 425 announced : 1, |
|
423 dirty : 1, /* commands have been run */ | 426 dirty : 1, /* commands have been run */ |
424 new_reserved : 5, 425 new_roles : 2, | |
426 new_portid : 24; 427 uint64_t node_wwn; 428 uint64_t port_wwn; 429 uint32_t gone_timer; 430} fcportdb_t; 431 432#define FC_PORTDB_STATE_NIL 0 433#define FC_PORTDB_STATE_PROBATIONAL 1 --- 8 unchanged lines hidden (view full) --- 442 * FC card specific information 443 * 444 * This structure is replicated across multiple channels for multi-id 445 * capapble chipsets, with some entities different on a per-channel basis. 446 */ 447 448typedef struct { 449 uint32_t | 427 new_portid : 24; 428 uint64_t node_wwn; 429 uint64_t port_wwn; 430 uint32_t gone_timer; 431} fcportdb_t; 432 433#define FC_PORTDB_STATE_NIL 0 434#define FC_PORTDB_STATE_PROBATIONAL 1 --- 8 unchanged lines hidden (view full) --- 443 * FC card specific information 444 * 445 * This structure is replicated across multiple channels for multi-id 446 * capapble chipsets, with some entities different on a per-channel basis. 447 */ 448 449typedef struct { 450 uint32_t |
451 fctape_enabled : 1, |
|
450 link_active : 1, 451 sendmarker : 1, 452 role : 2, 453 isp_gbspeed : 4, 454 isp_loopstate : 4, /* Current Loop State */ 455 isp_fwstate : 4, /* ISP F/W state */ 456 isp_topo : 3, /* Connection Type */ 457 loop_seen_once : 1; --- 217 unchanged lines hidden (view full) --- 675#define ISP_CRASHED 1 676#define ISP_RESETSTATE 2 677#define ISP_INITSTATE 3 678#define ISP_RUNSTATE 4 679 680/* 681 * ISP Runtime Configuration Options 682 */ | 452 link_active : 1, 453 sendmarker : 1, 454 role : 2, 455 isp_gbspeed : 4, 456 isp_loopstate : 4, /* Current Loop State */ 457 isp_fwstate : 4, /* ISP F/W state */ 458 isp_topo : 3, /* Connection Type */ 459 loop_seen_once : 1; --- 217 unchanged lines hidden (view full) --- 677#define ISP_CRASHED 1 678#define ISP_RESETSTATE 2 679#define ISP_INITSTATE 3 680#define ISP_RUNSTATE 4 681 682/* 683 * ISP Runtime Configuration Options 684 */ |
683#define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ 684#define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ 685#define ISP_CFG_TWOGB 0x20 /* force 2GB connection (23XX only) */ 686#define ISP_CFG_ONEGB 0x10 /* force 1GB connection (23XX only) */ | |
687#define ISP_CFG_FULL_DUPLEX 0x01 /* Full Duplex (Fibre Channel only) */ | 685#define ISP_CFG_FULL_DUPLEX 0x01 /* Full Duplex (Fibre Channel only) */ |
688#define ISP_CFG_PORT_PREF 0x0C /* Mask for Port Prefs (2200 only) */ | 686#define ISP_CFG_PORT_PREF 0x0c /* Mask for Port Prefs (all FC except 2100) */ |
689#define ISP_CFG_LPORT 0x00 /* prefer {N/F}L-Port connection */ 690#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ 691#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ | 687#define ISP_CFG_LPORT 0x00 /* prefer {N/F}L-Port connection */ 688#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ 689#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ |
692#define ISP_CFG_LPORT_ONLY 0x0C /* insist on {N/F}L-Port connection */ | 690#define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */ 691#define ISP_CFG_ONEGB 0x10 /* force 1GB connection (23XX only) */ 692#define ISP_CFG_TWOGB 0x20 /* force 2GB connection (23XX only) */ 693#define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ 694#define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ 695#define ISP_CFG_NOFCTAPE 0x100 /* disable FC-Tape */ 696#define ISP_CFG_FCTAPE 0x200 /* enable FC-Tape */ |
693#define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */ 694#define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */ 695#define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */ 696#define ISP_CFG_FOURGB 0x2000 /* force 4GB connection (24XX only) */ 697#define ISP_CFG_EIGHTGB 0x4000 /* force 8GB connection (25XX only) */ | 697#define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */ 698#define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */ 699#define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */ 700#define ISP_CFG_FOURGB 0x2000 /* force 4GB connection (24XX only) */ 701#define ISP_CFG_EIGHTGB 0x4000 /* force 8GB connection (25XX only) */ |
702#define ISP_CFG_SIXTEENGB 0x8000 /* force 16GB connection (82XX only) */ |
|
698 699/* 700 * For each channel, the outer layers should know what role that channel 701 * will take: ISP_ROLE_NONE, ISP_ROLE_INITIATOR, ISP_ROLE_TARGET, 702 * ISP_ROLE_BOTH. 703 * 704 * If you set ISP_ROLE_NONE, the cards will be reset, new firmware loaded, 705 * NVRAM read, and defaults set, but any further initialization (e.g. --- 240 unchanged lines hidden (view full) --- 946 ISPASYNC_LIP, /* FC LIP Received */ 947 ISPASYNC_LOOP_RESET, /* FC Loop Reset Received */ 948 ISPASYNC_CHANGE_NOTIFY, /* FC Change Notification */ 949 ISPASYNC_DEV_ARRIVED, /* FC Device Arrived */ 950 ISPASYNC_DEV_CHANGED, /* FC Device Changed */ 951 ISPASYNC_DEV_STAYED, /* FC Device Stayed */ 952 ISPASYNC_DEV_GONE, /* FC Device Departure */ 953 ISPASYNC_TARGET_NOTIFY, /* All target async notification */ | 703 704/* 705 * For each channel, the outer layers should know what role that channel 706 * will take: ISP_ROLE_NONE, ISP_ROLE_INITIATOR, ISP_ROLE_TARGET, 707 * ISP_ROLE_BOTH. 708 * 709 * If you set ISP_ROLE_NONE, the cards will be reset, new firmware loaded, 710 * NVRAM read, and defaults set, but any further initialization (e.g. --- 240 unchanged lines hidden (view full) --- 951 ISPASYNC_LIP, /* FC LIP Received */ 952 ISPASYNC_LOOP_RESET, /* FC Loop Reset Received */ 953 ISPASYNC_CHANGE_NOTIFY, /* FC Change Notification */ 954 ISPASYNC_DEV_ARRIVED, /* FC Device Arrived */ 955 ISPASYNC_DEV_CHANGED, /* FC Device Changed */ 956 ISPASYNC_DEV_STAYED, /* FC Device Stayed */ 957 ISPASYNC_DEV_GONE, /* FC Device Departure */ 958 ISPASYNC_TARGET_NOTIFY, /* All target async notification */ |
959 ISPASYNC_TARGET_NOTIFY_ACK, /* All target notify ack required */ |
|
954 ISPASYNC_TARGET_ACTION, /* All target action requested */ 955 ISPASYNC_FW_CRASH, /* All Firmware has crashed */ 956 ISPASYNC_FW_RESTARTED /* All Firmware has been restarted */ 957} ispasync_t; 958void isp_async(ispsoftc_t *, ispasync_t, ...); 959 960#define ISPASYNC_CHANGE_PDB 0 961#define ISPASYNC_CHANGE_SNS 1 --- 20 unchanged lines hidden (view full) --- 982#define ISP_LOGCONFIG 0x1 /* log configuration messages */ 983#define ISP_LOGINFO 0x2 /* log informational messages */ 984#define ISP_LOGWARN 0x4 /* log warning messages */ 985#define ISP_LOGERR 0x8 /* log error messages */ 986#define ISP_LOGDEBUG0 0x10 /* log simple debug messages */ 987#define ISP_LOGDEBUG1 0x20 /* log intermediate debug messages */ 988#define ISP_LOGDEBUG2 0x40 /* log most debug messages */ 989#define ISP_LOGDEBUG3 0x80 /* log high frequency debug messages */ | 960 ISPASYNC_TARGET_ACTION, /* All target action requested */ 961 ISPASYNC_FW_CRASH, /* All Firmware has crashed */ 962 ISPASYNC_FW_RESTARTED /* All Firmware has been restarted */ 963} ispasync_t; 964void isp_async(ispsoftc_t *, ispasync_t, ...); 965 966#define ISPASYNC_CHANGE_PDB 0 967#define ISPASYNC_CHANGE_SNS 1 --- 20 unchanged lines hidden (view full) --- 988#define ISP_LOGCONFIG 0x1 /* log configuration messages */ 989#define ISP_LOGINFO 0x2 /* log informational messages */ 990#define ISP_LOGWARN 0x4 /* log warning messages */ 991#define ISP_LOGERR 0x8 /* log error messages */ 992#define ISP_LOGDEBUG0 0x10 /* log simple debug messages */ 993#define ISP_LOGDEBUG1 0x20 /* log intermediate debug messages */ 994#define ISP_LOGDEBUG2 0x40 /* log most debug messages */ 995#define ISP_LOGDEBUG3 0x80 /* log high frequency debug messages */ |
990#define ISP_LOGSANCFG 0x100 /* log SAN configuration */ | 996#define ISP_LOG_SANCFG 0x100 /* log SAN configuration */ |
991#define ISP_LOG_CWARN 0x200 /* log SCSI command "warnings" (e.g., check conditions) */ | 997#define ISP_LOG_CWARN 0x200 /* log SCSI command "warnings" (e.g., check conditions) */ |
998#define ISP_LOG_WARN1 0x400 /* log WARNS we might be interested at some time */ |
|
992#define ISP_LOGTINFO 0x1000 /* log informational messages (target mode) */ 993#define ISP_LOGTDEBUG0 0x2000 /* log simple debug messages (target mode) */ 994#define ISP_LOGTDEBUG1 0x4000 /* log intermediate debug messages (target) */ 995#define ISP_LOGTDEBUG2 0x8000 /* log all debug messages (target) */ 996 997/* 998 * Each Platform provides it's own isposinfo substructure of the ispsoftc 999 * defined above. --- 58 unchanged lines hidden (view full) --- 1058 * XS_CDBP(xs) gets a pointer to the scsi CDB "" 1059 * XS_CDBLEN(xs) gets the CDB's length "" 1060 * XS_XFRLEN(xs) gets the associated data transfer length "" 1061 * XS_TIME(xs) gets the time (in milliseconds) for this command 1062 * XS_GET_RESID(xs) gets the current residual count 1063 * XS_GET_RESID(xs, resid) sets the current residual count 1064 * XS_STSP(xs) gets a pointer to the SCSI status byte "" 1065 * XS_SNSP(xs) gets a pointer to the associate sense data | 999#define ISP_LOGTINFO 0x1000 /* log informational messages (target mode) */ 1000#define ISP_LOGTDEBUG0 0x2000 /* log simple debug messages (target mode) */ 1001#define ISP_LOGTDEBUG1 0x4000 /* log intermediate debug messages (target) */ 1002#define ISP_LOGTDEBUG2 0x8000 /* log all debug messages (target) */ 1003 1004/* 1005 * Each Platform provides it's own isposinfo substructure of the ispsoftc 1006 * defined above. --- 58 unchanged lines hidden (view full) --- 1065 * XS_CDBP(xs) gets a pointer to the scsi CDB "" 1066 * XS_CDBLEN(xs) gets the CDB's length "" 1067 * XS_XFRLEN(xs) gets the associated data transfer length "" 1068 * XS_TIME(xs) gets the time (in milliseconds) for this command 1069 * XS_GET_RESID(xs) gets the current residual count 1070 * XS_GET_RESID(xs, resid) sets the current residual count 1071 * XS_STSP(xs) gets a pointer to the SCSI status byte "" 1072 * XS_SNSP(xs) gets a pointer to the associate sense data |
1066 * XS_SNSLEN(xs) gets the length of sense data storage | 1073 * XS_TOT_SNSLEN(xs) gets the total length of sense data storage 1074 * XS_CUR_SNSLEN(xs) gets the currently used lenght of sense data storage |
1067 * XS_SNSKEY(xs) dereferences XS_SNSP to get the current stored Sense Key 1068 * XS_SNSASC(xs) dereferences XS_SNSP to get the current stored Additional Sense Code 1069 * XS_SNSASCQ(xs) dereferences XS_SNSP to get the current stored Additional Sense Code Qualifier 1070 * XS_TAG_P(xs) predicate of whether this command should be tagged 1071 * XS_TAG_TYPE(xs) which type of tag to use 1072 * XS_SETERR(xs) set error state 1073 * 1074 * HBA_NOERROR command has no erros --- 5 unchanged lines hidden (view full) --- 1080 * HBA_ABORTED command was aborted (by request) 1081 * HBA_DATAOVR a data overrun was detected 1082 * HBA_ARQFAIL Automatic Request Sense failed 1083 * 1084 * XS_ERR(xs) return current error state 1085 * XS_NOERR(xs) there is no error currently set 1086 * XS_INITERR(xs) initialize error state 1087 * | 1075 * XS_SNSKEY(xs) dereferences XS_SNSP to get the current stored Sense Key 1076 * XS_SNSASC(xs) dereferences XS_SNSP to get the current stored Additional Sense Code 1077 * XS_SNSASCQ(xs) dereferences XS_SNSP to get the current stored Additional Sense Code Qualifier 1078 * XS_TAG_P(xs) predicate of whether this command should be tagged 1079 * XS_TAG_TYPE(xs) which type of tag to use 1080 * XS_SETERR(xs) set error state 1081 * 1082 * HBA_NOERROR command has no erros --- 5 unchanged lines hidden (view full) --- 1088 * HBA_ABORTED command was aborted (by request) 1089 * HBA_DATAOVR a data overrun was detected 1090 * HBA_ARQFAIL Automatic Request Sense failed 1091 * 1092 * XS_ERR(xs) return current error state 1093 * XS_NOERR(xs) there is no error currently set 1094 * XS_INITERR(xs) initialize error state 1095 * |
1088 * XS_SAVE_SENSE(xs, sp, len) save sense data | 1096 * XS_SAVE_SENSE(xs, sp, total_len, this_len) save sense data (total and current amount) |
1089 * | 1097 * |
1098 * XS_APPEND_SENSE(xs, sp, len) append more sense data 1099 * |
|
1090 * XS_SENSE_VALID(xs) indicates whether sense is valid 1091 * 1092 * DEFAULT_FRAMESIZE(ispsoftc_t *) Default Frame Size 1093 * DEFAULT_EXEC_THROTTLE(ispsoftc_t *) Default Execution Throttle 1094 * 1095 * GET_DEFAULT_ROLE(ispsoftc_t *, int) Get Default Role for a channel 1096 * SET_DEFAULT_ROLE(ispsoftc_t *, int, int) Set Default Role for a channel 1097 * DEFAULT_IID(ispsoftc_t *, int) Default SCSI initiator ID --- 51 unchanged lines hidden (view full) --- 1149 * This function externalized acknowledging (success/fail) an ABTS frame 1150 */ 1151int isp_acknak_abts(ispsoftc_t *, void *, int); 1152 1153/* 1154 * Enable/Disable/Modify a logical unit. 1155 * (softc, cmd, bus, tgt, lun, cmd_cnt, inotify_cnt) 1156 */ | 1100 * XS_SENSE_VALID(xs) indicates whether sense is valid 1101 * 1102 * DEFAULT_FRAMESIZE(ispsoftc_t *) Default Frame Size 1103 * DEFAULT_EXEC_THROTTLE(ispsoftc_t *) Default Execution Throttle 1104 * 1105 * GET_DEFAULT_ROLE(ispsoftc_t *, int) Get Default Role for a channel 1106 * SET_DEFAULT_ROLE(ispsoftc_t *, int, int) Set Default Role for a channel 1107 * DEFAULT_IID(ispsoftc_t *, int) Default SCSI initiator ID --- 51 unchanged lines hidden (view full) --- 1159 * This function externalized acknowledging (success/fail) an ABTS frame 1160 */ 1161int isp_acknak_abts(ispsoftc_t *, void *, int); 1162 1163/* 1164 * Enable/Disable/Modify a logical unit. 1165 * (softc, cmd, bus, tgt, lun, cmd_cnt, inotify_cnt) 1166 */ |
1157#define DFLT_CMND_CNT 0xfe /* unmonitored */ 1158#define DFLT_INOT_CNT 0xfe /* unmonitored */ | 1167#define DFLT_CMND_CNT 0xff /* unmonitored */ 1168#define DFLT_INOT_CNT 0xff /* unmonitored */ |
1159int isp_lun_cmd(ispsoftc_t *, int, int, int, int, int); 1160 1161/* 1162 * General request queue 'put' routine for target mode entries. 1163 */ 1164int isp_target_put_entry(ispsoftc_t *isp, void *); 1165 1166/* --- 23 unchanged lines hidden --- | 1169int isp_lun_cmd(ispsoftc_t *, int, int, int, int, int); 1170 1171/* 1172 * General request queue 'put' routine for target mode entries. 1173 */ 1174int isp_target_put_entry(ispsoftc_t *isp, void *); 1175 1176/* --- 23 unchanged lines hidden --- |