1: /*
2: * 1.3 (2.11BSD) 1999/2/25
3: *
4: * Definitions common to both MSCP and TMSCP were moved here from tmscp.h.
5: * Eventually the MSCP driver and include file will be modified to use these
6: * instead of their private versions.
7: */
8:
9: #ifndef _MSCP_COMMON_H_
10: #define _MSCP_COMMON_H_
11:
12: struct {
13: u_short mscp_msglen; /* length of MSCP packet */
14: char mscp_credits; /* low 4 bits: credits, high 4 bits: msgtype */
15: char mscp_vcid; /* virtual circuit id */
16: };
17:
18: /*
19: * Control message opcodes
20: */
21: #define M_OP_ABORT 0x01 /* Abort command */
22: #define M_OP_GTCMD 0x02 /* Get command status command */
23: #define M_OP_GTUNT 0x03 /* Get unit status command */
24: #define M_OP_STCON 0x04 /* Set controller characteristics command */
25: #define M_OP_ACCNM 0x05 /* Access non volatile memory */
26: #define M_OP_SEREX 0x07 /* Serious exceptin message */
27: #define M_OP_AVAIL 0x08 /* Available command */
28: #define M_OP_ONLIN 0x09 /* Online command */
29: #define M_OP_STUNT 0x0a /* Set unit characteristics command */
30: #define M_OP_DTACP 0x0b /* Determine access paths command */
31: #define M_OP_ACCES 0x10 /* Access command */
32: #define M_OP_CMPCD 0x11 /* Compare controller data command */
33: #define M_OP_ERASE 0x12 /* Erase command */
34: #define M_OP_FLUSH 0x13 /* Flush command */
35: #define M_OP_ERGAP 0x16 /* Erase gap command */
36: #define M_OP_COMP 0x20 /* Compare host data command */
37: #define M_OP_READ 0x21 /* Read command */
38: #define M_OP_WRITE 0x22 /* Write command */
39: #define M_OP_WRITM 0x24 /* Write tape mark command */
40: #define M_OP_REPOS 0x25 /* Reposition command */
41: /* 0x28 thru 0x2f reserved */
42: #define M_OP_AVATN 0x40 /* Available attention message */
43: #define M_OP_DUPUN 0x41 /* Duplicate unit number attention message */
44: #define M_OP_ACPTH 0x42 /* Access path attention message */
45: #define M_OP_RWATN 0x43 /* Rewind attention message */
46: #define M_OP_END 0x80 /* End message flag */
47:
48: /*
49: * Generic command modifiers
50: */
51: #define M_MD_EXPRS 0x8000 /* Express request */
52: #define M_MD_COMP 0x4000 /* Compare */
53: #define M_MD_CLSEX 0x2000 /* Clear serious exception */
54: #define M_MD_CDATL 0x1000 /* Clear cache data lost exception */
55: #define M_MD_SCCHH 0x0800 /* Suppress caching (high speed) */
56: #define M_MD_SCCHL 0x0400 /* Suppress caching (low speed) */
57: #define M_MD_SECOR 0x0200 /* Suppress error correction */
58: #define M_MD_SEREC 0x0100 /* Suppress error recovery */
59: #define M_MD_WBKNV 0x0040 /* Write back non volative mem */
60: #define M_MD_IMMED 0x0040 /* Immediate completion */
61: #define M_MD_WBKVL 0x0020 /* Write back volatile mem */
62: #define M_MD_UNLOD 0x0010 /* Unload */
63: #define M_MD_REVRS 0x0008 /* reverse */
64:
65: /*
66: * Repositioning command modifiers
67: */
68: #define M_MD_DLEOT 0x0080 /* delete LEOT */
69: #define M_MD_OBJCT 0x0004 /* object count */
70: #define M_MD_REWND 0x0002 /* rewind */
71:
72: /*
73: * Available command modifiers
74: */
75: #define M_MD_ALLCD 0x0002 /* All class drivers */
76: #define M_MD_SPNDW 0x0001 /* Spin down */
77:
78: /*
79: * Flush command modifiers
80: */
81: #define M_MD_VOLTL 0x0002 /* Volatile memory only */
82: #define M_MD_FLENU 0x0001 /* Flush entire unit's memory */
83:
84: /*
85: * Get unit status command modifiers
86: */
87: #define M_MD_NXUNT 0x0001 /* Get next unit */
88:
89: /*
90: * Online and set unit char command modifiers
91: */
92: #define M_MD_EXCAC 0x0020 /* Exclusive access */
93: #define M_MD_STWRP 0x0004 /* Enable write protect */
94:
95: /*
96: * End message flags
97: */
98: #define M_EF_ERLOG 0x0020 /* Error log generated */
99: #define M_EF_SEREX 0x0010 /* Serious exception */
100: #define M_EF_EOT 0x0008 /* End of tape encountered */
101: #define M_EF_PLS 0x0004 /* Position lost */
102: #define M_EF_DLS 0x0002 /* Cache data lost */
103:
104: /*
105: * Controller flags
106: */
107: #define M_CF_ATTN 0x0080 /* Enable attention messages */
108: #define M_CF_MISC 0x0040 /* Enable miscellaneous error log messages */
109: #define M_CF_OTHER 0x0020 /* Enable other host's error log messages */
110: #define M_CF_THIS 0x0010 /* Enable this host's error log messages */
111:
112:
113: /*
114: * Unit flags
115: */
116: #define M_UF_CACH 0x8000 /* Set if caching capable */
117: #define M_UF_WRTPH 0x2000 /* Write protect (hardware) */
118: #define M_UF_WRTPS 0x1000 /* Write protect (software or volume) */
119: #define M_UF_SCCHH 0x0800 /* Suppress caching */
120: #define M_UF_EXACC 0x0400 /* Exclusive access */
121: #define M_UF_LOADR 0x0200 /* Tape loader present */
122: #define M_UF_WRTPD 0x0100 /* Write protect (data safety) */
123: #define M_UF_RMVBL 0x0080 /* Removable media */
124: #define M_UF_WBKNV 0x0040 /* Write back (enables cache) */
125: #define M_UF_VSMSU 0x0020 /* Variable speed mode suppression */
126: #define M_UF_VARSP 0x0010 /* Variable speed unit */
127: #define M_UF_CACFL 0x0004 /* Cache has been flushed */
128: #define M_UF_CMPWR 0x0002 /* Compare writes */
129: #define M_UF_CMPRD 0x0001 /* Compare reads */
130:
131: /*
132: * Status codes
133: */
134: #define M_ST_MASK 0x1f /* Status code mask */
135: #define M_ST_SBCOD 0x20 /* sub code multiplier */
136: #define M_ST_SBBIT 0x05 /* Sub code starting bit position */
137:
138: #define M_ST_SUCC 0x00 /* Success */
139: #define M_ST_ICMD 0x01 /* Invalid command */
140: #define M_ST_ABRTD 0x02 /* Command aborted */
141: #define M_ST_OFFLN 0x03 /* Unit offline */
142: #define M_ST_AVLBL 0x04 /* Unit available */
143: #define M_ST_MFMTE 0x05 /* Media format error */
144: #define M_ST_WRTPR 0x06 /* Write protected */
145: #define M_ST_COMP 0x07 /* Compare error */
146: #define M_ST_DATA 0x08 /* Data error */
147: #define M_ST_HSTBF 0x09 /* Host buffer access error */
148: #define M_ST_CNTLR 0x0a /* Controller error */
149: #define M_ST_DRIVE 0x0b /* Drive error */
150: #define M_ST_FMTER 0x0c /* Formatter error */
151: #define M_ST_BOT 0x0d /* BOT encountered */
152: #define M_ST_TAPEM 0x0e /* Tape mark encountered */
153: #define M_ST_RDTRN 0x10 /* Record data truncated */
154: #define M_ST_PLOST 0x11 /* Position lost */
155: #define M_ST_SEX 0x12 /* Serious exception */
156: #define M_ST_LED 0x13 /* LEOT detected */
157: #define M_ST_BBR 0x14 /* Bad block replacement complete */
158: #define M_ST_IPARM 0x15 /* Invalid parameter */
159: #define M_ST_INFO 0x16 /* Informational message, not error */
160: #define M_ST_LOADR 0x17 /* Media loader error */
161: #define M_ST_DIAG 0x1f /* Message from internal diagnostic */
162:
163: /*
164: * Success subcodes
165: */
166: #define M_SC_NORML 0x0000 /* Normal */
167: #define M_SC_SDIGN 0x0001 /* Spin down ignored */
168: #define M_SC_STCON 0x0002 /* Still connected */
169: #define M_SC_DUPUN 0x0004 /* Duplicate unit number */
170: #define M_SC_ALONL 0x0008 /* Already online */
171: #define M_SC_STONL 0x0010 /* Still online */
172: #define M_SC_UNIGN 0x0011 /* Still online/Unload ignored (T) */
173: #define M_SC_EOT 0x0020 /* EOT seen */
174: #ifdef notnow
175: #define M_SC_INREP 0x0020 /* Incomplete replacement (D)
176: #define M_SC_IVRCT 0x0040 /* Invalid RCT */
177: #endif
178: #define M_SC_ROVOL 0x0080 /* Read only volume */
179:
180: /*
181: * Invalid command subcodes
182: */
183: #define M_SC_INVML 0x0000 /* Invalid message length */
184:
185: /*
186: * Data error subcodes
187: */
188: #define M_SC_LGAP 0x0000 /* Long gap seen */
189: #define M_SC_UREAD 0x0007 /* Unrecoverable read err */
190:
191: /*
192: * Unit offline subcodes
193: */
194: #define M_SC_UNKNO 0x0000 /* Unit unknown */
195: #define M_SC_NOVOL 0x0001 /* No volume (turned off) */
196: #define M_SC_INOPR 0x0002 /* Unit is inoperative */
197: #define M_SC_UDSBL 0x0008 /* Unit disabled */
198: #define M_SC_EXUSE 0x0010 /* Unit in use elsewhere */
199: #define M_SC_LOADE 0x0020 /* Loader error */
200:
201: /*
202: * Unit available subcodes
203: */
204: #define M_SC_AVAIL 0x0000 /* Success */
205: #ifdef notnow
206: #define M_SC_NOMEMB 0x0001 /* No members */
207: #define M_SC_ALUSE 0x0020 /* Online to another host */
208: #endif
209:
210: /*
211: * Write protect subcodes
212: */
213: #define M_SC_DATL 0x0008 /* Data loss write protected */
214: #define M_SC_SOFTW 0x0080 /* Software write protected */
215: #define M_SC_HARDW 0x0100 /* Hardware write protected */
216:
217: /*
218: * Invalid parameter sub-codes
219: */
220: #ifdef notnow
221: #define M_SC_IVKLN 0x0001 /* Invalid key length */
222: #define M_SC_IVKTP 0x0002 /* Invalid key type */
223: #define M_SC_IVKVL 0x0003 /* Invalid key value */
224:
225: /*
226: * Media format error sub-codes
227: */
228: #define M_SC_NO512 0x0005 /* 576 byte sectors on a 512 byte drive */
229: #define M_SC_UNFMT 0x0006 /* Disk unformatted or FCT corrupted */
230: #define M_SC_RCTBD 0x0008 /* RCT corrupted */
231: #define M_SC_NORBL 0x0009 /* No replacement block available */
232: #define M_SC_MULT 0x000A /* Multi-copy protection warning */
233:
234: /*
235: * Data error sub-codes
236: *
237: * sub-codes marked (*) may also appear in media format errors
238: */
239: #define M_SC_FRCER 0x0000 /* Forced error (*) */
240: #define M_SC_IVHDR 0x0002 /* Invalid header (*) */
241: #define M_SC_SYNTO 0x0003 /* Data synch timeout (*) */
242: #define M_SC_ECCFL 0x0004 /* Correctable error in ECC field */
243: #define M_SC_UNECC 0x0007 /* Uncorrectable ECC error (*) */
244: #define M_SC_1SECC 0x0008 /* 1 symbol correctable ECC error */
245: #define M_SC_2SECC 0x0009 /* 2 symbol correctable ECC error */
246: #define M_SC_3SECC 0x000a /* 3 symbol correctable ECC error */
247: #define M_SC_4SECC 0x000b /* 4 symbol correctable ECC error */
248: #define M_SC_5SECC 0x000c /* 5 symbol correctable ECC error */
249: #define M_SC_6SECC 0x000d /* 6 symbol correctable ECC error */
250: #define M_SC_7SECC 0x000e /* 7 symbol correctable ECC error */
251: #define M_SC_8SECC 0x000f /* 8 symbol correctable ECC error */
252:
253: /*
254: * Host buffer access error sub-codes
255: */
256: #define M_SC_ODDTA 0x0001 /* Odd transfer address */
257: #define M_SC_ODDBC 0x0002 /* Odd byte count */
258: #define M_SC_NXM 0x0003 /* Non-existent memory */
259: #define M_SC_MPAR 0x0004 /* Host memory parity error */
260: #define M_SC_IVPTE 0x0005 /* Invalid Page Table Entry (UQSSP) */
261: #define M_SC_IVBFN 0x0006 /* Invalid buffer name */
262: #define M_SC_BLENV 0x0007 /* Buffer length violation */
263: #define M_SC_ACVIO 0x0008 /* Access violation */
264:
265: /*
266: * Controller error sub-codes
267: */
268: #define M_SC_HDETO 0x0000 /* Host detected controller timeout */
269: #define M_SC_DLATE 0x0001 /* Data late (SERDES) error */
270: #define M_SC_EDCER 0x0002 /* EDC error */
271: #define M_SC_DTSTR 0x0003 /* Data structure error */
272: #define M_SC_IEDC 0x0004 /* Internal EDC error */
273: #define M_SC_LACIN 0x0005 /* LESI adaptor card input error */
274: #define M_SC_LACOU 0x0006 /* LESI adaptor card output error */
275: #define M_SC_LACCB 0x0007 /* LESI adaptor card cable not in place */
276: #define M_SC_OVRUN 0x0008 /* Controller overrun or underrun */
277: #define M_SC_MEMER 0x0009 /* Controller memory error */
278:
279: /*
280: * Drive error sub-codes
281: */
282: #define M_SC_CMDTO 0x0001 /* SDI command timed out */
283: #define M_SC_XMSER 0x0002 /* Controller-detected transmission error */
284: #define M_SC_MISSK 0x0003 /* Positioner error (mis-seek) */
285: #define M_SC_RWRDY 0x0004 /* Lost read/write ready between transfers */
286: #define M_SC_CLKDO 0x0005 /* Drive clock dropout */
287: #define M_SC_RXRDY 0x0006 /* Lost receiver ready between sectors */
288: #define M_SC_DRDET 0x0007 /* Drive-detected error */
289: #define M_SC_PULSE 0x0008 /* Ctlr-detected pulse/state parity error */
290: #define M_SC_PRTCL 0x000a /* Controller detected protocol error */
291: #define M_SC_FLINI 0x000b /* Drive failed initialization */
292: #define M_SC_IGINI 0x000c /* Drive ignored initialization */
293: #define M_SC_RRCOL 0x000d /* Receiver ready collision */
294:
295: /*
296: * Informational event only subcodes
297: */
298: #define M_SC_IQUAL 0x0001 /* Media Quality Log */
299: #define M_SC_ISTAT 0x0002 /* Unload, spin down statistics */
300:
301: #endif /* notnow */
302:
303: /*
304: * Error Log message format codes. Many of these are ifdef'd out so as to
305: * not overload the C preprocessor. The symbols themselves are not used by
306: * the kernel but are very handy to have when deciphering datagrams logged
307: * to the console or the messages file.
308: */
309: #define M_FM_CNTERR 0 /* Controller error */
310: #define M_FM_BUSADDR 1 /* Host memory access error */
311: #define M_FM_DISKTRN 2 /* Disk transfer error (D) */
312: #define M_FM_SDI 3 /* SDI errors */
313: #define M_FM_SMLDSK 4 /* Small disk errors */
314: #define M_FM_TAPETRN 5 /* Tape transfer error (T) */
315: #define M_FM_STIERR 6 /* STI communication or command failure (T) */
316: #define M_FM_STIDEL 7 /* STI drive error log (T) */
317: #define M_FM_STIFEL 0x8 /* STI formatter error log (T) */
318: #ifdef notnow
319: #define M_FM_REPLACE 0x9 /* Bad block replacement attempt */
320: #define M_FM_LDRERR 0xa /* Media loader errors */
321: #define M_FM_IBMSENSE 0xb /* Sense data error log (T) */
322: #endif
323:
324: /*
325: * Error Log message flags
326: */
327: #define M_LF_SUCC 0x80 /* Operation successful */
328: #define M_LF_CONT 0x40 /* Operation continuing */
329: #ifdef notnow
330: #define M_LF_BBR 0x20 /* Bad block replacement attempt */
331: #define M_LF_RPLER 0x10 /* Error during replacement */
332: #define M_LF_INFO 0x02 /* Informational */
333: #endif
334: #define M_LF_SQNRS 0x01 /* Sequence number reset */
335:
336: /*
337: * Tape Format Flag Values
338: */
339: #define M_TF_MASK 0x00ff /* Density bits */
340: #define M_TF_CODE 0x0100 /* Format code multiplier */
341: #define M_TF_800 0x01 /* NRZI 800 bpi */
342: #define M_TF_PE 0x02 /* Phase Encoded 1600 bpi */
343: #define M_TF_GCR 0x04 /* Group Code Recording 6250 bpi */
344: #define M_TF_BLK 0x08 /* Cartridge Block Mode */
345:
346: #ifdef notnow
347: /*
348: * Define a few of the common controller and drive types for reference but
349: * don't actually force the preprocessor to handle even more defines.
350: */
351: #define M_CM_UDA50 2
352: #define M_CM_TU81 5
353: #define M_CM_UDA50A 6
354: #define M_CM_TK50 9
355: #define M_CM_TQK50 9
356: #define M_CM_TK70 14
357: #define M_CM_TQK70 14
358: #define M_CM_RQDX3 19
359: #endif
360:
361: #endif /* _MSCP_COMMON_H_ */
Defined struct's
defined in line
12; used 12 times
Defined macros
M_ST_SUCC
defined in line
138; used 26 times
- in /usr/src/sys/pdpstand/ra.c line
179
- in /usr/src/sys/pdpstand/tmscp.c line
248
- in /usr/src/sys/pdpuba/ra.c line
1049,
1055,
1073,
1148,
1387
- in /usr/src/sys/pdpuba/tmscp.c line
772,
1226,
1243,
1422,
1459,
1490-1499(5),
1660,
1690,
1712,
1732,
1745,
1764,
1808,
1864
- in /usr/src/sys/pdpuba/tmscpdump.c line
151
Usage of this include