xref: /openbsd/sys/dev/sbus/qereg.h (revision 404b540a)
1 /*	$OpenBSD: qereg.h,v 1.4 2008/06/26 05:42:18 ray Exp $	*/
2 /*	$NetBSD: qereg.h,v 1.3 2000/07/24 04:28:51 mycroft Exp $	*/
3 
4 /*-
5  * Copyright (c) 1999 The NetBSD Foundation, Inc.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to The NetBSD Foundation
9  * by Paul Kranenburg.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /*
34  * Copyright (c) 1998 Jason L. Wright.
35  * All rights reserved.
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions
39  * are met:
40  * 1. Redistributions of source code must retain the above copyright
41  *    notice, this list of conditions and the following disclaimer.
42  * 2. Redistributions in binary form must reproduce the above copyright
43  *    notice, this list of conditions and the following disclaimer in the
44  *    documentation and/or other materials provided with the distribution.
45  *
46  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
47  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
48  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
49  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
50  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
51  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
55  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56  */
57 
58 /*
59  * QE Channel registers
60  */
61 #if 0
62 struct qe_cregs {
63 	u_int32_t ctrl;		/* control */
64 	u_int32_t stat;		/* status */
65 	u_int32_t rxds;		/* rx descriptor ring ptr */
66 	u_int32_t txds;		/* tx descriptor ring ptr */
67 	u_int32_t rimask;	/* rx interrupt mask */
68 	u_int32_t timask;	/* tx interrupt mask */
69 	u_int32_t qmask;	/* qec error interrupt mask */
70 	u_int32_t mmask;	/* mace error interrupt mask */
71 	u_int32_t rxwbufptr;	/* local memory rx write ptr */
72 	u_int32_t rxrbufptr;	/* local memory rx read ptr */
73 	u_int32_t txwbufptr;	/* local memory tx write ptr */
74 	u_int32_t txrbufptr;	/* local memory tx read ptr */
75 	u_int32_t ccnt;		/* collision counter */
76 	u_int32_t pipg;		/* inter-frame gap */
77 };
78 #endif
79 /* register indices: */
80 #define QE_CRI_CTRL	(0*4)
81 #define QE_CRI_STAT	(1*4)
82 #define QE_CRI_RXDS	(2*4)
83 #define QE_CRI_TXDS	(3*4)
84 #define QE_CRI_RIMASK	(4*4)
85 #define QE_CRI_TIMASK	(5*4)
86 #define QE_CRI_QMASK	(6*4)
87 #define QE_CRI_MMASK	(7*4)
88 #define QE_CRI_RXWBUF	(8*4)
89 #define QE_CRI_RXRBUF	(9*4)
90 #define QE_CRI_TXWBUF	(10*4)
91 #define QE_CRI_TXRBUF	(11*4)
92 #define QE_CRI_CCNT	(12*4)
93 #define QE_CRI_PIPG	(13*4)
94 
95 /* qe_cregs.ctrl: control. */
96 #define	QE_CR_CTRL_RXOFF	0x00000004	/* disable receiver */
97 #define	QE_CR_CTRL_RESET	0x00000002	/* reset this channel */
98 #define	QE_CR_CTRL_TWAKEUP	0x00000001	/* tx dma wakeup */
99 
100 /* qe_cregs.stat: status. */
101 #define	QE_CR_STAT_EDEFER	0x10000000	/* excessive defers */
102 #define	QE_CR_STAT_CLOSS	0x08000000	/* loss of carrier */
103 #define	QE_CR_STAT_ERETRIES	0x04000000	/* >16 retries */
104 #define	QE_CR_STAT_LCOLL	0x02000000	/* late tx collision */
105 #define	QE_CR_STAT_FUFLOW	0x01000000	/* fifo underflow */
106 #define	QE_CR_STAT_JERROR	0x00800000	/* jabber error */
107 #define	QE_CR_STAT_BERROR	0x00400000	/* babble error */
108 #define	QE_CR_STAT_TXIRQ	0x00200000	/* tx interrupt */
109 #define	QE_CR_STAT_TCCOFLOW	0x00100000	/* tx collision cntr expired */
110 #define	QE_CR_STAT_TXDERROR	0x00080000	/* tx descriptor is bad */
111 #define	QE_CR_STAT_TXLERR	0x00040000	/* tx late error */
112 #define	QE_CR_STAT_TXPERR	0x00020000	/* tx parity error */
113 #define	QE_CR_STAT_TXSERR	0x00010000	/* tx sbus error ack */
114 #define	QE_CR_STAT_RCCOFLOW	0x00001000	/* rx collision cntr expired */
115 #define	QE_CR_STAT_RUOFLOW	0x00000800	/* rx runt counter expired */
116 #define	QE_CR_STAT_MCOFLOW	0x00000400	/* rx missed counter expired */
117 #define	QE_CR_STAT_RXFOFLOW	0x00000200	/* rx fifo over flow */
118 #define	QE_CR_STAT_RLCOLL	0x00000100	/* rx late collision */
119 #define	QE_CR_STAT_FCOFLOW	0x00000080	/* rx frame counter expired */
120 #define	QE_CR_STAT_CECOFLOW	0x00000040	/* rx crc error cntr expired */
121 #define	QE_CR_STAT_RXIRQ	0x00000020	/* rx interrupt */
122 #define	QE_CR_STAT_RXDROP	0x00000010	/* rx dropped packet */
123 #define	QE_CR_STAT_RXSMALL	0x00000008	/* rx buffer too small */
124 #define	QE_CR_STAT_RXLERR	0x00000004	/* rx late error */
125 #define	QE_CR_STAT_RXPERR	0x00000002	/* rx parity error */
126 #define	QE_CR_STAT_RXSERR	0x00000001	/* rx sbus error ack */
127 #define QE_CR_STAT_BITS		"\020"				\
128 			"\01RXSERR\02RXPERR\03RXLERR"		\
129 			"\04RXSMALL\05RXDROP\06RXIRQ"		\
130 			"\07CECOFLOW\010FCOFLOW\011RLCOLL"	\
131 			"\012RXFOFLOW\013MCOFLOW\014RUOFLOW"	\
132 			"\015RCCOFLOW\021TXSERR\022TXPERR"	\
133 			"\023TXLERR\024TXDERROR\025TCCOFLOW"	\
134 			"\026TXIRQ\027BERROR\030JERROR"		\
135 			"\031FUFLOW\032LCOLL\033ERETRIES"	\
136 			"\034CLOSS\035EDEFER"
137 
138 /*
139  * Errors: all status bits except for TX/RX IRQ
140  */
141 #define	QE_CR_STAT_ALLERRORS	\
142 	( QE_CR_STAT_EDEFER   | QE_CR_STAT_CLOSS    | QE_CR_STAT_ERETRIES \
143 	| QE_CR_STAT_LCOLL    | QE_CR_STAT_FUFLOW   | QE_CR_STAT_JERROR \
144 	| QE_CR_STAT_BERROR   | QE_CR_STAT_TCCOFLOW | QE_CR_STAT_TXDERROR \
145 	| QE_CR_STAT_TXLERR   | QE_CR_STAT_TXPERR   | QE_CR_STAT_TXSERR \
146 	| QE_CR_STAT_RCCOFLOW | QE_CR_STAT_RUOFLOW  | QE_CR_STAT_MCOFLOW \
147 	| QE_CR_STAT_RXFOFLOW | QE_CR_STAT_RLCOLL   | QE_CR_STAT_FCOFLOW \
148 	| QE_CR_STAT_CECOFLOW | QE_CR_STAT_RXDROP   | QE_CR_STAT_RXSMALL \
149 	| QE_CR_STAT_RXLERR   | QE_CR_STAT_RXPERR   | QE_CR_STAT_RXSERR)
150 
151 /* qe_cregs.qmask: qec error interrupt mask. */
152 #define	QE_CR_QMASK_COFLOW	0x00100000	/* collision cntr overflow */
153 #define	QE_CR_QMASK_TXDERROR	0x00080000	/* tx descriptor error */
154 #define	QE_CR_QMASK_TXLERR	0x00040000	/* tx late error */
155 #define	QE_CR_QMASK_TXPERR	0x00020000	/* tx parity error */
156 #define	QE_CR_QMASK_TXSERR	0x00010000	/* tx sbus error ack */
157 #define	QE_CR_QMASK_RXDROP	0x00000010	/* rx packet dropped */
158 #define	QE_CR_QMASK_RXSMALL	0x00000008	/* rx buffer too small */
159 #define	QE_CR_QMASK_RXLERR	0x00000004	/* rx late error */
160 #define	QE_CR_QMASK_RXPERR	0x00000002	/* rx parity error */
161 #define	QE_CR_QMASK_RXSERR	0x00000001	/* rx sbus error ack */
162 
163 /* qe_cregs.mmask: MACE error interrupt mask. */
164 #define	QE_CR_MMASK_EDEFER	0x10000000	/* excess defer */
165 #define	QE_CR_MMASK_CLOSS	0x08000000	/* carrier loss */
166 #define	QE_CR_MMASK_ERETRY	0x04000000	/* excess retry */
167 #define	QE_CR_MMASK_LCOLL	0x02000000	/* late collision error */
168 #define	QE_CR_MMASK_UFLOW	0x01000000	/* underflow */
169 #define	QE_CR_MMASK_JABBER	0x00800000	/* jabber error */
170 #define	QE_CR_MMASK_BABBLE	0x00400000	/* babble error */
171 #define	QE_CR_MMASK_OFLOW	0x00000800	/* overflow */
172 #define	QE_CR_MMASK_RXCOLL	0x00000400	/* rx coll-cntr overflow */
173 #define	QE_CR_MMASK_RPKT	0x00000200	/* runt pkt overflow */
174 #define	QE_CR_MMASK_MPKT	0x00000100	/* missed pkt overflow */
175 
176 /* qe_cregs.pipg: inter-frame gap. */
177 #define	QE_CR_PIPG_TENAB	0x00000020	/* enable throttle */
178 #define	QE_CR_PIPG_MMODE	0x00000010	/* manual mode */
179 #define	QE_CR_PIPG_WMASK	0x0000000f	/* sbus wait mask */
180 
181 /*
182  * MACE registers
183  */
184 #if 0
185 struct qe_mregs {
186 	u_int8_t rcvfifo;	[0]	/* receive fifo */
187 	u_int8_t xmtfifo;	[1]	/* transmit fifo */
188 	u_int8_t xmtfc;		[2]	/* transmit frame control */
189 	u_int8_t xmtfs;		[3]	/* transmit frame status */
190 	u_int8_t xmtrc;		[4]	/* tx retry count */
191 	u_int8_t rcvfc;		[5]	/* receive frame control */
192 	u_int8_t rcvfs;		[6]	/* receive frame status */
193 	u_int8_t fifofc;	[7]	/* fifo frame count */
194 	u_int8_t ir;		[8]	/* interrupt register */
195 	u_int8_t imr;		[9]	/* interrupt mask register */
196 	u_int8_t pr;		[10]	/* poll register */
197 	u_int8_t biucc;		[11]	/* biu config control */
198 	u_int8_t fifocc;	[12]	/* fifo config control */
199 	u_int8_t maccc;		[13]	/* mac config control */
200 	u_int8_t plscc;		[14]	/* pls config control */
201 	u_int8_t phycc;		[15]	/* phy config control */
202 	u_int8_t chipid1;	[16]	/* chipid, low byte */
203 	u_int8_t chipid2;	[17]	/* chipid, high byte */
204 	u_int8_t iac;		[18]	/* internal address config */
205 	u_int8_t _reserved0;	[19]	/* reserved */
206 	u_int8_t ladrf;		[20]	/* logical address filter */
207 	u_int8_t padr;		[21]	/* physical address */
208 	u_int8_t _reserved1;	[22]	/* reserved */
209 	u_int8_t _reserved2;	[23]	/* reserved */
210 	u_int8_t mpc;		[24]	/* missed packet count */
211 	u_int8_t _reserved3;	[25]	/* reserved */
212 	u_int8_t rntpc;		[26]	/* runt packet count */
213 	u_int8_t rcvcc;		[27]	/* receive collision count */
214 	u_int8_t _reserved4;	[28]	/* reserved */
215 	u_int8_t utr;		[29]	/* user test register */
216 	u_int8_t rtr1;		[30]	/* reserved test register 1 */
217 	u_int8_t rtr2;		[31]	/* reserved test register 2 */
218 };
219 #endif
220 /* register indices: */
221 #define QE_MRI_RCVFIFO	0	/* receive fifo */
222 #define QE_MRI_XMTFIFO	1	/* transmit fifo */
223 #define QE_MRI_XMTFC	2	/* transmit frame control */
224 #define QE_MRI_XMTFS	3	/* transmit frame status */
225 #define QE_MRI_XMTRC	4	/* tx retry count */
226 #define QE_MRI_RCVFC	5	/* receive frame control */
227 #define QE_MRI_RCVFS	6	/* receive frame status */
228 #define QE_MRI_FIFOFC	7	/* fifo frame count */
229 #define QE_MRI_IR	8	/* interrupt register */
230 #define QE_MRI_IMR	9	/* interrupt mask register */
231 #define QE_MRI_PR	10	/* poll register */
232 #define QE_MRI_BIUCC	11	/* biu config control */
233 #define QE_MRI_FIFOCC	12	/* fifo config control */
234 #define QE_MRI_MACCC	13	/* mac config control */
235 #define QE_MRI_PLSCC	14	/* pls config control */
236 #define QE_MRI_PHYCC	15	/* phy config control */
237 #define QE_MRI_CHIPID1	16	/* chipid, low byte */
238 #define QE_MRI_CHIPID2	17	/* chipid, high byte */
239 #define QE_MRI_IAC	18	/* internal address config */
240 #define QE_MRI_LADRF	20	/* logical address filter */
241 #define QE_MRI_PADR	21	/* physical address */
242 #define QE_MRI_MPC	24	/* missed packet count */
243 #define QE_MRI_RNTPC	26	/* runt packet count */
244 #define QE_MRI_RCVCC	27	/* receive collision count */
245 #define QE_MRI_UTR	29	/* user test register */
246 #define QE_MRI_RTR1	30	/* reserved test register 1 */
247 #define QE_MRI_RTR2	31	/* reserved test register 2 */
248 
249 /* qe_mregs.xmtfc: transmit frame control. */
250 #define	QE_MR_XMTFC_DRETRY	0x80		/* disable retries */
251 #define	QE_MR_XMTFC_DXMTFCS	0x08		/* disable tx fcs */
252 #define	QE_MR_XMTFC_APADXMT	0x01		/* enable auto padding */
253 
254 /* qe_mregs.xmtfs: transmit frame status. */
255 #define	QE_MR_XMTFS_XMTSV	0x80		/* tx valid */
256 #define	QE_MR_XMTFS_UFLO	0x40		/* tx underflow */
257 #define	QE_MR_XMTFS_LCOL	0x20		/* tx late collision */
258 #define	QE_MR_XMTFS_MORE	0x10		/* tx > 1 retries */
259 #define	QE_MR_XMTFS_ONE		0x08		/* tx 1 retry */
260 #define	QE_MR_XMTFS_DEFER	0x04		/* tx pkt deferred */
261 #define	QE_MR_XMTFS_LCAR	0x02		/* tx carrier lost */
262 #define	QE_MR_XMTFS_RTRY	0x01		/* tx retry error */
263 
264 /* qe_mregs.xmtrc: transmit retry count. */
265 #define	QE_MR_XMTRC_EXDEF	0x80		/* tx excess defers */
266 #define	QE_MR_XMTRC_XMTRC	0x0f		/* tx retry count mask */
267 
268 /* qe_mregs.rcvfc: receive frame control. */
269 #define	QE_MR_RCVFC_LLRCV	0x08		/* rx low latency */
270 #define	QE_MR_RCVFC_MR		0x04		/* rx addr match/reject */
271 #define	QE_MR_RCVFC_ASTRPRCV	0x01		/* rx auto strip */
272 
273 /* qe_mregs.rcvfs: receive frame status. */
274 #define	QE_MR_RCVFS_OFLO	0x80		/* rx overflow */
275 #define	QE_MR_RCVFS_CLSN	0x40		/* rx late collision */
276 #define	QE_MR_RCVFS_FRAM	0x20		/* rx framing error */
277 #define	QE_MR_RCVFS_FCS		0x10		/* rx fcs error */
278 #define	QE_MR_RCVFS_RCVCNT	0x0f		/* rx msg byte count mask */
279 
280 /* qe_mregs.fifofc: fifo frame count. */
281 #define	QE_MR_FIFOFC_RCVFC	0xf0		/* rx fifo frame count */
282 #define	QE_MR_FIFOFC_XMTFC	0x0f		/* tx fifo frame count */
283 
284 /* qe_mregs.ir: interrupt register. */
285 #define	QE_MR_IR_JAB		0x80		/* jabber error */
286 #define	QE_MR_IR_BABL		0x40		/* babble error */
287 #define	QE_MR_IR_CERR		0x20		/* collision error */
288 #define	QE_MR_IR_RCVCCO		0x10		/* collision cnt overflow */
289 #define	QE_MR_IR_RNTPCO		0x08		/* runt pkt cnt overflow */
290 #define	QE_MR_IR_MPCO		0x04		/* miss pkt cnt overflow */
291 #define	QE_MR_IR_RCVINT		0x02		/* packet received */
292 #define	QE_MR_IR_XMTINT		0x01		/* packet transmitted */
293 
294 /* qe_mregs.imr: interrupt mask register. */
295 #define	QE_MR_IMR_JABM		0x80		/* jabber errors */
296 #define	QE_MR_IMR_BABLM		0x40		/* babble errors */
297 #define	QE_MR_IMR_CERRM		0x20		/* collision errors */
298 #define	QE_MR_IMR_RCVCCOM	0x10		/* rx collision count oflow */
299 #define	QE_MR_IMR_RNTPCOM	0x08		/* runt pkt cnt ovrflw */
300 #define	QE_MR_IMR_MPCOM		0x04		/* miss pkt cnt ovrflw */
301 #define	QE_MR_IMR_RCVINTM	0x02		/* rx interrupts */
302 #define	QE_MR_IMR_XMTINTM	0x01		/* tx interrupts */
303 
304 /* qe_mregs.pr: poll register. */
305 #define	QE_MR_PR_XMTSV		0x80		/* tx status is valid */
306 #define	QE_MR_PR_TDTREQ		0x40		/* tx data xfer request */
307 #define	QE_MR_PR_RDTREQ		0x20		/* rx data xfer request */
308 
309 /* qe_mregs.biucc: biu config control. */
310 #define	QE_MR_BIUCC_BSWAP	0x40		/* byte swap */
311 #define	QE_MR_BIUCC_4TS		0x00		/* 4byte xmit start point */
312 #define	QE_MR_BIUCC_16TS	0x10		/* 16byte xmit start point */
313 #define	QE_MR_BIUCC_64TS	0x20		/* 64byte xmit start point */
314 #define	QE_MR_BIUCC_112TS	0x30		/* 112byte xmit start point */
315 #define	QE_MR_BIUCC_SWRST	0x01		/* sw-reset mace */
316 
317 /* qe_mregs.fifocc: fifo config control. */
318 #define	QE_MR_FIFOCC_TXF8	0x00		/* tx fifo 8 write cycles */
319 #define	QE_MR_FIFOCC_TXF32	0x80		/* tx fifo 32 write cycles */
320 #define	QE_MR_FIFOCC_TXF16	0x40		/* tx fifo 16 write cycles */
321 #define	QE_MR_FIFOCC_RXF64	0x20		/* rx fifo 64 write cycles */
322 #define	QE_MR_FIFOCC_RXF32	0x10		/* rx fifo 32 write cycles */
323 #define	QE_MR_FIFOCC_RXF16	0x00		/* rx fifo 16 write cycles */
324 #define	QE_MR_FIFOCC_TFWU	0x08		/* tx fifo watermark update */
325 #define	QE_MR_FIFOCC_RFWU	0x04		/* rx fifo watermark update */
326 #define	QE_MR_FIFOCC_XMTBRST	0x02		/* tx burst enable */
327 #define	QE_MR_FIFOCC_RCVBRST	0x01		/* rx burst enable */
328 
329 /* qe_mregs.maccc: mac config control. */
330 #define	QE_MR_MACCC_PROM	0x80		/* promiscuous mode enable */
331 #define	QE_MR_MACCC_DXMT2PD	0x40		/* tx 2part deferral enable */
332 #define	QE_MR_MACCC_EMBA	0x20		/* modified backoff enable */
333 #define	QE_MR_MACCC_DRCVPA	0x08		/* rx physical addr disable */
334 #define	QE_MR_MACCC_DRCVBC	0x04		/* rx broadcast disable */
335 #define	QE_MR_MACCC_ENXMT	0x02		/* enable transmitter */
336 #define	QE_MR_MACCC_ENRCV	0x01		/* enable receiver */
337 
338 /* qe_mregs.plscc: pls config control. */
339 #define	QE_MR_PLSCC_XMTSEL	0x08		/* tx mode select */
340 #define QE_MR_PLSCC_PORTMASK	0x06		/* port selection bits */
341 #define	 QE_MR_PLSCC_GPSI	0x06		/* use gpsi connector */
342 #define	 QE_MR_PLSCC_DAI	0x04		/* use dai connector */
343 #define	 QE_MR_PLSCC_TP		0x02		/* use twistedpair connector */
344 #define	 QE_MR_PLSCC_AUI	0x00		/* use aui connector */
345 #define	QE_MR_PLSCC_ENPLSIO	0x01		/* pls i/o enable */
346 
347 /* qe_mregs.phycc: phy config control. */
348 #define	QE_MR_PHYCC_LNKFL	0x80		/* link fail */
349 #define	QE_MR_PHYCC_DLNKTST	0x40		/* disable link test logic */
350 #define	QE_MR_PHYCC_REVPOL	0x20		/* rx polarity */
351 #define	QE_MR_PHYCC_DAPC	0x10		/* autopolaritycorrect disab */
352 #define	QE_MR_PHYCC_LRT		0x08		/* select low threshold */
353 #define	QE_MR_PHYCC_ASEL	0x04		/* connector port auto-sel */
354 #define	QE_MR_PHYCC_RWAKE	0x02		/* remote wakeup */
355 #define	QE_MR_PHYCC_AWAKE	0x01		/* auto wakeup */
356 
357 /* qe_mregs.iac: internal address config. */
358 #define	QE_MR_IAC_ADDRCHG	0x80		/* start address change */
359 #define	QE_MR_IAC_PHYADDR	0x04		/* physical address reset */
360 #define	QE_MR_IAC_LOGADDR	0x02		/* logical address reset */
361 
362 /* qe_mregs.utr: user test register. */
363 #define	QE_MR_UTR_RTRE		0x80		/* enable resv test register */
364 #define	QE_MR_UTR_RTRD		0x40		/* disab resv test register */
365 #define	QE_MR_UTR_RPA		0x20		/* accept runt packets */
366 #define	QE_MR_UTR_FCOLL		0x10		/* force collision status */
367 #define	QE_MR_UTR_RCVSFCSE	0x08		/* enable fcs on rx */
368 #define	QE_MR_UTR_INTLOOPM	0x06		/* Internal loopback w/mandec */
369 #define	QE_MR_UTR_INTLOOP	0x04		/* Internal loopback */
370 #define	QE_MR_UTR_EXTLOOP	0x02		/* external loopback */
371 #define	QE_MR_UTR_NOLOOP	0x00		/* no loopback */
372 
373 /* Buffer and Ring sizes: fixed ring size */
374 #define	QE_TX_RING_MAXSIZE	256		/* maximum tx ring size */
375 #define	QE_RX_RING_MAXSIZE	256		/* maximum rx ring size */
376 #define	QE_TX_RING_SIZE		16
377 #define	QE_RX_RING_SIZE		16
378 #define	QE_PKT_BUF_SZ		2048
379 
380 #define	MC_POLY_LE		0xedb88320	/* mcast crc, little endian */
381