Lines Matching full:stm
884 static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm) in set_mode_densblk() argument
890 STm->default_density >= 0 && in set_mode_densblk()
891 STm->default_density != STp->density) { in set_mode_densblk()
892 arg = STm->default_density; in set_mode_densblk()
898 STm->default_blksize >= 0 && in set_mode_densblk()
899 STm->default_blksize != STp->block_size) { in set_mode_densblk()
900 arg |= STm->default_blksize; in set_mode_densblk()
909 STm->default_blksize, STm->default_density); in set_mode_densblk()
1047 struct st_modedef *STm; in check_tape() local
1060 STm = &(STp->modes[STp->current_mode]); in check_tape()
1226 if (!(STm->defaults_for_writes) && in check_tape()
1227 (retval = set_mode_densblk(STp, STm)) < 0) in check_tape()
1348 struct st_modedef *STm = &(STp->modes[STp->current_mode]); in st_flush() local
1423 if (!STm->sysv || STps->rw != ST_READING) { in st_flush()
1632 struct st_modedef *STm; in st_write() local
1651 STm = &(STp->modes[STp->current_mode]); in st_write()
1667 if ((retval = set_mode_densblk(STp, STm)) < 0) in st_write()
1669 if (STm->default_compression != ST_DONT_TOUCH && in st_write()
1671 if (st_compression(STp, (STm->default_compression == ST_YES))) { in st_write()
1749 STm->do_async_writes && STps->eof < ST_EOM_OK; in st_write()
1751 if (STp->block_size != 0 && STm->do_buffer_writes && in st_write()
1906 struct st_modedef *STm; in read_tape() local
1914 STm = &(STp->modes[STp->current_mode]); in read_tape()
1923 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) { in read_tape()
2104 struct st_modedef *STm; in st_read() local
2115 STm = &(STp->modes[STp->current_mode]); in st_read()
2117 if (!STm->do_read_ahead) { in st_read()
2245 static void st_log_options(struct scsi_tape * STp, struct st_modedef * STm) in DEB()
2251 STp->current_mode, STm->do_buffer_writes, in DEB()
2252 STm->do_async_writes, STm->do_read_ahead); in DEB()
2261 STm->defaults_for_writes, STp->omit_blklims, in DEB()
2266 STm->sysv, STp->immediate, STp->sili, in DEB()
2278 struct st_modedef *STm; local
2282 STm = &(STp->modes[STp->current_mode]);
2283 if (!STm->defined) {
2284 cd0 = STm->cdevs[0];
2285 cd1 = STm->cdevs[1];
2286 d0 = STm->devs[0];
2287 d1 = STm->devs[1];
2288 memcpy(STm, &(STp->modes[0]), sizeof(struct st_modedef));
2289 STm->cdevs[0] = cd0;
2290 STm->cdevs[1] = cd1;
2291 STm->devs[0] = d0;
2292 STm->devs[1] = d1;
2300 STm->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
2301 STm->do_async_writes = (options & MT_ST_ASYNC_WRITES) != 0;
2302 STm->defaults_for_writes = (options & MT_ST_DEF_WRITES) != 0;
2303 STm->do_read_ahead = (options & MT_ST_READ_AHEAD) != 0;
2314 STm->sysv = (options & MT_ST_SYSV) != 0;
2317 st_log_options(STp, STm); )
2321 STm->do_buffer_writes = value;
2323 STm->do_async_writes = value;
2325 STm->defaults_for_writes = value;
2327 STm->do_read_ahead = value;
2348 STm->sysv = value;
2354 st_log_options(STp, STm); )
2360 STm->default_blksize = (-1);
2363 STm->default_blksize = value;
2365 "%d bytes.\n", STm->default_blksize);
2368 set_mode_densblk(STp, STm);
2400 STm->default_density = (-1);
2404 STm->default_density = value & 0xff;
2406 STm->default_density);
2409 set_mode_densblk(STp, STm);
2427 STm->default_compression = ST_DONT_TOUCH;
2438 STm->default_compression = (value & 1 ? ST_YES : ST_NO);
2444 st_compression(STp, (STm->default_compression == ST_YES));
3509 struct st_modedef *STm; in st_ioctl_common() local
3522 STm = &(STp->modes[STp->current_mode]); in st_ioctl_common()
3559 if (!STm->defined && in st_ioctl_common()
3729 if (!STm->defined) { in st_ioctl_common()
3795 if (STm->do_async_writes || in st_ioctl_common()
3796 (STm->do_buffer_writes && STp->block_size != 0) || in st_ioctl_common()
4197 struct st_modedef *STm = &(tape->modes[mode]); in create_one_cdev() local
4211 STm->cdevs[rew] = cdev; in create_one_cdev()
4233 STm->devs[rew] = dev; in create_one_cdev()
4237 cdev_del(STm->cdevs[rew]); in create_one_cdev()
4239 STm->cdevs[rew] = NULL; in create_one_cdev()
4240 STm->devs[rew] = NULL; in create_one_cdev()
4265 struct st_modedef *STm = &(tape->modes[mode]); in remove_cdevs() local
4267 if (STm->cdevs[rew]) in remove_cdevs()
4268 cdev_del(STm->cdevs[rew]); in remove_cdevs()
4269 if (STm->devs[rew]) in remove_cdevs()
4270 device_unregister(STm->devs[rew]); in remove_cdevs()
4280 struct st_modedef *STm; in st_probe() local
4365 STm = &(tpnt->modes[i]); in st_probe()
4366 STm->defined = 0; in st_probe()
4367 STm->sysv = ST_SYSV; in st_probe()
4368 STm->defaults_for_writes = 0; in st_probe()
4369 STm->do_async_writes = ST_ASYNC_WRITES; in st_probe()
4370 STm->do_buffer_writes = ST_BUFFER_WRITES; in st_probe()
4371 STm->do_read_ahead = ST_READ_AHEAD; in st_probe()
4372 STm->default_compression = ST_DONT_TOUCH; in st_probe()
4373 STm->default_blksize = (-1); /* No forced size */ in st_probe()
4374 STm->default_density = (-1); /* No forced density */ in st_probe()
4375 STm->tape = tpnt; in st_probe()
4625 struct st_modedef *STm = dev_get_drvdata(dev); in defined_show() local
4628 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); in defined_show()
4637 struct st_modedef *STm = dev_get_drvdata(dev); in default_blksize_show() local
4640 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); in default_blksize_show()
4649 struct st_modedef *STm = dev_get_drvdata(dev); in default_density_show() local
4653 fmt = STm->default_density >= 0 ? "0x%02x\n" : "%d\n"; in default_density_show()
4654 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); in default_density_show()
4663 struct st_modedef *STm = dev_get_drvdata(dev); in default_compression_show() local
4666 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); in default_compression_show()
4674 struct st_modedef *STm = dev_get_drvdata(dev); in options_show() local
4675 struct scsi_tape *STp = STm->tape; in options_show()
4679 options = STm->do_buffer_writes ? MT_ST_BUFFER_WRITES : 0; in options_show()
4680 options |= STm->do_async_writes ? MT_ST_ASYNC_WRITES : 0; in options_show()
4681 options |= STm->do_read_ahead ? MT_ST_READ_AHEAD : 0; in options_show()
4685 options |= STm->defaults_for_writes ? MT_ST_DEF_WRITES : 0; in options_show()
4690 options |= STm->sysv ? MT_ST_SYSV : 0; in options_show()
4711 struct st_modedef *STm = dev_get_drvdata(dev); in read_cnt_show() local
4714 (long long)atomic64_read(&STm->tape->stats->read_cnt)); in read_cnt_show()
4729 struct st_modedef *STm = dev_get_drvdata(dev); in read_byte_cnt_show() local
4732 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt)); in read_byte_cnt_show()
4745 struct st_modedef *STm = dev_get_drvdata(dev); in read_ns_show() local
4748 (long long)atomic64_read(&STm->tape->stats->tot_read_time)); in read_ns_show()
4762 struct st_modedef *STm = dev_get_drvdata(dev); in write_cnt_show() local
4765 (long long)atomic64_read(&STm->tape->stats->write_cnt)); in write_cnt_show()
4779 struct st_modedef *STm = dev_get_drvdata(dev); in write_byte_cnt_show() local
4782 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt)); in write_byte_cnt_show()
4796 struct st_modedef *STm = dev_get_drvdata(dev); in write_ns_show() local
4799 (long long)atomic64_read(&STm->tape->stats->tot_write_time)); in write_ns_show()
4814 struct st_modedef *STm = dev_get_drvdata(dev); in in_flight_show() local
4817 (long long)atomic64_read(&STm->tape->stats->in_flight)); in in_flight_show()
4834 struct st_modedef *STm = dev_get_drvdata(dev); in io_ns_show() local
4837 (long long)atomic64_read(&STm->tape->stats->tot_io_time)); in io_ns_show()
4853 struct st_modedef *STm = dev_get_drvdata(dev); in other_cnt_show() local
4856 (long long)atomic64_read(&STm->tape->stats->other_cnt)); in other_cnt_show()
4871 struct st_modedef *STm = dev_get_drvdata(dev); in resid_cnt_show() local
4874 (long long)atomic64_read(&STm->tape->stats->resid_cnt)); in resid_cnt_show()