mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
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!
This commit is contained in:
parent
794a4f4081
commit
b99dd17277
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19454
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* New configuration setup: dufault@hda.com
|
* 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"
|
#include "opt_scsi.h"
|
||||||
@ -363,6 +363,11 @@ static struct scsidevs knowndevs[] =
|
|||||||
T_READONLY, T_WORM, T_REMOV, "HP", "C4324/C4325", "*",
|
T_READONLY, T_WORM, T_REMOV, "HP", "C4324/C4325", "*",
|
||||||
"worm", SC_ONE_LU
|
"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
|
* 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
|
* drive is empty, or a CD-R medium is in the drive, and they
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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.
|
/* XXX This is PRELIMINARY.
|
||||||
@ -197,6 +197,11 @@ struct worm_quirks worm_quirks[] = {
|
|||||||
hp4020i_prepare_disk, hp4020i_prepare_track,
|
hp4020i_prepare_disk, hp4020i_prepare_track,
|
||||||
hp4020i_finalize_track, hp4020i_finalize_disk
|
hp4020i_finalize_track, hp4020i_finalize_disk
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PHILIPS", "CDD2000",
|
||||||
|
hp4020i_prepare_disk, hp4020i_prepare_track,
|
||||||
|
hp4020i_finalize_track, hp4020i_finalize_disk
|
||||||
|
},
|
||||||
{0}
|
{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,
|
worm->n_blks = scsi_read_capacity(sc_link, &worm->blk_size,
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
if(worm->blk_size == 0)
|
/*
|
||||||
/* XXX */
|
* CD-R devices can assume various sizes, depending on the
|
||||||
worm->blk_size = 2048;
|
* 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)
|
if (worm->n_blks)
|
||||||
{
|
{
|
||||||
sc_link->flags |= SDEV_MEDIA_LOADED;
|
sc_link->flags |= SDEV_MEDIA_LOADED;
|
||||||
@ -238,12 +248,6 @@ wormattach(struct scsi_link *sc_link)
|
|||||||
|
|
||||||
TAILQ_INIT(&worm->buf_queue);
|
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
|
#ifdef DEVFS
|
||||||
mynor = wormunit(sc_link->dev);
|
mynor = wormunit(sc_link->dev);
|
||||||
worm->devfs_token =
|
worm->devfs_token =
|
||||||
@ -575,8 +579,7 @@ worm_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p,
|
|||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
else if (w->audio == 0 && w->preemp)
|
else if (w->audio == 0 && w->preemp)
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
else if ((worm->worm_flags & WORMFL_DISK_PREPED)==0 ||
|
else if ((worm->worm_flags & WORMFL_DISK_PREPED)==0)
|
||||||
(worm->worm_flags & WORMFL_WRITTEN) != 0)
|
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
else {
|
else {
|
||||||
worm->audio = w->audio;
|
worm->audio = w->audio;
|
||||||
|
Loading…
Reference in New Issue
Block a user