Commit | Line | Data |
---|---|---|
da7c5cc6 | 1 | /* |
af359dea C |
2 | * Copyright (c) 1988 Regents of the University of California. |
3 | * All rights reserved. | |
da7c5cc6 | 4 | * |
af359dea C |
5 | * This code is derived from software contributed to Berkeley by |
6 | * Chris Torek. | |
7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | |
15 | * documentation and/or other materials provided with the distribution. | |
16 | * 3. All advertising materials mentioning features or use of this software | |
17 | * must display the following acknowledgement: | |
18 | * This product includes software developed by the University of | |
19 | * California, Berkeley and its contributors. | |
20 | * 4. Neither the name of the University nor the names of its contributors | |
21 | * may be used to endorse or promote products derived from this software | |
22 | * without specific prior written permission. | |
23 | * | |
24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | |
35 | * | |
36 | * @(#)udareg.h 7.3 (Berkeley) 5/8/91 | |
da7c5cc6 | 37 | */ |
e332bda6 BJ |
38 | |
39 | /* | |
75408a24 | 40 | * UDA50 registers and structures |
e332bda6 BJ |
41 | */ |
42 | ||
75408a24 KB |
43 | /* |
44 | * Writing any value to udaip starts initialisation. Reading from it | |
45 | * when the UDA is running makes the UDA look through the command ring | |
46 | * to find any new commands. Reading udasa gives status; writing it | |
47 | * during initialisation sets things up. | |
48 | */ | |
e332bda6 | 49 | struct udadevice { |
75408a24 KB |
50 | u_short udaip; /* initialisation and polling */ |
51 | u_short udasa; /* status and address */ | |
e332bda6 BJ |
52 | }; |
53 | ||
75408a24 KB |
54 | /* |
55 | * Bits in UDA status register during initialisation | |
56 | */ | |
57 | #define UDA_ERR 0x8000 /* error */ | |
58 | #define UDA_STEP4 0x4000 /* step 4 has started */ | |
59 | #define UDA_STEP3 0x2000 /* step 3 has started */ | |
60 | #define UDA_STEP2 0x1000 /* step 2 has started */ | |
61 | #define UDA_STEP1 0x0800 /* step 1 has started */ | |
62 | #define UDA_NV 0x0400 /* no host settable interrupt vector */ | |
63 | #define UDA_QB 0x0200 /* controller supports Q22 bus */ | |
64 | #define UDA_DI 0x0100 /* controller implements diagnostics */ | |
65 | #define UDA_IE 0x0080 /* interrupt enable */ | |
66 | #define UDA_NCNRMASK 0x003f /* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */ | |
67 | #define UDA_IVECMASK 0x007f /* in STEP2, bits 0-6 are interruptvec / 4 */ | |
68 | #define UDA_PI 0x0001 /* host requests adapter purge interrupts */ | |
e332bda6 BJ |
69 | |
70 | /* | |
75408a24 | 71 | * Bits in UDA status register after initialisation |
e332bda6 | 72 | */ |
75408a24 | 73 | #define UDA_GO 0x0001 /* run */ |
e332bda6 | 74 | |
75408a24 KB |
75 | #define UDASR_BITS \ |
76 | "\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13NV\12QB\11DI\10IE\1GO" | |
77 | ||
78 | /* | |
79 | * UDA Communications Area. Note that this structure definition | |
80 | * requires NRSP and NCMD to be defined already. | |
81 | */ | |
e332bda6 BJ |
82 | struct udaca { |
83 | short ca_xxx1; /* unused */ | |
84 | char ca_xxx2; /* unused */ | |
85 | char ca_bdp; /* BDP to purge */ | |
75408a24 KB |
86 | short ca_cmdint; /* command ring transition flag */ |
87 | short ca_rspint; /* response ring transition flag */ | |
e332bda6 BJ |
88 | long ca_rspdsc[NRSP];/* response descriptors */ |
89 | long ca_cmddsc[NCMD];/* command descriptors */ | |
90 | }; | |
91 | ||
e332bda6 | 92 | /* |
75408a24 KB |
93 | * Simplified routines (e.g., uddump) reprogram the UDA50 for one command |
94 | * and one response at a time; uda1ca is like udaca except that it provides | |
95 | * exactly one command and response descriptor. | |
e332bda6 | 96 | */ |
75408a24 KB |
97 | struct uda1ca { |
98 | short ca_xxx1; | |
99 | char ca_xxx2; | |
100 | char ca_bdp; | |
101 | short ca_cmdint; | |
102 | short ca_rspint; | |
103 | long ca_rspdsc; | |
104 | long ca_cmddsc; | |
e332bda6 | 105 | }; |