question about SG_ ioctls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux