1: /* @(#)tmscp.h 1.2 (2.11BSD) 1998/2/23 */
2:
3: /****************************************************************
4: * *
5: * Licensed from Digital Equipment Corporation *
6: * Copyright (c) *
7: * Digital Equipment Corporation *
8: * Maynard, Massachusetts *
9: * 1985, 1986 *
10: * All rights reserved. *
11: * *
12: * The Information in this software is subject to change *
13: * without notice and should not be construed as a commitment *
14: * by Digital Equipment Corporation. Digital makes no *
15: * representations about the suitability of this software for *
16: * any purpose. It is supplied "As Is" without expressed or *
17: * implied warranty. *
18: * *
19: * If the Regents of the University of California or its *
20: * licensees modify the software in a manner creating *
21: * diriviative copyright rights, appropriate copyright *
22: * legends may be placed on the drivative work in addition *
23: * to that set forth above. *
24: * *
25: ****************************************************************
26: *
27: * Modification history:
28: *
29: * 23-Feb-98 - sms
30: * The version number and revision history were accidentally omitted
31: * when update #401 was prepared (29-Jan-98).
32: *
33: * Rearrange and clarify tmscp packet structure. It was apparently
34: * possible for the 'mscp_dscptr' field to be overwritten with status
35: * information by the controller. The 'm_filler' field was not used,
36: * no longer needed and in fact was just wasting 6 bytes of space. It
37: * was removed. The per controller structure is now 1864 bytes instead
38: * of 1896.
39: *
40: * 12-Dec-95 - sms
41: * Begin process of moving definitions common to MSCP and TMSCP into
42: * a different include file. Define additional flags for the (heavily)
43: * revised TMSCP driver.
44: *
45: * 18-Oct-85 - afd
46: * Added: defines for tape format (density) flag values.
47: *
48: * 18-Jul-85 - afd
49: * Added: #define M_UF_WBKNV 0000100
50: * for write back (which enables cache).
51: ************************************************************************/
52:
53:
54: #include <machine/mscp_common.h>
55:
56: /*
57: * A TMSCP packet.
58: *
59: * WARNING! If this structure grows be sure to change the '1864' in the
60: * file pdp/machdep2.c!!!
61: */
62:
63: struct mscp {
64: struct mscp_header mscp_header;/* device specific header */
65: u_short mscp_cmdref; /* command reference number */
66: u_short m_xxx0; /* filler */
67: short mscp_unit; /* unit number */
68: short m_xxx1; /* unused */
69: u_char mscp_opcode; /* opcode */
70: u_char mscp_flags; /* end message flags */
71: short mscp_modifier; /* modifiers */
72: union {
73: char FILLER[94]; /* sizeof (mslg) after 16 byte header */
74: struct {
75: u_short bytecnt; /* byte count (low order) */
76: u_short zzz2; /* 64kb max for pdp-11 (high order) */
77: u_short buf_l; /* buffer descriptor low word */
78: u_short buf_h; /* buffer descriptor high word */
79: long xxx2[2]; /* unused */
80: u_short lbn_l; /* logical block number low word */
81: u_short lbn_h; /* logical block number high word */
82: } gen;
83: struct {
84: short version; /* MSCP version */
85: short cntflgs; /* controller flags */
86: short hsttmo; /* host timeout */
87: short usefrac; /* use fraction */
88: u_long time[2]; /* time and date */
89: long cntdep; /* controller dependent parameters */
90: } scc;
91: struct {
92: short multunt; /* multi-unit code */
93: short unitflgs; /* unit flags */
94: long hostid; /* host identifier */
95: u_long unitid[2]; /* unit identifier */
96: long mediaid; /* media type identifier */
97: short format; /* format (tape density) */
98: short speed; /* tape speed = (ips * bpi) /1000 */
99: short fmtmenu; /* format menu */
100: u_short maxwtrec; /* max write byte count */
101: u_short noiserec; /* max noise record size */
102: u_short pad; /* reserved */
103: } gtu;
104: /*
105: * Reposition end message. Note: the shorts are not swapped in any
106: * of the longs.
107: */
108: struct {
109: u_long rcskiped; /* records skipped */
110: u_long tmskiped; /* tapemarks skipped */
111: u_long pad[2]; /* not used */
112: u_long position; /* tape position */
113: } rep_em;
114: } un;
115: long *mscp_dscptr; /* pointer to descriptor (software) */
116: };
117:
118: /*
119: * generic packet
120: */
121:
122: #define mscp_zzz2 un.gen.zzz2
123: #define mscp_bytecnt un.gen.bytecnt
124: #define mscp_buffer_h un.gen.buf_h
125: #define mscp_buffer_l un.gen.buf_l
126: #define mscp_lbn_h un.gen.lbn_h
127: #define mscp_lbn_l un.gen.lbn_l
128: #define mscp_status mscp_modifier
129: #define mscp_endcode mscp_opcode
130: #define mscp_position un.rep_em.position
131:
132: /*
133: * Abort / Get Command Status packet
134: */
135:
136: #define mscp_outref mscp_bytecnt
137:
138: /*
139: * Set Controller Characteristics packet
140: */
141:
142: #define mscp_version un.scc.version
143: #define mscp_cntflgs un.scc.cntflgs
144: #define mscp_hsttmo un.scc.hsttmo
145: #define mscp_time un.scc.time
146: #define mscp_cntdep un.scc.cntdep
147:
148: /*
149: * Reposition command packet fields
150: */
151:
152: #define mscp_reccnt mscp_bytecnt /* record/object count */
153: #define mscp_tmkcnt mscp_buffer_l /* tape mark count */
154:
155: /*
156: * Get Unit Status end packet
157: */
158:
159: #define mscp_multunt un.gtu.multunt
160: #define mscp_unitflgs un.gtu.unitflgs
161: #define mscp_hostid un.gtu.hostid
162: #define mscp_unitid un.gtu.unitid
163: #define mscp_mediaid un.gtu.mediaid
164: #define mscp_format un.gtu.format /* density:0=high */
165: #define mscp_speed un.gtu.speed /* (ips*bpi)/1000 */
166: #define un.gtu.fmtmenu
167:
168: /*
169: * Set Controller Characteristics end packet
170: */
171:
172: #define mscp_cnttmo mscp_hsttmo /* controller timeout */
173: #define mscp_cntcmdl mscp_usefrac /* controller soft & hardware version */
174: #define mscp_cntid mscp_unitid /* controller id */
175:
176: /*
177: * MSCP Error Log packet
178: *
179: * NOTE: MSCP packet must be padded to this size.
180: */
181:
182: struct mslg {
183: struct mscp_header mslg_header;/* device specific header */
184: long mslg_cmdref; /* command reference number */
185: short mslg_unit; /* unit number */
186: short mslg_seqnum; /* sequence number */
187: u_char mslg_format; /* format */
188: u_char mslg_flags; /* error log message flags */
189: short mslg_event; /* event code */
190: u_char me_cntid[8]; /* controller id */
191: u_char me_cntsvr; /* controller software version */
192: u_char me_cnthvr; /* controller hardware version */
193: short mslg_multunt; /* multi-unit code */
194: u_long me_unitid[2]; /* unit id */
195: u_char me_unitsvr; /* unit software version */
196: u_char me_unithvr; /* unit hardware version */
197: short mslg_group; /* group; retry + level */
198: long mslg_position; /* position (object count) */
199: u_char me_fmtsvr; /* formatter software version */
200: u_char me_fmthvr; /* formatter hardware version */
201: short mslg_xxx2; /* unused */
202: char mslg_stiunsucc[62]; /* STI status information */
203: };
204:
205: #define mslg_busaddr me_unitid.val[0]
206: #define mslg_sdecyl mslg_group
207:
208: /*
209: * These definitions were moved here where they could be included by
210: * both the main driver and the tape crash dump module.
211: */
212:
213: /*
214: * Per controller information structure.
215: */
216: struct tmscp_softc {
217: struct tmscpdevice *sc_addr; /* controller CSR address */
218: short sc_state; /* state of controller */
219: short sc_ivec; /* interrupt vector address */
220: short sc_unit; /* CONTROLLER number - NOT drive unit # */
221: short sc_credits; /* transfer credits */
222: short sc_lastcmd; /* pointer into command ring */
223: short sc_lastrsp; /* pointer into response ring */
224: struct buf sc_cmdbuf; /* internal command buffer */
225: struct buf sc_ctab; /* controller queue */
226: struct buf sc_wtab; /* I/O wait queue for controller */
227: struct tmscp *sc_com; /* communications area pointer */
228: struct tms_info *sc_drives[4]; /* pointers to per drive info */
229: };
230:
231: /*
232: * The TMSCP packet. This is the same as MSCP except for the leading 't'
233: * in the structure member names. Eventually the two drivers will use a
234: * single definition.
235: */
236: struct tmscp {
237: struct tmscpca tmscp_ca; /* communications area */
238: struct mscp tmscp_rsp[NRSP]; /* response packets */
239: struct mscp tmscp_cmd[NCMD]; /* command packets */
240: }; /* 1864 bytes per controller! */
241:
242: /*
243: * Per drive information structure.
244: */
245: struct tms_info {
246: long tms_type; /* Drive type field */
247: int tms_resid; /* residual from last xfer */
248: u_char tms_endcode; /* last command endcode */
249: u_char tms_flags; /* flags visible to user programs */
250: u_short tms_status; /* Command status from last command */
251: u_short Tflags; /* Internal driver flags */
252: short tms_fmtmenu; /* the unit's format (density) menu */
253: short tms_unitflgs; /* unit flag parameters */
254: short tms_format; /* unit's current format (density) */
255: long tms_position; /* Drive position */
256: struct buf tms_dtab; /* I/O tape drive queues */
257: };
258:
259: /* Bits in minor device */
260: #define TMSUNIT(dev) (minor(dev)&03)
261: #define TMSCTLR(dev) ((minor(dev) >> 6) & 3)
262: #define TMSDENS(dev) ((minor(dev) >> 3) & 3)
263: #define FMTMASK (M_TF_800|M_TF_PE|M_TF_GCR) /* = 7 */
264:
265: #define T_NOREWIND 04
Defined struct's
mscp
defined in line
63; used 72 times
- in line 238-239(4)
- in /usr/src/sys/pdpstand/tmscp.c line
194(2),
275(2)
- in /usr/src/sys/pdpuba/tmscp.c line
363(2),
460(2),
625(2),
863(2),
880-887(6),
894-898(4),
974(2),
1191(2),
1197(2),
1510(2),
1544(2),
1568(2),
1587(2),
1600(2),
1617(2),
1632(2),
1653(2),
1682(2),
1706(2),
1723(2),
1739(2),
1756(2),
1799(2),
1824(2),
1853(2)
- in /usr/src/sys/pdpuba/tmscpdump.c line
39(2),
126(2),
135-136(4)
mslg
defined in line
182; used 4 times
tms_info
defined in line
245; used 53 times
- in line 228
- in /usr/src/sys/pdpuba/tmscp.c line
285(2),
406-409(4),
624(2),
759(2),
976(2),
1192(2),
1340(2),
1409(2),
1486(2),
1514(2),
1549(2),
1573(2),
1591(2),
1599(2),
1621(2),
1631(2),
1656(2),
1685(2),
1709(2),
1726(2),
1742(2),
1759(2),
1803(2),
1827(2),
1856(2)
tmscp
defined in line
236; used 23 times
tmscp_softc
defined in line
216; used 64 times
- in /usr/src/sys/pdpuba/tmscp.c line
284(2),
370(2),
390(2),
432(2),
458(2),
623(2),
758(2),
861(2),
896(2),
936(2),
972(2),
1188(2),
1339(2),
1407(2),
1511(2),
1545(2),
1569(2),
1588(2),
1618(2),
1630(2),
1654(2),
1683(2),
1707(2),
1724(2),
1740(2),
1757(2),
1800(2),
1825(2),
1854(2)
- in /usr/src/sys/pdpuba/tmscpdump.c line
32(2),
38(2),
123(2)
Defined macros
defined in line
166; used 1 times
Usage of this include