All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Parimi <rparimi@gmail.com>
To: linux-scsi@vger.kernel.org
Subject: question about SG_ ioctls
Date: Tue, 27 Sep 2005 19:12:00 -0700	[thread overview]
Message-ID: <21c20ce70509271912142ef77@mail.gmail.com> (raw)

Hi,

I have a SCSI controller thats need to be tested for correct
performance with all the SG_ and SCSI_ ioctls. I've been using the
sg3_utils package to do this so far. The various programs in sg3_utils
issue calls to different ioctls depending on the command line
arguments passed onto them. I would like to have just one program that
issues calls to a few IOCTLs that I really care about, and want to
calls to these IOCTLs lined up in a C program like this:

===================================================================
   if ((res = ioctl(sg_fd, SG_GET_VERSION_NUM, &ver) < 0)) {
      printf("IOCTL SG_GET_VERSION_NUM failed\n");
      return 1;
   }
   printf("SG_GET_VERSION_NUM:\n");
   printf("\tversion = %d\n", ver);

   if ((res = ioctl(sg_fd, SCSI_IOCTL_GET_IDLUN, &my_idlun) < 0)) {
      printf("IOCTL SCSI_IOCTL_GET_IDLUN failed\n");
      return 1;
   }
   printf("SCSI_IOCTL_GET_IDLUN:\n");
   printf("\tchannel = %d\n\tid = %d\t\n\tlun = %d\n",
   (my_idlun.dev_id >> 16) & 0xff, my_idlun.dev_id & 0xff,
   (my_idlun.dev_id >> 8) & 0xff);
===================================================================

I want to know if doing the above is OK? I do not know if calling
certain IOCTLs in a specific order has any problems/issues. Also, if
the above program reports success for all the IOCTLs called, it is
safe to assume that the scsi controller is able to handle all IOCTLs
properly?

Thanks a lot,
--ravi

             reply	other threads:[~2005-09-28  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28  2:12 Ravi Parimi [this message]
2005-09-29  6:01 ` question about SG_ ioctls 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=21c20ce70509271912142ef77@mail.gmail.com \
    --to=rparimi@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.