linux-scsi.vger.kernel.org archive mirror
 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

* Re: CDROMSUBCHNL. . .
  2004-09-27  3:53 CDROMSUBCHNL. . Andy Kennedy
@ 2004-09-27  6:19 ` Jens Axboe
  2004-09-27 16:08   ` Andy Kennedy
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2004-09-27  6:19 UTC (permalink / raw)
  To: Andy Kennedy; +Cc: linux-scsi

On Sun, Sep 26 2004, Andy Kennedy wrote:
> 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?

Nonsense, noone removed the CDROMSUBCHNL ioctl.

-- 
Jens Axboe


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

* Re: CDROMSUBCHNL. . .
  2004-09-27  6:19 ` Jens Axboe
@ 2004-09-27 16:08   ` Andy Kennedy
  2004-09-27 16:40     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Kennedy @ 2004-09-27 16:08 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-scsi

Thank you so much for your prompt responce.  Could you please tell me where
I can find this call in the code now, or more specifically how I can poll my
CDROM for its current state?

Thanks,
Andy
----- Original Message ----- 
From: "Jens Axboe" <axboe@suse.de>
To: "Andy Kennedy" <akennedy@wpid-am.com>
Cc: <linux-scsi@vger.kernel.org>
Sent: Monday, September 27, 2004 1:19 AM
Subject: Re: CDROMSUBCHNL. . .


> On Sun, Sep 26 2004, Andy Kennedy wrote:
> > 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?
>
> Nonsense, noone removed the CDROMSUBCHNL ioctl.
>
> -- 
> Jens Axboe


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

* Re: CDROMSUBCHNL. . .
  2004-09-27 16:08   ` Andy Kennedy
@ 2004-09-27 16:40     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-09-27 16:40 UTC (permalink / raw)
  To: Andy Kennedy; +Cc: linux-scsi


(don't top post)

On Mon, Sep 27 2004, Andy Kennedy wrote:
> Thank you so much for your prompt responce.  Could you please tell me
> where I can find this call in the code now, or more specifically how I
> can poll my CDROM for its current state?

The code is in drivers/cdrom/cdrom.c

-- 
Jens Axboe


^ 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).