Commit | Line | Data |
---|---|---|
82bc5dc5 | 1 | /* vxreg.h 1.5 87/01/11 */ |
b56a1465 SL |
2 | |
3 | /* | |
3155ebd2 | 4 | * Vioc hardware interface structure. |
b56a1465 | 5 | */ |
3155ebd2 SL |
6 | struct vxdevice { |
7 | char v_vioc; /* 0 type of interrupt + vioc busy flag */ | |
b56a1465 SL |
8 | char v_hdwre; /* 1 trap, reset, or hard interrupt */ |
9 | char v_vcbsy; /* 2 command busy (set by host) */ | |
3155ebd2 | 10 | char v_vcid; /* 3 command identifier */ |
b56a1465 SL |
11 | short v_vcp[2]; /* 4 command pointer (sent by host) */ |
12 | short v_unused; /* 8 unused */ | |
13 | short v_rspoff; /* a offset into vblock for response buf */ | |
14 | char v_ustat; /* c status */ | |
3155ebd2 | 15 | char v_uqual; /* d interrupt qualifier */ |
b56a1465 | 16 | char v_usdata[0x3E]; /* e unsolicited interrupt data */ |
3155ebd2 SL |
17 | short v_maxxmt; /* 4C max xmit block size */ |
18 | short v_maxsilo; /* 4E max silo size */ | |
19 | char v_ident; /* 50 identifies type of vioc */ | |
20 | char v_fault; /* 51 denotes fault or ready after reset */ | |
21 | short v_dcd; /* 52 bit mask for carr detect by port */ | |
22 | short v_cts; /* 54 bit mask for cts by port */ | |
b56a1465 SL |
23 | short v_dsr; /* 56 bit mask for dsr by port */ |
24 | short v_secrec; /* 58 bit mask for secondary receive */ | |
25 | short v_badport; /* 5a bit mask of failed ports */ | |
26 | char v_portyp[16]; /* 5c type of each port */ | |
b56a1465 SL |
27 | }; |
28 | ||
3155ebd2 | 29 | /* control bits for v_vioc and v_hdwre */ |
fce3c26d SL |
30 | #define V_RESET 0x1 /* cause a vioc reset */ |
31 | #define V_TRP 0x2 /* cause a vioc trap */ | |
32 | #define V_INTR 0x4 /* cause a vioc interrupt */ | |
33 | #define V_ERR 0x80 /* generic error flag */ | |
34 | #define V_BSY 0x80 /* generic busy flag */ | |
35 | #define V_UNBSY 0x80 /* not busy for unsolicited interrupt */ | |
3155ebd2 SL |
36 | |
37 | /* command identifier codes */ | |
fce3c26d SL |
38 | #define VXC_LIDENT 0x0000 /* load ident, set int vectors */ |
39 | #define VXC_XMITDTA 0x0200 /* transmit */ | |
40 | #define VXC_XMITIMM 0x0400 /* xmit immediate */ | |
41 | #define VXC_FDTATOX 0x0300 /* flush data */ | |
42 | #define VXC_LPARAX 0x0600 /* load params */ | |
43 | #define VXC_SNDBRKX 0x0C00 /* send break to port */ | |
44 | #define VXC_MDMCTL 0x1000 /* auto modem control */ | |
3155ebd2 | 45 | /* bisync specific command identifiers */ |
fce3c26d SL |
46 | #define VXC_LPARAX1 0x060a |
47 | #define VXC_MDMCTL1 0x1004 | |
48 | #define VXC_HUNTMD1 0x0804 | |
3155ebd2 SL |
49 | |
50 | /* vioc types returned during config */ | |
fce3c26d SL |
51 | #define VXT_VIOCBOP 0x05 /* vioc-bop */ |
52 | #define VXT_PVIOCX 0x0A /* old connector panel vioc-x */ | |
53 | #define VXT_VIOCX 0x0B /* new connector panel vioc-x */ | |
54 | #define VXT_VIOCB 0x0C /* vioc-bisync */ | |
55 | #define VXT_NEW 0x10 /* new type bit (or'd in) */ | |
3155ebd2 | 56 | |
fce3c26d | 57 | #define VX_BISYNC 0x1 /* bisync flag indicator for bscport */ |
3155ebd2 | 58 | |
82bc5dc5 MK |
59 | /* connector panel types (per port) */ |
60 | #define VXT_NONE 0 /* no connector panel */ | |
61 | #define VXT_8PORT 1 /* 8 port RS-232C */ | |
62 | #define VXT_RS422 2 /* 8 port RS-422 (nonexistent) */ | |
63 | #define VXT_4PORT 3 /* 4 port RS-232 (with DSR/RING) */ | |
64 | #define VXT_PARALLEL 4 /* 4 port panel parallel port */ | |
65 | ||
3155ebd2 | 66 | /* v_fault status values */ |
fce3c26d | 67 | #define VXF_READY 0x55 /* no err in vioc self-initializaton */ |
3155ebd2 | 68 | |
82bc5dc5 MK |
69 | /* line parameters, set with VXC_LPARAX */ |
70 | #define BITS5 0x00 /* 5 bits per character */ | |
71 | #define BITS6 0x80 /* 6 bits per character */ | |
72 | #define BITS7 0x40 /* 7 bits per character */ | |
73 | #define BITS8 0xc0 /* 8 bits per character */ | |
74 | ||
75 | #define VNOPARITY 0x00 /* no parity bit */ | |
76 | #define VODDP 0x01 /* odd parity bit */ | |
77 | #define VEVENP 0x03 /* even parity bit */ | |
78 | ||
79 | #define VSTOP1 0x04 /* 1 stop bit */ | |
80 | #define VSTOP2 0x0c /* 2 stop bit */ | |
81 | ||
82 | #define V19200 0x13 /* 19.2 kbaud */ | |
83 | ||
3155ebd2 | 84 | /* modem control flags */ |
fce3c26d SL |
85 | #define VMOD_ON 1 |
86 | #define VMOD_OFF 0 | |
3155ebd2 | 87 | |
82bc5dc5 MK |
88 | #define V_AUTO 0x00 /* auto control of RTS, uses CTS */ |
89 | #define V_MANUAL 0x80 /* manual control of RTS, ignore CTS */ | |
90 | #define V_DTR_ON 0x02 /* set DTR output */ | |
91 | #define V_DTR_OFF 0x00 /* drop DTR output */ | |
92 | #define V_RTS 0x01 /* set RTS output (manual only) */ | |
3155ebd2 | 93 | |
fce3c26d SL |
94 | #define BRK_CHR 040 /* break character */ |
95 | #define DCD_ON 020 /* */ | |
96 | #define DCD_OFF 010 /* */ | |
97 | #define CTS_ON 004 /* */ | |
98 | #define DSR_ON 0200 /* modem signal states for bisync */ | |
99 | #define DSR_OFF 0100 | |
100 | #define DSR_CHG (DSR_ON|DSR_OFF) | |
3155ebd2 | 101 | |
fce3c26d | 102 | #define VX_SILO 0x800 /* offset to base of silo */ |
3155ebd2 SL |
103 | |
104 | /* input status bits returned in silo */ | |
fce3c26d SL |
105 | #define VX_PE 0x40 /* parity error */ |
106 | #define VX_FE 0x80 /* framing error */ | |
107 | #define VX_RO 0xc0 /* receiver overrun */ | |
3155ebd2 | 108 | |
fce3c26d SL |
109 | #define VRESPLEN 12 |
110 | #define VCMDLEN 64 | |
111 | #define VC_IQLEN 64 /* Interrupt circular queue length */ | |
112 | #define NVCXBUFS 16*3 /* 3 bufs per port per viocx */ | |
113 | #define VC_CMDBUFL NVCXBUFS /* circular cmd (to exec) queue len*/ | |
3155ebd2 SL |
114 | |
115 | struct vcmds { | |
116 | int v_cmdsem; /* # cmds waiting for itrque */ | |
117 | int v_curcnt; /* # cmds in itrque and executing */ | |
118 | caddr_t v_curcmd[VCMDLEN]; /* pointers to cmds being executed */ | |
119 | int v_fill; /* circular fill index */ | |
120 | int v_empty; /* circular empty index */ | |
121 | caddr_t cmdbuf[VC_CMDBUFL]; /* circular cmd (to exec) queue */ | |
122 | int v_itrfill; /* circular intr issue queue fill */ | |
123 | int v_itrempt; /* circular intr issue queue empty */ | |
124 | short v_itrqueu[VC_IQLEN]; /* circular intr issue queue */ | |
125 | }; | |
126 | ||
127 | struct vxcmd { | |
128 | struct vxcmd *c_fwd; | |
129 | short cmd; | |
130 | char par[58]; /* pad to 64 total size */ | |
131 | }; | |
132 | ||
133 | struct vxmit { | |
134 | char line; | |
135 | char bcount; | |
136 | char ostream[6]; | |
137 | }; | |
138 | ||
fce3c26d | 139 | #define SSPEED 13 /* standard speed 9600 bps */ |