| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | **************************************************************************** | 
|  | 11 | ****************************************************************************/ | 
|  | 12 | #ifndef _LINUX_MTIO_H | 
|  | 13 | #define _LINUX_MTIO_H | 
|  | 14 |  | 
|  | 15 | #include <linux/types.h> | 
|  | 16 | #include <linux/ioctl.h> | 
|  | 17 | #include <linux/qic117.h> | 
|  | 18 |  | 
|  | 19 | struct mtop { | 
|  | 20 | short mt_op; | 
|  | 21 | int mt_count; | 
|  | 22 | }; | 
|  | 23 |  | 
|  | 24 | #define MTRESET 0 | 
|  | 25 | #define MTFSF 1 | 
|  | 26 | #define MTBSF 2 | 
|  | 27 | #define MTFSR 3 | 
|  | 28 | #define MTBSR 4 | 
|  | 29 | #define MTWEOF 5 | 
|  | 30 | #define MTREW 6 | 
|  | 31 | #define MTOFFL 7 | 
|  | 32 | #define MTNOP 8 | 
|  | 33 | #define MTRETEN 9 | 
|  | 34 | #define MTBSFM 10 | 
|  | 35 | #define MTFSFM 11 | 
|  | 36 | #define MTEOM 12 | 
|  | 37 | #define MTERASE 13 | 
|  | 38 |  | 
|  | 39 | #define MTRAS1 14 | 
|  | 40 | #define MTRAS2 15 | 
|  | 41 | #define MTRAS3 16 | 
|  | 42 |  | 
|  | 43 | #define MTSETBLK 20 | 
|  | 44 | #define MTSETDENSITY 21 | 
|  | 45 | #define MTSEEK 22 | 
|  | 46 | #define MTTELL 23 | 
|  | 47 | #define MTSETDRVBUFFER 24 | 
|  | 48 |  | 
|  | 49 | #define MTFSS 25 | 
|  | 50 | #define MTBSS 26 | 
|  | 51 | #define MTWSM 27 | 
|  | 52 |  | 
|  | 53 | #define MTLOCK 28 | 
|  | 54 | #define MTUNLOCK 29 | 
|  | 55 | #define MTLOAD 30 | 
|  | 56 | #define MTUNLOAD 31 | 
|  | 57 | #define MTCOMPRESSION 32 | 
|  | 58 | #define MTSETPART 33 | 
|  | 59 | #define MTMKPART 34 | 
|  | 60 |  | 
|  | 61 | struct mtget { | 
|  | 62 | long mt_type; | 
|  | 63 | long mt_resid; | 
|  | 64 |  | 
|  | 65 | long mt_dsreg; | 
|  | 66 | long mt_gstat; | 
|  | 67 | long mt_erreg; | 
|  | 68 |  | 
|  | 69 | __kernel_daddr_t mt_fileno; | 
|  | 70 | __kernel_daddr_t mt_blkno; | 
|  | 71 | }; | 
|  | 72 |  | 
|  | 73 | #define MT_ISUNKNOWN 0x01 | 
|  | 74 | #define MT_ISQIC02 0x02 | 
|  | 75 | #define MT_ISWT5150 0x03 | 
|  | 76 | #define MT_ISARCHIVE_5945L2 0x04 | 
|  | 77 | #define MT_ISCMSJ500 0x05 | 
|  | 78 | #define MT_ISTDC3610 0x06 | 
|  | 79 | #define MT_ISARCHIVE_VP60I 0x07 | 
|  | 80 | #define MT_ISARCHIVE_2150L 0x08 | 
|  | 81 | #define MT_ISARCHIVE_2060L 0x09 | 
|  | 82 | #define MT_ISARCHIVESC499 0x0A | 
|  | 83 | #define MT_ISQIC02_ALL_FEATURES 0x0F | 
|  | 84 | #define MT_ISWT5099EEN24 0x11 | 
|  | 85 | #define MT_ISTEAC_MT2ST 0x12 | 
|  | 86 | #define MT_ISEVEREX_FT40A 0x32 | 
|  | 87 | #define MT_ISDDS1 0x51 | 
|  | 88 | #define MT_ISDDS2 0x52 | 
|  | 89 | #define MT_ISONSTREAM_SC 0x61 | 
|  | 90 | #define MT_ISSCSI1 0x71 | 
|  | 91 | #define MT_ISSCSI2 0x72 | 
|  | 92 |  | 
|  | 93 | #define MT_ISFTAPE_UNKNOWN 0x800000 | 
|  | 94 | #define MT_ISFTAPE_FLAG 0x800000 | 
|  | 95 |  | 
|  | 96 | struct mt_tape_info { | 
|  | 97 | long t_type; | 
|  | 98 | char *t_name; | 
|  | 99 | }; | 
|  | 100 |  | 
|  | 101 | #define MT_TAPE_INFO {   {MT_ISUNKNOWN, "Unknown type of tape device"},   {MT_ISQIC02, "Generic QIC-02 tape streamer"},   {MT_ISWT5150, "Wangtek 5150, QIC-150"},   {MT_ISARCHIVE_5945L2, "Archive 5945L-2"},   {MT_ISCMSJ500, "CMS Jumbo 500"},   {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"},   {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"},   {MT_ISARCHIVE_2150L, "Archive Viper 2150L"},   {MT_ISARCHIVE_2060L, "Archive Viper 2060L"},   {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"},   {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"},   {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"},   {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"},   {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"},   {MT_ISONSTREAM_SC, "OnStream SC-, DI-, DP-, or USB tape drive"},   {MT_ISSCSI1, "Generic SCSI-1 tape"},   {MT_ISSCSI2, "Generic SCSI-2 tape"},   {0, NULL}  } | 
|  | 102 |  | 
|  | 103 | struct mtpos { | 
|  | 104 | long mt_blkno; | 
|  | 105 | }; | 
|  | 106 |  | 
|  | 107 | struct mtvolinfo { | 
|  | 108 | unsigned int mt_volno; | 
|  | 109 | unsigned int mt_blksz; | 
|  | 110 | unsigned int mt_rawsize; | 
|  | 111 | unsigned int mt_size; | 
|  | 112 | unsigned int mt_cmpr:1; | 
|  | 113 | }; | 
|  | 114 |  | 
|  | 115 | #define MT_FT_RD_SINGLE 0 | 
|  | 116 | #define MT_FT_RD_AHEAD 1 | 
|  | 117 | #define MT_FT_WR_ASYNC 0 | 
|  | 118 | #define MT_FT_WR_MULTI 1 | 
|  | 119 | #define MT_FT_WR_SINGLE 2 | 
|  | 120 | #define MT_FT_WR_DELETE 3 | 
|  | 121 |  | 
|  | 122 | struct mtftseg | 
|  | 123 | { | 
|  | 124 | unsigned mt_segno; | 
|  | 125 | unsigned mt_mode; | 
|  | 126 | int mt_result; | 
|  | 127 | void __user *mt_data; | 
|  | 128 | }; | 
|  | 129 |  | 
|  | 130 | struct mttapesize { | 
|  | 131 | unsigned long mt_capacity; | 
|  | 132 | unsigned long mt_used; | 
|  | 133 | }; | 
|  | 134 |  | 
|  | 135 | #define FTFMT_SET_PARMS 1 | 
|  | 136 | #define FTFMT_GET_PARMS 2 | 
|  | 137 | #define FTFMT_FORMAT_TRACK 3 | 
|  | 138 | #define FTFMT_STATUS 4 | 
|  | 139 | #define FTFMT_VERIFY 5 | 
|  | 140 |  | 
|  | 141 | struct ftfmtparms { | 
|  | 142 | unsigned char ft_qicstd; | 
|  | 143 | unsigned char ft_fmtcode; | 
|  | 144 | unsigned char ft_fhm; | 
|  | 145 | unsigned char ft_ftm; | 
|  | 146 | unsigned short ft_spt; | 
|  | 147 | unsigned short ft_tpc; | 
|  | 148 | }; | 
|  | 149 |  | 
|  | 150 | struct ftfmttrack { | 
|  | 151 | unsigned int ft_track; | 
|  | 152 | unsigned char ft_gap3; | 
|  | 153 | }; | 
|  | 154 |  | 
|  | 155 | struct ftfmtstatus { | 
|  | 156 | unsigned int ft_segment; | 
|  | 157 | }; | 
|  | 158 |  | 
|  | 159 | struct ftfmtverify { | 
|  | 160 | unsigned int ft_segment; | 
|  | 161 | unsigned long ft_bsm; | 
|  | 162 | }; | 
|  | 163 |  | 
|  | 164 | struct mtftformat { | 
|  | 165 | unsigned int fmt_op; | 
|  | 166 | union fmt_arg { | 
|  | 167 | struct ftfmtparms fmt_parms; | 
|  | 168 | struct ftfmttrack fmt_track; | 
|  | 169 | struct ftfmtstatus fmt_status; | 
|  | 170 | struct ftfmtverify fmt_verify; | 
|  | 171 | } fmt_arg; | 
|  | 172 | }; | 
|  | 173 |  | 
|  | 174 | struct mtftcmd { | 
|  | 175 | unsigned int ft_wait_before; | 
|  | 176 | qic117_cmd_t ft_cmd; | 
|  | 177 | unsigned char ft_parm_cnt; | 
|  | 178 | unsigned char ft_parms[3]; | 
|  | 179 | unsigned int ft_result_bits; | 
|  | 180 | unsigned int ft_result; | 
|  | 181 | unsigned int ft_wait_after; | 
|  | 182 | int ft_status; | 
|  | 183 | int ft_error; | 
|  | 184 | }; | 
|  | 185 |  | 
|  | 186 | #define MTIOCTOP _IOW('m', 1, struct mtop) | 
|  | 187 | #define MTIOCGET _IOR('m', 2, struct mtget) | 
|  | 188 | #define MTIOCPOS _IOR('m', 3, struct mtpos) | 
|  | 189 |  | 
|  | 190 | #define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) | 
|  | 191 | #define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) | 
|  | 192 |  | 
|  | 193 | #define MTIOCRDFTSEG _IOWR('m', 6, struct mtftseg) | 
|  | 194 | #define MTIOCWRFTSEG _IOWR('m', 7, struct mtftseg) | 
|  | 195 | #define MTIOCVOLINFO _IOR('m', 8, struct mtvolinfo) | 
|  | 196 | #define MTIOCGETSIZE _IOR('m', 9, struct mttapesize) | 
|  | 197 | #define MTIOCFTFORMAT _IOWR('m', 10, struct mtftformat) | 
|  | 198 | #define MTIOCFTCMD _IOWR('m', 11, struct mtftcmd) | 
|  | 199 |  | 
|  | 200 | #define GMT_EOF(x) ((x) & 0x80000000) | 
|  | 201 | #define GMT_BOT(x) ((x) & 0x40000000) | 
|  | 202 | #define GMT_EOT(x) ((x) & 0x20000000) | 
|  | 203 | #define GMT_SM(x) ((x) & 0x10000000) | 
|  | 204 | #define GMT_EOD(x) ((x) & 0x08000000) | 
|  | 205 | #define GMT_WR_PROT(x) ((x) & 0x04000000) | 
|  | 206 |  | 
|  | 207 | #define GMT_ONLINE(x) ((x) & 0x01000000) | 
|  | 208 | #define GMT_D_6250(x) ((x) & 0x00800000) | 
|  | 209 | #define GMT_D_1600(x) ((x) & 0x00400000) | 
|  | 210 | #define GMT_D_800(x) ((x) & 0x00200000) | 
|  | 211 |  | 
|  | 212 | #define GMT_DR_OPEN(x) ((x) & 0x00040000) | 
|  | 213 |  | 
|  | 214 | #define GMT_IM_REP_EN(x) ((x) & 0x00010000) | 
|  | 215 | #define GMT_CLN(x) ((x) & 0x00008000) | 
|  | 216 |  | 
|  | 217 | #define MT_ST_BLKSIZE_SHIFT 0 | 
|  | 218 | #define MT_ST_BLKSIZE_MASK 0xffffff | 
|  | 219 | #define MT_ST_DENSITY_SHIFT 24 | 
|  | 220 | #define MT_ST_DENSITY_MASK 0xff000000 | 
|  | 221 |  | 
|  | 222 | #define MT_ST_SOFTERR_SHIFT 0 | 
|  | 223 | #define MT_ST_SOFTERR_MASK 0xffff | 
|  | 224 |  | 
|  | 225 | #define MT_ST_OPTIONS 0xf0000000 | 
|  | 226 | #define MT_ST_BOOLEANS 0x10000000 | 
|  | 227 | #define MT_ST_SETBOOLEANS 0x30000000 | 
|  | 228 | #define MT_ST_CLEARBOOLEANS 0x40000000 | 
|  | 229 | #define MT_ST_WRITE_THRESHOLD 0x20000000 | 
|  | 230 | #define MT_ST_DEF_BLKSIZE 0x50000000 | 
|  | 231 | #define MT_ST_DEF_OPTIONS 0x60000000 | 
|  | 232 | #define MT_ST_TIMEOUTS 0x70000000 | 
|  | 233 | #define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000) | 
|  | 234 | #define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000) | 
|  | 235 | #define MT_ST_SET_CLN 0x80000000 | 
|  | 236 |  | 
|  | 237 | #define MT_ST_BUFFER_WRITES 0x1 | 
|  | 238 | #define MT_ST_ASYNC_WRITES 0x2 | 
|  | 239 | #define MT_ST_READ_AHEAD 0x4 | 
|  | 240 | #define MT_ST_DEBUGGING 0x8 | 
|  | 241 | #define MT_ST_TWO_FM 0x10 | 
|  | 242 | #define MT_ST_FAST_MTEOM 0x20 | 
|  | 243 | #define MT_ST_AUTO_LOCK 0x40 | 
|  | 244 | #define MT_ST_DEF_WRITES 0x80 | 
|  | 245 | #define MT_ST_CAN_BSR 0x100 | 
|  | 246 | #define MT_ST_NO_BLKLIMS 0x200 | 
|  | 247 | #define MT_ST_CAN_PARTITIONS 0x400 | 
|  | 248 | #define MT_ST_SCSI2LOGICAL 0x800 | 
|  | 249 | #define MT_ST_SYSV 0x1000 | 
|  | 250 | #define MT_ST_NOWAIT 0x2000 | 
|  | 251 |  | 
|  | 252 | #define MT_ST_CLEAR_DEFAULT 0xfffff | 
|  | 253 | #define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000) | 
|  | 254 | #define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000) | 
|  | 255 | #define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000) | 
|  | 256 |  | 
|  | 257 | #define MT_ST_HPLOADER_OFFSET 10000 | 
|  | 258 |  | 
|  | 259 | #endif |