|
|
1.1 root 1: /*
2: * /usr/include/sys/xl.h
3: *
4: * Archive floppy tape support.
5: *
6: * Revised: Fri Jun 18 19:18:02 1993 CDT
7: */
8:
9: #ifndef __SYS_XL_H__
10: #define __SYS_XL_H__
11:
12: /************************************************************************/
13: /* QIC 117 commands */
14: /************************************************************************/
15: #define QIC_CMD_RST 01 /* reset */
16: #define QIC_CMD_RNB 02 /* report next bit */
17: #define QIC_CMD_PAUS 03 /* pause */
18: #define QIC_CMD_MPAUS 04 /* micro step pause */
19: #define QIC_CMD_ALTTO 05 /* alternate command timeout */
20: #define QIC_CMD_STS 06 /* status */
21: #define QIC_CMD_ECD 07 /* report error code */
22: #define QIC_CMD_DRVCN 08 /* report drive configuration */
23: #define QIC_CMD_ROMVN 09 /* report ROM version */
24: #define QIC_CMD_FWD 10 /* logical forward */
25: #define QIC_CMD_BOT 11 /* rewind to begining of tape */
26: #define QIC_CMD_EOT 12 /* forward to end of tape */
27: #define QIC_CMD_SEEK 13 /* seek head to track */
28: #define QIC_CMD_CAL 14 /* rewind, calibrate drive */
29: #define QIC_CMD_FMD 15 /* format mode */
30: #define QIC_CMD_WRF 16 /* write reference bursts */
31: #define QIC_CMD_VMD 17 /* verify mode */
32: #define QIC_CMD_STOP 18 /* stop tape motion */
33: #define QIC_CMD_SKPB 25 /* skip n segments back */
34: #define QIC_CMD_SKPF 26 /* skip n segments forward */
35: #define QIC_CMD_RATE 27 /* select rate */
36: #define QIC_CMD_NMD 30 /* normal (primary) mode */
37: #define QIC_CMD_VNDID 32 /* report vendor id */
38: #define QIC_CMD_TPSTAT 33 /* report tape status */
39: #define QIC_CMD_SKPBX 34 /* skip n segments back extended */
40: #define QIC_CMD_SKPFX 35 /* skip n segments forward extended */
41:
42: /* These are Archive/Mountain/Summit variants, not QIC standard. */
43: #define QIC_CMD_SS2 20 /* A/M/S soft select enable 2 */
44: #define QIC_CMD_SS1 23 /* A/M/S soft select enable 1 */
45: #define QIC_CMD_SS_OFF 24 /* A/M/S soft select disable */
46:
47: /* These are CMS variants, not QIC standard. */
48: #define QIC_CMD_NWTP 45 /* CMS new tape */
49: #define QIC_CMD_CSS_ON 46 /* CMS soft select enable */
50: #define QIC_CMD_CSS_OFF 47 /* CMS soft select disable */
51:
52: /************************************************************************/
53: /* QIC 117 Report Drive Status bits */
54: /************************************************************************/
55: #define QIC_STAT_RDY 0x01 /* drive ready or idle */
56: #define QIC_STAT_ERR 0x02 /* error detected */
57: #define QIC_STAT_PRSNT 0x04 /* cartridge present */
58: #define QIC_STAT_WPROT 0x08 /* cartridge write protected */
59: #define QIC_STAT_NEWCT 0x10 /* new cartridge */
60: #define QIC_STAT_REFD 0x20 /* cartridge referenced */
61: #define QIC_STAT_BOT 0x40 /* at physical BOT */
62: #define QIC_STAT_EOT 0x40 /* at physical EOT */
63:
64: /************************************************************************/
65: /* QIC 117 error codes */
66: /************************************************************************/
67:
68: /* command received while drive not ready */
69: #define QIC_ERR_NOT_READY 01
70:
71: /* cartridge not present or removed */
72: #define QIC_ERR_NO_CART 02
73:
74: /* motor speed error (not within 1%) */
75: #define QIC_ERR_MOTOR_SPEED 03
76:
77: /* motor speed fault (jammed, or gross speed error) */
78: #define QIC_ERR_MOTOR_FAULT 04
79:
80: /* cartridge write protected */
81: #define QIC_ERR_WPROT 05
82:
83: /* undefined or reserved command code */
84: #define QIC_ERR_BAD_CMD 06
85:
86: /* illegal track address specified for seek */
87: #define QIC_ERR_SEEK_TRK 07
88:
89: /* illegal command in report subcontext */
90: #define QIC_ERR_RPT_CMD 08
91:
92: /* illegal entry into a diagnostic mode */
93: #define QIC_ERR_DIAG_ENTRY 09
94:
95: /* broken tape detected (based on hole sensor) */
96: #define QIC_ERR_BROKEN_TAPE 10
97:
98: /* warning - read gain setting error */
99: #define QIC_ERR_READ_GAIN 11
100:
101: /* command received while error status pending (obsolete) */
102: #define QIC_ERR_ESTAT 12
103:
104: /* command received while new cartridge pending */
105: #define QIC_ERR_NEW_CART 13
106:
107: /* command illegal or undefined in primary mode */
108: #define QIC_ERR_PRI_MODE 14
109:
110: /* command illegal or undefined in format mode */
111: #define QIC_ERR_FMT_MODE 15
112:
113: /* command illegal or undefined in verify mode */
114: #define QIC_ERR_VFY_MODE 16
115:
116: /* logical forward not at logical BOT in format mode */
117: #define QIC_ERR_LOG_FWD 17
118:
119: /* logical EOT before all segments generated */
120: #define QIC_ERR_LOG_EOT 18
121:
122: /* command illegal when cartridge not referenced */
123: #define QIC_ERR_NOT_REF 19
124:
125: /* self-diagnostic failed (cannot be cleared) */
126: #define QIC_ERR_SELF_DX 20
127:
128: /* warning EEPROM not initialized, defaults set */
129: #define QIC_ERR_EE_DFLT 21
130:
131: /* EEPROM corrupt or hardware failure */
132: #define QIC_ERR_EE_BAD 22
133:
134: /* motion timeout error */
135: #define QIC_ERR_MOTION_TO 23
136:
137: /* data segment too long - logical forward or pause */
138: #define QIC_ERR_TOO_LONG 24
139:
140: /* transmit overrun (obsolete) */
141: #define QIC_ERR_XMIT_OVR 25
142:
143: /* power on reset occurred */
144: #define QIC_ERR_POWER_ON 26
145:
146: /* software reset occurred */
147: #define QIC_ERR_SOFT_RST 27
148:
149: /* diagnostic mode 1 error */
150: #define QIC_ERR_DX_1 28
151:
152: /* diagnostic mode 2 error */
153: #define QIC_ERR_DX_2 29
154:
155: /* command received during noninterruptible process */
156: #define QIC_ERR_NON_IRPT 30
157:
158: /* rate selection error */
159: #define QIC_ERR_RATE_SEL 31
160:
161: /* illegal command while in high speed mode */
162: #define QIC_ERR_HIGH_SPD 32
163:
164: /* illegal seek segment value */
165: #define QIC_ERR_SEEK_SEG 33
166:
167: /************************************************************************/
168: /* request buffer structure */
169: /************************************************************************/
170: struct rb{
171: struct rb *nxt; /* ptr to next packet */
172: unchar fun; /* function */
173: unchar sts; /* status */
174: ushort sgn; /* segment # */
175: paddr_t adr; /* addr of buffer */
176: ulong map; /* bad sector map */
177: unchar hed; /* fdc head */
178: unchar cyl; /* fdc cylinder */
179: unchar sct; /* base fdc sector */
180: unchar trk; /* tape track */
181: unchar tps; /* segment */
182: unchar idc; /* read id cylinder */
183: unchar ids; /* sct */
184: unchar nbk; /* # blocks */
185: unchar erc; /* error count */
186: unchar ers[ 3 ]; /* error sectors */
187: ushort tbl[ 33 ]; /* parsed segment params*/
188: };
189:
190: struct rbq { /* buf queue structure */
191: struct rb *top;
192: struct rb *bot;
193: };
194:
195: /************************************************************************/
196: /* Volume table structure (128 bytes) */
197: /************************************************************************/
198:
199: typedef struct {
200: unsigned char ident[4]; /* Volume entry signature "VTBL"*/
201: unsigned short data_seg_num; /* Starting segment number */
202: unsigned short last_seg_num; /* Ending segment number */
203: unsigned char op_system[6]; /* OS type "unix" */
204: unsigned char p1[43]; /* Null (offset 14-56) */
205: char c_seq_num; /* Multicartridge seq # */
206: /* initial cartridge = 1 */
207: unsigned short p3[34]; /* Null (offset 58-126) */
208: unsigned short last_blk_size; /* Reserved. For UNIX/Xenix */
209: /* last block data size */
210: } xlvtbl;
211:
212: /************************************************************************/
213: /* xl typedefs */
214: /************************************************************************/
215:
216: typedef unsigned char * fpchr;
217: typedef unsigned short * fpwrd;
218: typedef unsigned long * fplng;
219:
220: /************************************************************************/
221: /* xldefines */
222: /************************************************************************/
223:
224: #define RBFRD 0x01 /* rb.fun values */
225: #define RBFWT 0x02
226: #define RBWFD 0x03
227:
228: #define XLSRDY 0x01 /* xl6sts equates */
229: #define XLSEXC 0x02
230: #define XLSCIN 0x04
231: #define XLSWRP 0x08
232: #define XLSCHG 0x10
233: #define XLSREF 0x20
234: #define XLSBOT 0x40
235: #define XLSEOT 0x80
236: /* xlster equates */
237: #define XLSNEC 0x80 /* nec error */
238: #define XLSLSB 0x40 /* last status bit != 1 */
239: #define XLSSFT 0x20 /* soft error:, exc, chg, or no cin */
240: #define XLSNTD 0x10 /* not tape drive */
241: #define XLSNID 0x08 /* can't read id's */
242:
243: #endif /* __SYS_XL_H__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.