1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #define NI52_RESET 0
16 #define NI52_ATTENTION 1
17 #define NI52_TENA 3
18 #define NI52_TDIS 2
19 #define NI52_INTENA 5
20 #define NI52_INTDIS 4
21 #define NI52_MAGIC1 6
22 #define NI52_MAGIC2 7
23
24 #define NI52_MAGICVAL1 0x00
25 #define NI52_MAGICVAL2 0x55
26
27
28
29
30 #define SCP_DEFAULT_ADDRESS 0xfffff4
31
32
33
34
35
36
37 struct scp_struct
38 {
39 unsigned short zero_dum0;
40 unsigned char sysbus;
41 unsigned char zero_dum1;
42 unsigned short zero_dum2;
43 unsigned short zero_dum3;
44 char *iscp;
45 };
46
47
48
49
50
51 struct iscp_struct
52 {
53 unsigned char busy;
54 unsigned char zero_dummy;
55 unsigned short scb_offset;
56 char *scb_base;
57 };
58
59
60
61
62 struct scb_struct
63 {
64 unsigned char rus;
65 unsigned char cus;
66 unsigned char cmd_ruc;
67 unsigned char cmd_cuc;
68 unsigned short cbl_offset;
69 unsigned short rfa_offset;
70 unsigned short crc_errs;
71 unsigned short aln_errs;
72 unsigned short rsc_errs;
73 unsigned short ovrn_errs;
74 };
75
76
77
78
79 #define RUC_MASK 0x0070
80 #define RUC_NOP 0x0000
81 #define RUC_START 0x0010
82 #define RUC_RESUME 0x0020
83 #define RUC_SUSPEND 0x0030
84 #define RUC_ABORT 0x0040
85
86 #define CUC_MASK 0x07
87 #define CUC_NOP 0x00
88 #define CUC_START 0x01
89 #define CUC_RESUME 0x02
90 #define CUC_SUSPEND 0x03
91 #define CUC_ABORT 0x04
92
93 #define ACK_MASK 0xf0
94 #define ACK_CX 0x80
95 #define ACK_FR 0x40
96 #define ACK_CNA 0x20
97 #define ACK_RNR 0x10
98
99
100
101
102 #define STAT_MASK 0xf0
103 #define STAT_CX 0x80
104 #define STAT_FR 0x40
105 #define STAT_CNA 0x20
106 #define STAT_RNR 0x10
107
108 #define CU_STATUS 0x7
109 #define CU_SUSPEND 0x1
110 #define CU_ACTIVE 0x2
111
112 #define RU_STATUS 0x70
113 #define RU_SUSPEND 0x10
114 #define RU_NOSPACE 0x20
115 #define RU_READY 0x40
116
117
118
119
120 struct rfd_struct
121 {
122 unsigned char stat_low;
123 unsigned char stat_high;
124 unsigned char rfd_sf;
125 unsigned char last;
126 unsigned short next;
127 unsigned short rbd_offset;
128 unsigned char dest[6];
129 unsigned char source[6];
130 unsigned short length;
131 unsigned short zero_dummy;
132 };
133
134 #define RFD_LAST 0x80
135 #define RFD_SUSP 0x40
136 #define RFD_COMPL 0x80
137 #define RFD_OK 0x20
138 #define RFD_BUSY 0x40
139 #define RFD_ERR_LEN 0x10
140 #define RFD_ERR_CRC 0x08
141 #define RFD_ERR_ALGN 0x04
142 #define RFD_ERR_RNR 0x02
143 #define RFD_ERR_OVR 0x01
144
145 #define RFD_ERR_FTS 0x0080
146 #define RFD_ERR_NEOP 0x0040
147 #define RFD_ERR_TRUN 0x0020
148 #define RFD_MATCHADD 0x0002
149 #define RFD_COLLDET 0x0001
150
151
152
153
154 struct rbd_struct
155 {
156 unsigned short status;
157 unsigned short next;
158 char *buffer;
159 unsigned short size;
160 unsigned short zero_dummy;
161 };
162
163 #define RBD_LAST 0x8000
164 #define RBD_USED 0x4000
165 #define RBD_MASK 0x3fff
166
167
168
169
170 #define STAT_COMPL 0x8000
171 #define STAT_BUSY 0x4000
172 #define STAT_OK 0x2000
173
174
175
176
177 #define CMD_NOP 0x0000
178 #define CMD_IASETUP 0x0001
179 #define CMD_CONFIGURE 0x0002
180 #define CMD_MCSETUP 0x0003
181 #define CMD_XMIT 0x0004
182 #define CMD_TDR 0x0005
183 #define CMD_DUMP 0x0006
184 #define CMD_DIAGNOSE 0x0007
185
186
187
188
189 #define CMD_LAST 0x8000
190 #define CMD_SUSPEND 0x4000
191 #define CMD_INT 0x2000
192
193
194
195
196 struct nop_cmd_struct
197 {
198 unsigned short cmd_status;
199 unsigned short cmd_cmd;
200 unsigned short cmd_link;
201 };
202
203
204
205
206 struct iasetup_cmd_struct
207 {
208 unsigned short cmd_status;
209 unsigned short cmd_cmd;
210 unsigned short cmd_link;
211 unsigned char iaddr[6];
212 };
213
214
215
216
217 struct configure_cmd_struct
218 {
219 unsigned short cmd_status;
220 unsigned short cmd_cmd;
221 unsigned short cmd_link;
222 unsigned char byte_cnt;
223 unsigned char fifo;
224 unsigned char sav_bf;
225 unsigned char adr_len;
226 unsigned char priority;
227 unsigned char ifs;
228 unsigned char time_low;
229 unsigned char time_high;
230 unsigned char promisc;
231 unsigned char carr_coll;
232 unsigned char fram_len;
233 unsigned char dummy;
234 };
235
236
237
238
239 struct mcsetup_cmd_struct
240 {
241 unsigned short cmd_status;
242 unsigned short cmd_cmd;
243 unsigned short cmd_link;
244 unsigned short mc_cnt;
245 unsigned char mc_list[0][6];
246 };
247
248
249
250
251 struct dump_cmd_struct
252 {
253 unsigned short cmd_status;
254 unsigned short cmd_cmd;
255 unsigned short cmd_link;
256 unsigned short dump_offset;
257 };
258
259
260
261
262 struct transmit_cmd_struct
263 {
264 unsigned short cmd_status;
265 unsigned short cmd_cmd;
266 unsigned short cmd_link;
267 unsigned short tbd_offset;
268 unsigned char dest[6];
269 unsigned short length;
270 };
271
272 #define TCMD_ERRMASK 0x0fa0
273 #define TCMD_MAXCOLLMASK 0x000f
274 #define TCMD_MAXCOLL 0x0020
275 #define TCMD_HEARTBEAT 0x0040
276 #define TCMD_DEFERRED 0x0080
277 #define TCMD_UNDERRUN 0x0100
278 #define TCMD_LOSTCTS 0x0200
279 #define TCMD_NOCARRIER 0x0400
280 #define TCMD_LATECOLL 0x0800
281
282 struct tdr_cmd_struct
283 {
284 unsigned short cmd_status;
285 unsigned short cmd_cmd;
286 unsigned short cmd_link;
287 unsigned short status;
288 };
289
290 #define TDR_LNK_OK 0x8000
291 #define TDR_XCVR_PRB 0x4000
292 #define TDR_ET_OPN 0x2000
293 #define TDR_ET_SRT 0x1000
294 #define TDR_TIMEMASK 0x07ff
295
296
297
298
299 struct tbd_struct
300 {
301 unsigned short size;
302 unsigned short next;
303 char *buffer;
304 };
305
306 #define TBD_LAST 0x8000
307
308
309
310