Re: Can not send SCSI command to the cdrom device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, I must send the command to tell the CDROM device how to do after it received this command.

 And by the way, as far as I tried, these three device file in /dev/ are all referred to my CDROM device, why they have  so much difference?

   And how can I send the SCSI command to the CDROM device through scd1 file (bloack special)?

   Thanks.

Franko Fang
----- Original Message ----- 
From: "Greg KH" <greg@xxxxxxxxx>
To: "fangxiaozhi 00110321" <huananhu@xxxxxxxxxx>
Cc: <linux-usb@xxxxxxxxxxxxxxx>
Sent: Saturday, January 17, 2009 12:00 PM
Subject: Re: Can not send SCSI command to the cdrom device.


> On Sat, Jan 17, 2009 at 11:56:41AM +0800, fangxiaozhi 00110321 wrote:
>> 
>> Dear all:
>>  
>>   I have a CDROM device, and after I plug it into the Linux system, the Linux system will generate three device files in the directory of /dev/, such as:
>>   scd1: block special (11/0)
>>   sr1:  link to scd1
>>   sg1: character special(21/1)
>>  
>>   And I write a c program to send the SCSI command of SPACE to my CDROM device. Such as :
>>  
>>    fd = open("/dev/sg1", 0_RDWR);
>>    ioctl(fd, SCSI_IOCTL_SEND_COMMAND, cmdbuff);
>>  
>>   And I found that I can send the SPACE command to my CDROM device, if I open the file of /dev/sg1.
>>   But if I open the file of /dev/scd1, then I can not send the SPACE command to my CDROM device.
>>  
>>    Why I can not send SCSI command through /dev/scd1 ?
>>  
>>    What difference between /dev/sg1 and /dev/scd1 ?
> 
> One is a character device, and the other a block device.
> 
>>    And how can I send send the command through /dev/scd1?
> 
> You probably can't, it is usually a different block ioctl to do that.
> 
> What are you really trying to do here?
> 
> thanks,
> 
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux