Lines Matching refs:mtc
3539 struct mtop mtc; in st_ioctl() local
3541 if (_IOC_SIZE(cmd_in) != sizeof(mtc)) { in st_ioctl()
3546 i = copy_from_user(&mtc, p, sizeof(struct mtop)); in st_ioctl()
3552 if (mtc.mt_op == MTSETDRVBUFFER && !capable(CAP_SYS_ADMIN)) { in st_ioctl()
3559 (mtc.mt_op != MTSETDRVBUFFER && in st_ioctl()
3560 (mtc.mt_count & MT_ST_OPTIONS) == 0)) { in st_ioctl()
3568 if (mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM || in st_ioctl()
3569 mtc.mt_op == MTEOM) { in st_ioctl()
3570 mtc.mt_count -= 1; in st_ioctl()
3573 } else if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM) { in st_ioctl()
3574 mtc.mt_count += 1; in st_ioctl()
3580 if (mtc.mt_op == MTSEEK) { in st_ioctl()
3586 i = mtc.mt_op == MTREW || mtc.mt_op == MTOFFL || in st_ioctl()
3587 mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM || in st_ioctl()
3588 mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD || in st_ioctl()
3589 mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM || in st_ioctl()
3590 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM || in st_ioctl()
3591 mtc.mt_op == MTCOMPRESSION; in st_ioctl()
3599 (mtc.mt_op == MTREW || mtc.mt_op == MTOFFL || in st_ioctl()
3600 mtc.mt_op == MTSEEK || in st_ioctl()
3601 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM)) { in st_ioctl()
3607 if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM) in st_ioctl()
3608 mtc.mt_count++; in st_ioctl()
3618 if (mtc.mt_op != MTREW && in st_ioctl()
3619 mtc.mt_op != MTOFFL && in st_ioctl()
3620 mtc.mt_op != MTRETEN && in st_ioctl()
3621 mtc.mt_op != MTERASE && in st_ioctl()
3622 mtc.mt_op != MTSEEK && in st_ioctl()
3623 mtc.mt_op != MTEOM) { in st_ioctl()
3632 if (mtc.mt_op != MTNOP && mtc.mt_op != MTSETBLK && in st_ioctl()
3633 mtc.mt_op != MTSETDENSITY && mtc.mt_op != MTWSM && in st_ioctl()
3634 mtc.mt_op != MTSETDRVBUFFER && mtc.mt_op != MTSETPART) in st_ioctl()
3637 if (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED) in st_ioctl()
3640 if (mtc.mt_op == MTSETDRVBUFFER && in st_ioctl()
3641 (mtc.mt_count & MT_ST_OPTIONS) != 0) { in st_ioctl()
3642 retval = st_set_options(STp, mtc.mt_count); in st_ioctl()
3646 if (mtc.mt_op == MTSETPART) { in st_ioctl()
3648 mtc.mt_count < 0 || mtc.mt_count >= ST_NBR_PARTITIONS) { in st_ioctl()
3652 if (mtc.mt_count >= STp->nbr_partitions && in st_ioctl()
3657 if (mtc.mt_count >= STp->nbr_partitions) { in st_ioctl()
3661 STp->new_partition = mtc.mt_count; in st_ioctl()
3666 if (mtc.mt_op == MTMKPART) { in st_ioctl()
3676 i = partition_tape(STp, mtc.mt_count); in st_ioctl()
3687 STp->nbr_partitions = mtc.mt_count != 0 ? 2 : 1; in st_ioctl()
3693 if (mtc.mt_op == MTSEEK) { in st_ioctl()
3694 i = set_location(STp, mtc.mt_count, STp->new_partition, 0); in st_ioctl()
3701 if (mtc.mt_op == MTUNLOAD || mtc.mt_op == MTOFFL) { in st_ioctl()
3706 if (mtc.mt_op == MTLOAD) { in st_ioctl()
3707 retval = do_load_unload(STp, file, max(1, mtc.mt_count)); in st_ioctl()
3711 if (mtc.mt_op == MTLOCK || mtc.mt_op == MTUNLOCK) { in st_ioctl()
3712 retval = do_door_lock(STp, (mtc.mt_op == MTLOCK)); in st_ioctl()
3722 if (mtc.mt_op == MTCOMPRESSION) in st_ioctl()
3723 retval = st_compression(STp, (mtc.mt_count & 1)); in st_ioctl()
3725 retval = st_int_ioctl(STp, mtc.mt_op, mtc.mt_count); in st_ioctl()