Date: Sun, 17 Sep 2006 21:24:33 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 106261 for review Message-ID: <200609172124.k8HLOXrX088371@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106261 Change 106261 by mjacob@newisp on 2006/09/17 21:23:35 A variety of 24XX structure changes/additions for target mode. Affected files ... .. //depot/projects/newisp/dev/isp/isp.c#11 edit .. //depot/projects/newisp/dev/isp/isp_library.c#7 edit .. //depot/projects/newisp/dev/isp/isp_library.h#6 edit .. //depot/projects/newisp/dev/isp/isp_stds.h#2 edit .. //depot/projects/newisp/dev/isp/isp_target.c#4 edit .. //depot/projects/newisp/dev/isp/isp_target.h#6 edit .. //depot/projects/newisp/dev/isp/ispmbox.h#4 edit Differences ... ==== //depot/projects/newisp/dev/isp/isp.c#11 (text+ko) ==== @@ -4474,10 +4474,6 @@ } MEMZERO(hp, QENTRY_LEN); /* PERF */ continue; - } else if (etype == RQSTYPE_MARKER) { - isp_prt(isp, ISP_LOGDEBUG0, "MARKER"); - MEMZERO(hp, QENTRY_LEN); /* PERF */ - continue; } else { /* * Somebody reachable via isp_handle_other_response @@ -5137,7 +5133,10 @@ { switch (type) { case RQSTYPE_STATUS_CONT: - isp_prt(isp, ISP_LOGINFO, "Ignored Continuation Response"); + isp_prt(isp, ISP_LOGDEBUG0, "Ignored Continuation Response"); + return (1); + case RQSTYPE_MARKER: + isp_prt(isp, ISP_LOGDEBUG0, "Marker Response"); return (1); case RQSTYPE_ATIO: case RQSTYPE_CTIO: ==== //depot/projects/newisp/dev/isp/isp_library.c#7 (text) ==== @@ -1131,41 +1131,17 @@ */ void -isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) +isp_get_fc_hdr(ispsoftc_t *isp, fc_hdr_t *src, fc_hdr_t *dst) { - ISP_IOZGET_8(isp, &src->ct_revision, dst->ct_revision); - ISP_IOZGET_8(isp, &src->ct_in_id[0], dst->ct_in_id[0]); - ISP_IOZGET_8(isp, &src->ct_in_id[1], dst->ct_in_id[1]); - ISP_IOZGET_8(isp, &src->ct_in_id[2], dst->ct_in_id[2]); - ISP_IOZGET_8(isp, &src->ct_fcs_type, dst->ct_fcs_type); - ISP_IOZGET_8(isp, &src->ct_fcs_subtype, dst->ct_fcs_subtype); - ISP_IOZGET_8(isp, &src->ct_options, dst->ct_options); - ISP_IOZGET_8(isp, &src->ct_reserved0, dst->ct_reserved0); - ISP_IOZGET_16(isp, &src->ct_cmd_resp, dst->ct_cmd_resp); - ISP_IOZGET_16(isp, &src->ct_bcnt_resid, dst->ct_bcnt_resid); - ISP_IOZGET_8(isp, &src->ct_reserved1, dst->ct_reserved1); - ISP_IOZGET_8(isp, &src->ct_reason, dst->ct_reason); - ISP_IOZGET_8(isp, &src->ct_explanation, dst->ct_explanation); - ISP_IOZGET_8(isp, &src->ct_vunique, dst->ct_vunique); -} + int i, amt; + uint32_t *a, *b; -void -isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) -{ - ISP_IOZPUT_8(isp, src->ct_revision, &dst->ct_revision); - ISP_IOZPUT_8(isp, src->ct_in_id[0], &dst->ct_in_id[0]); - ISP_IOZPUT_8(isp, src->ct_in_id[1], &dst->ct_in_id[1]); - ISP_IOZPUT_8(isp, src->ct_in_id[2], &dst->ct_in_id[2]); - ISP_IOZPUT_8(isp, src->ct_fcs_type, &dst->ct_fcs_type); - ISP_IOZPUT_8(isp, src->ct_fcs_subtype, &dst->ct_fcs_subtype); - ISP_IOZPUT_8(isp, src->ct_options, &dst->ct_options); - ISP_IOZPUT_8(isp, src->ct_reserved0, &dst->ct_reserved0); - ISP_IOZPUT_16(isp, src->ct_cmd_resp, &dst->ct_cmd_resp); - ISP_IOZPUT_16(isp, src->ct_bcnt_resid, &dst->ct_bcnt_resid); - ISP_IOZPUT_8(isp, src->ct_reserved1, &dst->ct_reserved1); - ISP_IOZPUT_8(isp, src->ct_reason, &dst->ct_reason); - ISP_IOZPUT_8(isp, src->ct_explanation, &dst->ct_explanation); - ISP_IOZPUT_8(isp, src->ct_vunique, &dst->ct_vunique); + a = (uint32_t *) src; + b = (uint32_t *) dst; + amt = (sizeof (fc_hdr_t)) >> 2; + for (i = 0; i < amt; i++) { + ISP_IOZGET_32(isp, a++, *b++); + } } void @@ -1211,6 +1187,44 @@ } } +void +isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) +{ + ISP_IOZGET_8(isp, &src->ct_revision, dst->ct_revision); + ISP_IOZGET_8(isp, &src->ct_in_id[0], dst->ct_in_id[0]); + ISP_IOZGET_8(isp, &src->ct_in_id[1], dst->ct_in_id[1]); + ISP_IOZGET_8(isp, &src->ct_in_id[2], dst->ct_in_id[2]); + ISP_IOZGET_8(isp, &src->ct_fcs_type, dst->ct_fcs_type); + ISP_IOZGET_8(isp, &src->ct_fcs_subtype, dst->ct_fcs_subtype); + ISP_IOZGET_8(isp, &src->ct_options, dst->ct_options); + ISP_IOZGET_8(isp, &src->ct_reserved0, dst->ct_reserved0); + ISP_IOZGET_16(isp, &src->ct_cmd_resp, dst->ct_cmd_resp); + ISP_IOZGET_16(isp, &src->ct_bcnt_resid, dst->ct_bcnt_resid); + ISP_IOZGET_8(isp, &src->ct_reserved1, dst->ct_reserved1); + ISP_IOZGET_8(isp, &src->ct_reason, dst->ct_reason); + ISP_IOZGET_8(isp, &src->ct_explanation, dst->ct_explanation); + ISP_IOZGET_8(isp, &src->ct_vunique, dst->ct_vunique); +} + +void +isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *src, ct_hdr_t *dst) +{ + ISP_IOZPUT_8(isp, src->ct_revision, &dst->ct_revision); + ISP_IOZPUT_8(isp, src->ct_in_id[0], &dst->ct_in_id[0]); + ISP_IOZPUT_8(isp, src->ct_in_id[1], &dst->ct_in_id[1]); + ISP_IOZPUT_8(isp, src->ct_in_id[2], &dst->ct_in_id[2]); + ISP_IOZPUT_8(isp, src->ct_fcs_type, &dst->ct_fcs_type); + ISP_IOZPUT_8(isp, src->ct_fcs_subtype, &dst->ct_fcs_subtype); + ISP_IOZPUT_8(isp, src->ct_options, &dst->ct_options); + ISP_IOZPUT_8(isp, src->ct_reserved0, &dst->ct_reserved0); + ISP_IOZPUT_16(isp, src->ct_cmd_resp, &dst->ct_cmd_resp); + ISP_IOZPUT_16(isp, src->ct_bcnt_resid, &dst->ct_bcnt_resid); + ISP_IOZPUT_8(isp, src->ct_reserved1, &dst->ct_reserved1); + ISP_IOZPUT_8(isp, src->ct_reason, &dst->ct_reason); + ISP_IOZPUT_8(isp, src->ct_explanation, &dst->ct_explanation); + ISP_IOZPUT_8(isp, src->ct_vunique, &dst->ct_vunique); +} + #ifdef ISP_TARGET_MODE int isp_save_xs_tgt(ispsoftc_t *isp, void *xs, uint32_t *handlep) @@ -1269,608 +1283,738 @@ } void -isp_put_atio(ispsoftc_t *isp, at_entry_t *atsrc, at_entry_t *atdst) +isp_put_atio(ispsoftc_t *isp, at_entry_t *src, at_entry_t *dst) { int i; - isp_put_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXPUT_16(isp, atsrc->at_reserved, &atdst->at_reserved); - ISP_IOXPUT_16(isp, atsrc->at_handle, &atdst->at_handle); + isp_put_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXPUT_16(isp, src->at_reserved, &dst->at_reserved); + ISP_IOXPUT_16(isp, src->at_handle, &dst->at_handle); if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_iid); - ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_lun); - ISP_IOXPUT_8(isp, atsrc->at_cdblen, &atdst->at_tgt); - ISP_IOXPUT_8(isp, atsrc->at_tgt, &atdst->at_cdblen); - ISP_IOXPUT_8(isp, atsrc->at_status, &atdst->at_scsi_status); - ISP_IOXPUT_8(isp, atsrc->at_scsi_status, &atdst->at_status); - ISP_IOXPUT_8(isp, atsrc->at_tag_val, &atdst->at_tag_type); - ISP_IOXPUT_8(isp, atsrc->at_tag_type, &atdst->at_tag_val); + ISP_IOXPUT_8(isp, src->at_lun, &dst->at_iid); + ISP_IOXPUT_8(isp, src->at_iid, &dst->at_lun); + ISP_IOXPUT_8(isp, src->at_cdblen, &dst->at_tgt); + ISP_IOXPUT_8(isp, src->at_tgt, &dst->at_cdblen); + ISP_IOXPUT_8(isp, src->at_status, &dst->at_scsi_status); + ISP_IOXPUT_8(isp, src->at_scsi_status, &dst->at_status); + ISP_IOXPUT_8(isp, src->at_tag_val, &dst->at_tag_type); + ISP_IOXPUT_8(isp, src->at_tag_type, &dst->at_tag_val); } else { - ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_lun); - ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_iid); - ISP_IOXPUT_8(isp, atsrc->at_cdblen, &atdst->at_cdblen); - ISP_IOXPUT_8(isp, atsrc->at_tgt, &atdst->at_tgt); - ISP_IOXPUT_8(isp, atsrc->at_status, &atdst->at_status); - ISP_IOXPUT_8(isp, atsrc->at_scsi_status, - &atdst->at_scsi_status); - ISP_IOXPUT_8(isp, atsrc->at_tag_val, &atdst->at_tag_val); - ISP_IOXPUT_8(isp, atsrc->at_tag_type, &atdst->at_tag_type); + ISP_IOXPUT_8(isp, src->at_lun, &dst->at_lun); + ISP_IOXPUT_8(isp, src->at_iid, &dst->at_iid); + ISP_IOXPUT_8(isp, src->at_cdblen, &dst->at_cdblen); + ISP_IOXPUT_8(isp, src->at_tgt, &dst->at_tgt); + ISP_IOXPUT_8(isp, src->at_status, &dst->at_status); + ISP_IOXPUT_8(isp, src->at_scsi_status, + &dst->at_scsi_status); + ISP_IOXPUT_8(isp, src->at_tag_val, &dst->at_tag_val); + ISP_IOXPUT_8(isp, src->at_tag_type, &dst->at_tag_type); } - ISP_IOXPUT_32(isp, atsrc->at_flags, &atdst->at_flags); + ISP_IOXPUT_32(isp, src->at_flags, &dst->at_flags); for (i = 0; i < ATIO_CDBLEN; i++) { - ISP_IOXPUT_8(isp, atsrc->at_cdb[i], &atdst->at_cdb[i]); + ISP_IOXPUT_8(isp, src->at_cdb[i], &dst->at_cdb[i]); } for (i = 0; i < QLTM_SENSELEN; i++) { - ISP_IOXPUT_8(isp, atsrc->at_sense[i], &atdst->at_sense[i]); + ISP_IOXPUT_8(isp, src->at_sense[i], &dst->at_sense[i]); } } void -isp_get_atio(ispsoftc_t *isp, at_entry_t *atsrc, at_entry_t *atdst) +isp_get_atio(ispsoftc_t *isp, at_entry_t *src, at_entry_t *dst) { int i; - isp_get_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXGET_16(isp, &atsrc->at_reserved, atdst->at_reserved); - ISP_IOXGET_16(isp, &atsrc->at_handle, atdst->at_handle); + isp_get_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXGET_16(isp, &src->at_reserved, dst->at_reserved); + ISP_IOXGET_16(isp, &src->at_handle, dst->at_handle); if (ISP_IS_SBUS(isp)) { - ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_iid); - ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_lun); - ISP_IOXGET_8(isp, &atsrc->at_cdblen, atdst->at_tgt); - ISP_IOXGET_8(isp, &atsrc->at_tgt, atdst->at_cdblen); - ISP_IOXGET_8(isp, &atsrc->at_status, atdst->at_scsi_status); - ISP_IOXGET_8(isp, &atsrc->at_scsi_status, atdst->at_status); - ISP_IOXGET_8(isp, &atsrc->at_tag_val, atdst->at_tag_type); - ISP_IOXGET_8(isp, &atsrc->at_tag_type, atdst->at_tag_val); + ISP_IOXGET_8(isp, &src->at_lun, dst->at_iid); + ISP_IOXGET_8(isp, &src->at_iid, dst->at_lun); + ISP_IOXGET_8(isp, &src->at_cdblen, dst->at_tgt); + ISP_IOXGET_8(isp, &src->at_tgt, dst->at_cdblen); + ISP_IOXGET_8(isp, &src->at_status, dst->at_scsi_status); + ISP_IOXGET_8(isp, &src->at_scsi_status, dst->at_status); + ISP_IOXGET_8(isp, &src->at_tag_val, dst->at_tag_type); + ISP_IOXGET_8(isp, &src->at_tag_type, dst->at_tag_val); } else { - ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_lun); - ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_iid); - ISP_IOXGET_8(isp, &atsrc->at_cdblen, atdst->at_cdblen); - ISP_IOXGET_8(isp, &atsrc->at_tgt, atdst->at_tgt); - ISP_IOXGET_8(isp, &atsrc->at_status, atdst->at_status); - ISP_IOXGET_8(isp, &atsrc->at_scsi_status, - atdst->at_scsi_status); - ISP_IOXGET_8(isp, &atsrc->at_tag_val, atdst->at_tag_val); - ISP_IOXGET_8(isp, &atsrc->at_tag_type, atdst->at_tag_type); + ISP_IOXGET_8(isp, &src->at_lun, dst->at_lun); + ISP_IOXGET_8(isp, &src->at_iid, dst->at_iid); + ISP_IOXGET_8(isp, &src->at_cdblen, dst->at_cdblen); + ISP_IOXGET_8(isp, &src->at_tgt, dst->at_tgt); + ISP_IOXGET_8(isp, &src->at_status, dst->at_status); + ISP_IOXGET_8(isp, &src->at_scsi_status, + dst->at_scsi_status); + ISP_IOXGET_8(isp, &src->at_tag_val, dst->at_tag_val); + ISP_IOXGET_8(isp, &src->at_tag_type, dst->at_tag_type); } - ISP_IOXGET_32(isp, &atsrc->at_flags, atdst->at_flags); + ISP_IOXGET_32(isp, &src->at_flags, dst->at_flags); for (i = 0; i < ATIO_CDBLEN; i++) { - ISP_IOXGET_8(isp, &atsrc->at_cdb[i], atdst->at_cdb[i]); + ISP_IOXGET_8(isp, &src->at_cdb[i], dst->at_cdb[i]); } for (i = 0; i < QLTM_SENSELEN; i++) { - ISP_IOXGET_8(isp, &atsrc->at_sense[i], atdst->at_sense[i]); + ISP_IOXGET_8(isp, &src->at_sense[i], dst->at_sense[i]); } } void -isp_put_atio2(ispsoftc_t *isp, at2_entry_t *atsrc, at2_entry_t *atdst) +isp_put_atio2(ispsoftc_t *isp, at2_entry_t *src, at2_entry_t *dst) { int i; - isp_put_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXPUT_32(isp, atsrc->at_reserved, &atdst->at_reserved); - ISP_IOXPUT_8(isp, atsrc->at_lun, &atdst->at_lun); - ISP_IOXPUT_8(isp, atsrc->at_iid, &atdst->at_iid); - ISP_IOXPUT_16(isp, atsrc->at_rxid, &atdst->at_rxid); - ISP_IOXPUT_16(isp, atsrc->at_flags, &atdst->at_flags); - ISP_IOXPUT_16(isp, atsrc->at_status, &atdst->at_status); - ISP_IOXPUT_8(isp, atsrc->at_crn, &atdst->at_crn); - ISP_IOXPUT_8(isp, atsrc->at_taskcodes, &atdst->at_taskcodes); - ISP_IOXPUT_8(isp, atsrc->at_taskflags, &atdst->at_taskflags); - ISP_IOXPUT_8(isp, atsrc->at_execodes, &atdst->at_execodes); + isp_put_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXPUT_32(isp, src->at_reserved, &dst->at_reserved); + ISP_IOXPUT_8(isp, src->at_lun, &dst->at_lun); + ISP_IOXPUT_8(isp, src->at_iid, &dst->at_iid); + ISP_IOXPUT_16(isp, src->at_rxid, &dst->at_rxid); + ISP_IOXPUT_16(isp, src->at_flags, &dst->at_flags); + ISP_IOXPUT_16(isp, src->at_status, &dst->at_status); + ISP_IOXPUT_8(isp, src->at_crn, &dst->at_crn); + ISP_IOXPUT_8(isp, src->at_taskcodes, &dst->at_taskcodes); + ISP_IOXPUT_8(isp, src->at_taskflags, &dst->at_taskflags); + ISP_IOXPUT_8(isp, src->at_execodes, &dst->at_execodes); for (i = 0; i < ATIO2_CDBLEN; i++) { - ISP_IOXPUT_8(isp, atsrc->at_cdb[i], &atdst->at_cdb[i]); + ISP_IOXPUT_8(isp, src->at_cdb[i], &dst->at_cdb[i]); } - ISP_IOXPUT_32(isp, atsrc->at_datalen, &atdst->at_datalen); - ISP_IOXPUT_16(isp, atsrc->at_scclun, &atdst->at_scclun); + ISP_IOXPUT_32(isp, src->at_datalen, &dst->at_datalen); + ISP_IOXPUT_16(isp, src->at_scclun, &dst->at_scclun); for (i = 0; i < 4; i++) { - ISP_IOXPUT_16(isp, atsrc->at_wwpn[i], &atdst->at_wwpn[i]); + ISP_IOXPUT_16(isp, src->at_wwpn[i], &dst->at_wwpn[i]); } for (i = 0; i < 6; i++) { - ISP_IOXPUT_16(isp, atsrc->at_reserved2[i], - &atdst->at_reserved2[i]); + ISP_IOXPUT_16(isp, src->at_reserved2[i], + &dst->at_reserved2[i]); } - ISP_IOXPUT_16(isp, atsrc->at_oxid, &atdst->at_oxid); + ISP_IOXPUT_16(isp, src->at_oxid, &dst->at_oxid); } void -isp_put_atio2e(ispsoftc_t *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst) +isp_put_atio2e(ispsoftc_t *isp, at2e_entry_t *src, at2e_entry_t *dst) { int i; - isp_put_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXPUT_32(isp, atsrc->at_reserved, &atdst->at_reserved); - ISP_IOXPUT_16(isp, atsrc->at_iid, &atdst->at_iid); - ISP_IOXPUT_16(isp, atsrc->at_rxid, &atdst->at_rxid); - ISP_IOXPUT_16(isp, atsrc->at_flags, &atdst->at_flags); - ISP_IOXPUT_16(isp, atsrc->at_status, &atdst->at_status); - ISP_IOXPUT_8(isp, atsrc->at_crn, &atdst->at_crn); - ISP_IOXPUT_8(isp, atsrc->at_taskcodes, &atdst->at_taskcodes); - ISP_IOXPUT_8(isp, atsrc->at_taskflags, &atdst->at_taskflags); - ISP_IOXPUT_8(isp, atsrc->at_execodes, &atdst->at_execodes); + isp_put_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXPUT_32(isp, src->at_reserved, &dst->at_reserved); + ISP_IOXPUT_16(isp, src->at_iid, &dst->at_iid); + ISP_IOXPUT_16(isp, src->at_rxid, &dst->at_rxid); + ISP_IOXPUT_16(isp, src->at_flags, &dst->at_flags); + ISP_IOXPUT_16(isp, src->at_status, &dst->at_status); + ISP_IOXPUT_8(isp, src->at_crn, &dst->at_crn); + ISP_IOXPUT_8(isp, src->at_taskcodes, &dst->at_taskcodes); + ISP_IOXPUT_8(isp, src->at_taskflags, &dst->at_taskflags); + ISP_IOXPUT_8(isp, src->at_execodes, &dst->at_execodes); for (i = 0; i < ATIO2_CDBLEN; i++) { - ISP_IOXPUT_8(isp, atsrc->at_cdb[i], &atdst->at_cdb[i]); + ISP_IOXPUT_8(isp, src->at_cdb[i], &dst->at_cdb[i]); } - ISP_IOXPUT_32(isp, atsrc->at_datalen, &atdst->at_datalen); - ISP_IOXPUT_16(isp, atsrc->at_scclun, &atdst->at_scclun); + ISP_IOXPUT_32(isp, src->at_datalen, &dst->at_datalen); + ISP_IOXPUT_16(isp, src->at_scclun, &dst->at_scclun); for (i = 0; i < 4; i++) { - ISP_IOXPUT_16(isp, atsrc->at_wwpn[i], &atdst->at_wwpn[i]); + ISP_IOXPUT_16(isp, src->at_wwpn[i], &dst->at_wwpn[i]); } for (i = 0; i < 6; i++) { - ISP_IOXPUT_16(isp, atsrc->at_reserved2[i], - &atdst->at_reserved2[i]); + ISP_IOXPUT_16(isp, src->at_reserved2[i], + &dst->at_reserved2[i]); } - ISP_IOXPUT_16(isp, atsrc->at_oxid, &atdst->at_oxid); + ISP_IOXPUT_16(isp, src->at_oxid, &dst->at_oxid); } void -isp_get_atio2(ispsoftc_t *isp, at2_entry_t *atsrc, at2_entry_t *atdst) +isp_get_atio2(ispsoftc_t *isp, at2_entry_t *src, at2_entry_t *dst) { int i; - isp_get_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXGET_32(isp, &atsrc->at_reserved, atdst->at_reserved); - ISP_IOXGET_8(isp, &atsrc->at_lun, atdst->at_lun); - ISP_IOXGET_8(isp, &atsrc->at_iid, atdst->at_iid); - ISP_IOXGET_16(isp, &atsrc->at_rxid, atdst->at_rxid); - ISP_IOXGET_16(isp, &atsrc->at_flags, atdst->at_flags); - ISP_IOXGET_16(isp, &atsrc->at_status, atdst->at_status); - ISP_IOXGET_8(isp, &atsrc->at_crn, atdst->at_crn); - ISP_IOXGET_8(isp, &atsrc->at_taskcodes, atdst->at_taskcodes); - ISP_IOXGET_8(isp, &atsrc->at_taskflags, atdst->at_taskflags); - ISP_IOXGET_8(isp, &atsrc->at_execodes, atdst->at_execodes); + isp_get_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXGET_32(isp, &src->at_reserved, dst->at_reserved); + ISP_IOXGET_8(isp, &src->at_lun, dst->at_lun); + ISP_IOXGET_8(isp, &src->at_iid, dst->at_iid); + ISP_IOXGET_16(isp, &src->at_rxid, dst->at_rxid); + ISP_IOXGET_16(isp, &src->at_flags, dst->at_flags); + ISP_IOXGET_16(isp, &src->at_status, dst->at_status); + ISP_IOXGET_8(isp, &src->at_crn, dst->at_crn); + ISP_IOXGET_8(isp, &src->at_taskcodes, dst->at_taskcodes); + ISP_IOXGET_8(isp, &src->at_taskflags, dst->at_taskflags); + ISP_IOXGET_8(isp, &src->at_execodes, dst->at_execodes); for (i = 0; i < ATIO2_CDBLEN; i++) { - ISP_IOXGET_8(isp, &atsrc->at_cdb[i], atdst->at_cdb[i]); + ISP_IOXGET_8(isp, &src->at_cdb[i], dst->at_cdb[i]); } - ISP_IOXGET_32(isp, &atsrc->at_datalen, atdst->at_datalen); - ISP_IOXGET_16(isp, &atsrc->at_scclun, atdst->at_scclun); + ISP_IOXGET_32(isp, &src->at_datalen, dst->at_datalen); + ISP_IOXGET_16(isp, &src->at_scclun, dst->at_scclun); for (i = 0; i < 4; i++) { - ISP_IOXGET_16(isp, &atsrc->at_wwpn[i], atdst->at_wwpn[i]); + ISP_IOXGET_16(isp, &src->at_wwpn[i], dst->at_wwpn[i]); } for (i = 0; i < 6; i++) { - ISP_IOXGET_16(isp, &atsrc->at_reserved2[i], - atdst->at_reserved2[i]); + ISP_IOXGET_16(isp, &src->at_reserved2[i], + dst->at_reserved2[i]); } - ISP_IOXGET_16(isp, &atsrc->at_oxid, atdst->at_oxid); + ISP_IOXGET_16(isp, &src->at_oxid, dst->at_oxid); } void -isp_get_atio2e(ispsoftc_t *isp, at2e_entry_t *atsrc, at2e_entry_t *atdst) +isp_get_atio2e(ispsoftc_t *isp, at2e_entry_t *src, at2e_entry_t *dst) { int i; - isp_get_hdr(isp, &atsrc->at_header, &atdst->at_header); - ISP_IOXGET_32(isp, &atsrc->at_reserved, atdst->at_reserved); - ISP_IOXGET_16(isp, &atsrc->at_iid, atdst->at_iid); - ISP_IOXGET_16(isp, &atsrc->at_rxid, atdst->at_rxid); - ISP_IOXGET_16(isp, &atsrc->at_flags, atdst->at_flags); - ISP_IOXGET_16(isp, &atsrc->at_status, atdst->at_status); - ISP_IOXGET_8(isp, &atsrc->at_crn, atdst->at_crn); - ISP_IOXGET_8(isp, &atsrc->at_taskcodes, atdst->at_taskcodes); - ISP_IOXGET_8(isp, &atsrc->at_taskflags, atdst->at_taskflags); - ISP_IOXGET_8(isp, &atsrc->at_execodes, atdst->at_execodes); + isp_get_hdr(isp, &src->at_header, &dst->at_header); + ISP_IOXGET_32(isp, &src->at_reserved, dst->at_reserved); + ISP_IOXGET_16(isp, &src->at_iid, dst->at_iid); + ISP_IOXGET_16(isp, &src->at_rxid, dst->at_rxid); + ISP_IOXGET_16(isp, &src->at_flags, dst->at_flags); + ISP_IOXGET_16(isp, &src->at_status, dst->at_status); + ISP_IOXGET_8(isp, &src->at_crn, dst->at_crn); + ISP_IOXGET_8(isp, &src->at_taskcodes, dst->at_taskcodes); + ISP_IOXGET_8(isp, &src->at_taskflags, dst->at_taskflags); + ISP_IOXGET_8(isp, &src->at_execodes, dst->at_execodes); for (i = 0; i < ATIO2_CDBLEN; i++) { - ISP_IOXGET_8(isp, &atsrc->at_cdb[i], atdst->at_cdb[i]); + ISP_IOXGET_8(isp, &src->at_cdb[i], dst->at_cdb[i]); } - ISP_IOXGET_32(isp, &atsrc->at_datalen, atdst->at_datalen); - ISP_IOXGET_16(isp, &atsrc->at_scclun, atdst->at_scclun); + ISP_IOXGET_32(isp, &src->at_datalen, dst->at_datalen); + ISP_IOXGET_16(isp, &src->at_scclun, dst->at_scclun); for (i = 0; i < 4; i++) { - ISP_IOXGET_16(isp, &atsrc->at_wwpn[i], atdst->at_wwpn[i]); + ISP_IOXGET_16(isp, &src->at_wwpn[i], dst->at_wwpn[i]); } for (i = 0; i < 6; i++) { - ISP_IOXGET_16(isp, &atsrc->at_reserved2[i], - atdst->at_reserved2[i]); + ISP_IOXGET_16(isp, &src->at_reserved2[i], + dst->at_reserved2[i]); } - ISP_IOXGET_16(isp, &atsrc->at_oxid, atdst->at_oxid); + ISP_IOXGET_16(isp, &src->at_oxid, dst->at_oxid); +} + +void +isp_get_atio7(ispsoftc_t *isp, at7_entry_t *src, at7_entry_t *dst) +{ + ISP_IOXGET_8(isp, &src->at_type, dst->at_type); + ISP_IOXGET_8(isp, &src->at_count, dst->at_count); + ISP_IOXGET_16(isp, &src->at_ta_len, dst->at_ta_len); + ISP_IOXGET_32(isp, &src->at_rxid, dst->at_rxid); + isp_get_fc_hdr(isp, &src->at_hdr, &dst->at_hdr); + isp_get_fcp_cmnd_iu(isp, &src->at_cmnd, &dst->at_cmnd); } void -isp_put_ctio(ispsoftc_t *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst) +isp_put_ctio(ispsoftc_t *isp, ct_entry_t *src, ct_entry_t *dst) { int i; - isp_put_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); - ISP_IOXPUT_16(isp, ctsrc->ct_syshandle, &ctdst->ct_syshandle); - ISP_IOXPUT_16(isp, ctsrc->ct_fwhandle, &ctdst->ct_fwhandle); + isp_put_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXPUT_16(isp, src->ct_syshandle, &dst->ct_syshandle); + ISP_IOXPUT_16(isp, src->ct_fwhandle, &dst->ct_fwhandle); if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_lun); - ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_iid); - ISP_IOXPUT_8(isp, ctsrc->ct_tgt, &ctdst->ct_reserved2); - ISP_IOXPUT_8(isp, ctsrc->ct_reserved2, &ctdst->ct_tgt); - ISP_IOXPUT_8(isp, ctsrc->ct_status, &ctdst->ct_scsi_status); - ISP_IOXPUT_8(isp, ctsrc->ct_scsi_status, &ctdst->ct_status); - ISP_IOXPUT_8(isp, ctsrc->ct_tag_type, &ctdst->ct_tag_val); - ISP_IOXPUT_8(isp, ctsrc->ct_tag_val, &ctdst->ct_tag_type); + ISP_IOXPUT_8(isp, src->ct_iid, &dst->ct_lun); + ISP_IOXPUT_8(isp, src->ct_lun, &dst->ct_iid); + ISP_IOXPUT_8(isp, src->ct_tgt, &dst->ct_reserved2); + ISP_IOXPUT_8(isp, src->ct_reserved2, &dst->ct_tgt); + ISP_IOXPUT_8(isp, src->ct_status, &dst->ct_scsi_status); + ISP_IOXPUT_8(isp, src->ct_scsi_status, &dst->ct_status); + ISP_IOXPUT_8(isp, src->ct_tag_type, &dst->ct_tag_val); + ISP_IOXPUT_8(isp, src->ct_tag_val, &dst->ct_tag_type); } else { - ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_iid); - ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_lun); - ISP_IOXPUT_8(isp, ctsrc->ct_tgt, &ctdst->ct_tgt); - ISP_IOXPUT_8(isp, ctsrc->ct_reserved2, &ctdst->ct_reserved2); - ISP_IOXPUT_8(isp, ctsrc->ct_scsi_status, - &ctdst->ct_scsi_status); - ISP_IOXPUT_8(isp, ctsrc->ct_status, &ctdst->ct_status); - ISP_IOXPUT_8(isp, ctsrc->ct_tag_type, &ctdst->ct_tag_type); - ISP_IOXPUT_8(isp, ctsrc->ct_tag_val, &ctdst->ct_tag_val); + ISP_IOXPUT_8(isp, src->ct_iid, &dst->ct_iid); + ISP_IOXPUT_8(isp, src->ct_lun, &dst->ct_lun); + ISP_IOXPUT_8(isp, src->ct_tgt, &dst->ct_tgt); + ISP_IOXPUT_8(isp, src->ct_reserved2, &dst->ct_reserved2); + ISP_IOXPUT_8(isp, src->ct_scsi_status, + &dst->ct_scsi_status); + ISP_IOXPUT_8(isp, src->ct_status, &dst->ct_status); + ISP_IOXPUT_8(isp, src->ct_tag_type, &dst->ct_tag_type); + ISP_IOXPUT_8(isp, src->ct_tag_val, &dst->ct_tag_val); } - ISP_IOXPUT_32(isp, ctsrc->ct_flags, &ctdst->ct_flags); - ISP_IOXPUT_32(isp, ctsrc->ct_xfrlen, &ctdst->ct_xfrlen); - ISP_IOXPUT_32(isp, ctsrc->ct_resid, &ctdst->ct_resid); - ISP_IOXPUT_16(isp, ctsrc->ct_timeout, &ctdst->ct_timeout); - ISP_IOXPUT_16(isp, ctsrc->ct_seg_count, &ctdst->ct_seg_count); + ISP_IOXPUT_32(isp, src->ct_flags, &dst->ct_flags); + ISP_IOXPUT_32(isp, src->ct_xfrlen, &dst->ct_xfrlen); + ISP_IOXPUT_32(isp, src->ct_resid, &dst->ct_resid); + ISP_IOXPUT_16(isp, src->ct_timeout, &dst->ct_timeout); + ISP_IOXPUT_16(isp, src->ct_seg_count, &dst->ct_seg_count); for (i = 0; i < ISP_RQDSEG; i++) { - ISP_IOXPUT_32(isp, ctsrc->ct_dataseg[i].ds_base, - &ctdst->ct_dataseg[i].ds_base); - ISP_IOXPUT_32(isp, ctsrc->ct_dataseg[i].ds_count, - &ctdst->ct_dataseg[i].ds_count); + ISP_IOXPUT_32(isp, src->ct_dataseg[i].ds_base, + &dst->ct_dataseg[i].ds_base); + ISP_IOXPUT_32(isp, src->ct_dataseg[i].ds_count, + &dst->ct_dataseg[i].ds_count); } } void -isp_get_ctio(ispsoftc_t *isp, ct_entry_t *ctsrc, ct_entry_t *ctdst) +isp_get_ctio(ispsoftc_t *isp, ct_entry_t *src, ct_entry_t *dst) { int i; - isp_get_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); - ISP_IOXGET_16(isp, &ctsrc->ct_syshandle, ctdst->ct_syshandle); - ISP_IOXGET_16(isp, &ctsrc->ct_fwhandle, ctdst->ct_fwhandle); + isp_get_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXGET_16(isp, &src->ct_syshandle, dst->ct_syshandle); + ISP_IOXGET_16(isp, &src->ct_fwhandle, dst->ct_fwhandle); if (ISP_IS_SBUS(isp)) { - ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_iid); - ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_lun); - ISP_IOXGET_8(isp, &ctsrc->ct_reserved2, ctdst->ct_tgt); - ISP_IOXGET_8(isp, &ctsrc->ct_tgt, ctdst->ct_reserved2); - ISP_IOXGET_8(isp, &ctsrc->ct_status, ctdst->ct_scsi_status); - ISP_IOXGET_8(isp, &ctsrc->ct_scsi_status, ctdst->ct_status); - ISP_IOXGET_8(isp, &ctsrc->ct_tag_val, ctdst->ct_tag_type); - ISP_IOXGET_8(isp, &ctsrc->ct_tag_type, ctdst->ct_tag_val); + ISP_IOXGET_8(isp, &src->ct_lun, dst->ct_iid); + ISP_IOXGET_8(isp, &src->ct_iid, dst->ct_lun); + ISP_IOXGET_8(isp, &src->ct_reserved2, dst->ct_tgt); + ISP_IOXGET_8(isp, &src->ct_tgt, dst->ct_reserved2); + ISP_IOXGET_8(isp, &src->ct_status, dst->ct_scsi_status); + ISP_IOXGET_8(isp, &src->ct_scsi_status, dst->ct_status); + ISP_IOXGET_8(isp, &src->ct_tag_val, dst->ct_tag_type); + ISP_IOXGET_8(isp, &src->ct_tag_type, dst->ct_tag_val); } else { - ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_lun); - ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_iid); - ISP_IOXGET_8(isp, &ctsrc->ct_reserved2, ctdst->ct_reserved2); - ISP_IOXGET_8(isp, &ctsrc->ct_tgt, ctdst->ct_tgt); - ISP_IOXGET_8(isp, &ctsrc->ct_status, ctdst->ct_status); - ISP_IOXGET_8(isp, &ctsrc->ct_scsi_status, - ctdst->ct_scsi_status); - ISP_IOXGET_8(isp, &ctsrc->ct_tag_val, ctdst->ct_tag_val); - ISP_IOXGET_8(isp, &ctsrc->ct_tag_type, ctdst->ct_tag_type); + ISP_IOXGET_8(isp, &src->ct_lun, dst->ct_lun); + ISP_IOXGET_8(isp, &src->ct_iid, dst->ct_iid); + ISP_IOXGET_8(isp, &src->ct_reserved2, dst->ct_reserved2); + ISP_IOXGET_8(isp, &src->ct_tgt, dst->ct_tgt); + ISP_IOXGET_8(isp, &src->ct_status, dst->ct_status); + ISP_IOXGET_8(isp, &src->ct_scsi_status, + dst->ct_scsi_status); + ISP_IOXGET_8(isp, &src->ct_tag_val, dst->ct_tag_val); + ISP_IOXGET_8(isp, &src->ct_tag_type, dst->ct_tag_type); } - ISP_IOXGET_32(isp, &ctsrc->ct_flags, ctdst->ct_flags); - ISP_IOXGET_32(isp, &ctsrc->ct_xfrlen, ctdst->ct_xfrlen); - ISP_IOXGET_32(isp, &ctsrc->ct_resid, ctdst->ct_resid); - ISP_IOXGET_16(isp, &ctsrc->ct_timeout, ctdst->ct_timeout); - ISP_IOXGET_16(isp, &ctsrc->ct_seg_count, ctdst->ct_seg_count); + ISP_IOXGET_32(isp, &src->ct_flags, dst->ct_flags); + ISP_IOXGET_32(isp, &src->ct_xfrlen, dst->ct_xfrlen); + ISP_IOXGET_32(isp, &src->ct_resid, dst->ct_resid); + ISP_IOXGET_16(isp, &src->ct_timeout, dst->ct_timeout); + ISP_IOXGET_16(isp, &src->ct_seg_count, dst->ct_seg_count); for (i = 0; i < ISP_RQDSEG; i++) { ISP_IOXGET_32(isp, - &ctsrc->ct_dataseg[i].ds_base, - ctdst->ct_dataseg[i].ds_base); + &src->ct_dataseg[i].ds_base, + dst->ct_dataseg[i].ds_base); ISP_IOXGET_32(isp, - &ctsrc->ct_dataseg[i].ds_count, - ctdst->ct_dataseg[i].ds_count); + &src->ct_dataseg[i].ds_count, + dst->ct_dataseg[i].ds_count); } } void -isp_put_ctio2(ispsoftc_t *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst) +isp_put_ctio2(ispsoftc_t *isp, ct2_entry_t *src, ct2_entry_t *dst) { int i; - isp_put_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); - ISP_IOXPUT_32(isp, ctsrc->ct_syshandle, &ctdst->ct_syshandle); - ISP_IOXPUT_8(isp, ctsrc->ct_lun, &ctdst->ct_lun); - ISP_IOXPUT_8(isp, ctsrc->ct_iid, &ctdst->ct_iid); - ISP_IOXPUT_16(isp, ctsrc->ct_rxid, &ctdst->ct_rxid); - ISP_IOXPUT_16(isp, ctsrc->ct_flags, &ctdst->ct_flags); - ISP_IOXPUT_16(isp, ctsrc->ct_timeout, &ctdst->ct_timeout); - ISP_IOXPUT_16(isp, ctsrc->ct_seg_count, &ctdst->ct_seg_count); - ISP_IOXPUT_32(isp, ctsrc->ct_resid, &ctdst->ct_resid); - ISP_IOXPUT_32(isp, ctsrc->ct_reloff, &ctdst->ct_reloff); - if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { - ISP_IOXPUT_32(isp, ctsrc->rsp.m0._reserved, - &ctdst->rsp.m0._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m0._reserved2, - &ctdst->rsp.m0._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_scsi_status, - &ctdst->rsp.m0.ct_scsi_status); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_xfrlen, - &ctdst->rsp.m0.ct_xfrlen); - if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO2) { + isp_put_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXPUT_32(isp, src->ct_syshandle, &dst->ct_syshandle); + ISP_IOXPUT_8(isp, src->ct_lun, &dst->ct_lun); + ISP_IOXPUT_8(isp, src->ct_iid, &dst->ct_iid); + ISP_IOXPUT_16(isp, src->ct_rxid, &dst->ct_rxid); + ISP_IOXPUT_16(isp, src->ct_flags, &dst->ct_flags); + ISP_IOXPUT_16(isp, src->ct_timeout, &dst->ct_timeout); + ISP_IOXPUT_16(isp, src->ct_seg_count, &dst->ct_seg_count); + ISP_IOXPUT_32(isp, src->ct_resid, &dst->ct_resid); + ISP_IOXPUT_32(isp, src->ct_reloff, &dst->ct_reloff); + if ((src->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { + ISP_IOXPUT_32(isp, src->rsp.m0._reserved, + &dst->rsp.m0._reserved); + ISP_IOXPUT_16(isp, src->rsp.m0._reserved2, + &dst->rsp.m0._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m0.ct_scsi_status, + &dst->rsp.m0.ct_scsi_status); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_xfrlen, + &dst->rsp.m0.ct_xfrlen); + if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO2) { for (i = 0; i < ISP_RQDSEG_T2; i++) { ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg[i].ds_base, - &ctdst->rsp.m0.ct_dataseg[i].ds_base); + src->rsp.m0.ct_dataseg[i].ds_base, + &dst->rsp.m0.ct_dataseg[i].ds_base); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg[i].ds_count, - &ctdst->rsp.m0.ct_dataseg[i].ds_count); + src->rsp.m0.ct_dataseg[i].ds_count, + &dst->rsp.m0.ct_dataseg[i].ds_count); } - } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { + } else if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { for (i = 0; i < ISP_RQDSEG_T3; i++) { ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_base, - &ctdst->rsp.m0.ct_dataseg64[i].ds_base); + src->rsp.m0.ct_dataseg64[i].ds_base, + &dst->rsp.m0.ct_dataseg64[i].ds_base); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_basehi, - &ctdst->rsp.m0.ct_dataseg64[i].ds_basehi); + src->rsp.m0.ct_dataseg64[i].ds_basehi, + &dst->rsp.m0.ct_dataseg64[i].ds_basehi); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_count, - &ctdst->rsp.m0.ct_dataseg64[i].ds_count); + src->rsp.m0.ct_dataseg64[i].ds_count, + &dst->rsp.m0.ct_dataseg64[i].ds_count); } - } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO4) { - ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_dslist.ds_type, - &ctdst->rsp.m0.ct_dslist.ds_type); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_segment, - &ctdst->rsp.m0.ct_dslist.ds_segment); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_base, - &ctdst->rsp.m0.ct_dslist.ds_base); + } else if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO4) { + ISP_IOXPUT_16(isp, src->rsp.m0.ct_dslist.ds_type, + &dst->rsp.m0.ct_dslist.ds_type); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_dslist.ds_segment, + &dst->rsp.m0.ct_dslist.ds_segment); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_dslist.ds_base, + &dst->rsp.m0.ct_dslist.ds_base); } - } else if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE1) { - ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved, - &ctdst->rsp.m1._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved2, - &ctdst->rsp.m1._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_senselen, - &ctdst->rsp.m1.ct_senselen); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_scsi_status, - &ctdst->rsp.m1.ct_scsi_status); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_resplen, - &ctdst->rsp.m1.ct_resplen); + } else if ((src->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE1) { + ISP_IOXPUT_16(isp, src->rsp.m1._reserved, + &dst->rsp.m1._reserved); + ISP_IOXPUT_16(isp, src->rsp.m1._reserved2, + &dst->rsp.m1._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_senselen, + &dst->rsp.m1.ct_senselen); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_scsi_status, + &dst->rsp.m1.ct_scsi_status); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_resplen, + &dst->rsp.m1.ct_resplen); for (i = 0; i < MAXRESPLEN; i++) { - ISP_IOXPUT_8(isp, ctsrc->rsp.m1.ct_resp[i], - &ctdst->rsp.m1.ct_resp[i]); + ISP_IOXPUT_8(isp, src->rsp.m1.ct_resp[i], + &dst->rsp.m1.ct_resp[i]); } } else { - ISP_IOXPUT_32(isp, ctsrc->rsp.m2._reserved, - &ctdst->rsp.m2._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved2, - &ctdst->rsp.m2._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved3, - &ctdst->rsp.m2._reserved3); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_datalen, - &ctdst->rsp.m2.ct_datalen); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_base, - &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_base); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_count, - &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_count); + ISP_IOXPUT_32(isp, src->rsp.m2._reserved, + &dst->rsp.m2._reserved); + ISP_IOXPUT_16(isp, src->rsp.m2._reserved2, + &dst->rsp.m2._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m2._reserved3, + &dst->rsp.m2._reserved3); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_datalen, + &dst->rsp.m2.ct_datalen); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_base, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_base); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_count, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_count); } } void -isp_put_ctio2e(ispsoftc_t *isp, ct2e_entry_t *ctsrc, ct2e_entry_t *ctdst) +isp_put_ctio2e(ispsoftc_t *isp, ct2e_entry_t *src, ct2e_entry_t *dst) { int i; - isp_put_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); - ISP_IOXPUT_32(isp, ctsrc->ct_syshandle, &ctdst->ct_syshandle); - ISP_IOXPUT_16(isp, ctsrc->ct_iid, &ctdst->ct_iid); - ISP_IOXPUT_16(isp, ctsrc->ct_rxid, &ctdst->ct_rxid); - ISP_IOXPUT_16(isp, ctsrc->ct_flags, &ctdst->ct_flags); - ISP_IOXPUT_16(isp, ctsrc->ct_timeout, &ctdst->ct_timeout); - ISP_IOXPUT_16(isp, ctsrc->ct_seg_count, &ctdst->ct_seg_count); - ISP_IOXPUT_32(isp, ctsrc->ct_resid, &ctdst->ct_resid); - ISP_IOXPUT_32(isp, ctsrc->ct_reloff, &ctdst->ct_reloff); - if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { - ISP_IOXPUT_32(isp, ctsrc->rsp.m0._reserved, - &ctdst->rsp.m0._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m0._reserved2, - &ctdst->rsp.m0._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_scsi_status, - &ctdst->rsp.m0.ct_scsi_status); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_xfrlen, - &ctdst->rsp.m0.ct_xfrlen); - if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO2) { + isp_put_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXPUT_32(isp, src->ct_syshandle, &dst->ct_syshandle); + ISP_IOXPUT_16(isp, src->ct_iid, &dst->ct_iid); + ISP_IOXPUT_16(isp, src->ct_rxid, &dst->ct_rxid); + ISP_IOXPUT_16(isp, src->ct_flags, &dst->ct_flags); + ISP_IOXPUT_16(isp, src->ct_timeout, &dst->ct_timeout); + ISP_IOXPUT_16(isp, src->ct_seg_count, &dst->ct_seg_count); + ISP_IOXPUT_32(isp, src->ct_resid, &dst->ct_resid); + ISP_IOXPUT_32(isp, src->ct_reloff, &dst->ct_reloff); + if ((src->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { + ISP_IOXPUT_32(isp, src->rsp.m0._reserved, + &dst->rsp.m0._reserved); + ISP_IOXPUT_16(isp, src->rsp.m0._reserved2, + &dst->rsp.m0._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m0.ct_scsi_status, + &dst->rsp.m0.ct_scsi_status); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_xfrlen, + &dst->rsp.m0.ct_xfrlen); + if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO2) { for (i = 0; i < ISP_RQDSEG_T2; i++) { ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg[i].ds_base, - &ctdst->rsp.m0.ct_dataseg[i].ds_base); + src->rsp.m0.ct_dataseg[i].ds_base, + &dst->rsp.m0.ct_dataseg[i].ds_base); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg[i].ds_count, - &ctdst->rsp.m0.ct_dataseg[i].ds_count); + src->rsp.m0.ct_dataseg[i].ds_count, + &dst->rsp.m0.ct_dataseg[i].ds_count); } - } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { + } else if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO3) { for (i = 0; i < ISP_RQDSEG_T3; i++) { ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_base, - &ctdst->rsp.m0.ct_dataseg64[i].ds_base); + src->rsp.m0.ct_dataseg64[i].ds_base, + &dst->rsp.m0.ct_dataseg64[i].ds_base); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_basehi, - &ctdst->rsp.m0.ct_dataseg64[i].ds_basehi); + src->rsp.m0.ct_dataseg64[i].ds_basehi, + &dst->rsp.m0.ct_dataseg64[i].ds_basehi); ISP_IOXPUT_32(isp, - ctsrc->rsp.m0.ct_dataseg64[i].ds_count, - &ctdst->rsp.m0.ct_dataseg64[i].ds_count); + src->rsp.m0.ct_dataseg64[i].ds_count, + &dst->rsp.m0.ct_dataseg64[i].ds_count); } - } else if (ctsrc->ct_header.rqs_entry_type == RQSTYPE_CTIO4) { - ISP_IOXPUT_16(isp, ctsrc->rsp.m0.ct_dslist.ds_type, - &ctdst->rsp.m0.ct_dslist.ds_type); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_segment, - &ctdst->rsp.m0.ct_dslist.ds_segment); - ISP_IOXPUT_32(isp, ctsrc->rsp.m0.ct_dslist.ds_base, - &ctdst->rsp.m0.ct_dslist.ds_base); + } else if (src->ct_header.rqs_entry_type == RQSTYPE_CTIO4) { + ISP_IOXPUT_16(isp, src->rsp.m0.ct_dslist.ds_type, + &dst->rsp.m0.ct_dslist.ds_type); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_dslist.ds_segment, + &dst->rsp.m0.ct_dslist.ds_segment); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_dslist.ds_base, + &dst->rsp.m0.ct_dslist.ds_base); } - } else if ((ctsrc->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE1) { - ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved, - &ctdst->rsp.m1._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1._reserved2, - &ctdst->rsp.m1._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_senselen, - &ctdst->rsp.m1.ct_senselen); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_scsi_status, - &ctdst->rsp.m1.ct_scsi_status); - ISP_IOXPUT_16(isp, ctsrc->rsp.m1.ct_resplen, - &ctdst->rsp.m1.ct_resplen); + } else if ((src->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE1) { + ISP_IOXPUT_16(isp, src->rsp.m1._reserved, + &dst->rsp.m1._reserved); + ISP_IOXPUT_16(isp, src->rsp.m1._reserved2, + &dst->rsp.m1._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_senselen, + &dst->rsp.m1.ct_senselen); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_scsi_status, + &dst->rsp.m1.ct_scsi_status); + ISP_IOXPUT_16(isp, src->rsp.m1.ct_resplen, + &dst->rsp.m1.ct_resplen); for (i = 0; i < MAXRESPLEN; i++) { - ISP_IOXPUT_8(isp, ctsrc->rsp.m1.ct_resp[i], - &ctdst->rsp.m1.ct_resp[i]); + ISP_IOXPUT_8(isp, src->rsp.m1.ct_resp[i], + &dst->rsp.m1.ct_resp[i]); + } + } else { + ISP_IOXPUT_32(isp, src->rsp.m2._reserved, + &dst->rsp.m2._reserved); + ISP_IOXPUT_16(isp, src->rsp.m2._reserved2, + &dst->rsp.m2._reserved2); + ISP_IOXPUT_16(isp, src->rsp.m2._reserved3, + &dst->rsp.m2._reserved3); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_datalen, + &dst->rsp.m2.ct_datalen); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_base, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_base); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_count, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_count); + } +} + +void +isp_put_ctio7(ispsoftc_t *isp, ct7_entry_t *src, ct7_entry_t *dst) +{ + int i; + + isp_put_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXPUT_32(isp, src->ct_syshandle, &dst->ct_syshandle); + ISP_IOXPUT_16(isp, src->ct_nphdl, &dst->ct_nphdl); + ISP_IOXPUT_16(isp, src->ct_timeout, &dst->ct_timeout); + ISP_IOXPUT_16(isp, src->ct_seg_count, &dst->ct_seg_count); + ISP_IOXPUT_8(isp, src->ct_vpindex, &dst->ct_vpindex); + ISP_IOXPUT_8(isp, src->ct_xflags, &dst->ct_xflags); + ISP_IOXPUT_16(isp, src->ct_iid_lo, &dst->ct_iid_lo); + ISP_IOXPUT_8(isp, src->ct_iid_hi, &dst->ct_iid_hi); + ISP_IOXPUT_8(isp, src->ct_reserved, &dst->ct_reserved); + ISP_IOXPUT_32(isp, src->ct_rxid, &dst->ct_rxid); + ISP_IOXPUT_16(isp, src->ct_senselen, &dst->ct_senselen); + ISP_IOXPUT_16(isp, src->ct_flags, &dst->ct_flags); + ISP_IOXPUT_32(isp, src->ct_resid, &dst->ct_resid); + ISP_IOXPUT_16(isp, src->ct_oxid, &dst->ct_oxid); + ISP_IOXPUT_16(isp, src->ct_scsi_status, &dst->ct_scsi_status); + if ((dst->ct_flags & CT7_FLAG_MMASK) == CT7_FLAG_MODE0) { + ISP_IOXPUT_32(isp, src->rsp.m0.reloff, &dst->rsp.m0.reloff); + ISP_IOXPUT_32(isp, src->rsp.m0.reserved0, + &dst->rsp.m0.reserved0); + ISP_IOXPUT_32(isp, src->rsp.m0.ct_xfrlen, + &dst->rsp.m0.ct_xfrlen); + ISP_IOXPUT_32(isp, src->rsp.m0.reserved1, + &dst->rsp.m0.reserved1); + ISP_IOXPUT_32(isp, src->rsp.m0.ct.ds_base, + &dst->rsp.m0.ct.ds_base); + ISP_IOXPUT_32(isp, src->rsp.m0.ct.ds_basehi, + &dst->rsp.m0.ct.ds_basehi); + ISP_IOXPUT_32(isp, src->rsp.m0.ct.ds_count, + &dst->rsp.m0.ct.ds_count); + } else if ((dst->ct_flags & CT7_FLAG_MMASK) == CT7_FLAG_MODE1) { + ISP_IOXPUT_16(isp, src->rsp.m1.ct_resplen, + &dst->rsp.m1.ct_resplen); + ISP_IOXPUT_16(isp, src->rsp.m1.reserved, &dst->rsp.m1.reserved); + for (i = 0; i < MAXRESPLEN_24XX; i++) { + ISP_IOXPUT_8(isp, src->rsp.m1.ct_resp[i], + &dst->rsp.m1.ct_resp[i]); } } else { - ISP_IOXPUT_32(isp, ctsrc->rsp.m2._reserved, - &ctdst->rsp.m2._reserved); - ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved2, - &ctdst->rsp.m2._reserved2); - ISP_IOXPUT_16(isp, ctsrc->rsp.m2._reserved3, - &ctdst->rsp.m2._reserved3); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_datalen, - &ctdst->rsp.m2.ct_datalen); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_base, - &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_base); - ISP_IOXPUT_32(isp, ctsrc->rsp.m2.ct_fcp_rsp_iudata.ds_count, - &ctdst->rsp.m2.ct_fcp_rsp_iudata.ds_count); + ISP_IOXPUT_32(isp, src->rsp.m2.reserved0, + &dst->rsp.m2.reserved0); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_datalen, + &dst->rsp.m2.ct_datalen); + ISP_IOXPUT_32(isp, src->rsp.m2.reserved1, + &dst->rsp.m2.reserved1); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_base, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_base); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_basehi, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_basehi); + ISP_IOXPUT_32(isp, src->rsp.m2.ct_fcp_rsp_iudata.ds_count, + &dst->rsp.m2.ct_fcp_rsp_iudata.ds_count); } } + void -isp_get_ctio2(ispsoftc_t *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst) +isp_get_ctio2(ispsoftc_t *isp, ct2_entry_t *src, ct2_entry_t *dst) { int i; - isp_get_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); - ISP_IOXGET_32(isp, &ctsrc->ct_syshandle, ctdst->ct_syshandle); - ISP_IOXGET_8(isp, &ctsrc->ct_lun, ctdst->ct_lun); - ISP_IOXGET_8(isp, &ctsrc->ct_iid, ctdst->ct_iid); - ISP_IOXGET_16(isp, &ctsrc->ct_rxid, ctdst->ct_rxid); - ISP_IOXGET_16(isp, &ctsrc->ct_flags, ctdst->ct_flags); - ISP_IOXGET_16(isp, &ctsrc->ct_status, ctdst->ct_status); - ISP_IOXGET_16(isp, &ctsrc->ct_timeout, ctdst->ct_timeout); - ISP_IOXGET_16(isp, &ctsrc->ct_seg_count, ctdst->ct_seg_count); - ISP_IOXGET_32(isp, &ctsrc->ct_reloff, ctdst->ct_reloff); - ISP_IOXGET_32(isp, &ctsrc->ct_resid, ctdst->ct_resid); - if ((ctdst->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { - ISP_IOXGET_32(isp, &ctsrc->rsp.m0._reserved, - ctdst->rsp.m0._reserved); - ISP_IOXGET_16(isp, &ctsrc->rsp.m0._reserved2, - ctdst->rsp.m0._reserved2); - ISP_IOXGET_16(isp, &ctsrc->rsp.m0.ct_scsi_status, - ctdst->rsp.m0.ct_scsi_status); - ISP_IOXGET_32(isp, &ctsrc->rsp.m0.ct_xfrlen, - ctdst->rsp.m0.ct_xfrlen); - if (ctdst->ct_header.rqs_entry_type == RQSTYPE_CTIO2) { + isp_get_hdr(isp, &src->ct_header, &dst->ct_header); + ISP_IOXGET_32(isp, &src->ct_syshandle, dst->ct_syshandle); + ISP_IOXGET_8(isp, &src->ct_lun, dst->ct_lun); + ISP_IOXGET_8(isp, &src->ct_iid, dst->ct_iid); + ISP_IOXGET_16(isp, &src->ct_rxid, dst->ct_rxid); + ISP_IOXGET_16(isp, &src->ct_flags, dst->ct_flags); + ISP_IOXGET_16(isp, &src->ct_status, dst->ct_status); + ISP_IOXGET_16(isp, &src->ct_timeout, dst->ct_timeout); + ISP_IOXGET_16(isp, &src->ct_seg_count, dst->ct_seg_count); + ISP_IOXGET_32(isp, &src->ct_reloff, dst->ct_reloff); + ISP_IOXGET_32(isp, &src->ct_resid, dst->ct_resid); + if ((dst->ct_flags & CT2_FLAG_MMASK) == CT2_FLAG_MODE0) { + ISP_IOXGET_32(isp, &src->rsp.m0._reserved, >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609172124.k8HLOXrX088371>