Age | Commit message (Collapse) | Author |
|
|
|
some default values
|
|
|
|
cdlock/cdunlock now through disk_lock/disk_unlock
|
|
Be better about handling failures of SCSI CD READ TOC command.
|
|
|
|
Fixes DMA bug Angelos was seeing with DVD stuff.
Happy ripping!
|
|
|
|
|
|
|
|
|
|
the audio CDs could do with a bit more work, but this makes audio cd
playing not generate disklabel read-failure messages on first open; csapuntz
|
|
we need for the release
|
|
terms of 512-unit sectors, yet the disklabel said that the sector size
was 2048.
Enabled code that tries to read disklabel from first data track. I guess
this will be useful for those combination music/BSD install cds.
|
|
disklabel logic than the cd driver. This patch integrates that logic into
the SCSI cd driver.
Bug fixed - we no longer try to read disklabels off of audio CDs. No more
SCSI errors when you hit play the first time on an audio CD.
|
|
Updated ioctls to match
Minor patches in anticipation of wd->sd translation layer
|
|
|
|
Fix cd.c so it compiles on big-endian platforms
|
|
|
|
Mostly based on NetBSD-current
|
|
drives don't support READ_CD_CAPACITY on blank media ; downsj with modifications by me
|
|
|
|
|
|
implement an ioctl to get a spoofed label even for disks that have
a label on them.
|
|
for temporary storage of CD table of contents
|
|
|
|
|
|
should also fix some cdio problems with SCSI cdroms.
|
|
|
|
|
|
|
|
* Use scsi_do_ioctl() in cd.c and uk.c again.
|
|
reference for making transferral of meta-information possible from
readdisklabel to bounds_check_with_label. The first (and maybe only)
thing that will use this is the multi-disklabel-format code on the
alpha where the labelsector is passed via cpu_disklabel so the label
write-protection can work correctly no matter what label was found.
Also use a new macro DKBAD to get at the dkbad field of the cpu_disklabel
implementations that contain it. This too is for multi-disklabel
architectures where the "bad" field can be inside a union. Use this
macro as a means for a driver to check if an architecture supports
dkbad constructs.
Remove proto of bounds_check_with_label from all MD disklabel.h as it
is in sys/disklabel.h.
I have not been able to test the changes everywhere, if I break anything
I apologize, and promise to fix it as soon as I become aware of it.
|
|
to:
* New changer driver.
* Better optical support.
* Different `done' semantics.
* New quirks for SCSI QIC tape driver, SCSI floppy drives.
* Better support for SCSI-I devices.
Everybody needs to test this.
|
|
NetBSD PR#3409 from Koji Imada <koji@imada.math.human.nagoya-u.ac.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Implemented NetBSD PR#2529, adding ZIP 100.
* Added MTIOCTOP support to acd, cd, and sd.
* Implemented eject on close for acd, cd, and sd.
`mt -f /dev/rcd0d offline' now ejects a mounted {acd|cd|sd} when it is
unmounted.
|
|
|
|
allow CDDA disks to be read.
not tested, anyone w/ SCSI CD is ought to.
here is the test program (not tested too ;):
#define CDDA
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/scsiio.h>
#include <sys/cdio.h>
#include <scsi/scsi_all.h>
#include <scsi/scsi_cd.h>
#include <scsi/scsi_disk.h>
extern int errno;
void
usage()
{
fprintf(stderr, "usage: cdda -d device -b blkcnt -o offset >output\n");
exit(1);
}
char databuf[CD_DA_BLKSIZ];
main(int argc, char *argv[])
{
int ch;
int fd;
off_t offset = 0;
int cnt = 0;
char *dev = 0;
struct scsi_rw_big read_cmd;
struct scsi_mode_sense sense_cmd;
struct cd_mode_data bdesc;
scsireq_t req;
while ((ch = getopt(argc, argv, "d:b:o:")) != -1) {
switch (ch) {
case 'd':
dev = optarg;
break;
case 'b':
cnt = atoi(optarg);
if (cnt <= 0)
usage();
break;
case 'o':
offset = atoi(optarg);
break;
case '?':
default:
usage();
}
}
if (dev == NULL || cnt == 0)
usage();
fd = open(dev, O_RDONLY);
if (fd == -1)
err(1,"can't open device %s", dev);
#ifdef DEBUG
ch = SC_DB_FLOW;
ioctl(fd, SCIOCDEBUG, &ch);
#endif
ch = 1;
if (ioctl(fd, CDIOCSETCDDA, &ch) == -1)
warn("can't set CDDA mode");
read_cmd.opcode = READ_BIG; /* READ10 */
read_cmd.byte2 = 0; /* no relative */
read_cmd.reserved = 0;
read_cmd.length2 = 0;
read_cmd.length1 = 1; /* read one block at a time.
hope it caches! */
read_cmd.control = 0; /* LBA mode, leave flag & link zero */
for (; cnt > 0; cnt--, offset++) {
read_cmd.addr_3 = (offset >> 24) & 0xff;
read_cmd.addr_2 = (offset >> 16) & 0xff;
read_cmd.addr_1 = (offset >> 8) & 0xff;
read_cmd.addr_0 = offset & 0xff;
memset(&req, 0, sizeof(req));
req.flags = SCCMD_READ;
/* timeout is in milliseconds--not that it's obvious from the
include files! */
req.timeout = 10000; /* 10 sec */
bcopy(&read_cmd, req.cmd, sizeof(read_cmd));
req.cmdlen = sizeof(read_cmd);
req.databuf = databuf;
req.datalen = sizeof(databuf);
req.senselen = sizeof(req.sense); /* XXX */
if (ioctl(fd, SCIOCCOMMAND, &req) == -1) {
fprintf(stderr, "bad ioctl: %d\n", errno);
ch = 0;
ioctl(fd, CDIOCSETCDDA, &ch);
#ifdef DEBUG
ioctl(fd, SCIOCDEBUG, &ch);
#endif
exit(1);
}
if (req.retsts != 0 || req.error != 0) {
ch = 0;
ioctl(fd, CDIOCSETCDDA, &ch);
#ifdef DEBUG
ioctl(fd, SCIOCDEBUG, &ch);
#endif
errx(1,"return status %d, error %d\n", req.retsts, req.error);
}
if (req.datalen_used != sizeof(databuf)) {
ch = 0;
ioctl(fd, CDIOCSETCDDA, &ch);
#ifdef DEBUG
ioctl(fd, SCIOCDEBUG, &ch);
#endif
errx(1,"didn't get full buffer back (%x)", req.datalen_used);
}
write(1, databuf, sizeof(databuf));
}
ch = 0;
if (ioctl(fd, CDIOCSETCDDA, &ch) == -1)
warn("can't reset CDDA mode");
#ifdef DEBUG
ioctl(fd, SCIOCDEBUG, &ch);
#endif
close(fd);
exit(0);
}
|
|
|
|
|
|
|