Lines Matching full:stm

883 static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm)  in set_mode_densblk()  argument
889 STm->default_density >= 0 && in set_mode_densblk()
890 STm->default_density != STp->density) { in set_mode_densblk()
891 arg = STm->default_density; in set_mode_densblk()
897 STm->default_blksize >= 0 && in set_mode_densblk()
898 STm->default_blksize != STp->block_size) { in set_mode_densblk()
899 arg |= STm->default_blksize; in set_mode_densblk()
908 STm->default_blksize, STm->default_density); in set_mode_densblk()
1046 struct st_modedef *STm; in check_tape() local
1059 STm = &(STp->modes[STp->current_mode]); in check_tape()
1225 if (!(STm->defaults_for_writes) && in check_tape()
1226 (retval = set_mode_densblk(STp, STm)) < 0) in check_tape()
1347 struct st_modedef *STm = &(STp->modes[STp->current_mode]); in st_flush() local
1422 if (!STm->sysv || STps->rw != ST_READING) { in st_flush()
1631 struct st_modedef *STm; in st_write() local
1650 STm = &(STp->modes[STp->current_mode]); in st_write()
1666 if ((retval = set_mode_densblk(STp, STm)) < 0) in st_write()
1668 if (STm->default_compression != ST_DONT_TOUCH && in st_write()
1670 if (st_compression(STp, (STm->default_compression == ST_YES))) { in st_write()
1748 STm->do_async_writes && STps->eof < ST_EOM_OK; in st_write()
1750 if (STp->block_size != 0 && STm->do_buffer_writes && in st_write()
1905 struct st_modedef *STm; in read_tape() local
1913 STm = &(STp->modes[STp->current_mode]); in read_tape()
1922 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) { in read_tape()
2103 struct st_modedef *STm; in st_read() local
2114 STm = &(STp->modes[STp->current_mode]); in st_read()
2116 if (!STm->do_read_ahead) { in st_read()
2244 static void st_log_options(struct scsi_tape * STp, struct st_modedef * STm) in DEB()
2250 STp->current_mode, STm->do_buffer_writes, in DEB()
2251 STm->do_async_writes, STm->do_read_ahead); in DEB()
2260 STm->defaults_for_writes, STp->omit_blklims, in DEB()
2265 STm->sysv, STp->immediate, STp->sili, in DEB()
2277 struct st_modedef *STm; local
2281 STm = &(STp->modes[STp->current_mode]);
2282 if (!STm->defined) {
2283 cd0 = STm->cdevs[0];
2284 cd1 = STm->cdevs[1];
2285 d0 = STm->devs[0];
2286 d1 = STm->devs[1];
2287 memcpy(STm, &(STp->modes[0]), sizeof(struct st_modedef));
2288 STm->cdevs[0] = cd0;
2289 STm->cdevs[1] = cd1;
2290 STm->devs[0] = d0;
2291 STm->devs[1] = d1;
2299 STm->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
2300 STm->do_async_writes = (options & MT_ST_ASYNC_WRITES) != 0;
2301 STm->defaults_for_writes = (options & MT_ST_DEF_WRITES) != 0;
2302 STm->do_read_ahead = (options & MT_ST_READ_AHEAD) != 0;
2313 STm->sysv = (options & MT_ST_SYSV) != 0;
2316 st_log_options(STp, STm); )
2320 STm->do_buffer_writes = value;
2322 STm->do_async_writes = value;
2324 STm->defaults_for_writes = value;
2326 STm->do_read_ahead = value;
2347 STm->sysv = value;
2353 st_log_options(STp, STm); )
2359 STm->default_blksize = (-1);
2362 STm->default_blksize = value;
2364 "%d bytes.\n", STm->default_blksize);
2367 set_mode_densblk(STp, STm);
2399 STm->default_density = (-1);
2403 STm->default_density = value & 0xff;
2405 STm->default_density);
2408 set_mode_densblk(STp, STm);
2426 STm->default_compression = ST_DONT_TOUCH;
2437 STm->default_compression = (value & 1 ? ST_YES : ST_NO);
2443 st_compression(STp, (STm->default_compression == ST_YES));
3508 struct st_modedef *STm; in st_ioctl() local
3521 STm = &(STp->modes[STp->current_mode]); in st_ioctl()
3558 if (!STm->defined && in st_ioctl()
3728 if (!STm->defined) { in st_ioctl()
3794 if (STm->do_async_writes || in st_ioctl()
3795 (STm->do_buffer_writes && STp->block_size != 0) || in st_ioctl()
4165 struct st_modedef *STm = &(tape->modes[mode]); in create_one_cdev() local
4179 STm->cdevs[rew] = cdev; in create_one_cdev()
4201 STm->devs[rew] = dev; in create_one_cdev()
4205 cdev_del(STm->cdevs[rew]); in create_one_cdev()
4207 STm->cdevs[rew] = NULL; in create_one_cdev()
4208 STm->devs[rew] = NULL; in create_one_cdev()
4233 struct st_modedef *STm = &(tape->modes[mode]); in remove_cdevs() local
4235 if (STm->cdevs[rew]) in remove_cdevs()
4236 cdev_del(STm->cdevs[rew]); in remove_cdevs()
4237 if (STm->devs[rew]) in remove_cdevs()
4238 device_unregister(STm->devs[rew]); in remove_cdevs()
4247 struct st_modedef *STm; in st_probe() local
4315 STm = &(tpnt->modes[i]); in st_probe()
4316 STm->defined = 0; in st_probe()
4317 STm->sysv = ST_SYSV; in st_probe()
4318 STm->defaults_for_writes = 0; in st_probe()
4319 STm->do_async_writes = ST_ASYNC_WRITES; in st_probe()
4320 STm->do_buffer_writes = ST_BUFFER_WRITES; in st_probe()
4321 STm->do_read_ahead = ST_READ_AHEAD; in st_probe()
4322 STm->default_compression = ST_DONT_TOUCH; in st_probe()
4323 STm->default_blksize = (-1); /* No forced size */ in st_probe()
4324 STm->default_density = (-1); /* No forced density */ in st_probe()
4325 STm->tape = tpnt; in st_probe()
4569 struct st_modedef *STm = dev_get_drvdata(dev); in defined_show() local
4572 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); in defined_show()
4581 struct st_modedef *STm = dev_get_drvdata(dev); in default_blksize_show() local
4584 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); in default_blksize_show()
4593 struct st_modedef *STm = dev_get_drvdata(dev); in default_density_show() local
4597 fmt = STm->default_density >= 0 ? "0x%02x\n" : "%d\n"; in default_density_show()
4598 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); in default_density_show()
4607 struct st_modedef *STm = dev_get_drvdata(dev); in default_compression_show() local
4610 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); in default_compression_show()
4618 struct st_modedef *STm = dev_get_drvdata(dev); in options_show() local
4619 struct scsi_tape *STp = STm->tape; in options_show()
4623 options = STm->do_buffer_writes ? MT_ST_BUFFER_WRITES : 0; in options_show()
4624 options |= STm->do_async_writes ? MT_ST_ASYNC_WRITES : 0; in options_show()
4625 options |= STm->do_read_ahead ? MT_ST_READ_AHEAD : 0; in options_show()
4629 options |= STm->defaults_for_writes ? MT_ST_DEF_WRITES : 0; in options_show()
4634 options |= STm->sysv ? MT_ST_SYSV : 0; in options_show()
4655 struct st_modedef *STm = dev_get_drvdata(dev); in read_cnt_show() local
4658 (long long)atomic64_read(&STm->tape->stats->read_cnt)); in read_cnt_show()
4673 struct st_modedef *STm = dev_get_drvdata(dev); in read_byte_cnt_show() local
4676 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt)); in read_byte_cnt_show()
4689 struct st_modedef *STm = dev_get_drvdata(dev); in read_ns_show() local
4692 (long long)atomic64_read(&STm->tape->stats->tot_read_time)); in read_ns_show()
4706 struct st_modedef *STm = dev_get_drvdata(dev); in write_cnt_show() local
4709 (long long)atomic64_read(&STm->tape->stats->write_cnt)); in write_cnt_show()
4723 struct st_modedef *STm = dev_get_drvdata(dev); in write_byte_cnt_show() local
4726 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt)); in write_byte_cnt_show()
4740 struct st_modedef *STm = dev_get_drvdata(dev); in write_ns_show() local
4743 (long long)atomic64_read(&STm->tape->stats->tot_write_time)); in write_ns_show()
4758 struct st_modedef *STm = dev_get_drvdata(dev); in in_flight_show() local
4761 (long long)atomic64_read(&STm->tape->stats->in_flight)); in in_flight_show()
4778 struct st_modedef *STm = dev_get_drvdata(dev); in io_ns_show() local
4781 (long long)atomic64_read(&STm->tape->stats->tot_io_time)); in io_ns_show()
4797 struct st_modedef *STm = dev_get_drvdata(dev); in other_cnt_show() local
4800 (long long)atomic64_read(&STm->tape->stats->other_cnt)); in other_cnt_show()
4815 struct st_modedef *STm = dev_get_drvdata(dev); in resid_cnt_show() local
4818 (long long)atomic64_read(&STm->tape->stats->resid_cnt)); in resid_cnt_show()