Lines Matching +full:no +full:- +full:ct

1 -/* $NetBSD: isp_target.c,v 1.38 2024/09/08 09:36:50 rillig Exp $ */
2 /*-
3 * Copyright (c) 1997-2008 by Matthew Jacob
19 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
113 * (Accept Target IO) type- sometimes with enough info to stop the command at
120 * cards that 'auto-replenish' the f/w's ATIO count, but this is the basic
141 * code- we have no synchronization primitives in the common code.
215 len = at7iop->at_ta_len & 0xfffff;
216 if (len > (QENTRY_LEN - 8)) {
217 len -= (QENTRY_LEN - 8);
221 len -= QENTRY_LEN;
227 if (at7iop->at_cmnd.fcp_cmnd_task_management) {
288 iid = ecp->in_iid;
289 status = ecp->in_status;
290 seqid = ecp->in_seqid;
294 iid = fcp->in_iid;
295 status = fcp->in_status;
296 seqid = fcp->in_seqid;
301 status = inp->in_status & 0xff;
302 seqid = inp->in_seqid;
303 iid = inp->in_iid;
305 bus = GET_BUS_VAL(inp->in_iid);
306 SET_BUS_VAL(inp->in_iid, 0);
336 notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
403 if (nack_24xx->na_status != NA_OK) {
408 isp_prt(isp, level, "Notify Ack Status=0x%x; Subcode 0x%x seqid=0x%x", nack_24xx->na_status, nack_24xx->na_status_subcode, nack_24xx->na_rxid);
416 if (nack_fcp->na_status != NA_OK) {
421 isp_prt(isp, level, "Notify Ack Status=0x%x seqid 0x%x", nack_fcp->na_status, nack_fcp->na_seqid);
425 if (nackp->na_status != NA_OK) {
430 isp_prt(isp, level, "Notify Ack event 0x%x status=0x%x seqid 0x%x", nackp->na_event, nackp->na_status, nackp->na_seqid);
441 if (abts_rsp->abts_rsp_status) {
446 isp_prt(isp, level, "ABTS RSP response[0x%x]: status=0x%x sub=(0x%x 0x%x)", abts_rsp->abts_rsp_rxid_task, abts_rsp->abts_rsp_status,
447 abts_rsp->abts_rsp_payload.rsp.subcode1, abts_rsp->abts_rsp_payload.rsp.subcode2);
506 } else if (cmd == -RQSTYPE_ENABLE_LUN) {
510 } else if (cmd == -RQSTYPE_MODIFY_LUN) {
519 el.le_tgt = SDPARAM(isp, bus)->isp_initiator_id;
529 return (-1);
532 ISP_TDQE(isp, "isp_lun_cmd", isp->isp_reqidx, &el);
541 uint8_t etype = ((isphdr_t *) ap)->rqs_entry_type;
546 return (-1);
574 return (-1);
576 ISP_TDQE(isp, __func__, isp->isp_reqidx, ap);
596 atun._atio2.at_scclun = aep->at_scclun;
598 atun._atio2.at_lun = (uint8_t) aep->at_lun;
601 atun._atio2e.at_iid = ((at2e_entry_t *)aep)->at_iid;
603 atun._atio2.at_iid = aep->at_iid;
605 atun._atio2.at_rxid = aep->at_rxid;
611 atun._atio.at_handle = aep->at_handle;
612 atun._atio.at_iid = aep->at_iid;
613 atun._atio.at_tgt = aep->at_tgt;
614 atun._atio.at_lun = aep->at_lun;
615 atun._atio.at_tag_type = aep->at_tag_type;
616 atun._atio.at_tag_val = aep->at_tag_val;
617 atun._atio.at_status = (aep->at_flags & AT_TQAE);
624 * Command completion- both for handling cases of no resources or
625 * no blackhole driver, or other cases where we have to, inline,
671 isp_prt(isp, ISP_LOGTDEBUG0, "%s: [RX_ID 0x%x] chan %d code %x", __func__, aep->at_rxid, vpidx, code);
674 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO7;
675 cto->ct_header.rqs_entry_count = 1;
676 cto->ct_nphdl = nphdl;
677 cto->ct_rxid = aep->at_rxid;
678 cto->ct_iid_lo = (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2];
679 cto->ct_iid_hi = aep->at_hdr.s_id[0];
680 cto->ct_oxid = aep->at_hdr.ox_id;
681 cto->ct_scsi_status = sts;
682 cto->ct_vpidx = vpidx;
683 cto->ct_flags = CT7_NOACK;
685 cto->ct_flags |= CT7_TERMINATE;
687 cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS;
688 cto->ct_scsi_status |= (FCP_SNSLEN_VALID << 8);
689 cto->rsp.m1.ct_resplen = cto->ct_senselen = uimin(16, MAXRESPLEN_24XX);
690 ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof (cto->rsp.m1.ct_resp));
691 cto->rsp.m1.ct_resp[0] = 0xf0;
692 cto->rsp.m1.ct_resp[2] = (code >> 12) & 0xf;
693 cto->rsp.m1.ct_resp[7] = 8;
694 cto->rsp.m1.ct_resp[12] = (code >> 24) & 0xff;
695 cto->rsp.m1.ct_resp[13] = (code >> 16) & 0xff;
697 cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS;
699 if (aep->at_cmnd.cdb_dl.sf.fcp_cmnd_dl) {
700 cto->ct_resid = aep->at_cmnd.cdb_dl.sf.fcp_cmnd_dl;
701 if (cto->ct_resid < 0) {
702 cto->ct_scsi_status |= (FCP_RESID_OVERFLOW << 8);
703 } else if (cto->ct_resid > 0) {
704 cto->ct_scsi_status |= (FCP_RESID_UNDERFLOW << 8);
707 cto->ct_syshandle = hdl;
718 isp_prt(isp, ISP_LOGTDEBUG0, "%s: [RX_ID 0x%x] code %x", __func__, aep->at_rxid, code);
721 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
722 cto->ct_header.rqs_entry_count = 1;
724 cto->ct_lun = aep->at_lun;
727 un._ctio2e.ct_iid = ((at2e_entry_t *)aep)->at_iid;
729 cto->ct_iid = aep->at_iid;
731 cto->ct_rxid = aep->at_rxid;
732 cto->rsp.m1.ct_scsi_status = sts;
733 cto->ct_flags = CT2_SENDSTATUS | CT2_NO_DATA | CT2_FLAG_MODE1;
735 cto->ct_flags |= CT2_CCINCR;
737 if (aep->at_datalen) {
738 cto->ct_resid = aep->at_datalen;
739 cto->rsp.m1.ct_scsi_status |= CT2_DATA_UNDER;
742 cto->rsp.m1.ct_resp[0] = 0xf0;
743 cto->rsp.m1.ct_resp[2] = (code >> 12) & 0xf;
744 cto->rsp.m1.ct_resp[7] = 8;
745 cto->rsp.m1.ct_resp[12] = (code >> 24) & 0xff;
746 cto->rsp.m1.ct_resp[13] = (code >> 16) & 0xff;
747 cto->rsp.m1.ct_senselen = 16;
748 cto->rsp.m1.ct_scsi_status |= CT2_SNSLEN_VALID;
750 cto->ct_syshandle = hdl;
760 isp_prt(isp, ISP_LOGTDEBUG0, "%s: [IID %d] code %x", __func__, aep->at_iid, code);
763 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO;
764 cto->ct_header.rqs_entry_count = 1;
765 cto->ct_fwhandle = aep->at_handle;
766 cto->ct_iid = aep->at_iid;
767 cto->ct_tgt = aep->at_tgt;
768 cto->ct_lun = aep->at_lun;
769 cto->ct_tag_type = aep->at_tag_type;
770 cto->ct_tag_val = aep->at_tag_val;
771 if (aep->at_flags & AT_TQAE) {
772 cto->ct_flags |= CT_TQAE;
774 cto->ct_flags = CT_SENDSTATUS | CT_NO_DATA;
776 cto->ct_flags |= CT_CCINCR;
778 cto->ct_scsi_status = sts;
779 cto->ct_syshandle = hdl;
803 notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
842 ct7_entry_t *ct = (ct7_entry_t *) storage;
843 ct->ct_header.rqs_entry_type = RQSTYPE_CTIO7;
844 ct->ct_nphdl = CT7_OK;
845 ct->ct_syshandle = bus;
846 ct->ct_flags = CT7_SENDSTATUS;
849 ct2_entry_t *ct = (ct2_entry_t *) storage;
850 ct->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
851 ct->ct_status = CT_OK;
852 ct->ct_syshandle = bus;
853 ct->ct_flags = CT2_SENDSTATUS|CT2_FASTPOST;
855 ct_entry_t *ct = (ct_entry_t *) storage;
856 ct->ct_header.rqs_entry_type = RQSTYPE_CTIO;
857 ct->ct_status = CT_OK;
858 ct->ct_syshandle = bus;
860 ct->ct_fwhandle = 0;
861 ct->ct_flags = CT_SENDSTATUS;
868 if (isp->isp_state == ISP_RUNSTATE) {
881 * - abort: clean up the current command
882 * - abort tag and clear queue
889 uint8_t status = inp->in_status & ~QLTM_SVALID;
894 notify.nt_nphdl = GET_IID_VAL(inp->in_iid);
897 notify.nt_channel = GET_BUS_VAL(inp->in_iid);
898 notify.nt_tgt = inp->in_tgt;
899 notify.nt_lun = inp->in_lun;
901 notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
905 switch (inp->in_msg[0]) {
928 isp_prt(isp, ISP_LOGERR, "%s: unhandled message 0x%x", __func__, inp->in_msg[0]);
934 isp_prt(isp, ISP_LOGERR, "%s: unknown immediate notify status 0x%x", __func__, inp->in_status);
946 static const char f1[] = "%s from N-port handle 0x%x lun %d seq 0x%x";
947 static const char f2[] = "unknown %s 0x%x lun %d N-Port handle 0x%x task flags 0x%x seq 0x%x\n";
954 notify.nt_nphdl = ((in_fcentry_e_t *)inp)->in_iid;
955 loopid = ((in_fcentry_e_t *)inp)->in_iid;
956 seqid = ((in_fcentry_e_t *)inp)->in_seqid;
958 notify.nt_nphdl = inp->in_iid;
959 loopid = inp->in_iid;
960 seqid = inp->in_seqid;
967 notify.nt_lun = inp->in_scclun;
969 notify.nt_lun = inp->in_lun;
972 notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
976 if (inp->in_status != IN_MSG_RECEIVED) {
977 isp_prt(isp, ISP_LOGINFO, f2, "immediate notify status", inp->in_status, notify.nt_lun, loopid, inp->in_task_flags, inp->in_seqid);
982 if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) {
983 isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", loopid, notify.nt_lun, inp->in_seqid);
985 } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) {
986 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", loopid, notify.nt_lun, inp->in_seqid);
988 } else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) {
989 isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", loopid, notify.nt_lun, inp->in_seqid);
991 } else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) {
992 isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET", loopid, notify.nt_lun, inp->in_seqid);
994 } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) {
995 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA", loopid, notify.nt_lun, inp->in_seqid);
998 isp_prt(isp, ISP_LOGWARN, f2, "task flag", inp->in_status, notify.nt_lun, loopid, inp->in_task_flags, inp->in_seqid);
1017 notify.nt_lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | (aep->at_cmnd.fcp_cmnd_lun[1]);
1018 notify.nt_tagval = aep->at_rxid;
1019 notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
1021 sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | (aep->at_hdr.s_id[2]);
1024 did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2];
1025 for (chan = 0; chan < isp->isp_nchan; chan++) {
1026 if (FCPARAM(isp, chan)->isp_portid == did) {
1030 if (chan == isp->isp_nchan) {
1039 if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) {
1040 isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", sid, notify.nt_lun, aep->at_rxid);
1042 } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_CLEAR_TASK_SET) {
1043 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", sid, notify.nt_lun, aep->at_rxid);
1045 } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_LUN_RESET) {
1046 isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", sid, notify.nt_lun, aep->at_rxid);
1048 } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_TGT_RESET) {
1049 isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET", sid, notify.nt_lun, aep->at_rxid);
1051 } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_CLEAR_ACA) {
1052 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA", sid, notify.nt_lun, aep->at_rxid);
1055 isp_prt(isp, ISP_LOGWARN, f2, aep->at_cmnd.fcp_cmnd_task_management, notify.nt_lun, sid, aep->at_rxid);
1071 if (IS_24XX(isp) && arg != NULL && (((isphdr_t *)arg)->rqs_entry_type == RQSTYPE_ATIO)) {
1088 na->na_nphdl = in->in_nphdl;
1089 na->na_flags = in->in_flags & IN24XX_FLAG_PUREX_IOCB;
1090 na->na_status = in->in_status;
1091 na->na_status_subcode = in->in_status_subcode;
1092 na->na_rxid = in->in_rxid;
1093 na->na_oxid = in->in_oxid;
1094 na->na_vpidx = in->in_vpidx;
1095 if (in->in_status == IN24XX_SRR_RCVD) {
1096 na->na_srr_rxid = in->in_srr_rxid;
1097 na->na_srr_reloff_hi = in->in_srr_reloff_hi;
1098 na->na_srr_reloff_lo = in->in_srr_reloff_lo;
1099 na->na_srr_iu = in->in_srr_iu;
1100 na->na_srr_flags = 1;
1101 na->na_srr_reject_vunique = 0;
1102 na->na_srr_reject_explanation = 1;
1103 na->na_srr_reject_code = 1;
1106 na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
1107 na->na_header.rqs_entry_count = 1;
1117 ((na_fcentry_e_t *)na)->na_iid = ((in_fcentry_e_t *)inp)->in_iid;
1118 iid = ((na_fcentry_e_t *)na)->na_iid;
1120 na->na_iid = inp->in_iid;
1121 iid = na->na_iid;
1123 na->na_task_flags = inp->in_task_flags & TASK_FLAGS_RESERVED_MASK;
1124 na->na_seqid = inp->in_seqid;
1125 na->na_flags = NAFC_RCOUNT;
1126 na->na_status = inp->in_status;
1127 if (inp->in_status == IN_RESET) {
1128 na->na_flags |= NAFC_RST_CLRD;
1130 if (inp->in_status == IN_MSG_RECEIVED) {
1131 na->na_flags |= NAFC_TVALID;
1132 na->na_response = 0; /* XXX SUCCEEDED XXX */
1135 na->na_flags = NAFC_RST_CLRD;
1137 na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
1138 na->na_header.rqs_entry_count = 1;
1144 isp_prt(isp, ISP_LOGTDEBUG0, "notify ack loopid %u seqid %x flags %x tflags %x response %x", iid, na->na_seqid,
1145 na->na_flags, na->na_task_flags, na->na_response);
1151 na->na_iid = inp->in_iid;
1152 na->na_lun = inp->in_lun;
1153 na->na_tgt = inp->in_tgt;
1154 na->na_seqid = inp->in_seqid;
1155 if (inp->in_status == IN_RESET) {
1156 na->na_event = NA_RST_CLRD;
1159 na->na_event = NA_RST_CLRD;
1161 na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
1162 na->na_header.rqs_entry_count = 1;
1164 isp_prt(isp, ISP_LOGTDEBUG0, "notify ack loopid %u lun %u tgt %u seqid %x event %x", na->na_iid, na->na_lun, na->na_tgt, na->na_seqid, na->na_event);
1166 ISP_TDQE(isp, "isp_notify_ack", isp->isp_reqidx, storage);
1182 isp_prt(isp, ISP_LOGERR, "%s: called for non-24XX card", __func__);
1186 if (abts->abts_header.rqs_entry_type != RQSTYPE_ABTS_RCVD) {
1187 isp_prt(isp, ISP_LOGERR, "%s: called for non-ABTS entry (0x%x)", __func__, abts->abts_header.rqs_entry_type);
1198 rsp->abts_rsp_header.rqs_entry_type = RQSTYPE_ABTS_RSP;
1203 rsp->abts_rsp_r_ctl = BA_ACC;
1204 tmpw = rsp->abts_rsp_did_lo;
1205 tmpb = rsp->abts_rsp_did_hi;
1206 rsp->abts_rsp_did_lo = rsp->abts_rsp_sid_lo;
1207 rsp->abts_rsp_did_hi = rsp->abts_rsp_sid_hi;
1208 rsp->abts_rsp_sid_lo = tmpw;
1209 rsp->abts_rsp_sid_hi = tmpb;
1211 rsp->abts_rsp_f_ctl_hi ^= 0x80; /* invert Exchange Context */
1212 rsp->abts_rsp_f_ctl_hi &= ~0x7f; /* clear Sequence Initiator and other bits */
1213 rsp->abts_rsp_f_ctl_hi |= 0x10; /* abort the whole exchange */
1214 rsp->abts_rsp_f_ctl_hi |= 0x8; /* last data frame of sequence */
1215 rsp->abts_rsp_f_ctl_hi |= 0x1; /* transfer Sequence Initiative */
1216 rsp->abts_rsp_f_ctl_lo = 0;
1221 rx_id = rsp->abts_rsp_rx_id;
1222 ox_id = rsp->abts_rsp_ox_id;
1223 ISP_MEMZERO(&rsp->abts_rsp_payload.ba_acc, sizeof (rsp->abts_rsp_payload.ba_acc));
1224 isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS of 0x%x being BA_ACC'd", rsp->abts_rsp_rxid_abts, rsp->abts_rsp_rxid_task);
1225 rsp->abts_rsp_payload.ba_acc.aborted_rx_id = rx_id;
1226 rsp->abts_rsp_payload.ba_acc.aborted_ox_id = ox_id;
1227 rsp->abts_rsp_payload.ba_acc.high_seq_cnt = 0xffff;
1229 ISP_MEMZERO(&rsp->abts_rsp_payload.ba_rjt, sizeof (rsp->abts_rsp_payload.ba_acc));
1232 rsp->abts_rsp_payload.ba_rjt.reason = 5; /* Logical Busy */
1235 rsp->abts_rsp_payload.ba_rjt.reason = 9; /* Unable to perform command request */
1245 ISP_TDQE(isp, "isp_acknak_abts", isp->isp_reqidx, storage);
1254 lun = aep->at_lun;
1262 * we're still connected on the SCSI bus - i.e. the initiator
1267 switch (aep->at_status & ~QLTM_SVALID) {
1293 isp_prt(isp, ISP_LOGERR, atiocope, lun, GET_BUS_VAL(aep->at_iid));
1313 isp_prt(isp, ISP_LOGWARN, atior, lun, GET_IID_VAL(aep->at_iid), GET_BUS_VAL(aep->at_iid));
1318 isp_prt(isp, ISP_LOGERR, "Unknown ATIO status 0x%x from loopid %d for lun %d", aep->at_status, aep->at_iid, lun);
1330 lun = aep->at_scclun;
1332 lun = aep->at_lun;
1336 iid = ((at2e_entry_t *)aep)->at_iid;
1338 iid = aep->at_iid;
1348 * we're still connected on the SCSI bus - i.e. the initiator
1353 switch (aep->at_status & ~QLTM_SVALID) {
1366 isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for lun %d- command count overflow", lun);
1375 * resource count in the Enable Lun entry and no
1403 isp_prt(isp, ISP_LOGERR, "Unknown ATIO2 status 0x%x from loopid %d for lun %d", aep->at_status, iid, lun);
1410 isp_handle_ctio(ispsoftc_t *isp, ct_entry_t *ct)
1416 if (ct->ct_syshandle) {
1417 xs = isp_find_xs_tgt(isp, ct->ct_syshandle);
1425 switch (ct->ct_status & ~QLTM_SVALID) {
1435 if (ct->ct_flags & CT_SENDSTATUS) {
1437 } else if ((ct->ct_flags & CT_DATAMASK) == CT_NO_DATA) {
1441 isp_prt(isp, pl, "CTIO- iid %d disconnected OK", ct->ct_iid);
1478 isp_prt(isp, ISP_LOGERR, "Firmware rejected CTIO for disabled lun %d", ct->ct_lun);
1483 * CTIO rejected by the firmware due "no path for the
1485 * we tried to access the bus while a non-disconnecting
1488 isp_prt(isp, ISP_LOGERR, "Firmware rejected CTIO for bad nexus %d/%d/%d", ct->ct_iid, ct->ct_tgt, ct->ct_lun);
1519 isp_prt(isp, ISP_LOGERR, "CTIO returned by f/w- %s", fmsg);
1522 isp_prt(isp, ISP_LOGERR, "Unknown CTIO status 0x%x", ct->ct_status & ~QLTM_SVALID);
1534 if (ct->ct_syshandle == 0) {
1535 if ((ct->ct_flags & CT_SENDSTATUS) == 0) {
1541 isp_prt(isp, pl, "NO xs for CTIO (handle 0x%x) status 0x%x", ct->ct_syshandle, ct->ct_status & ~QLTM_SVALID);
1548 if ((ct->ct_flags & CT_DATAMASK) != CT_NO_DATA) {
1549 ISP_DMAFREE(isp, xs, ct->ct_syshandle);
1555 isp_async(isp, ISPASYNC_TARGET_ACTION, ct);
1560 isp_handle_ctio2(ispsoftc_t *isp, ct2_entry_t *ct)
1566 if (ct->ct_syshandle) {
1567 xs = isp_find_xs_tgt(isp, ct->ct_syshandle);
1575 switch (ct->ct_status & ~QLTM_SVALID) {
1616 isp_prt(isp, ISP_LOGTDEBUG0, "CTIO2 destroyed by %s: RX_ID=0x%x", fmsg, ct->ct_rxid);
1621 * CTIO rejected by the firmware - invalid data direction.
1653 isp_prt(isp, ISP_LOGWARN, "CTIO returned by f/w- %s", fmsg);
1661 isp_prt(isp, ISP_LOGWARN, "CTIO2 completed with Invalid RX_ID 0x%x", ct->ct_rxid);
1665 isp_prt(isp, ISP_LOGERR, "Unknown CTIO2 status 0x%x", ct->ct_status & ~QLTM_SVALID);
1677 if (ct->ct_syshandle == 0) {
1678 if ((ct->ct_flags & CT2_SENDSTATUS) == 0) {
1684 isp_prt(isp, pl, "NO xs for CTIO (handle 0x%x) status 0x%x", ct->ct_syshandle, ct->ct_status & ~QLTM_SVALID);
1687 if ((ct->ct_flags & CT2_DATAMASK) != CT2_NO_DATA) {
1688 ISP_DMAFREE(isp, xs, ct->ct_syshandle);
1690 if (ct->ct_flags & CT2_SENDSTATUS) {
1707 isp_async(isp, ISPASYNC_TARGET_ACTION, ct);
1715 isp_handle_ctio7(ispsoftc_t *isp, ct7_entry_t *ct)
1721 if (ct->ct_syshandle) {
1722 xs = isp_find_xs_tgt(isp, ct->ct_syshandle);
1730 switch (ct->ct_nphdl) {
1760 isp_prt(isp, ISP_LOGTDEBUG0, "CTIO7 destroyed by %s: RX_ID=0x%x", fmsg, ct->ct_rxid);
1787 isp_prt(isp, ISP_LOGWARN, "CTIO returned by f/w- %s", fmsg);
1795 isp_prt(isp, ISP_LOGWARN, "CTIO7 completed with Invalid RX_ID 0x%x", ct->ct_rxid);
1807 isp_prt(isp, ISP_LOGERR, "Unknown CTIO7 status 0x%x", ct->ct_nphdl);
1819 if (ct->ct_syshandle == 0) {
1820 if (ct->ct_flags & CT7_TERMINATE) {
1821 isp_prt(isp, ISP_LOGINFO, "termination of 0x%x complete", ct->ct_rxid);
1822 } else if ((ct->ct_flags & CT7_SENDSTATUS) == 0) {
1828 isp_prt(isp, pl, "NO xs for CTIO (handle 0x%x) status 0x%x", ct->ct_syshandle, ct->ct_nphdl);
1831 if ((ct->ct_flags & CT7_DATAMASK) != CT7_NO_DATA) {
1832 ISP_DMAFREE(isp, xs, ct->ct_syshandle);
1834 if (ct->ct_flags & CT7_SENDSTATUS) {
1851 isp_async(isp, ISPASYNC_TARGET_ACTION, ct);
1867 ochan = chan = ISP_GET_VPIDX(isp, inot_24xx->in_vpidx);
1870 hichan = isp->isp_nchan;
1872 if (chan >= isp->isp_nchan) {
1874 ISP_SNPRINTF(buf, sizeof buf, "%s: bad channel %d for status 0x%x", __func__, chan, inot_24xx->in_status);
1882 isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid);
1884 switch (inot_24xx->in_status) {
1892 inot_24xx->in_vpidx = chan;
1896 isp_prt(isp, ISP_LOGINFO, "%s: unhandled status (0x%x) for chan %d", __func__, inot_24xx->in_status, chan);
1901 inot_24xx->in_vpidx = ochan;