From 28775a6a5d7d5d913b0e14741d7b031ff00fde39 Mon Sep 17 00:00:00 2001 From: mycroft Date: Fri, 13 Jan 1995 14:38:13 +0000 Subject: [PATCH] Add a DIAGNOSTIC check. --- sys/dev/scsipi/scsi_base.c | 13 ++++++++++++- sys/scsi/scsi_base.c | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/sys/dev/scsipi/scsi_base.c b/sys/dev/scsipi/scsi_base.c index 4f586563dce9..70fa1e949276 100644 --- a/sys/dev/scsipi/scsi_base.c +++ b/sys/dev/scsipi/scsi_base.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_base.c,v 1.24 1994/12/30 05:33:06 mycroft Exp $ */ +/* $NetBSD: scsi_base.c,v 1.25 1995/01/13 14:38:13 mycroft Exp $ */ /* * Copyright (c) 1994 Charles Hannum. All rights reserved. @@ -513,6 +513,11 @@ scsi_scsi_cmd(sc_link, scsi_cmd, cmdlen, data_addr, datalen, SC_DEBUG(sc_link, SDEV_DB2, ("scsi_cmd\n")); +#ifdef DIAGNOSTIC + if (bp != 0 && (flags & SCSI_NOSLEEP) == 0) + panic("scsi_scsi_cmd: buffer without nosleep"); +#endif + if ((xs = scsi_make_xs(sc_link, scsi_cmd, cmdlen, data_addr, datalen, retries, timeout, bp, flags)) == NULL) return ENOMEM; @@ -762,6 +767,12 @@ scsi_interpret_sense(xs) printf(", info = %d (decimal)", info); } } + if (sense->extended_extra_len != 0) { + int n; + printf(", data ="); + for (n = 0; n < sense->extended_extra_len; n++) + printf(" %02x", sense->extended_extra_bytes[n]); + } printf("\n"); } return error; diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 4f586563dce9..70fa1e949276 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_base.c,v 1.24 1994/12/30 05:33:06 mycroft Exp $ */ +/* $NetBSD: scsi_base.c,v 1.25 1995/01/13 14:38:13 mycroft Exp $ */ /* * Copyright (c) 1994 Charles Hannum. All rights reserved. @@ -513,6 +513,11 @@ scsi_scsi_cmd(sc_link, scsi_cmd, cmdlen, data_addr, datalen, SC_DEBUG(sc_link, SDEV_DB2, ("scsi_cmd\n")); +#ifdef DIAGNOSTIC + if (bp != 0 && (flags & SCSI_NOSLEEP) == 0) + panic("scsi_scsi_cmd: buffer without nosleep"); +#endif + if ((xs = scsi_make_xs(sc_link, scsi_cmd, cmdlen, data_addr, datalen, retries, timeout, bp, flags)) == NULL) return ENOMEM; @@ -762,6 +767,12 @@ scsi_interpret_sense(xs) printf(", info = %d (decimal)", info); } } + if (sense->extended_extra_len != 0) { + int n; + printf(", data ="); + for (n = 0; n < sense->extended_extra_len; n++) + printf(" %02x", sense->extended_extra_bytes[n]); + } printf("\n"); } return error;