Lines Matching refs:mtc
3387 struct mtop mtc; in st_ioctl() local
3389 if (_IOC_SIZE(cmd_in) != sizeof(mtc)) { in st_ioctl()
3394 i = copy_from_user(&mtc, p, sizeof(struct mtop)); in st_ioctl()
3400 if (mtc.mt_op == MTSETDRVBUFFER && !capable(CAP_SYS_ADMIN)) { in st_ioctl()
3407 (mtc.mt_op != MTSETDRVBUFFER && in st_ioctl()
3408 (mtc.mt_count & MT_ST_OPTIONS) == 0)) { in st_ioctl()
3416 if (mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM || in st_ioctl()
3417 mtc.mt_op == MTEOM) { in st_ioctl()
3418 mtc.mt_count -= 1; in st_ioctl()
3421 } else if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM) { in st_ioctl()
3422 mtc.mt_count += 1; in st_ioctl()
3428 if (mtc.mt_op == MTSEEK) { in st_ioctl()
3434 i = mtc.mt_op == MTREW || mtc.mt_op == MTOFFL || in st_ioctl()
3435 mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM || in st_ioctl()
3436 mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD || in st_ioctl()
3437 mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM || in st_ioctl()
3438 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM || in st_ioctl()
3439 mtc.mt_op == MTCOMPRESSION; in st_ioctl()
3447 (mtc.mt_op == MTREW || mtc.mt_op == MTOFFL || in st_ioctl()
3448 mtc.mt_op == MTSEEK || in st_ioctl()
3449 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM)) { in st_ioctl()
3455 if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM) in st_ioctl()
3456 mtc.mt_count++; in st_ioctl()
3466 if (mtc.mt_op != MTREW && in st_ioctl()
3467 mtc.mt_op != MTOFFL && in st_ioctl()
3468 mtc.mt_op != MTRETEN && in st_ioctl()
3469 mtc.mt_op != MTERASE && in st_ioctl()
3470 mtc.mt_op != MTSEEK && in st_ioctl()
3471 mtc.mt_op != MTEOM) { in st_ioctl()
3480 if (mtc.mt_op != MTNOP && mtc.mt_op != MTSETBLK && in st_ioctl()
3481 mtc.mt_op != MTSETDENSITY && mtc.mt_op != MTWSM && in st_ioctl()
3482 mtc.mt_op != MTSETDRVBUFFER && mtc.mt_op != MTSETPART) in st_ioctl()
3485 if (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED) in st_ioctl()
3488 if (mtc.mt_op == MTSETDRVBUFFER && in st_ioctl()
3489 (mtc.mt_count & MT_ST_OPTIONS) != 0) { in st_ioctl()
3490 retval = st_set_options(STp, mtc.mt_count); in st_ioctl()
3494 if (mtc.mt_op == MTSETPART) { in st_ioctl()
3496 mtc.mt_count < 0 || mtc.mt_count >= ST_NBR_PARTITIONS) { in st_ioctl()
3500 if (mtc.mt_count >= STp->nbr_partitions && in st_ioctl()
3505 if (mtc.mt_count >= STp->nbr_partitions) { in st_ioctl()
3509 STp->new_partition = mtc.mt_count; in st_ioctl()
3514 if (mtc.mt_op == MTMKPART) { in st_ioctl()
3520 (i = partition_tape(STp, mtc.mt_count)) < 0) { in st_ioctl()
3536 if (mtc.mt_op == MTSEEK) { in st_ioctl()
3537 i = set_location(STp, mtc.mt_count, STp->new_partition, 0); in st_ioctl()
3544 if (mtc.mt_op == MTUNLOAD || mtc.mt_op == MTOFFL) { in st_ioctl()
3549 if (mtc.mt_op == MTLOAD) { in st_ioctl()
3550 retval = do_load_unload(STp, file, max(1, mtc.mt_count)); in st_ioctl()
3554 if (mtc.mt_op == MTLOCK || mtc.mt_op == MTUNLOCK) { in st_ioctl()
3555 retval = do_door_lock(STp, (mtc.mt_op == MTLOCK)); in st_ioctl()
3565 if (mtc.mt_op == MTCOMPRESSION) in st_ioctl()
3566 retval = st_compression(STp, (mtc.mt_count & 1)); in st_ioctl()
3568 retval = st_int_ioctl(STp, mtc.mt_op, mtc.mt_count); in st_ioctl()