Lines Matching refs:STm
897 static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm) in set_mode_densblk() argument
903 STm->default_density >= 0 && in set_mode_densblk()
904 STm->default_density != STp->density) { in set_mode_densblk()
905 arg = STm->default_density; in set_mode_densblk()
911 STm->default_blksize >= 0 && in set_mode_densblk()
912 STm->default_blksize != STp->block_size) { in set_mode_densblk()
913 arg |= STm->default_blksize; in set_mode_densblk()
922 STm->default_blksize, STm->default_density); in set_mode_densblk()
1075 struct st_modedef *STm; in check_tape() local
1088 STm = &(STp->modes[STp->current_mode]); in check_tape()
1254 if (!(STm->defaults_for_writes) && in check_tape()
1255 (retval = set_mode_densblk(STp, STm)) < 0) in check_tape()
1376 struct st_modedef *STm = &(STp->modes[STp->current_mode]); in st_flush() local
1451 if (!STm->sysv || STps->rw != ST_READING) { in st_flush()
1660 struct st_modedef *STm; in st_write() local
1679 STm = &(STp->modes[STp->current_mode]); in st_write()
1695 if ((retval = set_mode_densblk(STp, STm)) < 0) in st_write()
1697 if (STm->default_compression != ST_DONT_TOUCH && in st_write()
1699 if (st_compression(STp, (STm->default_compression == ST_YES))) { in st_write()
1777 STm->do_async_writes && STps->eof < ST_EOM_OK; in st_write()
1779 if (STp->block_size != 0 && STm->do_buffer_writes && in st_write()
1934 struct st_modedef *STm; in read_tape() local
1942 STm = &(STp->modes[STp->current_mode]); in read_tape()
1951 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) { in read_tape()
2132 struct st_modedef *STm; in st_read() local
2143 STm = &(STp->modes[STp->current_mode]); in st_read()
2145 if (!STm->do_read_ahead) { in st_read()
2273 static void st_log_options(struct scsi_tape * STp, struct st_modedef * STm) in DEB()
2279 STp->current_mode, STm->do_buffer_writes, in DEB()
2280 STm->do_async_writes, STm->do_read_ahead); in DEB()
2289 STm->defaults_for_writes, STp->omit_blklims, in DEB()
2294 STm->sysv, STp->immediate, STp->sili, in DEB()
2306 struct st_modedef *STm; local
2310 STm = &(STp->modes[STp->current_mode]);
2311 if (!STm->defined) {
2312 cd0 = STm->cdevs[0];
2313 cd1 = STm->cdevs[1];
2314 d0 = STm->devs[0];
2315 d1 = STm->devs[1];
2316 memcpy(STm, &(STp->modes[0]), sizeof(struct st_modedef));
2317 STm->cdevs[0] = cd0;
2318 STm->cdevs[1] = cd1;
2319 STm->devs[0] = d0;
2320 STm->devs[1] = d1;
2328 STm->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
2329 STm->do_async_writes = (options & MT_ST_ASYNC_WRITES) != 0;
2330 STm->defaults_for_writes = (options & MT_ST_DEF_WRITES) != 0;
2331 STm->do_read_ahead = (options & MT_ST_READ_AHEAD) != 0;
2342 STm->sysv = (options & MT_ST_SYSV) != 0;
2345 st_log_options(STp, STm); )
2349 STm->do_buffer_writes = value;
2351 STm->do_async_writes = value;
2353 STm->defaults_for_writes = value;
2355 STm->do_read_ahead = value;
2376 STm->sysv = value;
2382 st_log_options(STp, STm); )
2388 STm->default_blksize = (-1);
2391 STm->default_blksize = value;
2393 "%d bytes.\n", STm->default_blksize);
2396 set_mode_densblk(STp, STm);
2428 STm->default_density = (-1);
2432 STm->default_density = value & 0xff;
2434 STm->default_density);
2437 set_mode_densblk(STp, STm);
2455 STm->default_compression = ST_DONT_TOUCH;
2466 STm->default_compression = (value & 1 ? ST_YES : ST_NO);
2472 st_compression(STp, (STm->default_compression == ST_YES));
3535 static long st_common_ioctl(struct scsi_tape *STp, struct st_modedef *STm, in st_common_ioctl() argument
3541 if (!STm->defined) { in st_common_ioctl()
3598 struct st_modedef *STm; in st_ioctl() local
3611 STm = &(STp->modes[STp->current_mode]); in st_ioctl()
3631 return st_common_ioctl(STp, STm, file, cmd_in, arg); in st_ioctl()
3657 if (!STm->defined && in st_ioctl()
3842 if (!STm->defined) { in st_ioctl()
3919 if (STm->do_async_writes || in st_ioctl()
3920 (STm->do_buffer_writes && STp->block_size != 0) || in st_ioctl()
4267 struct st_modedef *STm = &(tape->modes[mode]); in create_one_cdev() local
4281 STm->cdevs[rew] = cdev; in create_one_cdev()
4303 STm->devs[rew] = dev; in create_one_cdev()
4307 cdev_del(STm->cdevs[rew]); in create_one_cdev()
4309 STm->cdevs[rew] = NULL; in create_one_cdev()
4310 STm->devs[rew] = NULL; in create_one_cdev()
4335 struct st_modedef *STm = &(tape->modes[mode]); in remove_cdevs() local
4337 if (STm->cdevs[rew]) in remove_cdevs()
4338 cdev_del(STm->cdevs[rew]); in remove_cdevs()
4339 if (STm->devs[rew]) in remove_cdevs()
4340 device_unregister(STm->devs[rew]); in remove_cdevs()
4349 struct st_modedef *STm; in st_probe() local
4418 STm = &(tpnt->modes[i]); in st_probe()
4419 STm->defined = 0; in st_probe()
4420 STm->sysv = ST_SYSV; in st_probe()
4421 STm->defaults_for_writes = 0; in st_probe()
4422 STm->do_async_writes = ST_ASYNC_WRITES; in st_probe()
4423 STm->do_buffer_writes = ST_BUFFER_WRITES; in st_probe()
4424 STm->do_read_ahead = ST_READ_AHEAD; in st_probe()
4425 STm->default_compression = ST_DONT_TOUCH; in st_probe()
4426 STm->default_blksize = (-1); /* No forced size */ in st_probe()
4427 STm->default_density = (-1); /* No forced density */ in st_probe()
4428 STm->tape = tpnt; in st_probe()
4675 struct st_modedef *STm = dev_get_drvdata(dev); in defined_show() local
4678 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); in defined_show()
4687 struct st_modedef *STm = dev_get_drvdata(dev); in default_blksize_show() local
4690 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); in default_blksize_show()
4699 struct st_modedef *STm = dev_get_drvdata(dev); in default_density_show() local
4703 fmt = STm->default_density >= 0 ? "0x%02x\n" : "%d\n"; in default_density_show()
4704 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); in default_density_show()
4713 struct st_modedef *STm = dev_get_drvdata(dev); in default_compression_show() local
4716 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); in default_compression_show()
4724 struct st_modedef *STm = dev_get_drvdata(dev); in options_show() local
4725 struct scsi_tape *STp = STm->tape; in options_show()
4729 options = STm->do_buffer_writes ? MT_ST_BUFFER_WRITES : 0; in options_show()
4730 options |= STm->do_async_writes ? MT_ST_ASYNC_WRITES : 0; in options_show()
4731 options |= STm->do_read_ahead ? MT_ST_READ_AHEAD : 0; in options_show()
4735 options |= STm->defaults_for_writes ? MT_ST_DEF_WRITES : 0; in options_show()
4740 options |= STm->sysv ? MT_ST_SYSV : 0; in options_show()
4761 struct st_modedef *STm = dev_get_drvdata(dev); in position_lost_in_reset_show() local
4762 struct scsi_tape *STp = STm->tape; in position_lost_in_reset_show()
4779 struct st_modedef *STm = dev_get_drvdata(dev); in read_cnt_show() local
4782 (long long)atomic64_read(&STm->tape->stats->read_cnt)); in read_cnt_show()
4797 struct st_modedef *STm = dev_get_drvdata(dev); in read_byte_cnt_show() local
4800 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt)); in read_byte_cnt_show()
4813 struct st_modedef *STm = dev_get_drvdata(dev); in read_ns_show() local
4816 (long long)atomic64_read(&STm->tape->stats->tot_read_time)); in read_ns_show()
4830 struct st_modedef *STm = dev_get_drvdata(dev); in write_cnt_show() local
4833 (long long)atomic64_read(&STm->tape->stats->write_cnt)); in write_cnt_show()
4847 struct st_modedef *STm = dev_get_drvdata(dev); in write_byte_cnt_show() local
4850 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt)); in write_byte_cnt_show()
4864 struct st_modedef *STm = dev_get_drvdata(dev); in write_ns_show() local
4867 (long long)atomic64_read(&STm->tape->stats->tot_write_time)); in write_ns_show()
4882 struct st_modedef *STm = dev_get_drvdata(dev); in in_flight_show() local
4885 (long long)atomic64_read(&STm->tape->stats->in_flight)); in in_flight_show()
4902 struct st_modedef *STm = dev_get_drvdata(dev); in io_ns_show() local
4905 (long long)atomic64_read(&STm->tape->stats->tot_io_time)); in io_ns_show()
4921 struct st_modedef *STm = dev_get_drvdata(dev); in other_cnt_show() local
4924 (long long)atomic64_read(&STm->tape->stats->other_cnt)); in other_cnt_show()
4939 struct st_modedef *STm = dev_get_drvdata(dev); in resid_cnt_show() local
4942 (long long)atomic64_read(&STm->tape->stats->resid_cnt)); in resid_cnt_show()