Sergey Vichik wrote:
> 
> Hello,
> 
> If any body knows how to send SCSI command using sd file : for example
> /dev/sda,
> Please let me know .
> 
> I tried ioctl() using SCSI_IOCTL_SEND_COMMAND command, it doesn't  work.
> 
> SCSI_IOCTL_SEND_COMMAND equals to 1,  it seems to be too small value for
> such ioctl command.

Within the limits put on SCSI_IOCTL_SEND_COMMAND (e.g. no transfer
greater than PAGE_SIZE length) it seems to work quite well.

Even though the sg driver is an alternate way to do the same thing,
there is an example of using that ioctl() [in scsi_inquiry.c]
in the utilities package. Also the sg documentation outlines 
that ioctl's usage. See the information at:
http://www.torque.net/sg

The only successful return value from that ioctl() is 0, all other
values imply some error.

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to