diff options
author | joerg <joerg@FreeBSD.org> | 1996-11-06 13:33:53 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-11-06 13:33:53 +0000 |
commit | 94c96027319f02f817bc2459c8384177006796a4 (patch) | |
tree | 98e0d6427f1511fcc656285bfe871119cf77bee8 /sys | |
parent | 3027e72f0efb4632f520f8945a9930e27d60e9c2 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/scsi/scsiconf.c | 7 | ||||
-rw-r--r-- | sys/scsi/worm.c | 27 |
2 files changed, 21 insertions, 13 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 60e747b..ac2cc5a 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -16,7 +16,7 @@ * * New configuration setup: dufault@hda.com * - * $Id: scsiconf.c,v 1.63 1996/09/08 10:44:16 phk Exp $ + * $Id: scsiconf.c,v 1.64 1996/09/10 23:31:08 bde Exp $ */ #include "opt_scsi.h" @@ -363,6 +363,11 @@ static struct scsidevs knowndevs[] = T_READONLY, T_WORM, T_REMOV, "HP", "C4324/C4325", "*", "worm", SC_ONE_LU }, + { + /* That's the Philips drive, in case anybody wonders... */ + T_READONLY, T_WORM, T_REMOV, "IMS", "CDD2000*", "*", + "worm", SC_ONE_LU + }, /* * The Plasmon's are dual-faced: they appear as T_WORM if the * drive is empty, or a CD-R medium is in the drive, and they 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; |