mtio.h
001: 
002: 
003: 
004: 
005: 
006: 
007: 
008: 
009: 
010: 
011: 
012: 
013: 
014: 
015: 
016: 
017: 
018: 
019: 
020: <hennus@cybercomm.nl>
021: 
022: #ifndef _SYS_MTIO_H
023: #define _SYS_MTIO_H     1
024: 
025: 
026: #include <sys/types.h>
027: #include <sys/ioctl.h>
028: 
029: 
030: 
031: struct mtop
032:   {
033:     short int mt_op;            
034:     int mt_count;               
035:   };
036: #define _IOT_mtop  \
037:   _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
038: 
039: 
040: #define MTRESET 0       
041: #define MTFSF   1       
042: 
043: #define MTBSF   2       
044: #define MTFSR   3       
045: #define MTBSR   4       
046: #define MTWEOF  5       
047: #define MTREW   6       
048: #define MTOFFL  7       
049: #define MTNOP   8       
050: #define MTRETEN 9       
051: #define MTBSFM  10      
052: #define MTFSFM  11      
053: #define MTEOM   12      
054: 
055: 
056: #define MTERASE 13      
057: 
058: #define MTRAS1  14      
059: #define MTRAS2  15      
060: #define MTRAS3  16      
061: 
062: #define MTSETBLK 20     
063: #define MTSETDENSITY 21 
064: #define MTSEEK  22      
065: #define MTTELL  23      
066: #define MTSETDRVBUFFER 24 
067: 
068: #define MTFSS   25      
069: #define MTBSS   26      
070: #define MTWSM   27      
071: 
072: #define MTLOCK  28      
073: #define MTUNLOCK 29     
074: #define MTLOAD  30      
075: #define MTUNLOAD 31     
076: #define MTCOMPRESSION 32
077: #define MTSETPART 33    
078: #define MTMKPART  34    
079: 
080: 
081: 
082: struct mtget
083:   {
084:     long int mt_type;           
085:     long int mt_resid;          
086: 
087: 
088: 
089:     
090:     long int mt_dsreg;          
091:     long int mt_gstat;          
092:     long int mt_erreg;          
093:     
094:     __daddr_t mt_fileno;        
095:     __daddr_t mt_blkno;         
096:   };
097: #define _IOT_mtget  \
098:   _IOT (_IOTS (long), 7, 0, 0, 0, 0)
099: 
100: 
101: 
102: 
103: #define MT_ISUNKNOWN            0x01
104: #define MT_ISQIC02              0x02    
105: #define MT_ISWT5150             0x03    
106: #define MT_ISARCHIVE_5945L2     0x04    
107: #define MT_ISCMSJ500            0x05    
108: #define MT_ISTDC3610            0x06    
109: #define MT_ISARCHIVE_VP60I      0x07    
110: #define MT_ISARCHIVE_2150L      0x08    
111: #define MT_ISARCHIVE_2060L      0x09    
112: #define MT_ISARCHIVESC499       0x0A    
113: #define MT_ISQIC02_ALL_FEATURES 0x0F    
114: #define MT_ISWT5099EEN24        0x11    
115: #define MT_ISTEAC_MT2ST         0x12    
116: 
117: #define MT_ISEVEREX_FT40A       0x32    
118: #define MT_ISDDS1               0x51    
119: #define MT_ISDDS2               0x52    
120: #define MT_ISSCSI1              0x71    
121: #define MT_ISSCSI2              0x72    
122: 
123: 
124: 
125: #define MT_ISFTAPE_UNKNOWN      0x800000 
126: #define MT_ISFTAPE_FLAG         0x800000
127: 
128: struct mt_tape_info
129:   {
130:     long int t_type;            
131:     char *t_name;               
132:   };
133: 
134: #define MT_TAPE_INFO \
135:   {                                                                           \
136:         {MT_ISUNKNOWN,          "Unknown type of tape device"},               \
137:         {MT_ISQIC02,            "Generic QIC-02 tape streamer"},              \
138:         {MT_ISWT5150,           "Wangtek 5150, QIC-150"},                     \
139:         {MT_ISARCHIVE_5945L2,   "Archive 5945L-2"},                           \
140:         {MT_ISCMSJ500,          "CMS Jumbo 500"},                             \
141:         {MT_ISTDC3610,          "Tandberg TDC 3610, QIC-24"},                 \
142:         {MT_ISARCHIVE_VP60I,    "Archive VP60i, QIC-02"},                     \
143:         {MT_ISARCHIVE_2150L,    "Archive Viper 2150L"},                       \
144:         {MT_ISARCHIVE_2060L,    "Archive Viper 2060L"},                       \
145:         {MT_ISARCHIVESC499,     "Archive SC-499 QIC-36 controller"},          \
146:         {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"},       \
147:         {MT_ISWT5099EEN24,      "Wangtek 5099-een24, 60MB"},                  \
148:         {MT_ISTEAC_MT2ST,       "Teac MT-2ST 155mb data cassette drive"},     \
149:         {MT_ISEVEREX_FT40A,     "Everex FT40A, QIC-40"},                      \
150:         {MT_ISSCSI1,            "Generic SCSI-1 tape"},                       \
151:         {MT_ISSCSI2,            "Generic SCSI-2 tape"},                       \
152:         {0, NULL}                                                             \
153:   }
154: 
155: 
156: 
157: 
158: struct mtpos
159:   {
160:     long int mt_blkno;  
161:   };
162: #define _IOT_mtpos  \
163:   _IOT_SIMPLE (long)
164: 
165: 
166: 
167: 
168: struct mtconfiginfo
169:   {
170:     long int mt_type;           
171:     long int ifc_type;          
172:     unsigned short int irqnr;   
173:     unsigned short int dmanr;   
174:     unsigned short int port;    
175: 
176:     unsigned long int debug;    
177: 
178:     unsigned have_dens:1;
179:     unsigned have_bsf:1;
180:     unsigned have_fsr:1;
181:     unsigned have_bsr:1;
182:     unsigned have_eod:1;
183:     unsigned have_seek:1;
184:     unsigned have_tell:1;
185:     unsigned have_ras1:1;
186:     unsigned have_ras2:1;
187:     unsigned have_ras3:1;
188:     unsigned have_qfa:1;
189: 
190:     unsigned pad1:5;
191:     char reserved[10];
192:   };
193: #define _IOT_mtconfiginfo  \
194:   _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) 
195: 
196: 
197: 
198: #define MTIOCTOP        _IOW('m', 1, struct mtop)       
199: #define MTIOCGET        _IOR('m', 2, struct mtget)      
200: #define MTIOCPOS        _IOR('m', 3, struct mtpos)      
201: 
202: 
203: 
204: #define MTIOCGETCONFIG  _IOR('m', 4, struct mtconfiginfo) 
205: #define MTIOCSETCONFIG  _IOW('m', 5, struct mtconfiginfo) 
206: 
207: 
208: 
209: 
210: 
211: 
212: #define GMT_EOF(x)              ((x) & 0x80000000)
213: #define GMT_BOT(x)              ((x) & 0x40000000)
214: #define GMT_EOT(x)              ((x) & 0x20000000)
215: #define GMT_SM(x)               ((x) & 0x10000000)  
216: #define GMT_EOD(x)              ((x) & 0x08000000)  
217: #define GMT_WR_PROT(x)          ((x) & 0x04000000)
218: 
219: #define GMT_ONLINE(x)           ((x) & 0x01000000)
220: #define GMT_D_6250(x)           ((x) & 0x00800000)
221: #define GMT_D_1600(x)           ((x) & 0x00400000)
222: #define GMT_D_800(x)            ((x) & 0x00200000)
223: 
224: 
225: #define GMT_DR_OPEN(x)          ((x) & 0x00040000)  
226: 
227: #define GMT_IM_REP_EN(x)        ((x) & 0x00010000)  
228: 
229: 
230: 
231: 
232: #define MT_ST_BLKSIZE_SHIFT     0
233: #define MT_ST_BLKSIZE_MASK      0xffffff
234: #define MT_ST_DENSITY_SHIFT     24
235: #define MT_ST_DENSITY_MASK      0xff000000
236: 
237: #define MT_ST_SOFTERR_SHIFT     0
238: #define MT_ST_SOFTERR_MASK      0xffff
239: 
240: 
241: #define MT_ST_OPTIONS           0xf0000000
242: #define MT_ST_BOOLEANS          0x10000000
243: #define MT_ST_SETBOOLEANS       0x30000000
244: #define MT_ST_CLEARBOOLEANS     0x40000000
245: #define MT_ST_WRITE_THRESHOLD   0x20000000
246: #define MT_ST_DEF_BLKSIZE       0x50000000
247: #define MT_ST_DEF_OPTIONS       0x60000000
248: 
249: #define MT_ST_BUFFER_WRITES     0x1
250: #define MT_ST_ASYNC_WRITES      0x2
251: #define MT_ST_READ_AHEAD        0x4
252: #define MT_ST_DEBUGGING         0x8
253: #define MT_ST_TWO_FM            0x10
254: #define MT_ST_FAST_MTEOM        0x20
255: #define MT_ST_AUTO_LOCK         0x40
256: #define MT_ST_DEF_WRITES        0x80
257: #define MT_ST_CAN_BSR           0x100
258: #define MT_ST_NO_BLKLIMS        0x200
259: #define MT_ST_CAN_PARTITIONS    0x400
260: #define MT_ST_SCSI2LOGICAL      0x800
261: 
262: 
263: #define MT_ST_CLEAR_DEFAULT     0xfffff
264: #define MT_ST_DEF_DENSITY       (MT_ST_DEF_OPTIONS | 0x100000)
265: #define MT_ST_DEF_COMPRESSION   (MT_ST_DEF_OPTIONS | 0x200000)
266: #define MT_ST_DEF_DRVBUFFER     (MT_ST_DEF_OPTIONS | 0x300000)
267: 
268: 
269: #define MT_ST_HPLOADER_OFFSET 10000
270: 
271: 
272: 
273: #ifndef DEFTAPE
274: # define DEFTAPE        "/dev/tape"
275: #endif
276: 
277: #endif 
278: 
      
      
      
      
   
      
      
         
            
            © Andrew Scott 2006 -
            2025, 
            All Rights Reserved