Can not send SCSI command to the cdrom device.

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

 



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 ?
 
   And how can I send send the command through /dev/scd1?
 
   Wait for the help, thanks.
 
Best Regards,
 
Franko Fang
2009-1-17


******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained here in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email
 immediately and delete it!
 *****************************************************************************************
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux