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