Now, before everyone gets their underware in a wad, this should be
seriously considered. If you want to get raw CD-DA to perfectly
copy your CD collection, you should use the CDROMREADAUDIO ioctl.
Is there really a need to read raw frames of mode1, mode2, or
raw (whatever) data? Boris, what are you needing these ioctls for?
-Erik
--
Erik B. Andersen Web: http://www.inconnect.com/~andersen/
email: andersee@debian.org
--This message was written using 73% post-consumer electrons--
p.s. for those interested, my work on the kernel CD-ROM layer is coming
along nicely. I now have several of the most common drivers ported to
the Uniform cdrom driver.
On Fri, 19 Sep 1997, Boris Tobotras wrote:
> Hi,
>
> Can anybody help me with finding a replacement for this patch
> destined for 2.1's sr_ioctl() in 2.0.30. Hard stuff is sr_read_sector()
> replacement.
>
> This patch is from readvcd-2.3. Or is there this patch for 2.0?
>
> -- cut here --
>
> case CDROMREADRAW:
> case CDROMREADMODE2:
> case CDROMREADMODE1:
> {
> unsigned char *raw;
> struct cdrom_msf msf;
> int blocksize, lba, rc;
>
> if (cmd == CDROMREADMODE1)
> blocksize = CD_FRAMESIZE; /* 2048 */
> else if (cmd == CDROMREADMODE2)
> blocksize = CD_FRAMESIZE_RAW0; /* 2336 */
> else
> /* some SCSI drives do not allow this one */
> blocksize = CD_FRAMESIZE_RAW; /* 2352 */
>
> rc = verify_area (VERIFY_READ, (void *) arg, sizeof(msf));
> if ( rc ) return -EFAULT;
> memcpy_fromfs(&msf,(void*)arg,sizeof(msf));
>
> if (!(raw = scsi_malloc(2048+512)))
> return -ENOMEM;
>
> lba = (((msf.cdmsf_min0 * CD_SECS) + msf.cdmsf_sec0)
> * CD_FRAMES + msf.cdmsf_frame0) - CD_BLOCK_OFFSET;
> rc = sr_read_sector(target, lba, blocksize, raw);
> if (!rc) {
> rc = verify_area (VERIFY_WRITE, raw, blocksize);
> if ( rc )
> rc = -EFAULT;
> else
> memcpy_tofs((void*)arg, raw, blocksize);
> }
> scsi_free(raw,2048+512);
> return rc;
> }
>
> --
> Best regards, -- Boris.
>
>
>