[8730] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: How to send scsi command using sd interface ?

daemon@ATHENA.MIT.EDU (Douglas Gilbert)
Sun Apr 30 23:28:10 2000

Message-ID: <390CED8C.6BD532F@interlog.com>
Date:	Sun, 30 Apr 2000 22:35:56 -0400
From: Douglas Gilbert <dgilbert@interlog.com>
MIME-Version: 1.0
To: Sergey Vichik <SVichik@store-age.com>
Cc: linux-scsi@vger.rutgers.edu
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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 majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post