[Midnightbsd-cvs] src [9125] trunk/sys/cam/cam_xpt.c: Move CAM_DEBUG_CDB messages from the point of quing to the pot of sending to SIM.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 1 20:38:16 EDT 2016


Revision: 9125
          http://svnweb.midnightbsd.org/src/?rev=9125
Author:   laffer1
Date:     2016-10-01 20:38:16 -0400 (Sat, 01 Oct 2016)
Log Message:
-----------
Move CAM_DEBUG_CDB messages from the point of quing to the pot of sending to SIM.

Modified Paths:
--------------
    trunk/sys/cam/cam_xpt.c

Modified: trunk/sys/cam/cam_xpt.c
===================================================================
--- trunk/sys/cam/cam_xpt.c	2016-10-02 00:37:37 UTC (rev 9124)
+++ trunk/sys/cam/cam_xpt.c	2016-10-02 00:38:16 UTC (rev 9125)
@@ -2462,7 +2462,6 @@
 void
 xpt_action_default(union ccb *start_ccb)
 {
-	char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
 	struct cam_path *path;
 
 	path = start_ccb->ccb_h.path;
@@ -2498,11 +2497,6 @@
 			    start_ccb->ccb_h.target_lun << 5;
 		}
 		start_ccb->csio.scsi_status = SCSI_STATUS_OK;
-		CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. CDB: %s\n",
-			  scsi_op_desc(start_ccb->csio.cdb_io.cdb_bytes[0],
-			  	       &path->device->inq_data),
-			  scsi_cdb_string(start_ccb->csio.cdb_io.cdb_bytes,
-					  cdb_str, sizeof(cdb_str))));
 	}
 	/* FALLTHROUGH */
 	case XPT_TARGET_IO:
@@ -2511,13 +2505,8 @@
 		start_ccb->csio.resid = 0;
 		/* FALLTHROUGH */
 	case XPT_ATA_IO:
-		if (start_ccb->ccb_h.func_code == XPT_ATA_IO) {
+		if (start_ccb->ccb_h.func_code == XPT_ATA_IO)
 			start_ccb->ataio.resid = 0;
-			CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. ACB: %s\n",
-			    ata_op_string(&start_ccb->ataio.cmd),
-			    ata_cmd_string(&start_ccb->ataio.cmd,
-					  cdb_str, sizeof(cdb_str))));
-		}
 		/* FALLTHROUGH */
 	case XPT_RESET_DEV:
 	case XPT_ENG_EXEC:
@@ -3260,6 +3249,7 @@
 xpt_run_dev_sendq(struct cam_eb *bus)
 {
 	struct	cam_devq *devq;
+	char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
 
 	CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n"));
 
@@ -3341,6 +3331,26 @@
 				work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
 		}
 
+		switch (work_ccb->ccb_h.func_code) {
+		case XPT_SCSI_IO:
+			CAM_DEBUG(work_ccb->ccb_h.path,
+			    CAM_DEBUG_CDB,("%s. CDB: %s\n",
+			     scsi_op_desc(work_ccb->csio.cdb_io.cdb_bytes[0],
+					  &device->inq_data),
+			     scsi_cdb_string(work_ccb->csio.cdb_io.cdb_bytes,
+					     cdb_str, sizeof(cdb_str))));
+			break;
+		case XPT_ATA_IO:
+			CAM_DEBUG(work_ccb->ccb_h.path,
+			    CAM_DEBUG_CDB,("%s. ACB: %s\n",
+			     ata_op_string(&work_ccb->ataio.cmd),
+			     ata_cmd_string(&work_ccb->ataio.cmd,
+					    cdb_str, sizeof(cdb_str))));
+			break;
+		default:
+			break;
+		}
+
 		/*
 		 * Device queues can be shared among multiple sim instances
 		 * that reside on different busses.  Use the SIM in the queue



More information about the Midnightbsd-cvs mailing list