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 - To unsubscribe from this list: 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