summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index f582d5fb07c..00402e42be7 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.273 2020/09/01 12:17:53 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.274 2020/09/05 14:21:52 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -849,7 +849,7 @@ scsi_inquire(struct scsi_link *link, struct scsi_inquiry_data *inqbuf,
* information. This avoids problems with devices that choke trying to
* supply more.
*/
- bytes = 36;
+ bytes = SID_SCSI2_HDRLEN + SID_SCSI2_ALEN;
#ifdef SCSIDEBUG
again:
@@ -872,13 +872,14 @@ again:
#ifdef SCSIDEBUG
sc_print_addr(link);
- if (bytes > inqbuf->additional_length + 4)
- bytes = inqbuf->additional_length + 4;
+ if (bytes > SID_SCSI2_HDRLEN + inqbuf->additional_length)
+ bytes = SID_SCSI2_HDRLEN + inqbuf->additional_length;
printf("got %zu of %u bytes of inquiry data:\n",
- bytes, inqbuf->additional_length + 4);
+ bytes, SID_SCSI2_HDRLEN + inqbuf->additional_length);
scsi_show_mem((u_char *)inqbuf, bytes);
- if (bytes == 36 && bytes < inqbuf->additional_length + 4) {
- bytes = inqbuf->additional_length + 4;
+ if (bytes == SID_SCSI2_HDRLEN + SID_SCSI2_ALEN && bytes <
+ SID_SCSI2_HDRLEN + inqbuf->additional_length) {
+ bytes = SID_SCSI2_HDRLEN + inqbuf->additional_length;
if (bytes > sizeof(*inqbuf))
bytes = sizeof(*inqbuf);
goto again;