All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: MASTHAN DUDEKULA <d.mastan@gmail.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: program inquiry is using a deprecated scsi_ioctl , please convert it to SG_IO
Date: Thu, 22 Feb 2007 16:15:31 -0600	[thread overview]
Message-ID: <1172182531.3378.41.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <868c9d9d0702212229p2e1a39ek9b73813899f18645@mail.gmail.com>

On Thu, 2007-02-22 at 11:59 +0530, MASTHAN DUDEKULA wrote:
> Hi JAMES,
>  
>  
> The following code is SG_IO equivalent of scsi ioctls
> SCSI_TEST_UNIT_READY
>  
>    unsigned char sense_b[32];
>     unsigned char turCmbBlk[] = {0x00, 0, 0, 0, 0, 0};
>     struct sg_io_hdr io_hdr; 
> 
>     memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
>     io_hdr.interface_id = 'S';
>     io_hdr.cmd_len = sizeof(turCmbBlk);
>     io_hdr.mx_sb_len = sizeof(sense_b);
>     io_hdr.dxfer_direction = SG_DXFER_NONE;
>     io_hdr.cmdp = turCmbBlk;
>     io_hdr.sbp = sense_b;
>     io_hdr.timeout = DEF_TIMEOUT;
> 
>     if (ioctl(fd, SG_IO, &io_hdr) < 0) {
>  
> Like this What is the SG_IO equivalent for SCSI_IOCTL_SCSI_COMMAND ?

I don't understand your question ... SCSI_IOCTL_SEND_COMMAND sends a
SCSI command to the device.  Your example of test unit ready above does
just that ... it sends a Test Unit Ready command to the device using
SG_IO ... exactly what do you not understand about using SG_IO to send
commands to the device?

James




  parent reply	other threads:[~2007-02-22 22:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 10:14 program inquiry is using a deprecated scsi_ioctl , please convert it to SG_IO Masthan
2007-02-08 14:50 ` James Bottomley
     [not found]   ` <868c9d9d0702202233pa206222jb9beb85d60089003@mail.gmail.com>
2007-02-21 17:17     ` James Bottomley
     [not found]       ` <868c9d9d0702212229p2e1a39ek9b73813899f18645@mail.gmail.com>
2007-02-22 22:15         ` James Bottomley [this message]
2007-02-22 23:59           ` 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=1172182531.3378.41.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=d.mastan@gmail.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.