|
|
1.1 root 1: /*
2: * BVP (BI VAX port) definitions
3: * used by the NI (DEBNA) driver,
4: * and perhaps eventually by the BVP MSCP port
5: */
6:
7: typedef struct quadque {
8: struct quadque *head, *tail;
9: } quadque;
10:
11: /*
12: * port queue block
13: * one per port;
14: * must be page-aligned
15: */
16: struct pqb {
17: quadque p_cmdq[4]; /* command queues */
18: quadque p_rspq; /* response queue */
19: short p_vector; /* interrupt vector, BR */
20: short p_nodmsk; /* interrupt node mask */
21: long p_nfreeq; /* number of free queues */
22: struct fqb *p_fqb; /* fqp virtual address */
23: char pp_junk0[156];
24: long p_bvplvl; /* BVP protocol version */
25: struct pqb *p_pqb; /* pqb virtual self-pointer */
26: struct bdt *p_bdt; /* bdt virtual address */
27: long p_bdtlen; /* and size */
28: struct pte *p_spt; /* system page table phys addr */
29: long p_sptlen; /* and size */
30: struct pte *p_gpt; /* global page table phys addr */
31: long p_gptlen; /* and size */
32: long p_funcmask; /* ?? */
33: char pp_junk1[24];
34: /* stuff filled in by port after init */
35: short p_maxdg; /* max datagram size */
36: short p_maxmsg; /* max message size */
37: long p_ucodetype;
38: long p_ucodevers;
39: long p_hwtype;
40: long p_vers[3];
41: char p_qelogo[216]; /* `queue entry logout area' */
42: };
43:
44: /*
45: * free queue block
46: */
47: struct fqb {
48: long f_size; /* max size of things in this queue */
49: long f_junk; /* reserved, apparently */
50: quadque f_q; /* the free queue itself */
51: };
52:
53: #define NFREEQ 1
54:
55: /*
56: * buffer descriptor
57: */
58: struct bdt {
59: short b_flags;
60: short b_key;
61: long b_len; /* length of buffer */
62: struct pte *b_pte; /* relevant page table */
63: long b_sw; /* reserved for software */
64: };
65:
66: #define NBDT 1
67:
68: /*
69: * bundle of data for one port
70: * the pqb must be page-aligned;
71: * stick this in a buffer,
72: * which means it must all fit in one
73: */
74: struct bvpdata {
75: struct pqb p;
76: struct fqb f[NFREEQ+1]; /* +1 acct off-by-one mystery in controller */
77: struct bdt b[NBDT];
78: };
79:
80: /*
81: * port registers
82: */
83: struct bvpregs {
84: long ctrl;
85: long stat;
86: long err;
87: long data;
88: /* on NI port only: */
89: long pudr;
90: unsigned char addr[6]; /* ethernet address */
91: };
92:
93: #define MSREGS 0xf0 /* offset to storage port registers */
94: #define NIREGS 0x204 /* offset to NI port registers */
95:
96: /*
97: * control bits
98: */
99: #define PCOWN 0x80 /* port own -- here is a command */
100: #define PCDS 8 /* shift data by eight bits */
101: #define PCINIT 1
102: #define PCENAB 2
103: #define PCCMDQ 6 /* command queue not empty */
104: #define PCFREQ 7 /* free queue not empty */
105:
106: /*
107: * status bits
108: */
109: #define PSOWN 0x80000000 /* port own -- status valid */
110: #define PSSTD 0x20000000 /* self test done */
111: #define PSACC 0x10000000 /* adapter can communicate */
112: #define PSSTAT 0x70000 /* port state: */
113: #define SUNDEF 0x10000 /* undefined */
114: #define SINIT 0x20000 /* initialized */
115: #define SENAB 0x40000 /* enabled */
116: #define PSERR 0x40 /* error summary */
117:
118: /*
119: * BVP packet headers
120: */
121:
122: /*
123: * datagram
124: */
125: struct bvpdg {
126: quadque q; /* queue linkage */
127: long bd_sw0; /* for software */
128: char bd_mbz; /* must be zero */
129: char bd_sts; /* BVP status */
130: char bd_opc; /* BVP opcode */
131: char bd_flag; /* BVP flags */
132: /* datagram header */
133: short bd_len; /* length, starting at next byte */
134: char bd_dgsts; /* datagram status */
135: char bd_sw1; /* software */
136: long bd_sw2; /* software */
137: long bd_ptdb; /* proto type block index */
138: };
139:
140: /*
141: * message
142: */
143: struct bvpmsg {
144: quadque q; /* queue linkage */
145: long bd_sw0; /* for software */
146: char bd_mbz; /* must be zero */
147: char bd_sts; /* BVP status */
148: char bd_opc; /* BVP opcode */
149: char bd_flag; /* BVP flags */
150: /* message header */
151: short bm_len; /* length, from next byte */
152: char bm_opc; /* message opcode */
153: char bm_nists; /* message/NI status */
154: long bm_sw1; /* software */
155: };
156:
157: #define BVPHSIZE 18 /* sizeof(whole packet) == bd_len + BVPHSIZE */
158:
159: /*
160: * BVP opcodes
161: */
162: #define BVPSNDDG 1 /* send datagram (or ack) */
163: #define BVPSNDMSG 2 /* send message */
164: #define BVPSNDDGI 3 /* send immediate datagram (or ack) */
165: #define BVPRCVDG 33 /* received datagram */
166: #define BVPRCVMSG 34 /* received message */
167: #define BVPRCVDGI 35 /* received immediate datagram */
168:
169: /*
170: * BVP flags
171: */
172: #define BVPRSP 01 /* response required */
173:
174: /*
175: * NI message opcodes
176: */
177: #define NIWPARAM 3 /* write device parameters */
178: #define NISTPTDB 7 /* set proto data block */
179: #define NICLPTDB 8 /* clear proto data block */
180:
181:
182: /*
183: * status codes
184: */
185: #define BVPSUC 0 /* BVP success */
186: #define NISUC 0 /* NI success */
187:
188: /*
189: * data for STPTDB
190: */
191: struct stptdb {
192: short pt_proto; /* protocol number */
193: char pt_fqi; /* free queue index */
194: char pt_flag; /* flags */
195: long pt_id; /* id number for this ptdb */
196: short pt_mcalen;
197: short pt_mcamax;
198: char pt_mcalist[8];
199: };
200:
201: /*
202: * pt_flag
203: */
204: #define PTABM 0x20 /* accept broadcast messages */
205: #define PTAUP 0x40 /* accept unknown protocols */
206: #define PTAAM 0x80 /* accept all multicasts */
207:
208: /*
209: * software data structures
210: */
211: struct bvp {
212: struct bvpdata *d;
213: struct bvpregs *r;
214: struct biic *rb;
215: struct buf *dbuf;
216: struct bvpregs rsave; /* for debugging */
217: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.