From 366f55288e6bc4b6639b4777cbd65d00f1825aae Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Tue, 25 Jan 2000 17:37:02 +0000 Subject: [PATCH] Go for the gusto and do the full 256 bytes for inquiry data. Obtained from:gibbs@freebsd.org --- sys/cam/scsi/scsi_all.c | 7 +++++++ sys/cam/scsi/scsi_all.h | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index bd614cf1218..10d4cc8595b 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2531,6 +2531,13 @@ scsi_inquiry(struct ccb_scsiio *csio, u_int32_t retries, scsi_cmd->byte2 |= SI_EVPD; scsi_cmd->page_code = page_code; } + /* + * A 'transfer units' count of 256 is coded as + * zero for all commands with a single byte count + * field. + */ + if (inq_len == 256) + inq_len = 0; scsi_cmd->length = inq_len; } diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index fe01620defb..37caa19e6f5 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -577,12 +577,7 @@ struct scsi_inquiry_data u_int8_t reserved3[22]; - /* - * The specifcation allows for 256 bytes of data, total. - * We avoid overflow problems with common usages of u_int8_t - * sizes by not getting at the last 4 bytes. - */ -#define SID_VENDOR_SPECIFIC_1_SIZE (256 - 96 - 4) +#define SID_VENDOR_SPECIFIC_1_SIZE 160 u_int8_t vendor_specific1[SID_VENDOR_SPECIFIC_1_SIZE]; };