summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2001-03-16 22:16:54 +0000
committerken <ken@FreeBSD.org>2001-03-16 22:16:54 +0000
commit3f14bdb2a9ddd121290994dbc760b498409497a1 (patch)
treec60776dcf10fc5c961fb26fca2f67504031d2a8b /sys
parent53289ebd9275a126c7ea4ff406f5886619d948cc (diff)
downloadFreeBSD-src-3f14bdb2a9ddd121290994dbc760b498409497a1.zip
FreeBSD-src-3f14bdb2a9ddd121290994dbc760b498409497a1.tar.gz
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 <san@iem.pw.edu.pl>
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_ses.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index d2ab63d..f42a4b3 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);
OpenPOWER on IntegriCloud