summaryrefslogtreecommitdiff
path: root/sys/scsi/cd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-06-05 21:27:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-06-05 21:27:08 +0000
commit9963da1d81006615c071513935289f75abd1f5e7 (patch)
tree1c3734cc7beb8cba191a504d78d35e6d45d4ba49 /sys/scsi/cd.c
parent9cd6fb862e725e92124396941780f9a74cee2c1d (diff)
Fix scsi_mode_select() and scsi_mode_select_big() to send just the
required number of bytes, rather than a full scsi_mode_sense_buf. Some devices (e.g. my HP SureStore DAT/24) decline to accept such oversized transfers. Instead, force callers to fill in the data_length field in the header and use that information to set the size of the transfer.
Diffstat (limited to 'sys/scsi/cd.c')
-rw-r--r--sys/scsi/cd.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 3428b5f0e82..612262c1f45 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.83 2005/06/03 17:29:55 krw Exp $ */
+/* $OpenBSD: cd.c,v 1.84 2005/06/05 21:27:07 krw Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -1382,12 +1382,10 @@ cd_setchan(cd, p0, p1, p2, p3, flags)
if (big)
error = scsi_mode_select_big(cd->sc_link, SMS_PF,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header_big *)&data, flags, 20000);
else
error = scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header *)&data, flags, 20000);
return (error);
}
@@ -1455,12 +1453,10 @@ cd_setvol(cd, arg, flags)
if (big)
error = scsi_mode_select_big(cd->sc_link, SMS_PF,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header_big *)&data, flags, 20000);
else
error = scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header *)&data, flags, 20000);
return (error);
}
@@ -1509,12 +1505,10 @@ cd_set_pa_immed(cd, flags)
if (big)
error = scsi_mode_select_big(cd->sc_link, SMS_PF,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header_big *)&data, flags, 20000);
else
error = scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, sizeof(data), flags,
- 20000);
+ (struct scsi_mode_header *)&data, flags, 20000);
return (error);
}