1 /* $NetBSD: if_nireg.h,v 1.3.20.4 2005/03/04 16:41:02 skrll Exp $ */
3 * Copyright (c) 1988 Regents of the University of California.
6 * This code is derived from software contributed to Berkeley by
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * @(#)nireg.h 7.3 (Berkeley) 6/28/90
37 * Registers for the DEBNA and DEBNK Ethernet interfaces
38 * (DEC calls these Network Interfaces, hence nireg.h)
42 * this seems to be intended to be more general, but I have no details,
43 * so it goes here for now
45 * BI Vax Port (BVP) stuff first:
49 u_long p_pcr
; /* port control register */
50 u_long p_psr
; /* port status register */
51 u_long p_per
; /* port error register */
52 u_long p_pdr
; /* port data register */
56 * BI node space registers
59 struct biiregs ni_bi
; /* BIIC registers, except GPRs */
60 struct bvpregs ni_tkp
; /* tk50 port control via BIIC GPRs */
61 u_long ni_xxx
[64]; /* unused */
62 u_long ni_rxcd
; /* receive console data */
63 struct bvpregs ni_nip
; /* NI port control via BCI3 GPRs */
64 u_long ni_pudr
; /* power-up diagnostic register */
76 #define PCR_MFREEQ 0x000
77 #define PCR_DFREEQ 0x100
78 #define PCR_RFREEQ 0x200
79 #define PCR_IFREEQ 0x300
80 #define PCR_CMDQ0 PCR_MFREEQ
81 #define PCR_CMDQ1 PCR_DFREEQ
82 #define PCR_CMDQ2 PCR_RFREEQ
83 #define PCR_CMDQ3 PCR_IFREEQ
84 #define PCR_RESTART 11
87 #define PCR_SHUTDOWN 4
92 #define PSR_OWN 0x80000000
93 #define PSR_STATE 0x00070000
94 #define PSR_STOPPED 0x00060000
95 #define PSR_ENABLED 0x00040000
96 #define PSR_INITED 0x00020000
97 #define PSR_UNDEF 0x00010000
98 #define PSR_RSQ 0x00000080
99 #define PSR_ERR 0x00000040
102 * The DEBNx uses a very weird (set of) structure(s) to communicate
103 * with something as simple as an ethernet controller. This is not
104 * very different to the way communication is done over CI with disks.
120 u_int8_t nm_text
[128];
123 /* Datagram packet */
133 u_int16_t nd_status2
;
135 u_int32_t nd_ptdbidx
;
144 #define NIDG_CHAIN 0x8000
146 /* NI parameter block */
152 u_int16_t np_curaddr
;
153 u_int16_t np_maxaddr
;
174 /* Protocol type definition block */
176 u_int16_t np_type
; /* Protocol type */
177 u_int8_t np_fque
; /* Free queue */
178 u_int8_t np_flags
; /* See below */
179 u_int32_t np_index
; /* protocol type index */
180 u_int16_t np_adrlen
; /* # of multicast addresses */
181 u_int16_t np_802
; /* for IEEE 802 packets */
182 u_int8_t np_mcast
[16][8];/* Multicast (direct match) array */
185 #define PTDB_PROMISC 0x08
186 #define PTDB_802 0x10
187 #define PTDB_BDC 0x20
188 #define PTDB_UNKN 0x40
189 #define PTDB_AMC 0x80
191 /* Buffer descriptor */
193 u_int16_t nb_status
; /* Offset, valid etc */
195 u_int32_t nb_len
; /* Buffer length */
196 u_int32_t nb_pte
; /* start (vax) PTE for this buffer */
199 #define NIBD_OFFSET 0x1ff
200 #define NIBD_VALID 0x8000
203 /* Free Queue Block */
223 /* DEBNx specific part of Generic VAX Port */
225 u_int16_t np_veclvl
; /* Interrupt vector + level */
226 u_int16_t np_node
; /* Where to interrupt */
228 u_int32_t np_vfqb
; /* Free queue block pointer */
229 u_int32_t np_pad1
[39];
231 u_int32_t np_vpqb
; /* Virtual address of Generic PQB */
232 u_int32_t np_vbdt
; /* Virtual address of descriptors */
233 u_int32_t np_nbdr
; /* Number of descriptors */
234 u_int32_t np_spt
; /* System Page Table */
235 u_int32_t np_sptlen
; /* System Page Table length */
236 u_int32_t np_gpt
; /* Global Page Table */
237 u_int32_t np_gptlen
; /* Global Page Table length */
239 u_int32_t np_pad2
[67];
242 /* "Generic VAX Port Control Block" whatever it means */
254 struct ni_pqb nc_pqb
; /* DEBNx specific part of struct */
258 /* BVP opcodes, should be somewhere else */
262 #define BVP_DGRAMRX 33
264 #define BVP_DGRAMIRX 35
266 /* NI-specific sub-opcodes */
276 /* bits in ni_pudr */
277 #define PUDR_TAPE 0x40000000 /* tk50 & assoc logic ok */
278 #define PUDR_PATCH 0x20000000 /* patch logic ok */
279 #define PUDR_VRAM 0x10000000 /* DEBNx onboard RAM ok */
280 #define PUDR_VROM1 0x08000000 /* uVax ROM 1 ok */ /* ? */
281 #define PUDR_VROM2 0x04000000 /* uVax ROM 2 ok */
282 #define PUDR_VROM3 0x02000000 /* uVax ROM 3 ok */
283 #define PUDR_VROM4 0x01000000 /* uVax ROM 4 ok */
284 #define PUDR_UVAX 0x00800000 /* uVax passes self test */
285 #define PUDR_BI 0x00400000 /* BIIC and BCI3 chips ok */
286 #define PUDR_TMR 0x00200000 /* interval timer ok */
287 #define PUDR_IRQ 0x00100000 /* no IRQ lines stuck */
288 #define PUDR_NI 0x00080000 /* Ethernet ctlr ok */
289 #define PUDR_TK50 0x00040000 /* tk50 present */
290 #define PUDR_PRES 0x00001000 /* tk50 present (again?!) */
291 #define PUDR_UVINT 0x00000800 /* uVax-to-80186 intr logic ok */
292 #define PUDR_BUSHD 0x00000400 /* no bus hold errors */
293 #define PUDR_II32 0x00000200 /* II32 transceivers ok */
294 #define PUDR_MPSC 0x00000100 /* MPSC logic ok */
295 #define PUDR_GAP 0x00000080 /* gap-detect logic ok */
296 #define PUDR_MISC 0x00000040 /* misc. registers ok */
297 #define PUDR_UNEXP 0x00000020 /* unexpected interrupt trapped */
298 #define PUDR_80186 0x00000010 /* 80186 ok */
299 #define PUDR_PATCH2 0x00000008 /* patch logic ok (again) */
300 #define PUDR_8RAM 0x00000004 /* 80186 RAM ok */
301 #define PUDR_8ROM2 0x00000002 /* 80186 ROM1 ok */
302 #define PUDR_8ROM1 0x00000001 /* 80186 ROM2 ok */