summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-09-20 15:35:43 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-09-20 15:35:43 +0000
commite457524765f85b53e7f8ed5e18e8c00d2b897a69 (patch)
tree12459b4efb840f928e1ec793fde274111a40f3ba
parente053319cfe2d3649af58fab925c339d83a20eb8f (diff)
Print inquiry and read capacity (10 and 16) data under SCSIDEBUG.
-rw-r--r--sys/scsi/scsi_base.c9
-rw-r--r--sys/scsi/sd.c12
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 22a29278843..1bed1b8d9c0 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.229 2019/09/01 15:03:32 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.230 2019/09/20 15:35:42 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -852,6 +852,13 @@ scsi_inquire(struct scsi_link *link, struct scsi_inquiry_data *inqbuf,
scsi_xs_put(xs);
+#ifdef SCSIDEBUG
+ sc_print_addr(link);
+ printf("got %d of %u bytes of inquiry data:\n",
+ SID_INQUIRY_HDR + SID_SCSI2_ALEN,
+ inqbuf->additional_length + 4);
+ scsi_show_mem((u_char *)inqbuf, SID_INQUIRY_HDR + SID_SCSI2_ALEN);
+#endif /* SCSIDEBUG */
return (error);
}
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index b867ef92df5..b5232264263 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.281 2019/09/15 15:00:30 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.282 2019/09/20 15:35:42 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -1462,6 +1462,11 @@ sd_read_cap_10(struct sd_softc *sc, int flags)
scsi_xs_put(xs);
if (rv == 0) {
+#ifdef SCSIDEBUG
+ sc_print_addr(sc->sc_link);
+ printf(" read Capacity 10 data:\n");
+ scsi_show_mem((u_char *)rdcap, sizeof(*rdcap));
+#endif /* SCSIDEBUG */
sc->params.disksize = _4btol(rdcap->addr) + 1ll;
sc->params.secsize = _4btol(rdcap->length);
CLR(sc->flags, SDF_THIN);
@@ -1515,6 +1520,11 @@ sd_read_cap_16(struct sd_softc *sc, int flags)
goto done;
}
+#ifdef SCSIDEBUG
+ sc_print_addr(sc->sc_link);
+ printf(" read Capacity 16 data:\n");
+ scsi_show_mem((u_char *)rdcap, sizeof(*rdcap));
+#endif /* SCSIDEBUG */
sc->params.disksize = _8btol(rdcap->addr) + 1;
sc->params.secsize = _4btol(rdcap->length);
if (ISSET(_2btol(rdcap->lowest_aligned), READ_CAP_16_TPE))