1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)mtreg.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: /*
10: * TU78 registers.
11: */
12:
13: struct mtdevice {
14: int mtcs; /* control status register */
15: int mter; /* error register */
16: int mtca; /* command address, rec cnt, skp cnt reg */
17: int mtmr1; /* maintenance register */
18: int mtas; /* attention summary register */
19: int mtbc; /* byte count register */
20: int mtdt; /* drive type register */
21: int mtds; /* drive status register */
22: int mtsn; /* serial number register */
23: int mtmr2; /* maintenance register */
24: int mtmr3; /* maintenance register */
25: int mtner; /* non-data transfer error register */
26: int mtncs[4]; /* non-data transfer command registers */
27: int mtia; /* internal address */
28: int mtid; /* internal data */
29: };
30:
31: /* mtcs */
32: #define MT_GO 000001 /* go bit */
33: #define MT_NOOP 000002 /* no operation */
34: #define MT_UNLOAD 000004 /* unload tape */
35: #define MT_REW 000006 /* rewind */
36: #define MT_SENSE 000010 /* sense */
37: #define MT_DSE 000012 /* data security erase */
38: #define MT_WTMPE 000014 /* write phase encoded tape mark */
39: #define MT_WTM MT_WTMPE /* generic write tape mark */
40: #define MT_WTMGCR 000016 /* write GCR tape mark */
41: #define MT_SFORW 000020 /* space forward record */
42: #define MT_SREV 000022 /* space reverse record */
43: #define MT_SFORWF 000024 /* space forward file */
44: #define MT_SREVF 000026 /* space reverse file */
45: #define MT_SFORWE 000030 /* space forward either */
46: #define MT_SREVE 000032 /* space reverse either */
47: #define MT_ERGPE 000034 /* erase tape, set PE */
48: #define MT_ERASE MT_ERGPE /* generic erase tape */
49: #define MT_ERGGCR 000036 /* erase tape, set GCR */
50: #define MT_CLSPE 000040 /* close file PE */
51: #define MT_CLS MT_CLSPE /* generic close file */
52: #define MT_CLSGCR 000042 /* close file GCR */
53: #define MT_SLEOT 000044 /* space to logical EOT */
54: #define MT_SFLEOT 000046 /* space forward file, stop on LEOT */
55: #define MT_WCHFWD 000050 /* write check forward */
56: #define MT_WCHREV 000056 /* write check reverse */
57: #define MT_WRITEPE 000060 /* write phase encoded */
58: #define MT_WRITE MT_WRITEPE /* generic write */
59: #define MT_WRITEGCR 000062 /* write group coded */
60: #define MT_READ 000070 /* read forward */
61: #define MT_EXSNS 000072 /* read extended sense error log */
62: #define MT_READREV 000076 /* read reverse */
63: #define MT_GCR 000002 /* make generic ops GCR ops */
64:
65: /* mtds */
66: #define MTDS_RDY 0100000 /* tape ready */
67: #define MTDS_PRES 0040000 /* tape unit has power */
68: #define MTDS_ONL 0020000 /* online */
69: #define MTDS_REW 0010000 /* tape rewinding */
70: #define MTDS_PE 0004000 /* tape set for phase encoded */
71: #define MTDS_BOT 0002000 /* tape at BOT */
72: #define MTDS_EOT 0001000 /* tape at EOT */
73: #define MTDS_FPT 0000400 /* write protected */
74: #define MTDS_AVAIL 0000200 /* unit available */
75: #define MTDS_SHR 0000100 /* unit is shared */
76: #define MTDS_MAINT 0000040 /* maintenance mode */
77: #define MTDS_DSE 0000020 /* DSE in progress */
78:
79: #define MTDS_BITS \
80: "\10\20RDY\17PRES\16ONL\15REW\14PE\13BOT\12EOT\11FPT\10AVAIL\
81: \7SHR\6MAINT\5DSE"
82:
83: /* mter */
84: #define MTER_INTCODE 0377 /* mask for interrupt code */
85: #define MTER_FAILCODE 0176000 /* failure code */
86:
87: /* interrupt codes */
88: #define MTER_DONE 001 /* operation complete */
89: #define MTER_TM 002 /* unexpected tape mark */
90: #define MTER_BOT 003 /* unexpected BOT detected */
91: #define MTER_EOT 004 /* tape positioned beyond EOT */
92: #define MTER_LEOT 005 /* unexpected LEOT detected */
93: #define MTER_NOOP 006 /* no-op completed */
94: #define MTER_RWDING 007 /* rewinding */
95: #define MTER_FPT 010 /* write protect error */
96: #define MTER_NOTRDY 011 /* not ready */
97: #define MTER_NOTAVL 012 /* not available */
98: #define MTER_OFFLINE 013 /* offline */
99: #define MTER_NONEX 014 /* unit does not exist */
100: #define MTER_NOTCAP 015 /* not capable */
101: #define MTER_ONLINE 017 /* tape came online */
102: #define MTER_LONGREC 020 /* long tape record */
103: #define MTER_SHRTREC 021 /* short tape record */
104: #define MTER_RETRY 022 /* retry */
105: #define MTER_RDOPP 023 /* read opposite */
106: #define MTER_UNREAD 024 /* unreadable */
107: #define MTER_ERROR 025 /* error */
108: #define MTER_EOTERR 026 /* EOT error */
109: #define MTER_BADTAPE 027 /* tape position lost */
110: #define MTER_TMFLTA 030 /* TM fault A */
111: #define MTER_TUFLTA 031 /* TU fault A */
112: #define MTER_TMFLTB 032 /* TM fault B */
113: #define MTER_MBFLT 034 /* Massbus fault */
114: #define MTER_KEYFAIL 077 /* keypad entry error */
115:
116: /* mtdt */
117: #define MTDT_NSA 0100000 /* not sector addressed; always 1 */
118: #define MTDT_TAP 0040000 /* tape; always 1 */
119: #define MTDT_MOH 0020000 /* moving head; always 0 */
120: #define MTDT_7CH 0010000 /* 7 channel; always 0 */
121: #define MTDT_DRQ 0004000 /* drive request required */
122: #define MTDT_SPR 0002000 /* slave present; always 1 ??? */
123: /* bit 9 is spare */
124: /* bits 8-0 are formatter/transport type */
125:
126: /* mtid */
127: #define MTID_RDY 0100000 /* controller ready */
128: #define MTID_CLR 0040000 /* controller clear */
129:
130: #define b_repcnt b_bcount
131: #define b_command b_resid
Defined struct's
Defined macros
MTER_FAILCODE
defined in line
85; used 13 times
- in /usr/src/sys/vaxmba/mt.c line
539,
565,
611,
749,
1048,
1081,
1114,
1136,
1171,
1214,
1281,
1393,
1475
MT_GO
defined in line
32; used 11 times
Usage of this include