summaryrefslogtreecommitdiffstats
path: root/sys/dev/wl/if_wl_i82586.h
blob: fc08adcc5226a5a53b626f853006de20d5ebb639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/*-
 * Mach Operating System
 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 *
 * $FreeBSD$
 */
/*
  Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
Cupertino, California.

		All Rights Reserved

  Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appears in all
copies and that both the copyright notice and this permission notice
appear in supporting documentation, and that the name of Olivetti
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.

  OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
 * Defines for managing the status word of the 82586 cpu.  For details see
 * the Intel LAN Component User's Manual starting at p. 2-14.
 *
 */

#define SCB_SW_INT	0xf000
#define SCB_SW_CX	0x8000		/* CU finished w/ int. bit set */
#define SCB_SW_FR	0x4000		/* RU finished receiving a frame */
#define SCB_SW_CNA	0x2000		/* CU left active state */
#define SCB_SW_RNR	0x1000		/* RU left ready state */

/* 
 * Defines for managing the Command Unit Status portion of the 82586
 * System Control Block.
 *
 */

#define SCB_CUS_IDLE	0x0000
#define SCB_CUS_SUSPND	0x0100
#define SCB_CUS_ACTV	0x0200

/* 
 * Defines for managing the Receive Unit Status portion of the System
 * Control Block.
 *
 */

#define SCB_RUS_IDLE	0x0000
#define SCB_RUS_SUSPND	0x0010
#define SCB_RUS_NORESRC 0x0020
#define SCB_RUS_READY	0x0040

/*
 * Defines that manage portions of the Command Word in the System Control
 * Block of the 82586.  Below are the Interrupt Acknowledge Bits and their
 * appropriate masks.
 *
 */

#define SCB_ACK_CX	0x8000
#define SCB_ACK_FR	0x4000
#define SCB_ACK_CNA	0x2000
#define SCB_ACK_RNR	0x1000

/* 
 * Defines for managing the Command Unit Control word, and the Receive
 * Unit Control word.  The software RESET bit is also defined.
 *
 */

#define SCB_CU_STRT	0x0100
#define SCB_CU_RSUM	0x0200
#define SCB_CU_SUSPND	0x0300
#define SCB_CU_ABRT	0x0400

#define SCB_RESET	0x0080

#define SCB_RU_STRT	0x0010
#define SCB_RU_RSUM	0x0020
#define SCB_RU_SUSPND	0x0030
#define SCB_RU_ABRT	0x0040


/*
 * The following define Action Commands for the 82586 chip.
 *
 */

#define	AC_NOP		0x00
#define AC_IASETUP	0x01
#define AC_CONFIGURE	0x02
#define AC_MCSETUP	0x03
#define AC_TRANSMIT	0x04
#define AC_TDR		0x05
#define AC_DUMP		0x06
#define AC_DIAGNOSE	0x07


/*
 * Defines for General Format for Action Commands, both Status Words, and
 * Command Words.
 *
 */

#define AC_SW_C		0x8000
#define AC_SW_B		0x4000
#define AC_SW_OK	0x2000
#define AC_SW_A		0x1000
#define TC_CARRIER	0x0400
#define TC_CLS		0x0200
#define TC_DMA		0x0100
#define TC_DEFER	0x0080
#define TC_SQE		0x0040
#define TC_COLLISION	0x0020
#define	AC_CW_EL	0x8000
#define AC_CW_S		0x4000
#define AC_CW_I		0x2000

/*
 * Specific defines for the transmit action command.
 *
 */

#define TBD_SW_EOF	0x8000
#define TBD_SW_COUNT	0x3fff

/*
 * Specific defines for the receive frame actions.
 *
 */

#define RBD_SW_EOF	0x8000
#define RBD_SW_COUNT	0x3fff

#define RFD_DONE	0x8000
#define RFD_BUSY	0x4000
#define RFD_OK		0x2000
#define RFD_CRC		0x0800
#define RFD_ALN		0x0400
#define RFD_RSC		0x0200
#define RFD_DMA		0x0100
#define RFD_SHORT	0x0080
#define RFD_EOF		0x0040
#define RFD_EL		0x8000
#define RFD_SUSP	0x4000
/*
 * 82586 chip specific structure definitions.  For details, see the Intel
 * LAN Components manual.
 *
 */


typedef	struct	{
	u_short	scp_sysbus;
	u_short	scp_unused[2];
	u_short	scp_iscp;
	u_short	scp_iscp_base;
} scp_t;


typedef	struct	{
	u_short	iscp_busy;
	u_short	iscp_scb_offset;
	u_short	iscp_scb;
	u_short	iscp_scb_base;
} iscp_t;


typedef struct	{
	u_short	scb_status;
	u_short	scb_command;
	u_short	scb_cbl_offset;
	u_short	scb_rfa_offset;
	u_short	scb_crcerrs;
	u_short	scb_alnerrs;
	u_short	scb_rscerrs;
	u_short	scb_ovrnerrs;
} scb_t;


typedef	struct	{
	u_short	tbd_offset;
	u_char	dest_addr[6];
	u_short	length;
} transmit_t;


typedef	struct	{
	u_short	fifolim_bytecnt;
	u_short	addrlen_mode;
	u_short	linprio_interframe;
	u_short	slot_time;
	u_short	hardware;
	u_short	min_frame_len;
} configure_t;


typedef	struct	{
	u_short	ac_status;
	u_short	ac_command;
	u_short	ac_link_offset;
	union	{
		transmit_t	transmit;
		configure_t	configure;
		u_char		iasetup[6];
	} cmd;
} ac_t;
	

typedef	struct	{
	u_short	act_count;
	u_short	next_tbd_offset;
	u_short	buffer_addr;
	u_short	buffer_base;
} tbd_t;


typedef	struct	{
	u_short	status;
	u_short	command;
	u_short	link_offset;
	u_short	rbd_offset;
	u_char	destination[6];
	u_char	source[6];
	u_short	length;
} fd_t;


typedef	struct	{
	u_short	status;
	u_short	next_rbd_offset;
	u_short	buffer_addr;
	u_short	buffer_base;
	u_short	size;
} rbd_t;
OpenPOWER on IntegriCloud