Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/sys
File: mtio.h
/* Structures and definitions for magnetic tape I/O control commands.
[0] Fix | Delete
Copyright (C) 1996-2018 Free Software Foundation, Inc.
[1] Fix | Delete
This file is part of the GNU C Library.
[2] Fix | Delete
[3] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[4] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[5] Fix | Delete
License as published by the Free Software Foundation; either
[6] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[7] Fix | Delete
[8] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[9] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[10] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[11] Fix | Delete
Lesser General Public License for more details.
[12] Fix | Delete
[13] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[14] Fix | Delete
License along with the GNU C Library; if not, see
[15] Fix | Delete
<http://www.gnu.org/licenses/>. */
[16] Fix | Delete
[17] Fix | Delete
/* Written by H. Bergman <hennus@cybercomm.nl>. */
[18] Fix | Delete
[19] Fix | Delete
#ifndef _SYS_MTIO_H
[20] Fix | Delete
#define _SYS_MTIO_H 1
[21] Fix | Delete
[22] Fix | Delete
/* Get necessary definitions from system and kernel headers. */
[23] Fix | Delete
#include <sys/types.h>
[24] Fix | Delete
#include <sys/ioctl.h>
[25] Fix | Delete
[26] Fix | Delete
[27] Fix | Delete
/* Structure for MTIOCTOP - magnetic tape operation command. */
[28] Fix | Delete
struct mtop
[29] Fix | Delete
{
[30] Fix | Delete
short int mt_op; /* Operations defined below. */
[31] Fix | Delete
int mt_count; /* How many of them. */
[32] Fix | Delete
};
[33] Fix | Delete
#define _IOT_mtop /* Hurd ioctl type field. */ \
[34] Fix | Delete
_IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
[35] Fix | Delete
[36] Fix | Delete
/* Magnetic Tape operations [Not all operations supported by all drivers]. */
[37] Fix | Delete
#define MTRESET 0 /* +reset drive in case of problems. */
[38] Fix | Delete
#define MTFSF 1 /* Forward space over FileMark,
[39] Fix | Delete
* position at first record of next file. */
[40] Fix | Delete
#define MTBSF 2 /* Backward space FileMark (position before FM). */
[41] Fix | Delete
#define MTFSR 3 /* Forward space record. */
[42] Fix | Delete
#define MTBSR 4 /* Backward space record. */
[43] Fix | Delete
#define MTWEOF 5 /* Write an end-of-file record (mark). */
[44] Fix | Delete
#define MTREW 6 /* Rewind. */
[45] Fix | Delete
#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */
[46] Fix | Delete
#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */
[47] Fix | Delete
#define MTRETEN 9 /* Retension tape. */
[48] Fix | Delete
#define MTBSFM 10 /* +backward space FileMark, position at FM. */
[49] Fix | Delete
#define MTFSFM 11 /* +forward space FileMark, position at FM. */
[50] Fix | Delete
#define MTEOM 12 /* Goto end of recorded media (for appending files).
[51] Fix | Delete
MTEOM positions after the last FM, ready for
[52] Fix | Delete
appending another file. */
[53] Fix | Delete
#define MTERASE 13 /* Erase tape -- be careful! */
[54] Fix | Delete
[55] Fix | Delete
#define MTRAS1 14 /* Run self test 1 (nondestructive). */
[56] Fix | Delete
#define MTRAS2 15 /* Run self test 2 (destructive). */
[57] Fix | Delete
#define MTRAS3 16 /* Reserved for self test 3. */
[58] Fix | Delete
[59] Fix | Delete
#define MTSETBLK 20 /* Set block length (SCSI). */
[60] Fix | Delete
#define MTSETDENSITY 21 /* Set tape density (SCSI). */
[61] Fix | Delete
#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */
[62] Fix | Delete
#define MTTELL 23 /* Tell block (Tandberg, etc.). */
[63] Fix | Delete
#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
[64] Fix | Delete
Ordinary buffered operation with code 1. */
[65] Fix | Delete
#define MTFSS 25 /* Space forward over setmarks. */
[66] Fix | Delete
#define MTBSS 26 /* Space backward over setmarks. */
[67] Fix | Delete
#define MTWSM 27 /* Write setmarks. */
[68] Fix | Delete
[69] Fix | Delete
#define MTLOCK 28 /* Lock the drive door. */
[70] Fix | Delete
#define MTUNLOCK 29 /* Unlock the drive door. */
[71] Fix | Delete
#define MTLOAD 30 /* Execute the SCSI load command. */
[72] Fix | Delete
#define MTUNLOAD 31 /* Execute the SCSI unload command. */
[73] Fix | Delete
#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */
[74] Fix | Delete
#define MTSETPART 33 /* Change the active tape partition. */
[75] Fix | Delete
#define MTMKPART 34 /* Format the tape with one or two partitions. */
[76] Fix | Delete
[77] Fix | Delete
/* structure for MTIOCGET - mag tape get status command */
[78] Fix | Delete
[79] Fix | Delete
struct mtget
[80] Fix | Delete
{
[81] Fix | Delete
long int mt_type; /* Type of magtape device. */
[82] Fix | Delete
long int mt_resid; /* Residual count: (not sure)
[83] Fix | Delete
number of bytes ignored, or
[84] Fix | Delete
number of files not skipped, or
[85] Fix | Delete
number of records not skipped. */
[86] Fix | Delete
/* The following registers are device dependent. */
[87] Fix | Delete
long int mt_dsreg; /* Status register. */
[88] Fix | Delete
long int mt_gstat; /* Generic (device independent) status. */
[89] Fix | Delete
long int mt_erreg; /* Error register. */
[90] Fix | Delete
/* The next two fields are not always used. */
[91] Fix | Delete
__daddr_t mt_fileno; /* Number of current file on tape. */
[92] Fix | Delete
__daddr_t mt_blkno; /* Current block number. */
[93] Fix | Delete
};
[94] Fix | Delete
#define _IOT_mtget /* Hurd ioctl type field. */ \
[95] Fix | Delete
_IOT (_IOTS (long), 7, 0, 0, 0, 0)
[96] Fix | Delete
[97] Fix | Delete
[98] Fix | Delete
/* Constants for mt_type. Not all of these are supported, and
[99] Fix | Delete
these are not all of the ones that are supported. */
[100] Fix | Delete
#define MT_ISUNKNOWN 0x01
[101] Fix | Delete
#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */
[102] Fix | Delete
#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */
[103] Fix | Delete
#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */
[104] Fix | Delete
#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */
[105] Fix | Delete
#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */
[106] Fix | Delete
#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */
[107] Fix | Delete
#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */
[108] Fix | Delete
#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */
[109] Fix | Delete
#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */
[110] Fix | Delete
#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */
[111] Fix | Delete
#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */
[112] Fix | Delete
#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive,
[113] Fix | Delete
Teac DC-1 card (Wangtek type). */
[114] Fix | Delete
#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */
[115] Fix | Delete
#define MT_ISDDS1 0x51 /* DDS device without partitions. */
[116] Fix | Delete
#define MT_ISDDS2 0x52 /* DDS device with partitions. */
[117] Fix | Delete
#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */
[118] Fix | Delete
#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */
[119] Fix | Delete
[120] Fix | Delete
/* QIC-40/80/3010/3020 ftape supported drives.
[121] Fix | Delete
20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */
[122] Fix | Delete
#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
[123] Fix | Delete
#define MT_ISFTAPE_FLAG 0x800000
[124] Fix | Delete
[125] Fix | Delete
struct mt_tape_info
[126] Fix | Delete
{
[127] Fix | Delete
long int t_type; /* Device type id (mt_type). */
[128] Fix | Delete
char *t_name; /* Descriptive name. */
[129] Fix | Delete
};
[130] Fix | Delete
[131] Fix | Delete
#define MT_TAPE_INFO \
[132] Fix | Delete
{ \
[133] Fix | Delete
{MT_ISUNKNOWN, "Unknown type of tape device"}, \
[134] Fix | Delete
{MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
[135] Fix | Delete
{MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
[136] Fix | Delete
{MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
[137] Fix | Delete
{MT_ISCMSJ500, "CMS Jumbo 500"}, \
[138] Fix | Delete
{MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
[139] Fix | Delete
{MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
[140] Fix | Delete
{MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
[141] Fix | Delete
{MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
[142] Fix | Delete
{MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
[143] Fix | Delete
{MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
[144] Fix | Delete
{MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
[145] Fix | Delete
{MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
[146] Fix | Delete
{MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
[147] Fix | Delete
{MT_ISSCSI1, "Generic SCSI-1 tape"}, \
[148] Fix | Delete
{MT_ISSCSI2, "Generic SCSI-2 tape"}, \
[149] Fix | Delete
{0, NULL} \
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
[153] Fix | Delete
/* Structure for MTIOCPOS - mag tape get position command. */
[154] Fix | Delete
[155] Fix | Delete
struct mtpos
[156] Fix | Delete
{
[157] Fix | Delete
long int mt_blkno; /* Current block number. */
[158] Fix | Delete
};
[159] Fix | Delete
#define _IOT_mtpos /* Hurd ioctl type field. */ \
[160] Fix | Delete
_IOT_SIMPLE (long)
[161] Fix | Delete
[162] Fix | Delete
[163] Fix | Delete
/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
[164] Fix | Delete
as an interim solution for QIC-02 until DDI is fully implemented. */
[165] Fix | Delete
struct mtconfiginfo
[166] Fix | Delete
{
[167] Fix | Delete
long int mt_type; /* Drive type. */
[168] Fix | Delete
long int ifc_type; /* Interface card type. */
[169] Fix | Delete
unsigned short int irqnr; /* IRQ number to use. */
[170] Fix | Delete
unsigned short int dmanr; /* DMA channel to use. */
[171] Fix | Delete
unsigned short int port; /* IO port base address. */
[172] Fix | Delete
[173] Fix | Delete
unsigned long int debug; /* Debugging flags. */
[174] Fix | Delete
[175] Fix | Delete
unsigned have_dens:1;
[176] Fix | Delete
unsigned have_bsf:1;
[177] Fix | Delete
unsigned have_fsr:1;
[178] Fix | Delete
unsigned have_bsr:1;
[179] Fix | Delete
unsigned have_eod:1;
[180] Fix | Delete
unsigned have_seek:1;
[181] Fix | Delete
unsigned have_tell:1;
[182] Fix | Delete
unsigned have_ras1:1;
[183] Fix | Delete
unsigned have_ras2:1;
[184] Fix | Delete
unsigned have_ras3:1;
[185] Fix | Delete
unsigned have_qfa:1;
[186] Fix | Delete
[187] Fix | Delete
unsigned pad1:5;
[188] Fix | Delete
char reserved[10];
[189] Fix | Delete
};
[190] Fix | Delete
#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \
[191] Fix | Delete
_IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */
[192] Fix | Delete
[193] Fix | Delete
[194] Fix | Delete
/* Magnetic tape I/O control commands. */
[195] Fix | Delete
#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */
[196] Fix | Delete
#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */
[197] Fix | Delete
#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/
[198] Fix | Delete
[199] Fix | Delete
/* The next two are used by the QIC-02 driver for runtime reconfiguration.
[200] Fix | Delete
See tpqic02.h for struct mtconfiginfo. */
[201] Fix | Delete
#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
[202] Fix | Delete
#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
[203] Fix | Delete
[204] Fix | Delete
/* Generic Mag Tape (device independent) status macros for examining
[205] Fix | Delete
mt_gstat -- HP-UX compatible.
[206] Fix | Delete
There is room for more generic status bits here, but I don't
[207] Fix | Delete
know which of them are reserved. At least three or so should
[208] Fix | Delete
be added to make this really useful. */
[209] Fix | Delete
#define GMT_EOF(x) ((x) & 0x80000000)
[210] Fix | Delete
#define GMT_BOT(x) ((x) & 0x40000000)
[211] Fix | Delete
#define GMT_EOT(x) ((x) & 0x20000000)
[212] Fix | Delete
#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
[213] Fix | Delete
#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
[214] Fix | Delete
#define GMT_WR_PROT(x) ((x) & 0x04000000)
[215] Fix | Delete
/* #define GMT_ ? ((x) & 0x02000000) */
[216] Fix | Delete
#define GMT_ONLINE(x) ((x) & 0x01000000)
[217] Fix | Delete
#define GMT_D_6250(x) ((x) & 0x00800000)
[218] Fix | Delete
#define GMT_D_1600(x) ((x) & 0x00400000)
[219] Fix | Delete
#define GMT_D_800(x) ((x) & 0x00200000)
[220] Fix | Delete
/* #define GMT_ ? ((x) & 0x00100000) */
[221] Fix | Delete
/* #define GMT_ ? ((x) & 0x00080000) */
[222] Fix | Delete
#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */
[223] Fix | Delete
/* #define GMT_ ? ((x) & 0x00020000) */
[224] Fix | Delete
#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/
[225] Fix | Delete
/* 16 generic status bits unused. */
[226] Fix | Delete
[227] Fix | Delete
[228] Fix | Delete
/* SCSI-tape specific definitions. Bitfield shifts in the status */
[229] Fix | Delete
#define MT_ST_BLKSIZE_SHIFT 0
[230] Fix | Delete
#define MT_ST_BLKSIZE_MASK 0xffffff
[231] Fix | Delete
#define MT_ST_DENSITY_SHIFT 24
[232] Fix | Delete
#define MT_ST_DENSITY_MASK 0xff000000
[233] Fix | Delete
[234] Fix | Delete
#define MT_ST_SOFTERR_SHIFT 0
[235] Fix | Delete
#define MT_ST_SOFTERR_MASK 0xffff
[236] Fix | Delete
[237] Fix | Delete
/* Bitfields for the MTSETDRVBUFFER ioctl. */
[238] Fix | Delete
#define MT_ST_OPTIONS 0xf0000000
[239] Fix | Delete
#define MT_ST_BOOLEANS 0x10000000
[240] Fix | Delete
#define MT_ST_SETBOOLEANS 0x30000000
[241] Fix | Delete
#define MT_ST_CLEARBOOLEANS 0x40000000
[242] Fix | Delete
#define MT_ST_WRITE_THRESHOLD 0x20000000
[243] Fix | Delete
#define MT_ST_DEF_BLKSIZE 0x50000000
[244] Fix | Delete
#define MT_ST_DEF_OPTIONS 0x60000000
[245] Fix | Delete
[246] Fix | Delete
#define MT_ST_BUFFER_WRITES 0x1
[247] Fix | Delete
#define MT_ST_ASYNC_WRITES 0x2
[248] Fix | Delete
#define MT_ST_READ_AHEAD 0x4
[249] Fix | Delete
#define MT_ST_DEBUGGING 0x8
[250] Fix | Delete
#define MT_ST_TWO_FM 0x10
[251] Fix | Delete
#define MT_ST_FAST_MTEOM 0x20
[252] Fix | Delete
#define MT_ST_AUTO_LOCK 0x40
[253] Fix | Delete
#define MT_ST_DEF_WRITES 0x80
[254] Fix | Delete
#define MT_ST_CAN_BSR 0x100
[255] Fix | Delete
#define MT_ST_NO_BLKLIMS 0x200
[256] Fix | Delete
#define MT_ST_CAN_PARTITIONS 0x400
[257] Fix | Delete
#define MT_ST_SCSI2LOGICAL 0x800
[258] Fix | Delete
[259] Fix | Delete
/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */
[260] Fix | Delete
#define MT_ST_CLEAR_DEFAULT 0xfffff
[261] Fix | Delete
#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
[262] Fix | Delete
#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
[263] Fix | Delete
#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
[264] Fix | Delete
[265] Fix | Delete
/* The offset for the arguments for the special HP changer load command. */
[266] Fix | Delete
#define MT_ST_HPLOADER_OFFSET 10000
[267] Fix | Delete
[268] Fix | Delete
[269] Fix | Delete
/* Specify default tape device. */
[270] Fix | Delete
#ifndef DEFTAPE
[271] Fix | Delete
# define DEFTAPE "/dev/tape"
[272] Fix | Delete
#endif
[273] Fix | Delete
[274] Fix | Delete
#endif /* mtio.h */
[275] Fix | Delete
[276] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function