From e35550e2bcf02ce8692e144c942cc09771c67c18 Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Fri, 16 Mar 2001 22:16:54 +0000 Subject: [PATCH] Fix inquiry length detection for the ses(4) driver. It was using the inq_len member of the ccb_getdev structure, but we've never filled that value in.. So we now get the length from the inquiry data returned by the drive. (Since we will fetch as much inquiry data as the drive claims to support.) Reviewed by: mjacob Reported by: Andrzej Tobola --- sys/cam/scsi/scsi_ses.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c index d2ab63d109e..f42a4b39ad2 100644 --- a/sys/cam/scsi/scsi_ses.c +++ b/sys/cam/scsi/scsi_ses.c @@ -286,14 +286,17 @@ sesasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) { cam_status status; struct ccb_getdev *cgd; + int inq_len; cgd = (struct ccb_getdev *)arg; + inq_len = cgd->inq_data.additional_length + 4; + /* * PROBLEM: WE NEED TO LOOK AT BYTES 48-53 TO SEE IF THIS IS * PROBLEM: IS A SAF-TE DEVICE. */ - switch (ses_type(&cgd->inq_data, cgd->inq_len)) { + switch (ses_type(&cgd->inq_data, inq_len)) { case SES_SES: case SES_SES_SCSI2: case SES_SES_PASSTHROUGH: @@ -746,9 +749,6 @@ ses_type(void *buf, int buflen) { unsigned char *iqd = buf; - if (buflen == 0) - buflen = 256; /* per SPC-2 */ - if (buflen < 8+SEN_ID_LEN) return (SES_NONE); -- 2.45.2