linux/include/uapi/linux/mtio.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* 
 * linux/mtio.h header file for Linux. Written by H. Bergman
 *
 * Modified for special ioctls provided by zftape in September 1997
 * by C.-J. Heine.
 */

#ifndef _LINUX_MTIO_H
#define _LINUX_MTIO_H

#include <linux/types.h>
#include <linux/ioctl.h>

/*
 * Structures and definitions for mag tape io control commands
 */

/* structure for MTIOCTOP - mag tape op command */
struct	mtop {};

/* Magnetic Tape operations [Not all operations supported by all drivers]: */
#define MTRESET
#define MTFSF
#define MTBSF
#define MTFSR
#define MTBSR
#define MTWEOF
#define MTREW
#define MTOFFL
#define MTNOP
#define MTRETEN
#define MTBSFM
#define MTFSFM
#define MTEOM
#define MTERASE

#define MTRAS1
#define MTRAS2
#define MTRAS3

#define MTSETBLK
#define MTSETDENSITY
#define MTSEEK
#define MTTELL
#define MTSETDRVBUFFER
			/* ordinary buffered operation with code 1 */
#define MTFSS
#define MTBSS
#define MTWSM

#define MTLOCK
#define MTUNLOCK
#define MTLOAD
#define MTUNLOAD
#define MTCOMPRESSION
#define MTSETPART
#define MTMKPART
#define MTWEOFI

/* structure for MTIOCGET - mag tape get status command */

struct	mtget {};



/*
 * Constants for mt_type. Not all of these are supported,
 * and these are not all of the ones that are supported.
 */
#define MT_ISUNKNOWN
#define MT_ISQIC02
#define MT_ISWT5150
#define MT_ISARCHIVE_5945L2
#define MT_ISCMSJ500
#define MT_ISTDC3610
#define MT_ISARCHIVE_VP60I
#define MT_ISARCHIVE_2150L
#define MT_ISARCHIVE_2060L
#define MT_ISARCHIVESC499
#define MT_ISQIC02_ALL_FEATURES
#define MT_ISWT5099EEN24
#define MT_ISTEAC_MT2ST
#define MT_ISEVEREX_FT40A
#define MT_ISDDS1
#define MT_ISDDS2
#define MT_ISONSTREAM_SC
#define MT_ISSCSI1
#define MT_ISSCSI2

/* QIC-40/80/3010/3020 ftape supported drives.
 * 20bit vendor ID + 0x800000 (see ftape-vendors.h)
 */
#define MT_ISFTAPE_UNKNOWN
#define MT_ISFTAPE_FLAG


/* structure for MTIOCPOS - mag tape get position command */

struct	mtpos {};


/* mag tape io control commands */
#define MTIOCTOP
#define MTIOCGET
#define MTIOCPOS


/* Generic Mag Tape (device independent) status macros for examining
 * mt_gstat -- HP-UX compatible.
 * There is room for more generic status bits here, but I don't
 * know which of them are reserved. At least three or so should
 * be added to make this really useful.
 */
#define GMT_EOF(x)
#define GMT_BOT(x)
#define GMT_EOT(x)
#define GMT_SM(x)
#define GMT_EOD(x)
#define GMT_WR_PROT(x)
/* #define GMT_ ? 		((x) & 0x02000000) */
#define GMT_ONLINE(x)
#define GMT_D_6250(x)
#define GMT_D_1600(x)
#define GMT_D_800(x)
/* #define GMT_ ? 		((x) & 0x00100000) */
/* #define GMT_ ? 		((x) & 0x00080000) */
#define GMT_DR_OPEN(x)
/* #define GMT_ ? 		((x) & 0x00020000) */
#define GMT_IM_REP_EN(x)
#define GMT_CLN(x)
/* 15 generic status bits unused */


/* SCSI-tape specific definitions */
/* Bitfield shifts in the status  */
#define MT_ST_BLKSIZE_SHIFT
#define MT_ST_BLKSIZE_MASK
#define MT_ST_DENSITY_SHIFT
#define MT_ST_DENSITY_MASK

#define MT_ST_SOFTERR_SHIFT
#define MT_ST_SOFTERR_MASK

/* Bitfields for the MTSETDRVBUFFER ioctl */
#define MT_ST_OPTIONS
#define MT_ST_BOOLEANS
#define MT_ST_SETBOOLEANS
#define MT_ST_CLEARBOOLEANS
#define MT_ST_WRITE_THRESHOLD
#define MT_ST_DEF_BLKSIZE
#define MT_ST_DEF_OPTIONS
#define MT_ST_TIMEOUTS
#define MT_ST_SET_TIMEOUT
#define MT_ST_SET_LONG_TIMEOUT
#define MT_ST_SET_CLN

#define MT_ST_BUFFER_WRITES
#define MT_ST_ASYNC_WRITES
#define MT_ST_READ_AHEAD
#define MT_ST_DEBUGGING
#define MT_ST_TWO_FM
#define MT_ST_FAST_MTEOM
#define MT_ST_AUTO_LOCK
#define MT_ST_DEF_WRITES
#define MT_ST_CAN_BSR
#define MT_ST_NO_BLKLIMS
#define MT_ST_CAN_PARTITIONS
#define MT_ST_SCSI2LOGICAL
#define MT_ST_SYSV
#define MT_ST_NOWAIT
#define MT_ST_SILI
#define MT_ST_NOWAIT_EOF

/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
#define MT_ST_CLEAR_DEFAULT
#define MT_ST_DEF_DENSITY
#define MT_ST_DEF_COMPRESSION
#define MT_ST_DEF_DRVBUFFER

/* The offset for the arguments for the special HP changer load command. */
#define MT_ST_HPLOADER_OFFSET

#endif /* _LINUX_MTIO_H */