blob: 07d998f3e99eb68e371affb2ca8832df5ed51d04 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _LINUX_MTIO_H
8#define _LINUX_MTIO_H
9#include <linux/types.h>
10#include <linux/ioctl.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011struct mtop {
Tao Baod7db5942015-01-28 10:07:51 -080012 short mt_op;
13 int mt_count;
Ben Cheng655a7c02013-10-16 16:09:24 -070014};
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define MTRESET 0
16#define MTFSF 1
17#define MTBSF 2
18#define MTFSR 3
Ben Cheng655a7c02013-10-16 16:09:24 -070019#define MTBSR 4
20#define MTWEOF 5
21#define MTREW 6
22#define MTOFFL 7
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define MTNOP 8
24#define MTRETEN 9
25#define MTBSFM 10
26#define MTFSFM 11
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define MTEOM 12
28#define MTERASE 13
29#define MTRAS1 14
30#define MTRAS2 15
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define MTRAS3 16
32#define MTSETBLK 20
33#define MTSETDENSITY 21
34#define MTSEEK 22
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define MTTELL 23
36#define MTSETDRVBUFFER 24
37#define MTFSS 25
38#define MTBSS 26
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define MTWSM 27
40#define MTLOCK 28
41#define MTUNLOCK 29
42#define MTLOAD 30
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define MTUNLOAD 31
44#define MTCOMPRESSION 32
45#define MTSETPART 33
46#define MTMKPART 34
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define MTWEOFI 35
48struct mtget {
Tao Baod7db5942015-01-28 10:07:51 -080049 long mt_type;
50 long mt_resid;
Tao Baod7db5942015-01-28 10:07:51 -080051 long mt_dsreg;
52 long mt_gstat;
53 long mt_erreg;
54 __kernel_daddr_t mt_fileno;
Tao Baod7db5942015-01-28 10:07:51 -080055 __kernel_daddr_t mt_blkno;
Ben Cheng655a7c02013-10-16 16:09:24 -070056};
57#define MT_ISUNKNOWN 0x01
58#define MT_ISQIC02 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define MT_ISWT5150 0x03
60#define MT_ISARCHIVE_5945L2 0x04
61#define MT_ISCMSJ500 0x05
62#define MT_ISTDC3610 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define MT_ISARCHIVE_VP60I 0x07
64#define MT_ISARCHIVE_2150L 0x08
65#define MT_ISARCHIVE_2060L 0x09
66#define MT_ISARCHIVESC499 0x0A
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define MT_ISQIC02_ALL_FEATURES 0x0F
68#define MT_ISWT5099EEN24 0x11
69#define MT_ISTEAC_MT2ST 0x12
70#define MT_ISEVEREX_FT40A 0x32
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define MT_ISDDS1 0x51
72#define MT_ISDDS2 0x52
73#define MT_ISONSTREAM_SC 0x61
74#define MT_ISSCSI1 0x71
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define MT_ISSCSI2 0x72
76#define MT_ISFTAPE_UNKNOWN 0x800000
77#define MT_ISFTAPE_FLAG 0x800000
78struct mtpos {
Tao Baod7db5942015-01-28 10:07:51 -080079 long mt_blkno;
Ben Cheng655a7c02013-10-16 16:09:24 -070080};
81#define MTIOCTOP _IOW('m', 1, struct mtop)
82#define MTIOCGET _IOR('m', 2, struct mtget)
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define MTIOCPOS _IOR('m', 3, struct mtpos)
84#define GMT_EOF(x) ((x) & 0x80000000)
85#define GMT_BOT(x) ((x) & 0x40000000)
86#define GMT_EOT(x) ((x) & 0x20000000)
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define GMT_SM(x) ((x) & 0x10000000)
88#define GMT_EOD(x) ((x) & 0x08000000)
89#define GMT_WR_PROT(x) ((x) & 0x04000000)
90#define GMT_ONLINE(x) ((x) & 0x01000000)
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define GMT_D_6250(x) ((x) & 0x00800000)
92#define GMT_D_1600(x) ((x) & 0x00400000)
93#define GMT_D_800(x) ((x) & 0x00200000)
94#define GMT_DR_OPEN(x) ((x) & 0x00040000)
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define GMT_IM_REP_EN(x) ((x) & 0x00010000)
96#define GMT_CLN(x) ((x) & 0x00008000)
97#define MT_ST_BLKSIZE_SHIFT 0
98#define MT_ST_BLKSIZE_MASK 0xffffff
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define MT_ST_DENSITY_SHIFT 24
100#define MT_ST_DENSITY_MASK 0xff000000
101#define MT_ST_SOFTERR_SHIFT 0
102#define MT_ST_SOFTERR_MASK 0xffff
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define MT_ST_OPTIONS 0xf0000000
104#define MT_ST_BOOLEANS 0x10000000
105#define MT_ST_SETBOOLEANS 0x30000000
106#define MT_ST_CLEARBOOLEANS 0x40000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define MT_ST_WRITE_THRESHOLD 0x20000000
108#define MT_ST_DEF_BLKSIZE 0x50000000
109#define MT_ST_DEF_OPTIONS 0x60000000
110#define MT_ST_TIMEOUTS 0x70000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
112#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
113#define MT_ST_SET_CLN 0x80000000
114#define MT_ST_BUFFER_WRITES 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define MT_ST_ASYNC_WRITES 0x2
116#define MT_ST_READ_AHEAD 0x4
117#define MT_ST_DEBUGGING 0x8
118#define MT_ST_TWO_FM 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define MT_ST_FAST_MTEOM 0x20
120#define MT_ST_AUTO_LOCK 0x40
121#define MT_ST_DEF_WRITES 0x80
122#define MT_ST_CAN_BSR 0x100
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#define MT_ST_NO_BLKLIMS 0x200
124#define MT_ST_CAN_PARTITIONS 0x400
125#define MT_ST_SCSI2LOGICAL 0x800
126#define MT_ST_SYSV 0x1000
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#define MT_ST_NOWAIT 0x2000
128#define MT_ST_SILI 0x4000
129#define MT_ST_NOWAIT_EOF 0x8000
130#define MT_ST_CLEAR_DEFAULT 0xfffff
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
132#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
133#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
134#define MT_ST_HPLOADER_OFFSET 10000
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#endif