1 /*
2 * Mach Operating System
3 * Copyright (c) 1991 Carnegie Mellon University
4 * Copyright (c) 1991 IBM Corporation
5 * All Rights Reserved.
6 *
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation,
12 * and that the name IBM not be used in advertising or publicity
13 * pertaining to distribution of the software without specific, written
14 * prior permission.
15 *
16 * CARNEGIE MELLON AND IBM ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON AND IBM DISCLAIM ANY LIABILITY OF ANY KIND FOR
18 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
26 *
27 * any improvements or extensions that they make and grant Carnegie Mellon
28 * the rights to redistribute these changes.
29 */
30
31 /*
32 * HISTORY
33 * $Log: if_trreg.h,v $
34 * Revision 2.2 93/02/04 08:00:27 danner
35 * Integrate PS2 code from IBM.
36 * [93/01/18 prithvi]
37 *
38 */
39
40 /* $Header: if_trreg.h,v 2.2 93/02/04 08:00:27 danner Exp $ */
41 /* $ACIS:if_lanreg.h 12.0$ */
42
43 #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
44 static char *rcsidif_lanreg = "$Header: if_trreg.h,v 2.2 93/02/04 08:00:27 danner Exp $";
45 #endif
46
47 /* Memory offsets of adapter control areas */
48
49 /* Window for the shared ram */
50 #define TR_SRAM_WINDOW 0xc0000
51
52 /* Offset of MMIO region */
53 #define TR_MMIO_OFFSET 0x80000
54
55 #define TR_ACA_OFFSET 0x1e00 /* Offset of ACA in MMIO region */
56
57
58 /* Base address of global interrupt release register */
59 #define GLOBAL_INT_REL 0x2f0
60
61 /* Bring-Up Test results */
62
63 #define BUT_OK 0x0000 /* Initialization completed OK */
64 #define BUT_PROCESSOR_FAIL 0x0020 /* Failed processor initialization */
65 #define BUT_ROM_FAIL 0x0022 /* Failed ROM test diagnostic */
66 #define BUT_RAM_FAIL 0x0024 /* Failed RAM test diagnostic */
67 #define BUT_INST_FAIL 0x0026 /* Failed instruction test diag. */
68 #define BUT_INTER_FAIL 0x0028 /* Failed interrupt test diagnostic */
69 #define BUT_MEM_FAIL 0x002a /* Failed memory interface diag. */
70 #define BUT_PROTOCOL_FAIL 0x002c /* Failed protocol handler diag. */
71
72
73 /* Direct PC-to-adapter commands */
74
75 #define DIR_INTERRUPT 0x00 /* Cause adapter to interrupt the PC */
76 #define DIR_MOD_OPEN_PARAMS 0x01 /* Modify open options */
77 #define DIR_RESTORE_OPEN_PARMS 0x02 /* Restore open options */
78 #define DIR_OPEN_ADAPTER 0x03 /* Open the adapter card */
79 #define DIR_CLOSE 0x04 /* Close adapter card */
80 #define DIR_SET_GRP_ADDR 0x06 /* Set adapter group address */
81 #define DIR_SET_FUNC_ADDR 0x07 /* Set adapter functional addr */
82 #define DIR_READ_LOG 0x08 /* Read and reset error counters */
83 #define XMIT_DIR_FRAME 0x0a /* Direct station transmit */
84
85
86 /* Adapter-Card-to-PC commands */
87
88 #define REC_DATA 0x81 /* Data received from ring station */
89 #define XMIT_DATA_REQ 0x82 /* Adapter needs data to xmit */
90 #define DLC_STATUS 0x83 /* DLC status has changed */
91 #define RING_STAT_CHANGE 0x84 /* Adapter has new ring-status info */
92
93
94 /* Open options */
95
96 #define OPEN_WRAP 0x8000 /* Wrap xmit data to receive data */
97 #define OPEN_NO_HARD_ERR 0x4000 /* Ring hard error and xmit beacon */
98 /* conditions do not cause interrupt */
99 #define OPEN_NO_SOFT_ERR 0x2000 /* Ring soft errors do not cause */
100 /* interrupt */
101 #define OPEN_PASS_MAC 0x1000 /* Pass all adapter-class MAC frames */
102 /* received but not supported by the */
103 /* adapter */
104 #define OPEN_PASS_ATTN_MAC 0x0800 /* Pass all attention-class MAC */
105 /* frames != the previously received */
106 /* attention MAC frame */
107 #define OPEN_PASS_BCON_MAC 0x0100 /* Pass the first beacon MAC frame */
108 /* and all subsequent beacon MAC */
109 /* frames that have a change in */
110 /* source address or beacon type */
111 #define OPEN_CONT 0x0080 /* Adapter will participate in */
112 /* monitor contention */
113
114 #define NUM_RCV_BUF 16 /* Number of receive buffers in */
115 /* shared RAM needed for adapter to */
116 /* open */
117 #define RCV_BUF_LEN 136 /* Length of each receive buffer */
118 #define RCV_BUF_DLEN RCV_BUF_LEN - 8 /* Length of data in rec buf */
119 #define DHB_LENGTH 1544 /* Length of each transmit buffer */
120 #define NUM_DHB 2 /* Number of transmit buffers */
121 #define DLC_MAX_SAP 0 /* MAX number of SAPs */
122 #define DLC_MAX_STA 0 /* MAX number of link stations */
123 #define DLC_MAX_GSAP 0 /* MAX number of group SAPs */
124 #define DLC_MAX_GMEM 0 /* MAX number of SAPs that can be */
125 /* assigned to any given group */
126 #define DLC_TICK 0 /* Zero selects default of 40ms */
127
128
129 /* Open return codes */
130
131 #define OPEN_OK 0x00 /* Open completed successfully */
132 #define OPEN_BAD_COMMAND 0x01 /* Invalid command code */
133 #define OPEN_ALREADY 0x03 /* Adapter is ALREADY open */
134 #define OPEN_MISSING_PARAMS 0x05 /* Required paramaters missing */
135 #define OPEN_UNRECOV_FAIL 0x07 /* Unrecoverable failure occurred */
136 #define OPEN_INAD_REC_BUFS 0x30 /* Inadequate receive buffers */
137 #define OPEN_BAD_NODE_ADDR 0x32 /* Invalid NODE address */
138 #define OPEN_BAD_REC_BUF_LEN 0x33 /* Invalid receive buffer length */
139 #define OPEN_BAD_XMIT_BUF_LEN 0x43 /* Invalid transmit buffer length */
140
141 /* Base address of Token-Ring adapter shared RAM */
142 #define TR_RAM_BASE 0xd4
143
144
145 /* Bit definitions of ISRA High Byte, (Adapter Status) */
146 #define TIMER_STAT 0x40 /* A Timer Control Reg. has an interrupt */
147 #define ACCESS_STAT 0x20 /* Shared RAM or MMIO access violation */
148 #define DEADMAN_TIMER 0x10 /* The deadman timer has expired */
149 #define PROCESSOR_CK 0x08 /* Adapter Processor Check */
150 #define H_INT_MASK 0x02 /* When on, no adapter hardware interrupts */
151 #define S_INT_MASK 0x01 /* When on, no adapter software interrupts */
152
153 /* Bit definitions of ISRA Low Byte, (Used by PC to interrupt adapter) */
154 #define CMD_IN_SRB 0x20 /* Inform adapter of command in SRB */
155 #define RESP_IN_ASB 0x10 /* Inform adapter of response in ASB */
156 #define SRB_FREE 0x08 /* Inform PC when SRB is FREE */
157 #define ASB_FREE 0x04 /* Inform PC when ASB is FREE */
158 #define ARB_FREE 0x02 /* Inform adapter ARB is FREE */
159 #define SSB_FREE 0x01 /* Inform adapter SSB is FREE */
160
161 /* Bit definitions of ISRP High Byte, (PC interrupts and interrupt control) */
162 #define NMI_INT_CTL 0x80 /* 1 = all interrupts to PC interrupt level */
163 /* 0 = error and timer interrupts to PC NMI */
164 #define INT_ENABLE 0x40 /* Allow adapter to interrupt the PC */
165 #define TCR_INT 0x10 /* Timer Control Reg. has interrupt for PC */
166 #define ERR_INT 0x08 /* Adap machine check, deadman timer, overrun */
167 #define ACCESS_INT 0x04 /* Shared RAM or MMIO access violation */
168 #define SHARED_INT_BLK 0x02 /* Shared interrupt blocked */
169 #define PRIM_ALT_ADDR 0x01 /* 0 = primary adapter address */
170 /* 1 = alternate adapter address */
171
172 /* Bit definitions of ISRP Low Byte, (PC interrupts) */
173 #define ADAP_CHK_INT 0x40 /* The adapter has an unrecoverable error */
174 #define SRB_RESP_INT 0x20 /* Adapter has placed a response in the SRB */
175 #define ASB_FREE_INT 0x10 /* Adapter has read response in ARB */
176 #define ARB_CMD_INT 0x08 /* ARB has command for PC to act on */
177 #define SSB_RESP_INT 0x04 /* SSB has response to previous SRB command */
178
179
180 /* Received frame message types */
181 #define MAC 0x02 /* MAC frame */
182 #define UI 0x06 /* Unsequenced Information */
183 #define UNIDENT 0x14 /* Other or unidentified message type */
184
185 /* Constants for Token-Ring physical header */
186 #define TR_ADDR_LEN 0x6 /* Length of a token-ring physical address */
187 #define DLC_HDR_LEN 0x3 /* Length of DLC header */
188 #define AC 0x10 /* Value of access control field */
189 #define FC 0x40 /* Value of frame control field */
190 #define UI_CMD 0x3 /* Unsequenced Information Command */
191 #define SNAP_LENGTH 0x05 /* SNAP field length */
192 /* protocol id = 3 bytes */
193 /* ethertype = 2 bytes */
194 #define HDR_LNGTH_NOROUTE 14 /* length of header with no route info */
195 #define SKIP_DSAP_SSAP 0x02 /* length of dsap and ssap in llc frame */
196
197 /* SAP DLC SRB commands (page 6-50 Token Ring Tech. Ref.) */
198 #define OPEN_SAP 0x15 /* activate service access point */
199 #define CLOSE_SAP 0x16 /* de-activate SAP */
200 #define XMIT_UI_FRM 0x0d /* transmit unnumbered info frame */
201 #define XMIT_XID_CMD 0x0e /* transmit XID command */
202 #define XMIT_TEST_CMD 0x11 /* transmit TEST command */
203
204 /* EXTENDED SAP STUFF */
205 #define EXTENDED_SAP 0xaa /* extended service access point */
206
207 /* BRIDGE STUFF */
208 #define TR_RI_PRESENT 0x80 /* routing info present bit */
209 #define TR_RCF_LEN_MASK 0x1f00
210 #define TR_RCF_BROADCAST 0x8000
211 #define TR_RCF_FRAME2K 0x0020
212 #define TR_MAX_BRIDGE 8
213 #define SOURCE_ADDR_BYT0 8 /* byte zero of source address */
214 #define RCF_BYT0 14 /* byte zero of RCF fields */
215
216 /* ARB RING STATUS CHANGE */
217 #define SIGNAL_LOSS 0x8000 /* signal loss */
218 #define HARD_ERR 0x4000 /* beacon frames sent */
219 #define SOFT_ERR 0x2000 /* soft error */
220 #define LOBE_FAULT 0x0800 /* lobe wire fault */
221 #define LOG_OFLOW 0x0080 /* adapter error log counter overflow */
222 #define SINGLE_STATION 0x0040 /* single station or ring */
Cache object: fa4f0792af36d0d6a0f9cdac116afd3e
|