summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2000-07-17 01:45:51 +0000
committermjacob <mjacob@FreeBSD.org>2000-07-17 01:45:51 +0000
commit978be15898fbb04173cde8c0708ac65184305426 (patch)
tree4867929dcd499d845bc09dc5f574c7e872fa877e /sys
parentbbd986658b798f92f4b7835006b438a28524d38f (diff)
downloadFreeBSD-src-978be15898fbb04173cde8c0708ac65184305426.zip
FreeBSD-src-978be15898fbb04173cde8c0708ac65184305426.tar.gz
Preserve CAM_DIS_DISCONNECT as passed up from SIM (like
CAM_TAG_ACTION_VALID and CAM_DIR_MASK). Remove redundant CAM_DEBUG line. Spiff up CAM_DEBUG printout for commands and move the printout up to the top where we can see it, even for the pending_ua/pending_ca cass. Add missing newline in a CAM_DEBUG.
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_target.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index fd337b9..686a90a 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -1347,7 +1347,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb)
desc = (struct targ_cmd_desc *)atio->ccb_h.ccb_descr;
/* Is this a tagged request? */
- flags = atio->ccb_h.flags & (CAM_TAG_ACTION_VALID|CAM_DIR_MASK);
+ flags = atio->ccb_h.flags &
+ (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK);
/*
* If we are done with the transaction, tell the
@@ -1431,9 +1432,6 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("targdone %x\n", done_ccb->ccb_h.func_code));
- CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
- ("targdone %x\n", done_ccb->ccb_h.func_code));
-
switch (done_ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO:
{
@@ -1454,6 +1452,18 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
return;
}
+#ifdef CAMDEBUG
+ {
+ int i;
+ char dcb[128];
+ for (dcb[0] = 0, i = 0; i < atio->cdb_len; i++) {
+ snprintf(dcb, sizeof dcb,
+ "%s %02x", dcb, cdb[i] & 0xff);
+ }
+ CAM_DEBUG(periph->path,
+ CAM_DEBUG_PERIPH, ("cdb:%s\n", dcb));
+ }
+#endif
if (atio->sense_len != 0) {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("ATIO with sense_len\n"));
@@ -1476,7 +1486,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
&& cdb[0] != INQUIRY) {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
- ("pending_ca %d pending_ua %dn", istate->pending_ca, istate->pending_ua));
+ ("pending_ca %d pending_ua %d\n",
+ istate->pending_ca, istate->pending_ua));
/* Pending UA, tell initiator */
/* Direction is always relative to the initator */
@@ -1513,10 +1524,6 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
if (pending_ca == CA_UNIT_ATTN)
istate->pending_ua = UA_NONE;
- CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
- ("cdb[..] = %x %x %x %x %x %x\n",
- cdb[0], cdb[1], cdb[2], cdb[3],
- cdb[4], cdb[5]));
/*
* Determine the type of incoming command and
* setup our buffer for a response.
OpenPOWER on IntegriCloud