Skip to contentSkip to conversation

CDROMSUBCHNL. . .

DISCUSSION Andy Kennedy 2 participants 4 messages Sep 27, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 8 lines · Andy Kennedy

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.

Signature · 1 line
Jens Axboe
#2 lore raw

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" <[email protected]>
To: "Andy Kennedy" <[email protected]>
Cc: <[email protected]>
Sent: Monday, September 27, 2004 1:19 AM
Subject: Re: CDROMSUBCHNL. . .

Quoted 4 lines · Andy Kennedy
Quoted 3 lines

Hi all,

I use the sr_ioctl calls in a program that I wrote to record tracks off

CDs.

Quoted 1 line
Quoted 1 line

The most important one that I use is CDROMSUBCHNL. I found that in

2.2.16

Quoted 1 line
Quoted 1 line

"case CDROMSUBCHNL" was removed without documentation. I have grepped

all

Quoted 1 line
Quoted 1 line

around in that kernel and also in the one before it and found nothing

about

Quoted 1 line
Quoted 1 line

why it was to be removed. Anyone have any idea why it got taken out and

can

Quoted 6 lines
Quoted 1 line

we put it back in?

Nonsense, noone removed the CDROMSUBCHNL ioctl.

Signature · 1 line
Jens Axboe
#3 lore raw

(don't top post)

Quoted 3 lines · Andy Kennedy

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

Signature · 1 line
Jens Axboe