From a3d09f4be1f39030a97c87adb833b3ee213874a5 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sun, 13 Nov 2005 14:29:58 +0000 Subject: ATAPI Tape drives need 6 byte MODE SENSE commands according to at least one spec. Unlike other ATAPI devices. Fixes PR #4611. --- sys/scsi/scsi_base.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sys/scsi/scsi_base.c') 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); -- cgit v1.2.3