summaryrefslogtreecommitdiff
path: root/sys/scsi/st.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-09-05 20:58:04 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-09-05 20:58:04 +0000
commit5b3bcebf744b244131ca98ce5c2cd3ddec28449d (patch)
treefc681c413187320c5d0309b0b88431c3b5827863 /sys/scsi/st.c
parentd1757272b5bf4a0ccbb1e5f122dcbb85b69cdbf8 (diff)
ATAPI tapes are always fixed blocksize
Diffstat (limited to 'sys/scsi/st.c')
-rw-r--r--sys/scsi/st.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index c41124be019..1b3eccbd371 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.26 1999/07/25 07:09:20 csapuntz Exp $ */
+/* $OpenBSD: st.c,v 1.27 1999/09/05 20:58:03 niklas Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -684,6 +684,7 @@ st_mount_tape(dev, flags)
*/
if ((error = st_mode_sense(st, 0)) != 0)
return error;
+
/*
* If we have gained a permanent density from somewhere,
* then use it in preference to the one supplied by
@@ -758,12 +759,20 @@ st_decide_mode(st, first_read)
struct st_softc *st;
boolean first_read;
{
-#ifdef SCSIDEBUG
struct scsi_link *sc_link = st->sc_link;
-#endif
SC_DEBUG(sc_link, SDEV_DB2, ("starting block mode decision\n"));
+ /* ATAPI tapes are always fixed blocksize. */
+ if (sc_link->flags & SDEV_ATAPI) {
+ st->flags |= ST_FIXEDBLOCKS;
+ if (st->media_blksize > 0)
+ st->blksize = st->media_blksize;
+ else
+ st->blksize = DEF_FIXED_BSIZE;
+ goto done;
+ }
+
/*
* If the drive can only handle fixed-length blocks and only at
* one size, perhaps we should just do that.