summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-03 04:15:51 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-03 04:15:51 +0000
commit8695298712ca6b05d95e2878ffa7ce38f135ccef (patch)
treee176e112d37d79ca8393e7f78acd1d4a66ab19ff /sys/scsi/scsi_base.c
parentdad57cbeaa269b36143f1e82dd2e1b74cec4496b (diff)
modernise scsi_inquiry. the length field has grown and now theres pages to
query. ok krw@
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 8c8cc705e88..bcde4fb7d9e 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.117 2006/12/12 02:44:36 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.118 2007/04/03 04:15:50 dlg Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -378,6 +378,7 @@ scsi_inquire(struct scsi_link *sc_link, struct scsi_inquiry_data *inqbuf,
int flags)
{
struct scsi_inquiry scsi_cmd;
+ int length;
int error;
bzero(&scsi_cmd, sizeof(scsi_cmd));
@@ -394,9 +395,10 @@ scsi_inquire(struct scsi_link *sc_link, struct scsi_inquiry_data *inqbuf,
* Ask for only the basic 36 bytes of SCSI2 inquiry information. This
* avoids problems with devices that choke trying to supply more.
*/
- scsi_cmd.length = SID_INQUIRY_HDR + SID_SCSI2_ALEN;
+ length = SID_INQUIRY_HDR + SID_SCSI2_ALEN;
+ _lto2b(length, scsi_cmd.length);
error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd,
- sizeof(scsi_cmd), (u_char *)inqbuf, scsi_cmd.length, 2, 10000, NULL,
+ sizeof(scsi_cmd), (u_char *)inqbuf, length, 2, 10000, NULL,
SCSI_DATA_IN | flags);
return (error);