diff options
author | Matt Jacob <mjacob@FreeBSD.org> | 2006-11-02 03:21:32 +0000 |
---|---|---|
committer | Matt Jacob <mjacob@FreeBSD.org> | 2006-11-02 03:21:32 +0000 |
commit | 10365e5a68725142a2a7effaec46ca1d8f5b273a (patch) | |
tree | 51750d8ca50a883d32c721be30cbb55cbe2c28c8 /sys/dev/isp/ispmbox.h | |
parent | 657669576694b95bd1ea4df0d3b94b9245f5e1c4 (diff) | |
download | src-10365e5a68725142a2a7effaec46ca1d8f5b273a.tar.gz src-10365e5a68725142a2a7effaec46ca1d8f5b273a.zip |
Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.
Notes
Notes:
svn path=/head/; revision=163899
Diffstat (limited to 'sys/dev/isp/ispmbox.h')
-rw-r--r-- | sys/dev/isp/ispmbox.h | 620 |
1 files changed, 492 insertions, 128 deletions
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h index 2ef8d51e42d7..a4461c724066 100644 --- a/sys/dev/isp/ispmbox.h +++ b/sys/dev/isp/ispmbox.h @@ -44,7 +44,7 @@ #define MBOX_ABOUT_FIRMWARE 0x0008 /* 9 */ /* a */ - /* b */ +#define MBOX_LOAD_RISC_RAM 0x000b /* c */ #define MBOX_WRITE_RAM_WORD_EXTENDED 0x000d #define MBOX_CHECK_FIRMWARE 0x000e @@ -123,6 +123,7 @@ #define MBOX_GET_FIRMWARE_OPTIONS 0x0028 #define MBOX_SET_FIRMWARE_OPTIONS 0x0038 #define MBOX_GET_RESOURCE_COUNT 0x0042 +#define MBOX_REQUEST_OFFLINE_MODE 0x0043 #define MBOX_ENHANCED_GET_PDB 0x0047 #define MBOX_EXEC_COMMAND_IOCB_A64 0x0054 #define MBOX_INIT_FIRMWARE 0x0060 @@ -148,12 +149,14 @@ #define MBOX_DRIVER_HEARTBEAT 0x005B #define MBOX_FW_HEARTBEAT 0x005C -#define MBOX_GET_SET_DATA_RATE 0x005D /* 23XX only */ -#define MBGSD_GET_RATE 0 -#define MBGSD_SET_RATE 1 +#define MBOX_GET_SET_DATA_RATE 0x005D /* 24XX/23XX only */ +#define MBGSD_GET_RATE 0 +#define MBGSD_SET_RATE 1 +#define MBGSD_SET_RATE_NOW 2 /* 24XX only */ #define MBGSD_ONEGB 0 #define MBGSD_TWOGB 1 #define MBGSD_AUTO 2 +#define MBGSD_FOURGB 3 /* 24XX only */ #define ISP2100_SET_PCI_PARAM 0x00ff @@ -173,6 +176,10 @@ #define MBOX_LOOP_ID_USED 0x4008 #define MBOX_ALL_IDS_USED 0x4009 #define MBOX_NOT_LOGGED_IN 0x400A +/* pseudo mailbox completion codes */ +#define MBOX_REGS_BUSY 0x6000 /* registers in use */ +#define MBOX_TIMEOUT 0x6001 /* command timed out */ + #define MBLOGALL 0x000f #define MBLOGNONE 0x0000 #define MBLOGMASK(x) ((x) & 0xf) @@ -199,6 +206,8 @@ #define ASYNC_PDB_CHANGED 0x8014 #define ASYNC_CHANGE_NOTIFY 0x8015 #define ASYNC_LIP_F8 0x8016 +#define ASYNC_LIP_ERROR 0x8017 +#define ASYNC_SECURITY_UPDATE 0x801B #define ASYNC_CMD_CMPLT 0x8020 #define ASYNC_CTIO_DONE 0x8021 #define ASYNC_IP_XMIT_DONE 0x8022 @@ -221,6 +230,8 @@ #define ISP_CONN_LOOPBACK 5 #define ASYNC_RIO_RESP 0x8040 #define ASYNC_RIO_COMP 0x8042 +#define ASYNC_RCV_ERR 0x8048 + /* * 2.01.31 2200 Only. Need Bit 13 in Mailbox 1 for Set Firmware Options * mailbox command to enable this. @@ -228,20 +239,14 @@ #define ASYNC_QFULL_SENT 0x8049 /* - * Mailbox Usages + * 24XX only */ +#define ASYNC_RJT_SENT 0x8049 -#define WRITE_REQUEST_QUEUE_IN_POINTER(isp, value) \ - ISP_WRITE(isp, isp->isp_rqstinrp, value) - -#define READ_REQUEST_QUEUE_OUT_POINTER(isp) \ - ISP_READ(isp, isp->isp_rqstoutrp) - -#define READ_RESPONSE_QUEUE_IN_POINTER(isp) \ - ISP_READ(isp, isp->isp_respinrp) - -#define WRITE_RESPONSE_QUEUE_OUT_POINTER(isp, value) \ - ISP_WRITE(isp, isp->isp_respoutrp, value) +/* + * All IOCB Queue entries are this size + */ +#define QENTRY_LEN 64 /* * Command Structure Definitions @@ -288,6 +293,7 @@ typedef struct { #define RQSFLAG_FULL 0x02 #define RQSFLAG_BADHEADER 0x04 #define RQSFLAG_BADPACKET 0x08 +#define RQSFLAG_MASK 0x0f /* RQS entry_type definitions */ #define RQSTYPE_REQUEST 0x01 @@ -307,11 +313,13 @@ typedef struct { #define RQSTYPE_CTIO1 0x0f /* Target Mode */ #define RQSTYPE_STATUS_CONT 0x10 #define RQSTYPE_T2RQS 0x11 +#define RQSTYPE_CTIO7 0x12 #define RQSTYPE_IP_XMIT 0x13 +#define RQSTYPE_TSK_MGMT 0x14 #define RQSTYPE_T4RQS 0x15 #define RQSTYPE_ATIO2 0x16 /* Target Mode */ #define RQSTYPE_CTIO2 0x17 /* Target Mode */ -#define RQSTYPE_CSET0 0x18 +#define RQSTYPE_T7RQS 0x18 #define RQSTYPE_T3RQS 0x19 #define RQSTYPE_IP_XMIT_64 0x1b #define RQSTYPE_CTIO4 0x1e /* Target Mode */ @@ -320,6 +328,12 @@ typedef struct { #define RQSTYPE_RIO2 0x22 #define RQSTYPE_IP_RECV 0x23 #define RQSTYPE_IP_RECV_CONT 0x24 +#define RQSTYPE_CT_PASSTHRU 0x29 +#define RQSTYPE_ABORT_IO 0x33 +#define RQSTYPE_T6RQS 0x48 +#define RQSTYPE_LOGIN 0x52 +#define RQSTYPE_ABTS_RCVD 0x54 /* 24XX only */ +#define RQSTYPE_ABTS_RSP 0x55 /* 24XX only */ #define ISP_RQDSEG 4 @@ -329,7 +343,6 @@ typedef struct { uint8_t req_lun_trn; uint8_t req_target; uint16_t req_cdblen; -#define req_modifier req_cdblen /* marker packet */ uint16_t req_flags; uint16_t req_reserved; uint16_t req_time; @@ -337,13 +350,33 @@ typedef struct { uint8_t req_cdb[12]; ispds_t req_dataseg[ISP_RQDSEG]; } ispreq_t; - -#define ispreq64_t ispreqt3_t /* same as.... */ #define ISP_RQDSEG_A64 2 -/* - * A request packet can also be a marker packet. - */ +typedef struct { + isphdr_t mrk_header; + uint32_t mrk_handle; + uint8_t mrk_reserved0; + uint8_t mrk_target; + uint16_t mrk_modifier; + uint16_t mrk_flags; + uint16_t mrk_lun; + uint8_t mrk_reserved1[48]; +} isp_marker_t; + +typedef struct { + isphdr_t mrk_header; + uint32_t mrk_handle; + uint16_t mrk_nphdl; + uint8_t mrk_modifier; + uint8_t mrk_reserved0; + uint8_t mrk_reserved1; + uint8_t mrk_vphdl; + uint16_t mrk_reserved2; + uint8_t mrk_lun[8]; + uint8_t mrk_reserved3[40]; +} isp_marker_24xx_t; + + #define SYNC_DEVICE 0 #define SYNC_TARGET 1 #define SYNC_ALL 2 @@ -357,7 +390,7 @@ typedef struct { uint8_t req_target; uint16_t req_scclun; uint16_t req_flags; - uint16_t _res2; + uint16_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[16]; @@ -371,7 +404,7 @@ typedef struct { uint16_t req_target; uint16_t req_scclun; uint16_t req_flags; - uint16_t _res2; + uint16_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[16]; @@ -387,13 +420,14 @@ typedef struct { uint8_t req_target; uint16_t req_scclun; uint16_t req_flags; - uint16_t _res2; + uint16_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[16]; uint32_t req_totalcnt; ispds64_t req_dataseg[ISP_RQDSEG_T3]; } ispreqt3_t; +#define ispreq64_t ispreqt3_t /* same as.... */ typedef struct { isphdr_t req_header; @@ -401,7 +435,7 @@ typedef struct { uint16_t req_target; uint16_t req_scclun; uint16_t req_flags; - uint16_t _res2; + uint16_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[16]; @@ -437,16 +471,86 @@ typedef struct { uint8_t req_target; uint16_t req_cdblen; uint16_t req_flags; - uint16_t _res1; + uint16_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[44]; } ispextreq_t; +/* 24XX only */ +typedef struct { + uint16_t fcd_length; + uint16_t fcd_a1500; + uint16_t fcd_a3116; + uint16_t fcd_a4732; + uint16_t fcd_a6348; +} fcp_cmnd_ds_t; + +typedef struct { + isphdr_t req_header; + uint32_t req_handle; + uint16_t req_nphdl; + uint16_t req_time; + uint16_t req_seg_count; + uint16_t req_fc_rsp_dsd_length; + uint8_t req_lun[8]; + uint16_t req_flags; + uint16_t req_fc_cmnd_dsd_length; + uint16_t req_fc_cmnd_dsd_a1500; + uint16_t req_fc_cmnd_dsd_a3116; + uint16_t req_fc_cmnd_dsd_a4732; + uint16_t req_fc_cmnd_dsd_a6348; + uint16_t req_fc_rsp_dsd_a1500; + uint16_t req_fc_rsp_dsd_a3116; + uint16_t req_fc_rsp_dsd_a4732; + uint16_t req_fc_rsp_dsd_a6348; + uint32_t req_totalcnt; + uint16_t req_tidlo; + uint8_t req_tidhi; + uint8_t req_vpidx; + ispds64_t req_dataseg; +} ispreqt6_t; + +typedef struct { + isphdr_t req_header; + uint32_t req_handle; + uint16_t req_nphdl; + uint16_t req_time; + uint16_t req_seg_count; + uint16_t req_reserved; + uint8_t req_lun[8]; + uint8_t req_alen_datadir; + uint8_t req_task_management; + uint8_t req_task_attribute; + uint8_t req_crn; + uint8_t req_cdb[16]; + uint32_t req_dl; + uint16_t req_tidlo; + uint8_t req_tidhi; + uint8_t req_vpidx; + ispds64_t req_dataseg; +} ispreqt7_t; + +/* I/O Abort Structure */ +typedef struct { + isphdr_t abrt_header; + uint32_t abrt_handle; + uint16_t abrt_nphdl; + uint16_t abrt_options; + uint32_t abrt_cmd_handle; + uint8_t abrt_reserved[32]; + uint16_t abrt_tidlo; + uint8_t abrt_tidhi; + uint8_t abrt_vpidx; + uint8_t abrt_reserved1[12]; +} isp24xx_abrt_t; +#define ISP24XX_ABRT_NO_ABTS 0x01 /* don't actually send an ABTS */ +#define ISP24XX_ABRT_ENXIO 0x31 /* in nphdl on return */ + #define ISP_CDSEG 7 typedef struct { isphdr_t req_header; - uint32_t _res1; + uint32_t req_reserved; ispds_t req_dataseg[ISP_CDSEG]; } ispcontreq_t; @@ -471,11 +575,33 @@ typedef struct { uint8_t req_sense_data[32]; } ispstatusreq_t; +/* + * Status Continuation + */ typedef struct { isphdr_t req_header; uint8_t req_sense_data[60]; } ispstatus_cont_t; +/* + * 24XX Type 0 status + */ +typedef struct { + isphdr_t req_header; + uint32_t req_handle; + uint16_t req_completion_status; + uint16_t req_oxid; + uint32_t req_resid; + uint16_t req_reserved0; + uint16_t req_state_flags; + uint16_t req_reserved1; + uint16_t req_scsi_status; + uint32_t req_fcp_residual; + uint32_t req_sense_len; + uint32_t req_response_len; + uint8_t req_rsp_sense[28]; +} isp24xx_statusreq_t; + /* * For Qlogic 2X00, the high order byte of SCSI status has * additional meaning. @@ -486,6 +612,25 @@ typedef struct { #define RQCS_SV 0x200 /* Sense Length Valid */ #define RQCS_RV 0x100 /* FCP Response Length Valid */ +/* + * CT Passthru IOCB + */ +typedef struct { + isphdr_t ctp_header; + uint32_t ctp_handle; + uint16_t ctp_status; + uint16_t ctp_nphdl; /* n-port handle */ + uint16_t ctp_cmd_cnt; /* Command DSD count */ + uint16_t ctp_vpidx; /* low 8 bits */ + uint16_t ctp_time; + uint16_t ctp_reserved0; + uint16_t ctp_rsp_cnt; /* Response DSD count */ + uint16_t ctp_reserved1[5]; + uint32_t ctp_rsp_bcnt; /* Response byte count */ + uint32_t ctp_cmd_bcnt; /* Command byte count */ + ispds64_t ctp_dataseg[2]; +} isp_ct_pt_t; + /* * Completion Status Codes. */ @@ -530,6 +675,13 @@ typedef struct { #define RQCS_PORT_CHANGED 0x002A #define RQCS_PORT_BUSY 0x002B +/* 24XX Only Completion Codes */ +#define RQCS_24XX_DRE 0x0011 /* data reassembly error */ +#define RQCS_24XX_TABORT 0x0013 /* aborted by target */ +#define RQCS_24XX_ENOMEM 0x002C /* f/w resource unavailable */ +#define RQCS_24XX_TMO 0x0030 /* task management overrun */ + + /* * 1X00 specific State Flags */ @@ -587,6 +739,7 @@ typedef struct { /* * About Firmware returns an 'attribute' word in mailbox 6. + * These attributes are for 2200 and 2300. */ #define ISP_FW_ATTR_TMODE 0x01 #define ISP_FW_ATTR_SCCLUN 0x02 @@ -598,8 +751,14 @@ typedef struct { #define ISP_FW_ATTR_VI_SOLARIS 0x80 #define ISP_FW_ATTR_2KLOGINS 0x100 /* XXX: just a guess */ -#define IS_2KLOGIN(isp) \ - (IS_FC(isp) && (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_2KLOGINS)) +/* and these are for the 2400 */ +#define ISP2400_FW_ATTR_CLASS2 (1 << 0) +#define ISP2400_FW_ATTR_IP (1 << 1) +#define ISP2400_FW_ATTR_MULTIID (1 << 2) +#define ISP2400_FW_ATTR_SB2 (1 << 3) +#define ISP2400_FW_ATTR_T10CRC (1 << 4) +#define ISP2400_FW_ATTR_VI (1 << 5) +#define ISP2400_FW_ATTR_EXPFW (1 << 13) /* * Reduced Interrupt Operation Response Queue Entreis @@ -616,7 +775,7 @@ typedef struct { } isp_rio2_t; /* - * FC (ISP2100) specific data structures + * FC (ISP2100/ISP2200/ISP2300/ISP2400) specific data structures */ /* @@ -624,9 +783,9 @@ typedef struct { * * Version One (prime) format. */ -typedef struct isp_icb { +typedef struct { uint8_t icb_version; - uint8_t _reserved0; + uint8_t icb_reserved0; uint16_t icb_fwoptions; uint16_t icb_maxfrmlen; uint16_t icb_maxalloc; @@ -648,42 +807,48 @@ typedef struct isp_icb { uint8_t icb_ccnt; uint8_t icb_icnt; uint16_t icb_lunetimeout; - uint16_t _reserved1; + uint16_t icb_reserved1; uint16_t icb_xfwoptions; uint8_t icb_racctimer; uint8_t icb_idelaytimer; uint16_t icb_zfwoptions; - uint16_t _reserved2[13]; + uint16_t icb_reserved2[13]; } isp_icb_t; + #define ICB_VERSION1 1 -#define ICBOPT_HARD_ADDRESS 0x0001 -#define ICBOPT_FAIRNESS 0x0002 -#define ICBOPT_FULL_DUPLEX 0x0004 -#define ICBOPT_FAST_POST 0x0008 -#define ICBOPT_TGT_ENABLE 0x0010 -#define ICBOPT_INI_DISABLE 0x0020 -#define ICBOPT_INI_ADISC 0x0040 -#define ICBOPT_INI_TGTTYPE 0x0080 -#define ICBOPT_PDBCHANGE_AE 0x0100 -#define ICBOPT_NOLIP 0x0200 -#define ICBOPT_SRCHDOWN 0x0400 -#define ICBOPT_PREVLOOP 0x0800 -#define ICBOPT_STOP_ON_QFULL 0x1000 -#define ICBOPT_FULL_LOGIN 0x2000 -#define ICBOPT_BOTH_WWNS 0x4000 #define ICBOPT_EXTENDED 0x8000 +#define ICBOPT_BOTH_WWNS 0x4000 +#define ICBOPT_FULL_LOGIN 0x2000 +#define ICBOPT_STOP_ON_QFULL 0x1000 /* 2200/2100 only */ +#define ICBOPT_PREVLOOP 0x0800 +#define ICBOPT_SRCHDOWN 0x0400 +#define ICBOPT_NOLIP 0x0200 +#define ICBOPT_PDBCHANGE_AE 0x0100 +#define ICBOPT_INI_TGTTYPE 0x0080 +#define ICBOPT_INI_ADISC 0x0040 +#define ICBOPT_INI_DISABLE 0x0020 +#define ICBOPT_TGT_ENABLE 0x0010 +#define ICBOPT_FAST_POST 0x0008 +#define ICBOPT_FULL_DUPLEX 0x0004 +#define ICBOPT_FAIRNESS 0x0002 +#define ICBOPT_HARD_ADDRESS 0x0001 +#define ICBXOPT_NO_LOGOUT 0x8000 /* no logout on link failure */ +#define ICBXOPT_FCTAPE_CCQ 0x4000 /* FC-Tape Command Queueing */ +#define ICBXOPT_FCTAPE_CONFIRM 0x2000 +#define ICBXOPT_FCTAPE 0x1000 #define ICBXOPT_CLASS2_ACK0 0x0200 #define ICBXOPT_CLASS2 0x0100 -#define ICBXOPT_LOOP_ONLY (0 << 4) -#define ICBXOPT_PTP_ONLY (1 << 4) -#define ICBXOPT_LOOP_2_PTP (2 << 4) -#define ICBXOPT_PTP_2_LOOP (3 << 4) - +#define ICBXOPT_NO_PLAY 0x0080 /* don't play if can't get hard addr */ +#define ICBXOPT_TOPO_MASK 0x0070 +#define ICBXOPT_LOOP_ONLY 0x0000 +#define ICBXOPT_PTP_ONLY 0x0010 +#define ICBXOPT_LOOP_2_PTP 0x0020 +#define ICBXOPT_PTP_2_LOOP 0x0030 /* * The lower 4 bits of the xfwoptions field are the OPERATION MODE bits. - * RIO is not defined for the 23XX cards + * RIO is not defined for the 23XX cards (just 2200) */ #define ICBXOPT_RIO_OFF 0 #define ICBXOPT_RIO_16BIT 1 @@ -693,14 +858,60 @@ typedef struct isp_icb { #define ICBXOPT_ZIO 5 #define ICBXOPT_TIMER_MASK 0x7 -#define ICBZOPT_ENA_RDXFR_RDY 0x01 -#define ICBZOPT_ENA_OOF (1 << 6) /* out of order frame handling */ -#define ICBZOPT_50_OHM 0x0200 -/* These 3 only apply to the 2300 */ -#define ICBZOPT_RATE_ONEGB (MBGSD_ONEGB << 14) -#define ICBZOPT_RATE_TWOGB (MBGSD_TWOGB << 14) -#define ICBZOPT_RATE_AUTO (MBGSD_AUTO << 14) - +#define ICBZOPT_RATE_MASK 0xC000 +#define ICBZOPT_RATE_ONEGB 0x0000 +#define ICBZOPT_RATE_AUTO 0x8000 +#define ICBZOPT_RATE_TWOGB 0x4000 +#define ICBZOPT_50_OHM 0x2000 +#define ICBZOPT_ENA_OOF 0x0040 /* out of order frame handling */ +#define ICBZOPT_RSPSZ_MASK 0x0030 +#define ICBZOPT_RSPSZ_24 0x0000 +#define ICBZOPT_RSPSZ_12 0x0010 +#define ICBZOPT_RSPSZ_24A 0x0020 +#define ICBZOPT_RSPSZ_32 0x0030 +#define ICBZOPT_SOFTID 0x0002 +#define ICBZOPT_ENA_RDXFR_RDY 0x0001 + +/* 2400 F/W options */ +#define ICB2400_OPT1_BOTH_WWNS 0x00004000 +#define ICB2400_OPT1_FULL_LOGIN 0x00002000 +#define ICB2400_OPT1_PREVLOOP 0x00000800 +#define ICB2400_OPT1_SRCHDOWN 0x00000400 +#define ICB2400_OPT1_NOLIP 0x00000200 +#define ICB2400_OPT1_INI_DISABLE 0x00000020 +#define ICB2400_OPT1_TGT_ENABLE 0x00000010 +#define ICB2400_OPT1_FULL_DUPLEX 0x00000004 +#define ICB2400_OPT1_FAIRNESS 0x00000002 +#define ICB2400_OPT1_HARD_ADDRESS 0x00000001 + +#define ICB2400_OPT2_FCTAPE 0x00001000 +#define ICB2400_OPT2_CLASS2_ACK0 0x00000200 +#define ICB2400_OPT2_CLASS2 0x00000100 +#define ICB2400_OPT2_NO_PLAY 0x00000080 +#define ICB2400_OPT2_TOPO_MASK 0x00000070 +#define ICB2400_OPT2_LOOP_ONLY 0x00000000 +#define ICB2400_OPT2_PTP_ONLY 0x00000010 +#define ICB2400_OPT2_LOOP_2_PTP 0x00000020 +#define ICB2400_OPT2_PTP_2_LOOP 0x00000030 +#define ICB2400_OPT2_TIMER_MASK 0x00000007 +#define ICB2400_OPT2_ZIO 0x00000005 +#define ICB2400_OPT2_ZIO1 0x00000006 + +#define ICB2400_OPT3_75_OHM 0x00010000 +#define ICB2400_OPT3_RATE_MASK 0x0000E000 +#define ICB2400_OPT3_RATE_ONEGB 0x00000000 +#define ICB2400_OPT3_RATE_TWOGB 0x00002000 +#define ICB2400_OPT3_RATE_AUTO 0x00004000 +#define ICB2400_OPT3_RATE_FOURGB 0x00006000 +#define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 +#define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 +#define ICB2400_OPT3_ENA_OOF 0x00000040 +/* note that a response size flag of zero is reserved! */ +#define ICB2400_OPT3_RSPSZ_MASK 0x00000030 +#define ICB2400_OPT3_RSPSZ_12 0x00000010 +#define ICB2400_OPT3_RSPSZ_24 0x00000020 +#define ICB2400_OPT3_RSPSZ_32 0x00000030 +#define ICB2400_OPT3_SOFTID 0x00000002 #define ICB_MIN_FRMLEN 256 #define ICB_MAX_FRMLEN 2112 @@ -714,6 +925,41 @@ typedef struct isp_icb { #define ICB_LUN_ENABLE_TOV 180 +/* + * And somebody at QLogic had a great idea that you could just change + * the structure *and* keep the version number the same as the other cards. + */ +typedef struct { + uint16_t icb_version; + uint16_t icb_reserved0; + uint16_t icb_maxfrmlen; + uint16_t icb_execthrottle; + uint16_t icb_xchgcnt; + uint16_t icb_hardaddr; + uint8_t icb_portname[8]; + uint8_t icb_nodename[8]; + uint16_t icb_rspnsin; + uint16_t icb_rqstout; + uint16_t icb_retry_count; + uint16_t icb_priout; + uint16_t icb_rsltqlen; + uint16_t icb_rqstqlen; + uint16_t icb_ldn_nols; + uint16_t icb_prqstqlen; + uint16_t icb_rqstaddr[4]; + uint16_t icb_respaddr[4]; + uint16_t icb_priaddr[4]; + uint16_t icb_reserved1[4]; + uint16_t icb_atio_in; + uint16_t icb_atioqlen; + uint16_t icb_atioqaddr[4]; + uint16_t icb_idelaytimer; + uint16_t icb_logintime; + uint32_t icb_fwoptions1; + uint32_t icb_fwoptions2; + uint32_t icb_fwoptions3; + uint16_t icb_reserved2[12]; +} isp_icb_2400_t; #define RQRSP_ADDR0015 0 #define RQRSP_ADDR1631 1 @@ -751,22 +997,6 @@ typedef struct isp_icb { ((uint64_t) array[ICB_NNM7] << 56) /* - * FC-AL Position Map - * - * This is an at most 128 byte map that returns either - * the LILP or Firmware generated list of ports. - * - * We deviate a bit from the returned qlogic format to - * use an extra bit to say whether this was a LILP or - * f/w generated map. - */ -typedef struct { - uint8_t fwmap : 1, - count : 7; - uint8_t map[127]; -} fcpos_map_t; - -/* * Port Data Base Element */ @@ -774,7 +1004,6 @@ typedef struct { uint16_t pdb_options; uint8_t pdb_mstate; uint8_t pdb_sstate; -#define BITS2WORD(x) ((x)[0] << 16 | (x)[3] << 8 | (x)[2]) uint8_t pdb_hardaddr_bits[4]; uint8_t pdb_portid_bits[4]; uint8_t pdb_nodename[8]; @@ -810,7 +1039,7 @@ typedef struct { uint16_t pdb_loopid; uint16_t pdb_il_ptr; uint16_t pdb_sl_ptr; -} isp_pdb_t; +} isp_pdb_21xx_t; #define PDB_OPTIONS_XMITTING (1<<11) #define PDB_OPTIONS_LNKXMIT (1<<10) @@ -835,35 +1064,109 @@ typedef struct { #define SVC3_ROLE_MASK 0x30 #define SVC3_ROLE_SHIFT 4 +#define BITS2WORD(x) ((x)[0] << 16 | (x)[3] << 8 | (x)[2]) +#define BITS2WORD_24XX(x) ((x)[0] << 16 | (x)[1] << 8 | (x)[2]) + /* - * CT definition - * - * This is as the QLogic f/w documentations defines it- which is just opposite, - * bit wise, from what the specification defines it as. Additionally, the - * ct_response and ct_resid (really from FC-GS-2) need to be byte swapped. - */ - -typedef struct { - uint8_t ct_revision; - uint8_t ct_portid[3]; - uint8_t ct_fcs_type; - uint8_t ct_fcs_subtype; - uint8_t ct_options; - uint8_t ct_res0; - uint16_t ct_response; - uint16_t ct_resid; - uint8_t ct_res1; - uint8_t ct_reason; - uint8_t ct_explanation; - uint8_t ct_vunique; -} ct_hdr_t; -#define FS_ACC 0x8002 -#define FS_RJT 0x8001 - -#define FC4_IP 5 /* ISO/EEC 8802-2 LLC/SNAP "Out of Order Delivery" */ -#define FC4_SCSI 8 /* SCSI-3 via Fivre Channel Protocol (FCP) */ -#define FC4_FC_SVC 0x20 /* Fibre Channel Services */ + * Port Data Base Element- 24XX cards + */ +typedef struct { + uint16_t pdb_flags; + uint8_t pdb_curstate; + uint8_t pdb_laststate; + uint8_t pdb_hardaddr_bits[4]; + uint8_t pdb_portid_bits[4]; +#define pdb_nxt_seqid_2400 pdb_portid_bits[3] + uint16_t pdb_retry_timer; + uint16_t pdb_handle; + uint16_t pdb_rcv_dsize; + uint16_t pdb_reserved0; + uint16_t pdb_prli_svc0; + uint16_t pdb_prli_svc3; + uint8_t pdb_portname[8]; + uint8_t pdb_nodename[8]; + uint8_t pdb_reserved1[24]; +} isp_pdb_24xx_t; + +#define PDB2400_TID_SUPPORTED 0x4000 +#define PDB2400_FC_TAPE 0x0080 +#define PDB2400_CLASS2_ACK0 0x0040 +#define PDB2400_FCP_CONF 0x0020 +#define PDB2400_CLASS2 0x0010 +#define PDB2400_ADDR_VALID 0x0002 +/* + * Common elements from the above two structures that are actually useful to us. + */ +typedef struct { + uint16_t handle; + uint16_t reserved; + uint32_t s3_role : 8, + portid : 24; + uint8_t portname[8]; + uint8_t nodename[8]; +} isp_pdb_t; + +/* + * ISP24XX- Login/Logout Port IOCB + */ +typedef struct { + isphdr_t plogx_header; + uint32_t plogx_handle; + uint16_t plogx_status; + uint16_t plogx_nphdl; + uint16_t plogx_flags; + uint16_t plogx_vphdl; /* low 8 bits */ + uint16_t plogx_portlo; /* low 16 bits */ + uint16_t plogx_rspsz_porthi; + struct { + uint16_t lo16; + uint16_t hi16; + } plogx_ioparm[11]; +} isp_plogx_t; + +#define PLOGX_STATUS_OK 0x00 +#define PLOGX_STATUS_UNAVAIL 0x28 +#define PLOGX_STATUS_LOGOUT 0x29 +#define PLOGX_STATUS_IOCBERR 0x31 + +#define PLOGX_IOCBERR_NOLINK 0x01 +#define PLOGX_IOCBERR_NOIOCB 0x02 +#define PLOGX_IOCBERR_NOXGHG 0x03 +#define PLOGX_IOCBERR_FAILED 0x04 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_NOFABRIC 0x05 +#define PLOGX_IOCBERR_NOTREADY 0x07 +#define PLOGX_IOCBERR_NOLOGIN 0x08 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_NOPCB 0x0a +#define PLOGX_IOCBERR_REJECT 0x18 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_EINVAL 0x19 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_PORTUSED 0x1a /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_HNDLUSED 0x1b /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_NOHANDLE 0x1c +#define PLOGX_IOCBERR_NOFLOGI 0x1f /* further info in IOPARM 1 */ + +#define PLOGX_FLG_CMD_MASK 0xf +#define PLOGX_FLG_CMD_PLOGI 0 +#define PLOGX_FLG_CMD_PRLI 1 +#define PLOGX_FLG_CMD_PDISC 2 +#define PLOGX_FLG_CMD_LOGO 8 +#define PLOGX_FLG_CMD_PRLO 9 +#define PLOGX_FLG_CMD_TPRLO 10 + +#define PLOGX_FLG_COND_PLOGI 0x10 /* if with PLOGI */ +#define PLOGX_FLG_IMPLICIT 0x10 /* if with LOGO, PRLO, TPRLO */ +#define PLOGX_FLG_SKIP_PRLI 0x20 /* if with PLOGI */ +#define PLOGX_FLG_IMPLICIT_LOGO_ALL 0x20 /* if with LOGO */ +#define PLOGX_FLG_EXPLICIT_LOGO 0x40 /* if with LOGO */ +#define PLOGX_FLG_COMMON_FEATURES 0x80 /* if with PLOGI */ +#define PLOGX_FLG_FREE_NPHDL 0x80 /* if with with LOGO */ + +#define PLOGX_FLG_CLASS2 0x100 /* if with PLOGI */ +#define PLOGX_FLG_FCP2_OVERRIDE 0x200 /* if with PRLOG, PRLI */ + +/* + * Simple Name Server Data Structures + */ #define SNS_GA_NXT 0x100 #define SNS_GPN_ID 0x112 #define SNS_GNN_ID 0x113 @@ -872,61 +1175,61 @@ typedef struct { #define SNS_RFT_ID 0x217 typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ - uint16_t snscb_res0; + uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ - uint16_t snscb_res1; + uint16_t snscb_reserved1; uint16_t snscb_data[1]; /* variable data */ } sns_screq_t; /* Subcommand Request Structure */ typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ - uint16_t snscb_res0; + uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ - uint16_t snscb_res1; + uint16_t snscb_reserved1; uint16_t snscb_cmd; - uint16_t snscb_res2; - uint32_t snscb_res3; + uint16_t snscb_reserved2; + uint32_t snscb_reserved3; uint32_t snscb_port; } sns_ga_nxt_req_t; #define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t)) typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ - uint16_t snscb_res0; + uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ - uint16_t snscb_res1; + uint16_t snscb_reserved1; uint16_t snscb_cmd; - uint16_t snscb_res2; - uint32_t snscb_res3; + uint16_t snscb_reserved2; + uint32_t snscb_reserved3; uint32_t snscb_portid; } sns_gxn_id_req_t; #define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t)) typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ - uint16_t snscb_res0; + uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ - uint16_t snscb_res1; + uint16_t snscb_reserved1; uint16_t snscb_cmd; uint16_t snscb_mword_div_2; - uint32_t snscb_res3; + uint32_t snscb_reserved3; uint32_t snscb_fc4_type; } sns_gid_ft_req_t; #define SNS_GID_FT_REQ_SIZE (sizeof (sns_gid_ft_req_t)) typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ - uint16_t snscb_res0; + uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ - uint16_t snscb_res1; + uint16_t snscb_reserved1; uint16_t snscb_cmd; - uint16_t snscb_res2; - uint32_t snscb_res3; + uint16_t snscb_reserved2; + uint32_t snscb_reserved3; uint32_t snscb_port; uint32_t snscb_fc4_types[8]; } sns_rft_id_req_t; @@ -980,7 +1283,68 @@ typedef struct { } snscb_ports[1]; } sns_gid_ft_rsp_t; #define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2)) - #define SNS_RFT_ID_RESP_SIZE (sizeof (ct_hdr_t)) +/* + * Other Misc Structures + */ + +/* ELS Pass Through */ +typedef struct { + isphdr_t els_hdr; + uint32_t els_handle; + uint16_t els_status; + uint16_t els_nphdl; + uint16_t els_xmit_dsd_count; /* outgoing only */ + uint8_t els_vphdl; + uint8_t els_sof; + uint32_t els_rxid; + uint16_t els_recv_dsd_count; /* outgoing only */ + uint8_t els_opcode; + uint8_t els_reserved1; + uint8_t els_did_lo; + uint8_t els_did_mid; + uint8_t els_did_hi; + uint8_t els_reserved2; + uint16_t els_reserved3; + uint16_t els_ctl_flags; + union { + struct { + uint32_t _els_bytecnt; + uint32_t _els_subcode1; + uint32_t _els_subcode2; + uint8_t _els_reserved4[20]; + } in; + struct { + uint32_t _els_recv_bytecnt; + uint32_t _els_xmit_bytecnt; + uint32_t _els_xmit_dsd_length; + uint16_t _els_xmit_dsd_a1500; + uint16_t _els_xmit_dsd_a3116; + uint16_t _els_xmit_dsd_a4732; + uint16_t _els_xmit_dsd_a6348; + uint32_t _els_recv_dsd_length; + uint16_t _els_recv_dsd_a1500; + uint16_t _els_recv_dsd_a3116; + uint16_t _els_recv_dsd_a4732; + uint16_t _els_recv_dsd_a6348; + } out; + } inout; +#define els_bytecnt inout.in._els_bytecnt +#define els_subcode1 inout.in._els_subcode1 +#define els_subcode2 inout.in._els_subcode2 +#define els_reserved4 inout.in._els_reserved4 +#define els_recv_bytecnt inout.out._els_recv_bytecnt +#define els_xmit_bytecnt inout.out._els_xmit_bytecnt +#define els_xmit_dsd_length inout.out._els_xmit_dsd_length +#define els_xmit_dsd_a1500 inout.out._els_xmit_dsd_a1500 +#define els_xmit_dsd_a3116 inout.out._els_xmit_dsd_a3116 +#define els_xmit_dsd_a4732 inout.out._els_xmit_dsd_a4732 +#define els_xmit_dsd_a6348 inout.out._els_xmit_dsd_a6348 +#define els_recv_dsd_length inout.out._els_recv_dsd_length +#define els_recv_dsd_a1500 inout.out._els_recv_dsd_a1500 +#define els_recv_dsd_a3116 inout.out._els_recv_dsd_a3116 +#define els_recv_dsd_a4732 inout.out._els_recv_dsd_a4732 +#define els_recv_dsd_a6348 inout.out._els_recv_dsd_a6348 +} els_t; #endif /* _ISPMBOX_H */ |