From a4eb4f164651cd879ec1a617218f27de5fb0f0c2 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Mon, 17 Jul 2000 00:43:47 +0000 Subject: [PATCH] Whoops- forgot to commit this other pearl from Justin- only set or clear CAM_TAG_ACTION_VALID if this is an XPT_SCSI_IO CCB (otherwise, the peripheral driver knows best...).. Obtained from:gibbs@freebsd.org --- sys/cam/cam_xpt.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 61d109a08f2..72f971cca6a 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3673,14 +3673,18 @@ xpt_run_dev_sendq(struct cam_eb *bus) splx(s); - if ((device->inq_flags & SID_CmdQue) != 0) - work_ccb->ccb_h.flags |= CAM_TAG_ACTION_VALID; - else - /* - * Clear this in case of a retried CCB that failed - * due to a rejected tag. - */ - work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; + /* In Target mode, the peripheral driver knows best... */ + if (work_ccb->ccb_h.func_code == XPT_SCSI_IO) { + if ((device->inq_flags & SID_CmdQue) != 0 + && work_ccb->csio.tag_action != CAM_TAG_ACTION_NONE) + work_ccb->ccb_h.flags |= CAM_TAG_ACTION_VALID; + else + /* + * Clear this in case of a retried CCB that + * failed due to a rejected tag. + */ + work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; + } /* * Device queues can be shared among multiple sim instances