All of lore.kernel.org
 help / color / mirror / Atom feed
* CDROMSUBCHNL. . .
@ 2004-09-27  3:53 Andy Kennedy
  2004-09-27  6:19 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Kennedy @ 2004-09-27  3:53 UTC (permalink / raw)
  To: linux-scsi

Hi all,

I use the sr_ioctl calls in a program that I wrote to record tracks off CDs.
The most important one that I use is CDROMSUBCHNL.  I found that in 2.2.16
"case CDROMSUBCHNL" was removed without documentation.  I have grepped all
around in that kernel and also in the one before it and found nothing about
why it was to be removed.  Anyone have any idea why it got taken out and can
we put it back in?

The missing code is as follows:
    case CDROMSUBCHNL:
    {
        struct cdrom_subchnl* subchnl = (struct cdrom_subchnl*)arg;
        char * buffer;

        sr_cmd[0] = SCMD_READ_SUBCHANNEL;
        sr_cmd[1] = ((scsi_CDs[target].device->lun) << 5) | 0x02;    /* MSF
form
at */
        sr_cmd[2] = 0x40;    /* I do want the subchannel info */
        sr_cmd[3] = 0x01;    /* Give me current position info */
        sr_cmd[4] = sr_cmd[5] = 0;
        sr_cmd[6] = 0;
        sr_cmd[7] = 0;
        sr_cmd[8] = 16;
        sr_cmd[9] = 0;

        if ((buffer = (unsigned char *) scsi_malloc(512)) == NULL)
                return -ENOMEM;

        result = sr_do_ioctl(target, sr_cmd, buffer, 16, 0);

        subchnl->cdsc_audiostatus = buffer[1];
        subchnl->cdsc_format = CDROM_MSF;
        subchnl->cdsc_ctrl = buffer[5] & 0xf;
        subchnl->cdsc_trk = buffer[6];
        subchnl->cdsc_ind = buffer[7];

        subchnl->cdsc_reladdr.msf.minute = buffer[13];
        subchnl->cdsc_reladdr.msf.second = buffer[14];
        subchnl->cdsc_reladdr.msf.frame = buffer[15];
        subchnl->cdsc_absaddr.msf.minute = buffer[9];
        subchnl->cdsc_absaddr.msf.second = buffer[10];
        subchnl->cdsc_absaddr.msf.frame = buffer[11];

        scsi_free(buffer, 512);
        break;
    }

Thanks,
Andy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-27 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-27  3:53 CDROMSUBCHNL. . Andy Kennedy
2004-09-27  6:19 ` Jens Axboe
2004-09-27 16:08   ` Andy Kennedy
2004-09-27 16:40     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.