Only print sense data diagnostics if debugging is enabled with the

AHD_SHOW_SENSE flag.
This commit is contained in:
Justin T. Gibbs 2008-02-17 16:00:36 +00:00
parent e17660e79c
commit 2e9878a7c5

View File

@ -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;