diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-11-13 14:29:58 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-11-13 14:29:58 +0000 |
commit | a3d09f4be1f39030a97c87adb833b3ee213874a5 (patch) | |
tree | 79173061729c498b10431b9e513b9864804f30a2 /sys/scsi/scsi_base.c | |
parent | e946d7adfd67215f70bab9766d813195cd88ac68 (diff) |
ATAPI Tape drives need 6 byte MODE SENSE commands according to at
least one spec. Unlike other ATAPI devices.
Fixes PR #4611.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r-- | sys/scsi/scsi_base.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 570166d7ead..82126f9a86e 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.96 2005/11/13 03:27:42 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.97 2005/11/13 14:29:57 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -503,13 +503,16 @@ scsi_do_mode_sense(sc_link, page, buf, page_data, density, block_count, if (big) *big = 0; - if ((sc_link->flags & SDEV_ATAPI) == 0) { + if ((sc_link->flags & SDEV_ATAPI) == 0 || + (sc_link->inqdata.device & SID_TYPE) == T_SEQUENTIAL) { /* * Try 6 byte mode sense request first. Some devices don't * distinguish between 6 and 10 byte MODE SENSE commands, - * returning 6 byte data for 10 byte requests. Don't bother - * with SMS_DBD. Check returned data length to ensure that - * at least a header (3 additional bytes) is returned. + * returning 6 byte data for 10 byte requests. ATAPI tape + * drives use MODE SENSE (6) even though ATAPI uses 10 byte + * everything else. Don't bother with SMS_DBD. Check returned + * data length to ensure that at least a header (3 additional + * bytes) is returned. */ error = scsi_mode_sense(sc_link, 0, page, &buf->hdr, sizeof(*buf), flags, 20000); |