summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2008-02-17 16:00:36 +0000
committergibbs <gibbs@FreeBSD.org>2008-02-17 16:00:36 +0000
commitaa983b9c64c9a623683dd26ce72ad547d844a297 (patch)
tree4bdce1bb55201ca7ece2ddb82ed5225178f14d94 /sys/dev
parent869799580497fabd00e4a119fd0112acb0202561 (diff)
downloadFreeBSD-src-aa983b9c64c9a623683dd26ce72ad547d844a297.zip
FreeBSD-src-aa983b9c64c9a623683dd26ce72ad547d844a297.tar.gz
Only print sense data diagnostics if debugging is enabled with the
AHD_SHOW_SENSE flag.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/aic7xxx/aic79xx_osm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c
index c977794..f8c5662 100644
--- a/sys/dev/aic7xxx/aic79xx_osm.c
+++ b/sys/dev/aic7xxx/aic79xx_osm.c
@@ -316,7 +316,6 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
} else if ((scb->flags & SCB_PKT_SENSE) != 0) {
struct scsi_status_iu_header *siu;
u_int sense_len;
- int i;
/*
* Copy only the sense data into the provided buffer.
@@ -328,11 +327,18 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
memcpy(&ccb->csio.sense_data,
ahd_get_sense_buf(ahd, scb) + SIU_SENSE_OFFSET(siu),
sense_len);
- printf("Copied %d bytes of sense data offset %d:", sense_len,
- SIU_SENSE_OFFSET(siu));
- for (i = 0; i < sense_len; i++)
- printf(" 0x%x", ((uint8_t *)&ccb->csio.sense_data)[i]);
- printf("\n");
+#ifdef AHD_DEBUG
+ if ((ahd_debug & AHD_SHOW_SENSE) != 0) {
+ uint8_t *sense_data = (uint8_t *)&ccb->csio.sense_data;
+ u_int i;
+
+ printf("Copied %d bytes of sense data offset %d:",
+ sense_len, SIU_SENSE_OFFSET(siu));
+ for (i = 0; i < sense_len; i++)
+ printf(" 0x%x", *sense_data++);
+ printf("\n");
+ }
+#endif
scb->io_ctx->ccb_h.status |= CAM_AUTOSNS_VALID;
}
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
OpenPOWER on IntegriCloud