All of lore.kernel.org
 help / color / mirror / Atom feed
From: fangxiaozhi 00110321 <huananhu@huawei.com>
To: linux-scsi@vger.kernel.org
Subject: Can not send SCSI command to the cdrom device.
Date: Sat, 17 Jan 2009 17:02:54 +0800	[thread overview]
Message-ID: <face93d65cecd.5cecdface93d6@huawei.com> (raw)

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!
 *****************************************************************************************

             reply	other threads:[~2009-01-17  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17  9:02 fangxiaozhi 00110321 [this message]
2009-01-17 16:40 ` Can not send SCSI command to the cdrom device Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=face93d65cecd.5cecdface93d6@huawei.com \
    --to=huananhu@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.