summaryrefslogtreecommitdiffstats
path: root/sys/scsi/worm.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-11-06 13:33:53 +0000
committerjoerg <joerg@FreeBSD.org>1996-11-06 13:33:53 +0000
commit94c96027319f02f817bc2459c8384177006796a4 (patch)
tree98e0d6427f1511fcc656285bfe871119cf77bee8 /sys/scsi/worm.c
parent3027e72f0efb4632f520f8945a9930e27d60e9c2 (diff)
downloadFreeBSD-src-94c96027319f02f817bc2459c8384177006796a4.zip
FreeBSD-src-94c96027319f02f817bc2459c8384177006796a4.tar.gz
Updates and bugfixes to the worm driver:
. also detect the Phlips CDD2000; it's software-compatible with the HP part Submitted by: cau@cc.gatech.edu (Carlos Ugarte) . correct the blocksize handling for CD-DA tracks, and fix multitrack handling Submitted by: nsayer@quack.kfu.com (Nick Sayer) 2.2 candidates!
Diffstat (limited to 'sys/scsi/worm.c')
-rw-r--r--sys/scsi/worm.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c
index b85832d..62b1fc5 100644
--- a/sys/scsi/worm.c
+++ b/sys/scsi/worm.c
@@ -43,7 +43,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: worm.c,v 1.28 1996/07/14 10:46:56 joerg Exp $
+ * $Id: worm.c,v 1.29 1996/09/08 10:44:18 phk Exp $
*/
/* XXX This is PRELIMINARY.
@@ -197,6 +197,11 @@ struct worm_quirks worm_quirks[] = {
hp4020i_prepare_disk, hp4020i_prepare_track,
hp4020i_finalize_track, hp4020i_finalize_disk
},
+ {
+ "PHILIPS", "CDD2000",
+ hp4020i_prepare_disk, hp4020i_prepare_track,
+ hp4020i_finalize_track, hp4020i_finalize_disk
+ },
{0}
};
@@ -211,9 +216,14 @@ worm_size(struct scsi_link *sc_link, int flags)
worm->n_blks = scsi_read_capacity(sc_link, &worm->blk_size,
flags);
- if(worm->blk_size == 0)
- /* XXX */
- worm->blk_size = 2048;
+ /*
+ * CD-R devices can assume various sizes, depending on the
+ * intended purpose of the track. Hence, READ CAPACITY
+ * doesn't give us any good results. Make a more educated
+ * guess instead.
+ */
+ worm->blk_size = (worm->audio? 2352: 2048);
+
if (worm->n_blks)
{
sc_link->flags |= SDEV_MEDIA_LOADED;
@@ -238,12 +248,6 @@ wormattach(struct scsi_link *sc_link)
TAILQ_INIT(&worm->buf_queue);
- printf("- see worm(4) for usage warnings");
-
- if (worm_size(sc_link, SCSI_NOSLEEP | SCSI_NOMASK) != 0)
- printf("- can't get capacity.");
- else
- printf("with %ld blocks.", worm->n_blks);
#ifdef DEVFS
mynor = wormunit(sc_link->dev);
worm->devfs_token =
@@ -575,8 +579,7 @@ worm_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p,
error = EINVAL;
else if (w->audio == 0 && w->preemp)
error = EINVAL;
- else if ((worm->worm_flags & WORMFL_DISK_PREPED)==0 ||
- (worm->worm_flags & WORMFL_WRITTEN) != 0)
+ else if ((worm->worm_flags & WORMFL_DISK_PREPED)==0)
error = EINVAL;
else {
worm->audio = w->audio;
OpenPOWER on IntegriCloud