Lines Matching defs:io

205 static int cctl_do_io(int fd, int retries, union ctl_io *io, const char *func);
572 cctl_do_io(int fd, int retries, union ctl_io *io, const char *func)
575 if (ioctl(fd, CTL_IO, io) == -1) {
579 } while (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)
1009 union ctl_io *io;
1019 io = ctl_scsi_alloc_io(iid);
1020 if (io == NULL) {
1062 ctl_scsi_sync_cache(/*io*/ io,
1071 io->io_hdr.nexus.targ_lun = lun;
1072 io->io_hdr.nexus.initid = iid;
1074 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1079 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1082 ctl_io_error_print(io, NULL, stderr);
1084 ctl_scsi_free_io(io);
1093 union ctl_io *io;
1100 io = ctl_scsi_alloc_io(iid);
1101 if (io == NULL) {
1122 ctl_scsi_start_stop(/*io*/ io,
1131 io->io_hdr.nexus.targ_lun = lun;
1132 io->io_hdr.nexus.initid = iid;
1134 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1139 ctl_scsi_path_string(io, scsi_path, sizeof(scsi_path));
1140 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1144 ctl_io_error_print(io, NULL, stderr);
1147 ctl_scsi_free_io(io);
1156 union ctl_io *io;
1168 io = ctl_scsi_alloc_io(iid);
1169 if (io == NULL) {
1284 ctl_scsi_mode_sense(io,
1296 io->io_hdr.nexus.targ_lun = lun;
1297 io->io_hdr.nexus.initid = iid;
1299 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1304 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1309 if (io->scsiio.cdb[0] == MODE_SENSE_6) {
1356 ctl_io_error_print(io, NULL, stderr);
1359 ctl_scsi_free_io(io);
1371 union ctl_io *io;
1382 io = ctl_scsi_alloc_io(iid);
1383 if (io == NULL) {
1425 ctl_scsi_read_capacity(io,
1435 ctl_scsi_read_capacity_16(io,
1446 io->io_hdr.nexus.initid = iid;
1447 io->io_hdr.nexus.targ_lun = lun;
1449 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1454 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1479 ctl_io_error_print(io, NULL, stderr);
1482 ctl_scsi_free_io(io);
1495 union ctl_io *io;
1511 io = ctl_scsi_alloc_io(iid);
1512 if (io == NULL) {
1520 io->io_hdr.flags |= CTL_FLAG_NO_DATAMOVE;
1624 ctl_scsi_read_write(io,
1635 io->io_hdr.nexus.targ_lun = lun;
1636 io->io_hdr.nexus.initid = iid;
1638 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1643 if (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)
1652 } else if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)
1653 ctl_io_error_print(io, NULL, stderr);
1658 ctl_scsi_free_io(io);
1674 union ctl_io *io;
1681 io = ctl_scsi_alloc_io(iid);
1682 if (io == NULL) {
1699 ctl_scsi_free_io(io);
1703 ctl_scsi_report_luns(io,
1710 io->io_hdr.nexus.initid = iid;
1711 io->io_hdr.nexus.targ_lun = lun;
1713 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1718 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1731 ctl_io_error_print(io, NULL, stderr);
1735 ctl_scsi_free_io(io);
1796 union ctl_io *io;
1798 io = ctl_scsi_alloc_io(iid);
1799 if (io == NULL) {
1804 ctl_scsi_tur(io,
1808 io->io_hdr.nexus.targ_lun = lun;
1809 io->io_hdr.nexus.initid = iid;
1811 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1812 ctl_scsi_free_io(io);
1816 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)
1819 ctl_io_error_print(io, NULL, stderr);
1829 union ctl_io *io;
1834 io = ctl_scsi_alloc_io(iid);
1835 if (io == NULL) {
1840 ctl_scsi_inquiry(/*io*/ io,
1848 io->io_hdr.nexus.targ_lun = lun;
1849 io->io_hdr.nexus.initid = iid;
1851 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1856 if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) {
1858 ctl_io_error_print(io, NULL, stderr);
1860 ctl_scsi_path_string(io, path_str, path_len);
1863 ctl_scsi_free_io(io);
1899 union ctl_io *io;
1905 io = ctl_scsi_alloc_io(iid);
1906 if (io == NULL) {
1913 ctl_scsi_request_sense(/*io*/ io,
1920 io->io_hdr.nexus.targ_lun = lun;
1921 io->io_hdr.nexus.initid = iid;
1923 if (cctl_do_io(fd, retries, io, __func__) != 0) {
1928 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1929 bcopy(sense_data, &io->scsiio.sense_data, sizeof(*sense_data));
1930 io->scsiio.sense_len = sizeof(*sense_data);
1931 ctl_scsi_sense_print(&io->scsiio, NULL, stdout);
1933 ctl_io_error_print(io, NULL, stderr);
1937 ctl_scsi_free_io(io);
1946 union ctl_io *io;
1954 io = ctl_scsi_alloc_io(iid);
1955 if (io == NULL) {
1970 ctl_scsi_maintenance_in(/*io*/ io,
1977 io->io_hdr.nexus.targ_lun = lun;
1978 io->io_hdr.nexus.initid = iid;
1980 if (cctl_do_io(fd, 0, io, __func__) != 0) {
1985 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
1997 ctl_io_error_print(io, NULL, stderr);
2000 ctl_scsi_free_io(io);
2011 union ctl_io *io;
2019 io = ctl_scsi_alloc_io(iid);
2020 if (io == NULL) {
2035 ctl_scsi_inquiry(/*io*/ io,
2043 io->io_hdr.nexus.targ_lun = lun;
2044 io->io_hdr.nexus.initid = iid;
2046 if (cctl_do_io(fd, 0, io, __func__) != 0) {
2051 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
2063 ctl_io_error_print(io, NULL, stderr);
2066 ctl_scsi_free_io(io);
2079 union ctl_io *io;
2089 io = ctl_scsi_alloc_io(iid);
2090 if (io == NULL) {
2122 ctl_scsi_persistent_res_in(io,
2129 io->io_hdr.nexus.targ_lun = lun;
2130 io->io_hdr.nexus.initid = iid;
2132 if (cctl_do_io(fd, retry_count, io, __func__) != 0) {
2137 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
2164 ctl_io_error_print(io, NULL, stderr);
2167 ctl_scsi_free_io(io);
2180 union ctl_io *io;
2191 io = ctl_scsi_alloc_io(iid);
2192 if (io == NULL) {
2239 ctl_scsi_persistent_res_out(io,
2249 io->io_hdr.nexus.targ_lun = lun;
2250 io->io_hdr.nexus.initid = iid;
2252 if (cctl_do_io(fd, retry_count, io, __func__) != 0) {
2256 if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
2258 ctl_scsi_path_string(io, scsi_path, sizeof(scsi_path));
2262 ctl_io_error_print(io, NULL, stderr);
2265 ctl_scsi_free_io(io);