summaryrefslogtreecommitdiff
path: root/sys/dev/ic/isp_target.c
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>2000-10-16 01:02:02 +0000
committermjacob <mjacob@cvs.openbsd.org>2000-10-16 01:02:02 +0000
commit9cc1567806c1cd21079fd2d4304cb9d473812767 (patch)
tree8bcdc7f9b6ff007ecad40d121f805f84f32678bc /sys/dev/ic/isp_target.c
parent72cbdc846bedac2befb88855f176a7bbc835f811 (diff)
Update OpenBSD with respect to Solaris/FreeBSD/NetBSD/Linux versions.
Major rewrite of a lot of internals- far too many to list. Cleaner locking, more paramaterization, an isp_prt logging function that handles debugging as well as error printouts. We also should no longer hang if there is no Loop for Fibre Channel when booting. The file ispvar.h now contains a list of all platform required macros and explanation as to what they're for. This should make maintenance easier.
Diffstat (limited to 'sys/dev/ic/isp_target.c')
-rw-r--r--sys/dev/ic/isp_target.c257
1 files changed, 124 insertions, 133 deletions
diff --git a/sys/dev/ic/isp_target.c b/sys/dev/ic/isp_target.c
index d6b7fd14b9e..4718c2b6f61 100644
--- a/sys/dev/ic/isp_target.c
+++ b/sys/dev/ic/isp_target.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: isp_target.c,v 1.2 2000/07/06 05:31:48 mjacob Exp $ */
+/* $OpenBSD: isp_target.c,v 1.3 2000/10/16 01:02:00 mjacob Exp $ */
/*
* Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters.
*
- * Copyright (c) 1999 by Matthew Jacob
+ * Copyright (c) 1999, 2000 by Matthew Jacob
* All rights reserved.
* mjacob@feral.com
*
@@ -12,10 +12,7 @@
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
+ * 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -49,7 +46,10 @@
#endif
#ifdef ISP_TARGET_MODE
-int isp_tdebug = 0;
+static char *atiocope =
+ "ATIO returned for lun %d because it was in the middle of Bus Device Reset";
+static char *atior =
+ "ATIO returned for lun %d from initiator %d because a Bus Reset occurred";
static void isp_got_msg __P((struct ispsoftc *, int, in_entry_t *));
static void isp_got_msg_fc __P((struct ispsoftc *, int, in_fcentry_t *));
@@ -179,8 +179,8 @@ isp_target_notify(isp, vptr, optrp)
inotp->in_iid &= ~0x80;
}
}
- ITDEBUG(2, ("isp_target_notify: Immediate Notify, "
- "status=0x%x seqid=0x%x\n", status, seqid));
+ isp_prt(isp, ISP_LOGTDEBUG1,
+ "Immediate Notify, status=0x%x seqid=0x%x", status, seqid);
switch (status) {
case IN_RESET:
(void) isp_async(isp, ISPASYNC_BUS_RESET, &bus);
@@ -194,26 +194,29 @@ isp_target_notify(isp, vptr, optrp)
}
break;
case IN_RSRC_UNAVAIL:
- PRINTF("%s: Firmware out of ATIOs\n", isp->isp_name);
+ isp_prt(isp, ISP_LOGWARN, "Firmware out of ATIOs");
break;
case IN_ABORT_TASK:
- PRINTF("%s: Abort Task for Initiator %d RX_ID 0x%x\n",
- isp->isp_name, inot_fcp->in_iid, seqid);
+ isp_prt(isp, ISP_LOGWARN,
+ "Abort Task for Initiator %d RX_ID 0x%x",
+ inot_fcp->in_iid, seqid);
break;
case IN_PORT_LOGOUT:
- PRINTF("%s: Port Logout for Initiator %d RX_ID 0x%x\n",
- isp->isp_name, inot_fcp->in_iid, seqid);
+ isp_prt(isp, ISP_LOGWARN,
+ "Port Logout for Initiator %d RX_ID 0x%x",
+ inot_fcp->in_iid, seqid);
break;
case IN_PORT_CHANGED:
- PRINTF("%s: Port Changed for Initiator %d RX_ID 0x%x\n",
- isp->isp_name, inot_fcp->in_iid, seqid);
+ isp_prt(isp, ISP_LOGWARN,
+ "Port Changed for Initiator %d RX_ID 0x%x",
+ inot_fcp->in_iid, seqid);
break;
case IN_GLOBAL_LOGO:
- PRINTF("%s: All ports logged out\n", isp->isp_name);
+ isp_prt(isp, ISP_LOGWARN, "All ports logged out");
break;
default:
- PRINTF("%s: bad status (0x%x) in isp_target_notify\n",
- isp->isp_name, status);
+ isp_prt(isp, ISP_LOGERR,
+ "bad status (0x%x) in isp_target_notify", status);
break;
}
isp_notify_ack(isp, vptr);
@@ -225,18 +228,19 @@ isp_target_notify(isp, vptr, optrp)
* Immediate Notify entry for some asynchronous event.
*/
if (IS_FC(isp)) {
- ITDEBUG(2, ("%s: Notify Ack status=0x%x seqid 0x%x\n",
- isp->isp_name, nack_fcp->na_status,
- nack_fcp->na_seqid));
+ isp_prt(isp, ISP_LOGTDEBUG1,
+ "Notify Ack status=0x%x seqid 0x%x",
+ nack_fcp->na_status, nack_fcp->na_seqid);
} else {
- ITDEBUG(2, ("%s: Notify Ack event 0x%x status=0x%x "
- "seqid 0x%x\n", isp->isp_name, nackp->na_event,
- nackp->na_status, nackp->na_seqid));
+ isp_prt(isp, ISP_LOGTDEBUG1,
+ "Notify Ack event 0x%x status=0x%x seqid 0x%x",
+ nackp->na_event, nackp->na_status, nackp->na_seqid);
}
break;
default:
- PRINTF("%s: Unknown entry type 0x%x in isp_target_notify",
- isp->isp_name, hdrp->rqs_entry_type);
+ isp_prt(isp, ISP_LOGERR,
+ "Unknown entry type 0x%x in isp_target_notify",
+ hdrp->rqs_entry_type);
rval = -1;
break;
}
@@ -310,8 +314,8 @@ isp_lun_cmd(isp, cmd, bus, tgt, lun, opaque)
}
if (isp_getrqentry(isp, &iptr, &optr, &outp)) {
- PRINTF("%s: Request Queue Overflow in isp_lun_cmd\n",
- isp->isp_name);
+ isp_prt(isp, ISP_LOGWARN,
+ "Request Queue Overflow in isp_lun_cmd");
return (-1);
}
ISP_SWIZ_ENABLE_LUN(isp, outp, &el);
@@ -331,8 +335,8 @@ isp_target_put_entry(isp, ap)
u_int8_t etype = ((isphdr_t *) ap)->rqs_entry_type;
if (isp_getrqentry(isp, &iptr, &optr, &outp)) {
- PRINTF("%s: Request Queue Overflow in isp_target_put_entry "
- "for type 0x%x\n", isp->isp_name, etype);
+ isp_prt(isp, ISP_LOGWARN,
+ "Request Queue Overflow in isp_target_put_entry");
return (-1);
}
switch (etype) {
@@ -349,8 +353,8 @@ isp_target_put_entry(isp, ap)
ISP_SWIZ_CTIO2(isp, outp, ap);
break;
default:
- PRINTF("%s: Unknown type 0x%x in isp_put_entry\n",
- isp->isp_name, etype);
+ isp_prt(isp, ISP_LOGERR,
+ "Unknown type 0x%x in isp_put_entry", etype);
return (-1);
}
@@ -518,22 +522,21 @@ isp_target_async(isp, bus, event)
*/
MEMZERO(&msg, sizeof msg);
if (IS_FC(isp)) {
- msg.nt_iid =
- ((fcparam *)isp->isp_param)->isp_loopid;
+ msg.nt_iid = FCPARAM(isp)->isp_loopid;
} else {
- msg.nt_iid =
- ((sdparam *)isp->isp_param)->isp_initiator_id;
+ msg.nt_iid = SDPARAM(isp)->isp_initiator_id;
}
msg.nt_bus = bus;
msg.nt_msg[0] = MSG_BUS_DEV_RESET;
(void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg);
break;
default:
- PRINTF("%s: isp_target_async: unknown event 0x%x\n",
- isp->isp_name, event);
+ isp_prt(isp, ISP_LOGERR,
+ "isp_target_async: unknown event 0x%x", event);
break;
}
- isp_notify_ack(isp, NULL);
+ if (isp->isp_state == ISP_RUNSTATE)
+ isp_notify_ack(isp, NULL);
}
@@ -566,8 +569,8 @@ isp_got_msg(isp, bus, inp)
MEMCPY(msg.nt_msg, inp->in_msg, IN_MSGLEN);
(void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg);
} else {
- PRINTF("%s: unknown immediate notify status 0x%x\n",
- isp->isp_name, inp->in_status);
+ isp_prt(isp, ISP_LOGERR,
+ "unknown immediate notify status 0x%x", inp->in_status);
}
}
@@ -580,12 +583,12 @@ isp_got_msg_fc(isp, bus, inp)
int bus;
in_fcentry_t *inp;
{
- static char *f1 = "%s: %s from iid %d lun %d seq 0x%x\n";
+ static char *f1 = "%s from iid %d lun %d seq 0x%x";
static char *f2 =
- "%s: unknown %s 0x%x lun %d iid %d task flags 0x%x seq 0x%x\n";
+ "unknown %s 0x%x lun %d iid %d task flags 0x%x seq 0x%x\n";
if (inp->in_status != IN_MSG_RECEIVED) {
- PRINTF(f2, isp->isp_name, "immediate notify status",
+ isp_prt(isp, ISP_LOGINFO, f2, "immediate notify status",
inp->in_status, inp->in_lun, inp->in_iid,
inp->in_task_flags, inp->in_seqid);
} else {
@@ -602,28 +605,28 @@ isp_got_msg_fc(isp, bus, inp)
msg.nt_tagval = inp->in_seqid;
if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK) {
- PRINTF(f1, isp->isp_name, "ABORT TASK",
+ isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK",
inp->in_iid, inp->in_lun, inp->in_seqid);
msg.nt_msg[0] = MSG_ABORT_TAG;
} else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) {
- PRINTF(f1, isp->isp_name, "CLEAR TASK SET",
+ isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET",
inp->in_iid, inp->in_lun, inp->in_seqid);
msg.nt_msg[0] = MSG_CLEAR_QUEUE;
} else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) {
- PRINTF(f1, isp->isp_name, "TARGET RESET",
+ isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET",
inp->in_iid, inp->in_lun, inp->in_seqid);
msg.nt_msg[0] = MSG_BUS_DEV_RESET;
} else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) {
- PRINTF(f1, isp->isp_name, "CLEAR ACA",
+ isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA",
inp->in_iid, inp->in_lun, inp->in_seqid);
/* ???? */
msg.nt_msg[0] = MSG_REL_RECOVERY;
} else if (inp->in_task_flags & TASK_FLAGS_TERMINATE_TASK) {
- PRINTF(f1, isp->isp_name, "TERMINATE TASK",
+ isp_prt(isp, ISP_LOGINFO, f1, "TERMINATE TASK",
inp->in_iid, inp->in_lun, inp->in_seqid);
msg.nt_msg[0] = MSG_TERM_IO_PROC;
} else {
- PRINTF(f2, isp->isp_name, "task flag",
+ isp_prt(isp, ISP_LOGWARN, f2, "task flag",
inp->in_status, inp->in_lun, inp->in_iid,
inp->in_task_flags, inp->in_seqid);
}
@@ -643,8 +646,8 @@ isp_notify_ack(isp, arg)
void *outp;
if (isp_getrqentry(isp, &iptr, &optr, &outp)) {
- PRINTF("%s: Request Queue Overflow For isp_notify_ack\n",
- isp->isp_name);
+ isp_prt(isp, ISP_LOGWARN,
+ "Request Queue Overflow For isp_notify_ack");
return;
}
@@ -720,8 +723,8 @@ isp_handle_atio(isp, aep)
/*
* ATIO rejected by the firmware due to disabled lun.
*/
- PRINTF("%s: rejected ATIO for disabled lun %d\n",
- isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "rejected ATIO for disabled lun %d", lun);
break;
case AT_NOCAP:
/*
@@ -729,8 +732,9 @@ isp_handle_atio(isp, aep)
* We sent an ATIO that overflowed the firmware's
* command resource count.
*/
- PRINTF("%s: rejected ATIO for lun %d because of command count"
- " overflow\n", isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "rejected ATIO for lun %d because of command count"
+ " overflow", lun);
break;
case AT_BDR_MSG:
@@ -743,9 +747,7 @@ isp_handle_atio(isp, aep)
* not increment it. Therefore we should never get
* this status here.
*/
- PRINTF("%s: ATIO returned for lun %d because it was in the "
- " middle of coping with a Bus Device Reset\n",
- isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR, atiocope, lun);
break;
case AT_CDB: /* Got a CDB */
@@ -765,15 +767,14 @@ isp_handle_atio(isp, aep)
* Ignore it because the async event will clear things
* up for us.
*/
- PRINTF("%s: ATIO returned for lun %d from initiator %d because"
- " a Bus Reset occurred\n", isp->isp_name, lun,
- aep->at_iid);
+ isp_prt(isp, ISP_LOGWARN, atior, lun, aep->at_iid);
break;
default:
- PRINTF("%s: Unknown ATIO status 0x%x from initiator %d for lun"
- " %d\n", isp->isp_name, aep->at_status, aep->at_iid, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "Unknown ATIO status 0x%x from initiator %d for lun %d",
+ aep->at_status, aep->at_iid, lun);
(void) isp_target_put_atio(isp, aep->at_iid, aep->at_tgt,
lun, aep->at_tag_type, aep->at_tag_val);
break;
@@ -810,8 +811,8 @@ isp_handle_atio2(isp, aep)
/*
* ATIO rejected by the firmware due to disabled lun.
*/
- PRINTF("%s: rejected ATIO2 for disabled lun %d\n",
- isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "rejected ATIO2 for disabled lun %d", lun);
break;
case AT_NOCAP:
/*
@@ -819,8 +820,8 @@ isp_handle_atio2(isp, aep)
* We sent an ATIO that overflowed the firmware's
* command resource count.
*/
- PRINTF("%s: rejected ATIO2 for lun %d because of command count"
- " overflow\n", isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "rejected ATIO2 for lun %d- command count overflow", lun);
break;
case AT_BDR_MSG:
@@ -833,9 +834,7 @@ isp_handle_atio2(isp, aep)
* not increment it. Therefore we should never get
* this status here.
*/
- PRINTF("%s: ATIO2 returned for lun %d because it was in the "
- " middle of coping with a Bus Device Reset\n",
- isp->isp_name, lun);
+ isp_prt(isp, ISP_LOGERR, atiocope, lun);
break;
case AT_CDB: /* Got a CDB */
@@ -854,15 +853,14 @@ isp_handle_atio2(isp, aep)
* Ignore it because the async event will clear things
* up for us.
*/
- PRINTF("%s: ATIO2 returned for lun %d from initiator %d because"
- " a Bus Reset occurred\n", isp->isp_name, lun,
- aep->at_iid);
+ isp_prt(isp, ISP_LOGERR, atior, lun, aep->at_iid);
break;
default:
- PRINTF("%s: Unknown ATIO2 status 0x%x from initiator %d for lun"
- " %d\n", isp->isp_name, aep->at_status, aep->at_iid, lun);
+ isp_prt(isp, ISP_LOGERR,
+ "Unknown ATIO2 status 0x%x from initiator %d for lun %d",
+ aep->at_status, aep->at_iid, lun);
(void) isp_target_put_atio(isp, aep->at_iid, 0, lun, 0, 0);
break;
}
@@ -873,16 +871,16 @@ isp_handle_ctio(isp, ct)
struct ispsoftc *isp;
ct_entry_t *ct;
{
- ISP_SCSI_XFER_T *xs;
- int pl = 0;
+ XS_T *xs;
+ int pl = ISP_LOGTDEBUG2;
char *fmsg = NULL;
if (ct->ct_reserved) {
xs = isp_find_xs(isp, ct->ct_reserved);
if (xs == NULL)
- pl = 0;
+ pl = ISP_LOGALL;
} else {
- pl = 2;
+ pl = ISP_LOGTDEBUG1;
xs = NULL;
}
@@ -902,8 +900,8 @@ isp_handle_ctio(isp, ct)
/*
* Nothing to do in this case.
*/
- IDPRINTF(pl, ("%s:CTIO- iid %d disconnected OK\n",
- isp->isp_name, ct->ct_iid));
+ isp_prt(isp, pl, "CTIO- iid %d disconnected OK",
+ ct->ct_iid);
return;
}
break;
@@ -933,7 +931,7 @@ isp_handle_ctio(isp, ct)
if (fmsg == NULL)
fmsg = "ABORT TASK sent by Initiator";
- PRINTF("%s: CTIO destroyed by %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGWARN, "CTIO destroyed by %s", fmsg);
break;
case CT_INVAL:
@@ -941,8 +939,9 @@ isp_handle_ctio(isp, ct)
* CTIO rejected by the firmware due to disabled lun.
* "Cannot Happen".
*/
- PRINTF("%s: Firmware rejected CTIO for disabled lun %d\n",
- isp->isp_name, ct->ct_lun);
+ isp_prt(isp, ISP_LOGERR,
+ "Firmware rejected CTIO for disabled lun %d",
+ ct->ct_lun);
break;
case CT_NOPATH:
@@ -952,8 +951,9 @@ isp_handle_ctio(isp, ct)
* we tried to access the bus while a non-disconnecting
* command is in process.
*/
- PRINTF("%s: Firmware rejected CTIO for bad nexus %d/%d/%d\n",
- isp->isp_name, ct->ct_iid, ct->ct_tgt, ct->ct_lun);
+ isp_prt(isp, ISP_LOGERR,
+ "Firmware rejected CTIO for bad nexus %d/%d/%d",
+ ct->ct_iid, ct->ct_tgt, ct->ct_lun);
break;
case CT_RSELTMO:
@@ -962,7 +962,7 @@ isp_handle_ctio(isp, ct)
case CT_TIMEOUT:
if (fmsg == NULL)
fmsg = "Command";
- PRINTF("%s: Firmware timed out on %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGERR, "Firmware timed out on %s", fmsg);
break;
case CT_ERR:
@@ -980,7 +980,7 @@ isp_handle_ctio(isp, ct)
if (fmsg == NULL)
fmsg = "unacknowledged Immediate Notify pending";
- PRINTF("%s: CTIO returned by f/w- %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGERR, "CTIO returned by f/w- %s", fmsg);
#if 0
if (status & SENSEVALID) {
bcopy((caddr_t) (cep + CTIO_SENSE_OFFSET),
@@ -991,7 +991,7 @@ isp_handle_ctio(isp, ct)
#endif
break;
default:
- PRINTF("%s: Unknown CTIO status 0x%x\n", isp->isp_name,
+ isp_prt(isp, ISP_LOGERR, "Unknown CTIO status 0x%x",
ct->ct_status & ~QLTM_SVALID);
break;
}
@@ -1006,19 +1006,16 @@ isp_handle_ctio(isp, ct)
*/
if (ct->ct_reserved == 0) {
if ((ct->ct_flags & CT_SENDSTATUS) == 0) {
- IDPRINTF(pl,
- ("%s: intermediate CTIO completed ok\n",
- isp->isp_name));
+ isp_prt(isp, pl,
+ "intermediate CTIO completed ok");
} else {
- IDPRINTF(pl,
- ("%s: unmonitored CTIO completed ok\n",
- isp->isp_name));
+ isp_prt(isp, pl,
+ "unmonitored CTIO completed ok");
}
} else {
- IDPRINTF(pl,
- ("%s: NO xs for CTIO (handle 0x%x) status 0x%x\n",
- isp->isp_name, ct->ct_reserved,
- ct->ct_status & ~QLTM_SVALID));
+ isp_prt(isp, pl,
+ "NO xs for CTIO (handle 0x%x) status 0x%x",
+ ct->ct_reserved, ct->ct_status & ~QLTM_SVALID);
}
} else {
if (ct->ct_flags & CT_SENDSTATUS) {
@@ -1030,15 +1027,13 @@ isp_handle_ctio(isp, ct)
* only there can we do the appropriate command
* complete thread synchronization.
*/
- IDPRINTF(pl,
- ("%s:status CTIO complete\n", isp->isp_name));
+ isp_prt(isp, pl, "status CTIO complete");
} else {
/*
* Final CTIO completed. Release DMA resources and
* notify platform dependent layers.
*/
- IDPRINTF(pl,
- ("%s: data CTIO complete\n", isp->isp_name));
+ isp_prt(isp, pl, "data CTIO complete");
ISP_DMAFREE(isp, xs, ct->ct_reserved);
}
(void) isp_async(isp, ISPASYNC_TARGET_ACTION, ct);
@@ -1053,16 +1048,16 @@ isp_handle_ctio2(isp, ct)
struct ispsoftc *isp;
ct2_entry_t *ct;
{
- ISP_SCSI_XFER_T *xs;
- int pl = 3;
+ XS_T *xs;
+ int pl = ISP_LOGTDEBUG2;
char *fmsg = NULL;
if (ct->ct_reserved) {
xs = isp_find_xs(isp, ct->ct_reserved);
if (xs == NULL)
- pl = 0;
+ pl = ISP_LOGALL;
} else {
- pl = 2;
+ pl = ISP_LOGTDEBUG1;
xs = NULL;
}
@@ -1102,14 +1097,14 @@ isp_handle_ctio2(isp, ct)
if (fmsg == NULL)
fmsg = "ABORT TASK sent by Initiator";
- PRINTF("%s: CTIO2 destroyed by %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGERR, "CTIO2 destroyed by %s", fmsg);
break;
case CT_INVAL:
/*
* CTIO rejected by the firmware - invalid data direction.
*/
- PRINTF("%s: CTIO2 had wrong data directiond\n", isp->isp_name);
+ isp_prt(isp, ISP_LOGERR, "CTIO2 had wrong data directiond");
break;
case CT_NOPATH:
@@ -1119,8 +1114,9 @@ isp_handle_ctio2(isp, ct)
* we tried to access the bus while a non-disconnecting
* command is in process.
*/
- PRINTF("%s: Firmware rejected CTIO2 for bad nexus %d->%d\n",
- isp->isp_name, ct->ct_iid, ct->ct_lun);
+ isp_prt(isp, ISP_LOGERR,
+ "Firmware rejected CTIO2 for bad nexus %d->%d",
+ ct->ct_iid, ct->ct_lun);
break;
case CT_RSELTMO:
@@ -1129,7 +1125,7 @@ isp_handle_ctio2(isp, ct)
case CT_TIMEOUT:
if (fmsg == NULL)
fmsg = "Command";
- PRINTF("%s: Firmware timed out on %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGERR, "Firmware timed out on %s", fmsg);
break;
case CT_ERR:
@@ -1154,7 +1150,7 @@ isp_handle_ctio2(isp, ct)
if (fmsg == NULL)
fmsg = "unacknowledged Immediate Notify pending";
- PRINTF("%s: CTIO returned by f/w- %s\n", isp->isp_name, fmsg);
+ isp_prt(isp, ISP_LOGERR, "CTIO returned by f/w- %s", fmsg);
#if 0
if (status & SENSEVALID) {
bcopy((caddr_t) (cep + CTIO_SENSE_OFFSET),
@@ -1170,13 +1166,13 @@ isp_handle_ctio2(isp, ct)
* CTIO rejected by the firmware because an invalid RX_ID.
* Just print a message.
*/
- PRINTF("%s: CTIO2 completed with Invalid RX_ID 0x%x\n",
- isp->isp_name, ct->ct_rxid);
+ isp_prt(isp, ISP_LOGERR,
+ "CTIO2 completed with Invalid RX_ID 0x%x", ct->ct_rxid);
break;
default:
- IDPRINTF(pl, ("%s: Unknown CTIO status 0x%x\n", isp->isp_name,
- ct->ct_status & ~QLTM_SVALID));
+ isp_prt(isp, ISP_LOGERR, "Unknown CTIO status 0x%x",
+ ct->ct_status & ~QLTM_SVALID);
break;
}
@@ -1190,19 +1186,16 @@ isp_handle_ctio2(isp, ct)
*/
if (ct->ct_reserved == 0) {
if ((ct->ct_flags & CT_SENDSTATUS) == 0) {
- IDPRINTF(pl,
- ("%s: intermediate CTIO completed ok\n",
- isp->isp_name));
+ isp_prt(isp, pl,
+ "intermediate CTIO completed ok");
} else {
- IDPRINTF(pl,
- ("%s: unmonitored CTIO completed ok\n",
- isp->isp_name));
+ isp_prt(isp, pl,
+ "unmonitored CTIO completed ok");
}
} else {
- IDPRINTF(pl,
- ("%s: NO xs for CTIO (handle 0x%x) status 0x%x\n",
- isp->isp_name, ct->ct_reserved,
- ct->ct_status & ~QLTM_SVALID));
+ isp_prt(isp, pl,
+ "NO xs for CTIO (handle 0x%x) status 0x%x",
+ ct->ct_reserved, ct->ct_status & ~QLTM_SVALID);
}
} else {
if (ct->ct_flags & CT_SENDSTATUS) {
@@ -1214,15 +1207,13 @@ isp_handle_ctio2(isp, ct)
* only there can we do the appropriate command
* complete thread synchronization.
*/
- IDPRINTF(pl,
- ("%s: status CTIO complete\n", isp->isp_name));
+ isp_prt(isp, pl, "status CTIO complete");
} else {
/*
* Final CTIO completed. Release DMA resources and
* notify platform dependent layers.
*/
- IDPRINTF(pl,
- ("%s: data CTIO complete\n", isp->isp_name));
+ isp_prt(isp, pl, "data CTIO complete");
ISP_DMAFREE(isp, xs, ct->ct_reserved);
}
(void) isp_async(isp, ISPASYNC_TARGET_ACTION, ct);