Lines Matching refs:STm

885 static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm)  in set_mode_densblk()  argument
891 STm->default_density >= 0 && in set_mode_densblk()
892 STm->default_density != STp->density) { in set_mode_densblk()
893 arg = STm->default_density; in set_mode_densblk()
899 STm->default_blksize >= 0 && in set_mode_densblk()
900 STm->default_blksize != STp->block_size) { in set_mode_densblk()
901 arg |= STm->default_blksize; in set_mode_densblk()
910 STm->default_blksize, STm->default_density); in set_mode_densblk()
1048 struct st_modedef *STm; in check_tape() local
1061 STm = &(STp->modes[STp->current_mode]); in check_tape()
1227 if (!(STm->defaults_for_writes) && in check_tape()
1228 (retval = set_mode_densblk(STp, STm)) < 0) in check_tape()
1349 struct st_modedef *STm = &(STp->modes[STp->current_mode]); in st_flush() local
1424 if (!STm->sysv || STps->rw != ST_READING) { in st_flush()
1633 struct st_modedef *STm; in st_write() local
1652 STm = &(STp->modes[STp->current_mode]); in st_write()
1668 if ((retval = set_mode_densblk(STp, STm)) < 0) in st_write()
1670 if (STm->default_compression != ST_DONT_TOUCH && in st_write()
1672 if (st_compression(STp, (STm->default_compression == ST_YES))) { in st_write()
1750 STm->do_async_writes && STps->eof < ST_EOM_OK; in st_write()
1752 if (STp->block_size != 0 && STm->do_buffer_writes && in st_write()
1907 struct st_modedef *STm; in read_tape() local
1915 STm = &(STp->modes[STp->current_mode]); in read_tape()
1924 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) { in read_tape()
2105 struct st_modedef *STm; in st_read() local
2116 STm = &(STp->modes[STp->current_mode]); in st_read()
2118 if (!STm->do_read_ahead) { in st_read()
2246 static void st_log_options(struct scsi_tape * STp, struct st_modedef * STm) in DEB()
2252 STp->current_mode, STm->do_buffer_writes, in DEB()
2253 STm->do_async_writes, STm->do_read_ahead); in DEB()
2262 STm->defaults_for_writes, STp->omit_blklims, in DEB()
2267 STm->sysv, STp->immediate, STp->sili, in DEB()
2279 struct st_modedef *STm; local
2283 STm = &(STp->modes[STp->current_mode]);
2284 if (!STm->defined) {
2285 cd0 = STm->cdevs[0];
2286 cd1 = STm->cdevs[1];
2287 d0 = STm->devs[0];
2288 d1 = STm->devs[1];
2289 memcpy(STm, &(STp->modes[0]), sizeof(struct st_modedef));
2290 STm->cdevs[0] = cd0;
2291 STm->cdevs[1] = cd1;
2292 STm->devs[0] = d0;
2293 STm->devs[1] = d1;
2301 STm->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
2302 STm->do_async_writes = (options & MT_ST_ASYNC_WRITES) != 0;
2303 STm->defaults_for_writes = (options & MT_ST_DEF_WRITES) != 0;
2304 STm->do_read_ahead = (options & MT_ST_READ_AHEAD) != 0;
2315 STm->sysv = (options & MT_ST_SYSV) != 0;
2318 st_log_options(STp, STm); )
2322 STm->do_buffer_writes = value;
2324 STm->do_async_writes = value;
2326 STm->defaults_for_writes = value;
2328 STm->do_read_ahead = value;
2349 STm->sysv = value;
2355 st_log_options(STp, STm); )
2361 STm->default_blksize = (-1);
2364 STm->default_blksize = value;
2366 "%d bytes.\n", STm->default_blksize);
2369 set_mode_densblk(STp, STm);
2401 STm->default_density = (-1);
2405 STm->default_density = value & 0xff;
2407 STm->default_density);
2410 set_mode_densblk(STp, STm);
2428 STm->default_compression = ST_DONT_TOUCH;
2439 STm->default_compression = (value & 1 ? ST_YES : ST_NO);
2445 st_compression(STp, (STm->default_compression == ST_YES));
3510 struct st_modedef *STm; in st_ioctl() local
3523 STm = &(STp->modes[STp->current_mode]); in st_ioctl()
3560 if (!STm->defined && in st_ioctl()
3730 if (!STm->defined) { in st_ioctl()
3796 if (STm->do_async_writes || in st_ioctl()
3797 (STm->do_buffer_writes && STp->block_size != 0) || in st_ioctl()
4167 struct st_modedef *STm = &(tape->modes[mode]); in create_one_cdev() local
4181 STm->cdevs[rew] = cdev; in create_one_cdev()
4203 STm->devs[rew] = dev; in create_one_cdev()
4207 cdev_del(STm->cdevs[rew]); in create_one_cdev()
4209 STm->cdevs[rew] = NULL; in create_one_cdev()
4210 STm->devs[rew] = NULL; in create_one_cdev()
4235 struct st_modedef *STm = &(tape->modes[mode]); in remove_cdevs() local
4237 if (STm->cdevs[rew]) in remove_cdevs()
4238 cdev_del(STm->cdevs[rew]); in remove_cdevs()
4239 if (STm->devs[rew]) in remove_cdevs()
4240 device_unregister(STm->devs[rew]); in remove_cdevs()
4249 struct st_modedef *STm; in st_probe() local
4317 STm = &(tpnt->modes[i]); in st_probe()
4318 STm->defined = 0; in st_probe()
4319 STm->sysv = ST_SYSV; in st_probe()
4320 STm->defaults_for_writes = 0; in st_probe()
4321 STm->do_async_writes = ST_ASYNC_WRITES; in st_probe()
4322 STm->do_buffer_writes = ST_BUFFER_WRITES; in st_probe()
4323 STm->do_read_ahead = ST_READ_AHEAD; in st_probe()
4324 STm->default_compression = ST_DONT_TOUCH; in st_probe()
4325 STm->default_blksize = (-1); /* No forced size */ in st_probe()
4326 STm->default_density = (-1); /* No forced density */ in st_probe()
4327 STm->tape = tpnt; in st_probe()
4571 struct st_modedef *STm = dev_get_drvdata(dev); in defined_show() local
4574 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined); in defined_show()
4583 struct st_modedef *STm = dev_get_drvdata(dev); in default_blksize_show() local
4586 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize); in default_blksize_show()
4595 struct st_modedef *STm = dev_get_drvdata(dev); in default_density_show() local
4599 fmt = STm->default_density >= 0 ? "0x%02x\n" : "%d\n"; in default_density_show()
4600 l = snprintf(buf, PAGE_SIZE, fmt, STm->default_density); in default_density_show()
4609 struct st_modedef *STm = dev_get_drvdata(dev); in default_compression_show() local
4612 l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1); in default_compression_show()
4620 struct st_modedef *STm = dev_get_drvdata(dev); in options_show() local
4621 struct scsi_tape *STp = STm->tape; in options_show()
4625 options = STm->do_buffer_writes ? MT_ST_BUFFER_WRITES : 0; in options_show()
4626 options |= STm->do_async_writes ? MT_ST_ASYNC_WRITES : 0; in options_show()
4627 options |= STm->do_read_ahead ? MT_ST_READ_AHEAD : 0; in options_show()
4631 options |= STm->defaults_for_writes ? MT_ST_DEF_WRITES : 0; in options_show()
4636 options |= STm->sysv ? MT_ST_SYSV : 0; in options_show()
4657 struct st_modedef *STm = dev_get_drvdata(dev); in read_cnt_show() local
4660 (long long)atomic64_read(&STm->tape->stats->read_cnt)); in read_cnt_show()
4675 struct st_modedef *STm = dev_get_drvdata(dev); in read_byte_cnt_show() local
4678 (long long)atomic64_read(&STm->tape->stats->read_byte_cnt)); in read_byte_cnt_show()
4691 struct st_modedef *STm = dev_get_drvdata(dev); in read_ns_show() local
4694 (long long)atomic64_read(&STm->tape->stats->tot_read_time)); in read_ns_show()
4708 struct st_modedef *STm = dev_get_drvdata(dev); in write_cnt_show() local
4711 (long long)atomic64_read(&STm->tape->stats->write_cnt)); in write_cnt_show()
4725 struct st_modedef *STm = dev_get_drvdata(dev); in write_byte_cnt_show() local
4728 (long long)atomic64_read(&STm->tape->stats->write_byte_cnt)); in write_byte_cnt_show()
4742 struct st_modedef *STm = dev_get_drvdata(dev); in write_ns_show() local
4745 (long long)atomic64_read(&STm->tape->stats->tot_write_time)); in write_ns_show()
4760 struct st_modedef *STm = dev_get_drvdata(dev); in in_flight_show() local
4763 (long long)atomic64_read(&STm->tape->stats->in_flight)); in in_flight_show()
4780 struct st_modedef *STm = dev_get_drvdata(dev); in io_ns_show() local
4783 (long long)atomic64_read(&STm->tape->stats->tot_io_time)); in io_ns_show()
4799 struct st_modedef *STm = dev_get_drvdata(dev); in other_cnt_show() local
4802 (long long)atomic64_read(&STm->tape->stats->other_cnt)); in other_cnt_show()
4817 struct st_modedef *STm = dev_get_drvdata(dev); in resid_cnt_show() local
4820 (long long)atomic64_read(&STm->tape->stats->resid_cnt)); in resid_cnt_show()