1: /* @(#)tmscp.h 7.1 (Berkeley) 6/5/86 */
2:
3: /*
4: * @(#)tmscp.h 1.3 10/21/85
5: * Definitions for the Tape Mass Storage Control Protocol
6: */
7:
8: /****************************************************************
9: * *
10: * Licensed from Digital Equipment Corporation *
11: * Copyright (c) *
12: * Digital Equipment Corporation *
13: * Maynard, Massachusetts *
14: * 1985, 1986 *
15: * All rights reserved. *
16: * *
17: * The Information in this software is subject to change *
18: * without notice and should not be construed as a commitment *
19: * by Digital Equipment Corporation. Digital makes no *
20: * representations about the suitability of this software for *
21: * any purpose. It is supplied "As Is" without expressed or *
22: * implied warranty. *
23: * *
24: * If the Regents of the University of California or its *
25: * licensees modify the software in a manner creating *
26: * diriviative copyright rights, appropriate copyright *
27: * legends may be placed on the drivative work in addition *
28: * to that set forth above. *
29: * *
30: ****************************************************************
31: *
32: * Modification history: /sys/vax/tmscp.h
33: *
34: * 18-Oct-85 - afd
35: * Added: defines for tape format (density) flag values.
36: *
37: * 18-Jul-85 - afd
38: * Added: #define M_UF_WBKNV 0000100
39: * for write back (which enables cache).
40: ************************************************************************/
41:
42:
43: /*
44: * Control message opcodes
45: */
46: #define M_OP_ABORT 0001 /* Abort command */
47: #define M_OP_GTCMD 0002 /* Get command status command */
48: #define M_OP_GTUNT 0003 /* Get unit status command */
49: #define M_OP_STCON 0004 /* Set controller characteristics command */
50: #define M_OP_AVAIL 0010 /* Available command */
51: #define M_OP_ONLIN 0011 /* Online command */
52: #define M_OP_STUNT 0012 /* Set unit characteristics command */
53: #define M_OP_DTACP 0013 /* Determine access paths command */
54: #define M_OP_ACCES 0020 /* Access command */
55: #define M_OP_CMPCD 0021 /* Compare controller data command */
56: #define M_OP_ERASE 0022 /* Erase command */
57: #define M_OP_FLUSH 0023 /* Flush command */
58: #define M_OP_ERGAP 0026 /* Erase gap command */
59: #define M_OP_COMP 0040 /* Compare host data command */
60: #define M_OP_READ 0041 /* Read command */
61: #define M_OP_WRITE 0042 /* Write command */
62: #define M_OP_WRITM 0044 /* Write tape mark command */
63: #define M_OP_REPOS 0045 /* Reposition command */
64: #define M_OP_AVATN 0100 /* Available attention message */
65: #define M_OP_DUPUN 0101 /* Duplicate unit number attention message */
66: #define M_OP_ACPTH 0102 /* Access path attention message */
67: #define M_OP_END 0200 /* End message flag */
68:
69:
70: /*
71: * Generic command modifiers
72: */
73: #define M_MD_COMP 0040000 /* Compare */
74: #define M_MD_CLSEX 0020000 /* Clear serious exception */
75: #define M_MD_SECOR 0001000 /* Suppress error correction */
76: #define M_MD_SEREC 0000400 /* Suppress error recovery */
77: #define M_MD_STWRP 0000004 /* Set write protect */
78: #define M_MD_ALLCD 0000002 /* All class drivers */
79: #define M_MD_NXUNT 0000001 /* Next unit */
80:
81: /*
82: * TMSCP command modifiers
83: */
84: #define M_MD_DLEOT 0000200 /* Delete LEOT */
85: #define M_MD_IMMED 0000100 /* Immediate completion */
86: #define M_MD_EXCAC 0000040 /* Exclusive access */
87: #define M_MD_UNLOD 0000020 /* Unload */
88: #define M_MD_REVRS 0000010 /* reverse */
89: #define M_MD_OBJCT 0000004 /* object count */
90: #define M_MD_REWND 0000002 /* rewind */
91:
92: /*
93: * End message flags
94: */
95: #define M_EF_ERLOG 0040 /* Error log generated */
96: #define M_EF_SEREX 0020 /* Serious exception */
97: #define M_EF_EOT 0010 /* End of tape encountered */
98: #define M_EF_PLS 0004 /* Position lost */
99:
100:
101: /*
102: * Controller flags
103: */
104: #define M_CF_ATTN 0200 /* Enable attention messages */
105: #define M_CF_MISC 0100 /* Enable miscellaneous error log messages */
106: #define M_CF_OTHER 0040 /* Enable other host's error log messages */
107: #define M_CF_THIS 0020 /* Enable this host's error log messages */
108:
109:
110: /*
111: * Unit flags
112: */
113: #define M_UF_WRTPH 0020000 /* Write protect (hardware) */
114: #define M_UF_WRTPS 0010000 /* Write protect (software or volume) */
115: #define M_UF_WBKNV 0000100 /* Write back (enables cache) */
116: #define M_UF_VSMSU 0000040 /* Variable speed mode suppression */
117: #define M_UF_VARSP 0000020 /* Variable speed unit */
118: #define M_UF_CMPWR 0000002 /* Compare writes */
119: #define M_UF_CMPRD 0000001 /* Compare reads */
120:
121:
122: /*
123: * Status codes
124: */
125: #define M_ST_MASK 037 /* Status code mask */
126: #define M_ST_SUCC 000 /* Success */
127: #define M_ST_ICMD 001 /* Invalid command */
128: #define M_ST_ABRTD 002 /* Command aborted */
129: #define M_ST_OFFLN 003 /* Unit offline */
130: #define M_ST_AVLBL 004 /* Unit available */
131: #define M_ST_WRTPR 006 /* Write protected */
132: #define M_ST_COMP 007 /* Compare error */
133: #define M_ST_DATA 010 /* Data error */
134: #define M_ST_HSTBF 011 /* Host buffer access error */
135: #define M_ST_CNTLR 012 /* Controller error */
136: #define M_ST_DRIVE 013 /* Drive error */
137: #define M_ST_FMTER 014 /* Formatter error */
138: #define M_ST_BOT 015 /* BOT encountered */
139: #define M_ST_TAPEM 016 /* Tape mark encountered */
140: #define M_ST_RDTRN 020 /* Record data truncated */
141: #define M_ST_PLOST 021 /* Position lost */
142: #define M_ST_SEX 022 /* Serious exception */
143: #define M_ST_LED 023 /* LEOT detected */
144: #define M_ST_DIAG 037 /* Message from an internal diagnostic */
145:
146: /*
147: * An MSCP packet
148: */
149:
150: struct mscp {
151: struct mscp_header mscp_header;/* device specific header */
152: long mscp_cmdref; /* command reference number */
153: short mscp_unit; /* unit number */
154: short mscp_xxx1; /* unused */
155: u_char mscp_opcode; /* opcode */
156: u_char mscp_flags; /* end message flags */
157: short mscp_modifier; /* modifiers */
158: union {
159: struct {
160: long Mscp_bytecnt; /* byte count */
161: long Mscp_buffer; /* buffer descriptor */
162: long Mscp_mapbase; /* physical addr of map registers */
163: long Mscp_xxx2; /* unused */
164: long Mscp_lbn; /* logical block number */
165: long Mscp_xxx4; /* unused */
166: long *Mscp_dscptr; /* pointer to descriptor (software) */
167: long Mscp_sftwds[17];/* software words, padding */
168: } mscp_generic;
169: struct {
170: short Mscp_version; /* MSCP version */
171: short Mscp_cntflgs; /* controller flags */
172: short Mscp_hsttmo; /* host timeout */
173: short Mscp_usefrac; /* use fraction */
174: quad Mscp_time; /* time and date */
175: long Mscp_cntdep; /* controller dependent parameters */
176: } mscp_setcntchar;
177: struct {
178: short Mscp_multunt; /* multi-unit code */
179: short Mscp_unitflgs; /* unit flags */
180: long Mscp_hostid; /* host identifier */
181: quad Mscp_unitid; /* unit identifier */
182: long Mscp_mediaid; /* media type identifier */
183: short Mscp_format; /* format (tape density) */
184: short Mscp_speed; /* tape speed = (ips * bpi) /1000 */
185: short Mscp_fmtmenu; /* format menu */
186: short Mscp_group; /* group size */
187: short Mscp_cylinder; /* cylinder size */
188: short Mscp_xxx3; /* reserved */
189: short Mscp_rctsize; /* RCT table size */
190: char Mscp_rbns; /* RBNs / track */
191: char Mscp_rctcpys; /* RCT copies */
192: } mscp_getunitsts;
193: } mscp_un;
194: short mscp_fil1;
195: short mscp_fil2;
196: short mscp_fil3;
197: };
198:
199: #define mscp_msglen (sizeof (struct mscp) - sizeof(struct mscp_header))
200:
201: /*
202: * generic packet
203: */
204:
205: #define mscp_bytecnt mscp_un.mscp_generic.Mscp_bytecnt
206: #define mscp_buffer mscp_un.mscp_generic.Mscp_buffer
207: #define mscp_mapbase mscp_un.mscp_generic.Mscp_mapbase
208: #define mscp_lbn mscp_un.mscp_generic.Mscp_lbn
209: #define mscp_dscptr mscp_un.mscp_generic.Mscp_dscptr
210: #define mscp_sftwds mscp_un.mscp_generic.Mscp_sftwds
211: #define mscp_status mscp_modifier
212:
213: /*
214: * Abort / Get Command Status packet
215: */
216:
217: #define mscp_outref mscp_bytecnt
218:
219: /*
220: * Set Controller Characteristics packet
221: */
222:
223: #define mscp_version mscp_un.mscp_setcntchar.Mscp_version
224: #define mscp_cntflgs mscp_un.mscp_setcntchar.Mscp_cntflgs
225: #define mscp_hsttmo mscp_un.mscp_setcntchar.Mscp_hsttmo
226: #define mscp_usefrac mscp_un.mscp_setcntchar.Mscp_usefrac
227: #define mscp_time mscp_un.mscp_setcntchar.Mscp_time
228: #define mscp_cntdep mscp_un.mscp_setcntchar.Mscp_cntdep
229:
230: /*
231: * Reposition command packet fields
232: */
233:
234: #define mscp_reccnt mscp_bytecnt /* record/object count */
235: #define mscp_tmkcnt mscp_buffer /* tape mark count */
236:
237: /*
238: * Get Unit Status end packet
239: */
240:
241: #define mscp_multunt mscp_un.mscp_getunitsts.Mscp_multunt
242: #define mscp_unitflgs mscp_un.mscp_getunitsts.Mscp_unitflgs
243: #define mscp_hostid mscp_un.mscp_getunitsts.Mscp_hostid
244: #define mscp_unitid mscp_un.mscp_getunitsts.Mscp_unitid
245: #define mscp_mediaid mscp_un.mscp_getunitsts.Mscp_mediaid
246: #define mscp_format mscp_un.mscp_getunitsts.Mscp_format /* density:0=high */
247: #define mscp_speed mscp_un.mscp_getunitsts.Mscp_speed /* (ips*bpi)/1000 */
248: #define mscp_un.mscp_getunitsts.Mscp_fmtmenu
249:
250: /*
251: * Online / Set Unit Characteristics end packet
252: */
253:
254: #define mscp_maxwrt mscp_dscptr /* max write byte count */
255: #define mscp_noiserec mscp_cylinder /* noise record */
256:
257: /*
258: * Set Controller Characteristics end packet
259: */
260:
261: #define mscp_cnttmo mscp_hsttmo /* controller timeout */
262: #define mscp_cntcmdl mscp_usefrac /* controller soft & hardware version */
263: #define mscp_cntid mscp_unitid /* controller id */
264:
265:
266: /*
267: * Error Log message format codes
268: */
269: #define M_FM_CNTERR 0 /* Controller error */
270: #define M_FM_BUSADDR 1 /* Host memory access error */
271: #define M_FM_TAPETRN 5 /* Tape transfer error */
272: #define M_FM_STIERR 6 /* STI communication or command failure */
273: #define M_FM_STIDEL 7 /* STI drive error log */
274: #define M_FM_STIFEL 010 /* STI formatter error log */
275:
276: /*
277: * Error Log message flags
278: */
279: #define M_LF_SUCC 0200 /* Operation successful */
280: #define M_LF_CONT 0100 /* Operation continuing */
281: #define M_LF_SQNRS 0001 /* Sequence number reset */
282:
283: /*
284: * Tape Format Flag Values
285: */
286: #define M_TF_800 001 /* NRZI 800 bpi */
287: #define M_TF_PE 002 /* Phase Encoded 1600 bpi */
288: #define M_TF_GCR 004 /* Group Code Recording 6250 bpi */
289: #define M_TF_BLK 010 /* Cartridge Block Mode */
290:
291: /*
292: * MSCP Error Log packet
293: *
294: * NOTE: MSCP packet must be padded to this size.
295: */
296:
297: struct mslg {
298: struct mscp_header mslg_header;/* device specific header */
299: long mslg_cmdref; /* command reference number */
300: short mslg_unit; /* unit number */
301: short mslg_seqnum; /* sequence number */
302: u_char mslg_format; /* format */
303: u_char mslg_flags; /* error log message flags */
304: short mslg_event; /* event code */
305: quad mslg_cntid; /* controller id */
306: u_char mslg_cntsvr; /* controller software version */
307: u_char mslg_cnthvr; /* controller hardware version */
308: short mslg_multunt; /* multi-unit code */
309: quad mslg_unitid; /* unit id */
310: u_char mslg_unitsvr; /* unit software version */
311: u_char mslg_unithvr; /* unit hardware version */
312: short mslg_group; /* group; retry + level */
313: long mslg_position; /* position (object count) */
314: u_char mslg_fmtsvr; /* formatter software version */
315: u_char mslg_fmthvr; /* formatter hardware version */
316: short mslg_xxx2; /* unused */
317: char mslg_stiunsucc[62]; /* STI status information */
318: };
319:
320: #define mslg_busaddr mslg_unitid.val[0]
321: #define mslg_sdecyl mslg_group
Defined struct's
mscp
defined in line
150; used 34 times
- in /usr/src/sys/stand/tmscp.c line
77-83(6),
95(2),
204-208(4),
266(2)
- in /usr/src/sys/vaxuba/tmscp.c line
174-175(4),
261(2),
343(2),
451(2),
680(2),
892-896(4),
999(2),
1317(2)
mslg
defined in line
297; used 6 times
Defined macros
defined in line
248; used 1 times
Usage of this include