xref: /reactos/drivers/network/dd/pcnet/pcnethw.h (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * ReactOS AMD PCNet Driver
3*c2c66affSColin Finck  *
4*c2c66affSColin Finck  * Copyright (C) 2003 Vizzini <vizzini@plasmic.com>
5*c2c66affSColin Finck  *
6*c2c66affSColin Finck  * This program is free software; you can redistribute it and/or modify
7*c2c66affSColin Finck  * it under the terms of the GNU General Public License as published by
8*c2c66affSColin Finck  * the Free Software Foundation; either version 2 of the License, or
9*c2c66affSColin Finck  * (at your option) any later version.
10*c2c66affSColin Finck  *
11*c2c66affSColin Finck  * This program is distributed in the hope that it will be useful,
12*c2c66affSColin Finck  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*c2c66affSColin Finck  * GNU General Public License for more details.
15*c2c66affSColin Finck  *
16*c2c66affSColin Finck  * You should have received a copy of the GNU General Public License along
17*c2c66affSColin Finck  * with this program; if not, write to the Free Software Foundation, Inc.,
18*c2c66affSColin Finck  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*c2c66affSColin Finck  *
20*c2c66affSColin Finck  * PURPOSE:
21*c2c66affSColin Finck  *     PCNet hardware configuration constants
22*c2c66affSColin Finck  * REVISIONS:
23*c2c66affSColin Finck  *     01-Sept-2003 vizzini - Created
24*c2c66affSColin Finck  * NOTES:
25*c2c66affSColin Finck  *     - This file represents a clean re-implementation from the AMD
26*c2c66affSColin Finck  *       PCNet II chip documentation (Am79C790A, pub# 19436).
27*c2c66affSColin Finck  */
28*c2c66affSColin Finck 
29*c2c66affSColin Finck #pragma once
30*c2c66affSColin Finck 
31*c2c66affSColin Finck /* when in 32-bit mode, most registers require the top 16 bits be 0. */
32*c2c66affSColin Finck #define MASK16(__x__) ((__x__) & 0x0000ffff)
33*c2c66affSColin Finck 
34*c2c66affSColin Finck #define NUMBER_OF_PORTS 0x20    /* number of i/o ports the board requires */
35*c2c66affSColin Finck 
36*c2c66affSColin Finck /* offsets of important registers */
37*c2c66affSColin Finck #define RDP     0x10    /* same address in 16-bit and 32-bit IO mode */
38*c2c66affSColin Finck 
39*c2c66affSColin Finck #define RAP16   0x12
40*c2c66affSColin Finck #define RESET16 0x14
41*c2c66affSColin Finck #define BDP16   0x16
42*c2c66affSColin Finck 
43*c2c66affSColin Finck #define RAP32   0x14
44*c2c66affSColin Finck #define RESET32 0x18
45*c2c66affSColin Finck #define BDP32   0x1c
46*c2c66affSColin Finck 
47*c2c66affSColin Finck /* NOTE:  vmware doesn't support 32-bit i/o programming so we use 16-bit */
48*c2c66affSColin Finck #define RAP RAP16
49*c2c66affSColin Finck #define BDP BDP16
50*c2c66affSColin Finck 
51*c2c66affSColin Finck /* pci id of the device */
52*c2c66affSColin Finck #define PCI_ID 0x20001022
53*c2c66affSColin Finck #define VEN_ID 0x1022
54*c2c66affSColin Finck #define DEV_ID 0x2000
55*c2c66affSColin Finck 
56*c2c66affSColin Finck /* software style constants */
57*c2c66affSColin Finck #define SW_STYLE_0 0
58*c2c66affSColin Finck #define SW_STYLE_1 1
59*c2c66affSColin Finck #define SW_STYLE_2 2
60*c2c66affSColin Finck #define SW_STYLE_3 3
61*c2c66affSColin Finck 
62*c2c66affSColin Finck /* control and status registers */
63*c2c66affSColin Finck #define CSR0   0x0      /* controller status register */
64*c2c66affSColin Finck #define CSR1   0x1      /* init block address 0 */
65*c2c66affSColin Finck #define CSR2   0x2      /* init block address 1 */
66*c2c66affSColin Finck #define CSR3   0x3      /* interrupt masks and deferral control */
67*c2c66affSColin Finck #define CSR4   0x4      /* test and features control */
68*c2c66affSColin Finck #define CSR5   0x5      /* extended control and interrupt */
69*c2c66affSColin Finck #define CSR6   0x6      /* rx/tx descriptor table length */
70*c2c66affSColin Finck #define CSR8   0x8      /* logical address filter 0 */
71*c2c66affSColin Finck #define CSR9   0x9      /* logical address filter 1 */
72*c2c66affSColin Finck #define CSR10  0xa      /* logical address filter 2 */
73*c2c66affSColin Finck #define CSR11  0xb      /* logical address filter 3 */
74*c2c66affSColin Finck #define CSR12  0xc      /* physical address register 0 */
75*c2c66affSColin Finck #define CSR13  0xd      /* physical address register 1 */
76*c2c66affSColin Finck #define CSR14  0xe      /* physical address register 2 */
77*c2c66affSColin Finck #define CSR15  0xf      /* Mode */
78*c2c66affSColin Finck #define CSR16  0x10     /* initialization block address lower */
79*c2c66affSColin Finck #define CSR17  0x11     /* initialization block address upper */
80*c2c66affSColin Finck #define CSR18  0x12     /* current receive buffer address lower */
81*c2c66affSColin Finck #define CSR19  0x13     /* current receive buffer address upper */
82*c2c66affSColin Finck #define CSR20  0x14     /* current transmit buffer address lower */
83*c2c66affSColin Finck #define CSR21  0x15     /* current transmit buffer address upper */
84*c2c66affSColin Finck #define CSR22  0x16     /* next receive buffer address lower */
85*c2c66affSColin Finck #define CSR23  0x17     /* next receive buffer address upper */
86*c2c66affSColin Finck #define CSR24  0x18     /* base address of receive descriptor ring lower */
87*c2c66affSColin Finck #define CSR25  0x19     /* base address of receive descriptor ring upper */
88*c2c66affSColin Finck #define CSR26  0x1a     /* next receive descriptor address lower */
89*c2c66affSColin Finck #define CSR27  0x1b     /* next receive descriptor address upper */
90*c2c66affSColin Finck #define CSR28  0x1c     /* current receive descriptor address lower */
91*c2c66affSColin Finck #define CSR29  0x1d     /* current receive descriptor address upper */
92*c2c66affSColin Finck #define CSR30  0x1e     /* base address of transmit descriptor ring lower */
93*c2c66affSColin Finck #define CSR31  0x1f     /* base address of transmit descriptor ring upper */
94*c2c66affSColin Finck #define CSR32  0x20     /* next transmit descriptor address lower */
95*c2c66affSColin Finck #define CSR33  0x21     /* next transmit descriptor address upper */
96*c2c66affSColin Finck #define CSR34  0x22     /* current transmit descriptor address lower */
97*c2c66affSColin Finck #define CSR35  0x23     /* current transmit descriptor address upper */
98*c2c66affSColin Finck #define CSR36  0x24     /* next next receive descriptor address lower */
99*c2c66affSColin Finck #define CSR37  0x25     /* next next receive descriptor address upper */
100*c2c66affSColin Finck #define CSR38  0x26     /* next next transmit descriptor address lower */
101*c2c66affSColin Finck #define CSR39  0x27     /* next next transmit descriptor address upper */
102*c2c66affSColin Finck #define CSR40  0x28     /* current receive byte count */
103*c2c66affSColin Finck #define CSR41  0x29     /* current receive status */
104*c2c66affSColin Finck #define CSR42  0x2a     /* current transmit byte count */
105*c2c66affSColin Finck #define CSR43  0x2b     /* current transmit status */
106*c2c66affSColin Finck #define CSR44  0x2c     /* next receive byte count */
107*c2c66affSColin Finck #define CSR45  0x2d     /* next receive status */
108*c2c66affSColin Finck #define CSR46  0x2e     /* poll time counter */
109*c2c66affSColin Finck #define CSR47  0x2f     /* polling interval */
110*c2c66affSColin Finck #define CSR58  0x3a     /* software style */
111*c2c66affSColin Finck #define CSR60  0x3c     /* previous transmit descriptor address lower */
112*c2c66affSColin Finck #define CSR61  0x3d     /* previous transmit descriptor address upper */
113*c2c66affSColin Finck #define CSR62  0x3e     /* previous transmit byte count */
114*c2c66affSColin Finck #define CSR63  0x3f     /* previous transmit status */
115*c2c66affSColin Finck #define CSR64  0x40     /* next transmit buffer address lower */
116*c2c66affSColin Finck #define CSR65  0x41     /* next transmit buffer address upper */
117*c2c66affSColin Finck #define CSR66  0x42     /* next transmit byte count */
118*c2c66affSColin Finck #define CSR67  0x43     /* next transmit status */
119*c2c66affSColin Finck #define CSR72  0x48     /* receive descriptor ring counter */
120*c2c66affSColin Finck #define CSR74  0x4a     /* transmit descriptor ring counter */
121*c2c66affSColin Finck #define CSR76  0x4c     /* receive descriptor ring length */
122*c2c66affSColin Finck #define CSR78  0x4e     /* transmit descriptor ring length */
123*c2c66affSColin Finck #define CSR80  0x50     /* dma transfer counter and fifo watermark control */
124*c2c66affSColin Finck #define CSR82  0x52     /* bus activity timer */
125*c2c66affSColin Finck #define CSR84  0x54     /* dma address register lower */
126*c2c66affSColin Finck #define CSR85  0x55     /* dma address register upper */
127*c2c66affSColin Finck #define CSR86  0x56     /* buffer byte counter */
128*c2c66affSColin Finck #define CSR88  0x58     /* chip id register lower */
129*c2c66affSColin Finck #define CSR89  0x59     /* chip id register upper */
130*c2c66affSColin Finck #define CSR94  0x5e     /* transmit time domain reflectometry count */
131*c2c66affSColin Finck #define CSR100 0x64     /* bus timeout */
132*c2c66affSColin Finck #define CSR112 0x70     /* missed frame count */
133*c2c66affSColin Finck #define CSR114 0x72     /* receive collision count */
134*c2c66affSColin Finck #define CSR122 0x7a     /* advanced feature control */
135*c2c66affSColin Finck #define CSR124 0x7c     /* test register control */
136*c2c66affSColin Finck 
137*c2c66affSColin Finck /* bus configuration registers */
138*c2c66affSColin Finck #define BCR2   0x2      /* miscellaneous configuration */
139*c2c66affSColin Finck #define BCR4   0x4      /* link status led */
140*c2c66affSColin Finck #define BCR5   0x5      /* led1 status */
141*c2c66affSColin Finck #define BCR6   0x6      /* led2 status */
142*c2c66affSColin Finck #define BCR7   0x7      /* led3 status */
143*c2c66affSColin Finck #define BCR9   0x9      /* full-duplex control */
144*c2c66affSColin Finck #define BCR16  0x10     /* i/o base address lower */
145*c2c66affSColin Finck #define BCR17  0x11     /* i/o base address upper */
146*c2c66affSColin Finck #define BCR18  0x12     /* burst and bus control register */
147*c2c66affSColin Finck #define BCR19  0x13     /* eeprom control and status */
148*c2c66affSColin Finck #define BCR20  0x14     /* software style */
149*c2c66affSColin Finck #define BCR21  0x15     /* interrupt control */
150*c2c66affSColin Finck #define BCR22  0x16     /* pci latency register */
151*c2c66affSColin Finck 
152*c2c66affSColin Finck /* CSR0 bits */
153*c2c66affSColin Finck #define CSR0_INIT  0x1          /* read initialization block */
154*c2c66affSColin Finck #define CSR0_STRT  0x2          /* start the chip */
155*c2c66affSColin Finck #define CSR0_STOP  0x4          /* stop the chip */
156*c2c66affSColin Finck #define CSR0_TDMD  0x8          /* transmit demand */
157*c2c66affSColin Finck #define CSR0_TXON  0x10         /* transmit on */
158*c2c66affSColin Finck #define CSR0_RXON  0x20         /* receive on */
159*c2c66affSColin Finck #define CSR0_IENA  0x40         /* interrupt enabled */
160*c2c66affSColin Finck #define CSR0_INTR  0x80         /* interrupting */
161*c2c66affSColin Finck #define CSR0_IDON  0x100        /* initialization done */
162*c2c66affSColin Finck #define CSR0_TINT  0x200        /* transmit interrupt */
163*c2c66affSColin Finck #define CSR0_RINT  0x400        /* receive interrupt */
164*c2c66affSColin Finck #define CSR0_MERR  0x800        /* memory error */
165*c2c66affSColin Finck #define CSR0_MISS  0x1000       /* missed frame */
166*c2c66affSColin Finck #define CSR0_CERR  0x2000       /* collision error */
167*c2c66affSColin Finck #define CSR0_BABL  0x4000       /* babble */
168*c2c66affSColin Finck #define CSR0_ERR   0x8000       /* error */
169*c2c66affSColin Finck 
170*c2c66affSColin Finck /* CSR3 bits */
171*c2c66affSColin Finck #define CSR3_BSWP    0x4        /* byte swap */
172*c2c66affSColin Finck #define CSR3_EMBA    0x8        /* enable modified backoff algorithm */
173*c2c66affSColin Finck #define CSR3_DXMT2PD 0x10       /* disable transmit two-part deferral */
174*c2c66affSColin Finck #define CSR3_LAPPEN  0x20       /* lookahead packet processing enable */
175*c2c66affSColin Finck #define CSR3_DXSUFLO 0x40       /* disable transmit stop on underflow */
176*c2c66affSColin Finck #define CSR3_IDONM   0x100      /* initialization done mask */
177*c2c66affSColin Finck #define CSR3_TINTM   0x200      /* transmit interrupt mask */
178*c2c66affSColin Finck #define CSR3_RINTM   0x400      /* receive interrupt mask */
179*c2c66affSColin Finck #define CSR3_MERRM   0x800      /* memory error interrupt mask */
180*c2c66affSColin Finck #define CSR3_MISSM   0x1000     /* missed frame interrupt mask */
181*c2c66affSColin Finck #define CSR3_BABLM   0x4000     /* babble interrupt mask */
182*c2c66affSColin Finck 
183*c2c66affSColin Finck /* CSR4 bits */
184*c2c66affSColin Finck #define CSR4_JABM      0x1      /* jabber interrupt mask */
185*c2c66affSColin Finck #define CSR4_JAB       0x2      /* interrupt on jabber error */
186*c2c66affSColin Finck #define CSR4_TXSTRTM   0x4      /* transmit start interrupt mask */
187*c2c66affSColin Finck #define CSR4_TXSTRT    0x8      /* interrupt on transmit start */
188*c2c66affSColin Finck #define CSR4_RCVCCOM   0x10     /* receive collision counter overflow mask */
189*c2c66affSColin Finck #define CSR4_RCVCCO    0X20     /* interrupt on receive collision counter overflow */
190*c2c66affSColin Finck #define CSR4_UINT      0x40     /* user interrupt */
191*c2c66affSColin Finck #define CSR4_UINTCMD   0x80     /* user interrupt command */
192*c2c66affSColin Finck #define CSR4_MFCOM     0x100    /* missed frame counter overflow mask */
193*c2c66affSColin Finck #define CSR4_MFCO      0x200    /* interrupt on missed frame counter overflow */
194*c2c66affSColin Finck #define CSR4_ASTRP_RCV 0x400    /* auto pad strip on receive */
195*c2c66affSColin Finck #define CSR4_APAD_XMT  0x800    /* auto pad on transmit */
196*c2c66affSColin Finck #define CSR4_DPOLL     0x1000   /* disable transmit polling */
197*c2c66affSColin Finck #define CSR4_TIMER     0x2000   /* enable bus activity timer */
198*c2c66affSColin Finck #define CSR4_DMAPLUS   0x4000   /* set to 1 for pci */
199*c2c66affSColin Finck #define CSR4_EN124     0x8000   /* enable CSR124 access */
200*c2c66affSColin Finck 
201*c2c66affSColin Finck /* CSR5 bits */
202*c2c66affSColin Finck #define CSR5_SPND      0x1      /* suspend */
203*c2c66affSColin Finck #define CSR5_MPMODE    0x2      /* magic packet mode */
204*c2c66affSColin Finck #define CSR5_MPEN      0x4      /* magic packet enable */
205*c2c66affSColin Finck #define CSR5_MPINTE    0x8      /* magic packet interrupt enable */
206*c2c66affSColin Finck #define CSR5_MPINT     0x10     /* magic packet interrupt */
207*c2c66affSColin Finck #define CSR5_MPPLBA    0x20     /* magic packet physical logical broadcast accept */
208*c2c66affSColin Finck #define CSR5_EXDINTE   0x40     /* excessive deferral interrupt enable */
209*c2c66affSColin Finck #define CSR5_EXDINT    0x80     /* excessive deferral interrupt */
210*c2c66affSColin Finck #define CSR5_SLPINTE   0x100    /* sleep interrupt enable */
211*c2c66affSColin Finck #define CSR5_SLPINT    0x200    /* sleep interrupt */
212*c2c66affSColin Finck #define CSR5_SINE      0x400    /* system interrupt enable */
213*c2c66affSColin Finck #define CSR5_SINT      0x800    /* system interrupt */
214*c2c66affSColin Finck #define CSR5_LTINTEN   0x4000   /* last transmit interrupt enable */
215*c2c66affSColin Finck #define CSR5_TOKINTD   0x8000   /* transmit ok interrupt disable */
216*c2c66affSColin Finck 
217*c2c66affSColin Finck /* CSR15 bits */
218*c2c66affSColin Finck #define CSR15_DRX      0x1      /* disable receiver */
219*c2c66affSColin Finck #define CSR15_DTX      0x2      /* disable transmitter */
220*c2c66affSColin Finck #define CSR15_LOOP     0x4      /* loopback enable */
221*c2c66affSColin Finck #define CSR15_DXMTFCS  0x8      /* disable transmit fcs */
222*c2c66affSColin Finck #define CSR15_FCOLL    0x10     /* force collision */
223*c2c66affSColin Finck #define CSR15_DRTY     0x20     /* disable retry */
224*c2c66affSColin Finck #define CSR15_INTL     0x40     /* internal loopback */
225*c2c66affSColin Finck #define CSR15_PORTSEL0 0x80     /* port selection bit 0 */
226*c2c66affSColin Finck #define CSR15_PORTSEL1 0x100    /* port selection bit 1 */
227*c2c66affSColin Finck #define CSR15_LRT      0x200    /* low receive threshold - same as TSEL */
228*c2c66affSColin Finck #define CSR15_TSEL     0x200    /* transmit mode select - same as LRT */
229*c2c66affSColin Finck #define CSR15_MENDECL  0x400    /* mendec loopback mode */
230*c2c66affSColin Finck #define CSR15_DAPC     0x800    /* disable automatic parity correction */
231*c2c66affSColin Finck #define CSR15_DLNKTST  0x1000   /* disable link status */
232*c2c66affSColin Finck #define CSR15_DRCVPA   0x2000   /* disable receive physical address */
233*c2c66affSColin Finck #define CSR15_DRCVBC   0x4000   /* disable receive broadcast */
234*c2c66affSColin Finck #define CSR15_PROM     0x8000   /* promiscuous mode */
235*c2c66affSColin Finck 
236*c2c66affSColin Finck /* CSR58 bits */
237*c2c66affSColin Finck #define CSR58_SSIZE32  0x100    /* 32-bit software size */
238*c2c66affSColin Finck #define CSR58_CSRPCNET 0x200    /* csr pcnet-isa configuration */
239*c2c66affSColin Finck #define CSR58_APERREN  0x400    /* advanced parity error handling enable */
240*c2c66affSColin Finck 
241*c2c66affSColin Finck /* CSR124 bits */
242*c2c66affSColin Finck #define CSR124_RPA     0x4      /* runt packet accept */
243*c2c66affSColin Finck 
244*c2c66affSColin Finck /* BCR2 bits */
245*c2c66affSColin Finck #define BCR2_ASEL      0x2      /* auto-select media */
246*c2c66affSColin Finck #define BCR2_AWAKE     0x4      /* select sleep mode */
247*c2c66affSColin Finck #define BCR2_EADISEL   0x8      /* eadi select */
248*c2c66affSColin Finck #define BCR2_DXCVRPOL  0x10     /* dxcvr polarity */
249*c2c66affSColin Finck #define BCR2_DXCVRCTL  0x20     /* dxcvr control */
250*c2c66affSColin Finck #define BCR2_INTLEVEL  0x80     /* interrupt level/edge */
251*c2c66affSColin Finck #define BCR2_APROMWE   0x100    /* address prom write enable */
252*c2c66affSColin Finck #define BCR2_LEDPE     0x1000   /* LED programming enable */
253*c2c66affSColin Finck #define BCR2_TMAULOOP  0x4000   /* t-mau transmit on loopback */
254*c2c66affSColin Finck 
255*c2c66affSColin Finck /* BCR4 bits */
256*c2c66affSColin Finck #define BCR4_COLE      0x1      /* collision status enable */
257*c2c66affSColin Finck #define BCR4_JABE      0x2      /* jabber status enable */
258*c2c66affSColin Finck #define BCR4_RCVE      0x4      /* receive status enable */
259*c2c66affSColin Finck #define BCR4_RXPOLE    0x8      /* receive polarity status enable */
260*c2c66affSColin Finck #define BCR4_XMTE      0x10     /* transmit status enable */
261*c2c66affSColin Finck #define BCR4_RCVME     0x20     /* receive match status enable */
262*c2c66affSColin Finck #define BCR4_LNKSTE    0x40     /* link status enable */
263*c2c66affSColin Finck #define BCR4_PSE       0x80     /* pulse stretcher enable */
264*c2c66affSColin Finck #define BCR4_FDLSE     0x100    /* full-duplex link status enable */
265*c2c66affSColin Finck #define BCR4_MPSE      0x200    /* magic packet status enable */
266*c2c66affSColin Finck #define BCR4_E100      0x1000   /* link speed */
267*c2c66affSColin Finck #define BCR4_LEDDIS    0x2000   /* led disable */
268*c2c66affSColin Finck #define BCR4_LEDPOL    0x4000   /* led polarity */
269*c2c66affSColin Finck #define BCR4_LEDOUT    0x8000   /* led output pin value */
270*c2c66affSColin Finck 
271*c2c66affSColin Finck /* BCR5 bits */
272*c2c66affSColin Finck #define BCR5_COLE      0x1      /* collision status enable */
273*c2c66affSColin Finck #define BCR5_JABE      0x2      /* jabber status enable */
274*c2c66affSColin Finck #define BCR5_RCVE      0x4      /* receive status enable */
275*c2c66affSColin Finck #define BCR5_RXPOLE    0x8      /* receive polarity status enable */
276*c2c66affSColin Finck #define BCR5_XMTE      0x10     /* transmit status enable */
277*c2c66affSColin Finck #define BCR5_RCVME     0x20     /* receive match status enable */
278*c2c66affSColin Finck #define BCR5_LNKSTE    0x40     /* link status enable */
279*c2c66affSColin Finck #define BCR5_PSE       0x80     /* pulse stretcher enable */
280*c2c66affSColin Finck #define BCR5_FDLSE     0x100    /* full-duplex link status enable */
281*c2c66affSColin Finck #define BCR5_MPSE      0x200    /* magic packet status enable */
282*c2c66affSColin Finck #define BCR5_E100      0x1000   /* link speed */
283*c2c66affSColin Finck #define BCR5_LEDDIS    0x2000   /* led disable */
284*c2c66affSColin Finck #define BCR5_LEDPOL    0x4000   /* led polarity */
285*c2c66affSColin Finck #define BCR5_LEDOUT    0x8000   /* led output pin value */
286*c2c66affSColin Finck 
287*c2c66affSColin Finck /* BCR6 bits */
288*c2c66affSColin Finck #define BCR6_COLE      0x1      /* collision status enable */
289*c2c66affSColin Finck #define BCR6_JABE      0x2      /* jabber status enable */
290*c2c66affSColin Finck #define BCR6_RCVE      0x4      /* receive status enable */
291*c2c66affSColin Finck #define BCR6_RXPOLE    0x8      /* receive polarity status enable */
292*c2c66affSColin Finck #define BCR6_XMTE      0x10     /* transmit status enable */
293*c2c66affSColin Finck #define BCR6_RCVME     0x20     /* receive match status enable */
294*c2c66affSColin Finck #define BCR6_LNKSTE    0x40     /* link status enable */
295*c2c66affSColin Finck #define BCR6_PSE       0x80     /* pulse stretcher enable */
296*c2c66affSColin Finck #define BCR6_FDLSE     0x100    /* full-duplex link status enable */
297*c2c66affSColin Finck #define BCR6_MPSE      0x200    /* magic packet status enable */
298*c2c66affSColin Finck #define BCR6_E100      0x1000   /* link speed */
299*c2c66affSColin Finck #define BCR6_LEDDIS    0x2000   /* led disable */
300*c2c66affSColin Finck #define BCR6_LEDPOL    0x4000   /* led polarity */
301*c2c66affSColin Finck #define BCR6_LEDOUT    0x8000   /* led output pin value */
302*c2c66affSColin Finck 
303*c2c66affSColin Finck /* BCR7 bits */
304*c2c66affSColin Finck #define BCR7_COLE      0x1      /* collision status enable */
305*c2c66affSColin Finck #define BCR7_JABE      0x2      /* jabber status enable */
306*c2c66affSColin Finck #define BCR7_RCVE      0x4      /* receive status enable */
307*c2c66affSColin Finck #define BCR7_RXPOLE    0x8      /* receive polarity status enable */
308*c2c66affSColin Finck #define BCR7_XMTE      0x10     /* transmit status enable */
309*c2c66affSColin Finck #define BCR7_RCVME     0x20     /* receive match status enable */
310*c2c66affSColin Finck #define BCR7_LNKSTE    0x40     /* link status enable */
311*c2c66affSColin Finck #define BCR7_PSE       0x80     /* pulse stretcher enable */
312*c2c66affSColin Finck #define BCR7_FDLSE     0x100    /* full-duplex link status enable */
313*c2c66affSColin Finck #define BCR7_MPSE      0x200    /* magic packet status enable */
314*c2c66affSColin Finck #define BCR7_E100      0x1000   /* link speed */
315*c2c66affSColin Finck #define BCR7_LEDDIS    0x2000   /* led disable */
316*c2c66affSColin Finck #define BCR7_LEDPOL    0x4000   /* led polarity */
317*c2c66affSColin Finck #define BCR7_LEDOUT    0x8000   /* led output pin value */
318*c2c66affSColin Finck 
319*c2c66affSColin Finck /* BCR9 bits */
320*c2c66affSColin Finck #define BCR9_FDEN      0x1      /* full-duplex enable */
321*c2c66affSColin Finck #define BCR9_AUIFD     0x2      /* aui full-duplex */
322*c2c66affSColin Finck #define BCR9_FDRPAD    0x4      /* full-duplex runt packet accept disable */
323*c2c66affSColin Finck 
324*c2c66affSColin Finck /* BCR18 bits */
325*c2c66affSColin Finck #define BCR18_BWRITE   0x20     /* burst write enable */
326*c2c66affSColin Finck #define BCR18_BREADE   0x40     /* burst read enable */
327*c2c66affSColin Finck #define BCR18_DWIO     0x80     /* dword i/o enable */
328*c2c66affSColin Finck #define BCR18_EXTREQ   0x100    /* extended request */
329*c2c66affSColin Finck #define BCR18_MEMCMD   0x200    /* memory command */
330*c2c66affSColin Finck 
331*c2c66affSColin Finck /* BCR19 bits */
332*c2c66affSColin Finck #define BCR19_EDI      0x1      /* eeprom data in - same as EDO */
333*c2c66affSColin Finck #define BCR19_ED0      0x1      /* eeprom data out - same as EDI */
334*c2c66affSColin Finck #define BCR19_ESK      0x2      /* eeprom serial clock */
335*c2c66affSColin Finck #define BCR19_ECS      0x4      /* eeprom chip select */
336*c2c66affSColin Finck #define BCR19_EEN      0x8      /* eeprom port enable */
337*c2c66affSColin Finck #define BCR19_EEDET    0x2000   /* eeprom detect */
338*c2c66affSColin Finck #define BCR19_PREAD    0x4000   /* eeprom read */
339*c2c66affSColin Finck #define BCR19_PVALID   0x8000   /* eeprom valid */
340*c2c66affSColin Finck 
341*c2c66affSColin Finck /* BCR20 bits */
342*c2c66affSColin Finck #define BCR20_SSIZE32  0x100    /* 32-bit software size */
343*c2c66affSColin Finck #define BCR20_CSRPCNET 0x200    /* csr pcnet-isa configuration */
344*c2c66affSColin Finck #define BCR20_APERREN  0x400    /* advanced parity error handling enable */
345*c2c66affSColin Finck 
346*c2c66affSColin Finck /* initialization block for 32-bit software style */
347*c2c66affSColin Finck typedef struct _INITIALIZATION_BLOCK
348*c2c66affSColin Finck {
349*c2c66affSColin Finck   USHORT MODE;          /* card mode (csr15) */
350*c2c66affSColin Finck   UCHAR  RLEN;          /* encoded number of receive descriptor ring entries */
351*c2c66affSColin Finck   UCHAR  TLEN;          /* encoded number of transmit descriptor ring entries */
352*c2c66affSColin Finck   UCHAR  PADR[6];       /* physical address */
353*c2c66affSColin Finck   USHORT RES;           /* reserved */
354*c2c66affSColin Finck   UCHAR  LADR[8];       /* logical address */
355*c2c66affSColin Finck   ULONG  RDRA;          /* receive descriptor ring address */
356*c2c66affSColin Finck   ULONG  TDRA;          /* transmit descriptor ring address */
357*c2c66affSColin Finck } INITIALIZATION_BLOCK, *PINITIALIZATION_BLOCK;
358*c2c66affSColin Finck 
359*c2c66affSColin Finck /* receive descriptor, software stle 2 (32-bit) */
360*c2c66affSColin Finck typedef struct _RECEIVE_DESCRIPTOR
361*c2c66affSColin Finck {
362*c2c66affSColin Finck   ULONG  RBADR;         /* receive buffer address */
363*c2c66affSColin Finck   USHORT BCNT;          /* two's compliment buffer byte count - NOTE: always OR with 0xf000 */
364*c2c66affSColin Finck   USHORT FLAGS;         /* flags - always and with 0xfff0 */
365*c2c66affSColin Finck   USHORT MCNT;          /* message byte count ; always AND with 0x0fff */
366*c2c66affSColin Finck   UCHAR  RPC;           /* runt packet count */
367*c2c66affSColin Finck   UCHAR  RCC;           /* receive collision count */
368*c2c66affSColin Finck   ULONG  RES;           /* reserved */
369*c2c66affSColin Finck } RECEIVE_DESCRIPTOR, *PRECEIVE_DESCRIPTOR;
370*c2c66affSColin Finck 
371*c2c66affSColin Finck /* receive descriptor flags */
372*c2c66affSColin Finck #define RD_BAM         0x10     /* broadcast address match */
373*c2c66affSColin Finck #define RD_LAFM        0x20     /* logical address filter match */
374*c2c66affSColin Finck #define RD_PAM         0x40     /* physical address match */
375*c2c66affSColin Finck #define RD_BPE         0x80     /* bus parity error */
376*c2c66affSColin Finck #define RD_ENP         0x100    /* end of packet */
377*c2c66affSColin Finck #define RD_STP         0x200    /* start of packet */
378*c2c66affSColin Finck #define RD_BUFF        0x400    /* buffer error */
379*c2c66affSColin Finck #define RD_CRC         0x800    /* crc error */
380*c2c66affSColin Finck #define RD_OFLO        0x1000   /* overflow error */
381*c2c66affSColin Finck #define RD_FRAM        0x2000   /* framing error */
382*c2c66affSColin Finck #define RD_ERR         0x4000   /* an error bit is set */
383*c2c66affSColin Finck #define RD_OWN         0x8000   /* buffer ownership (0=host, 1=nic) */
384*c2c66affSColin Finck 
385*c2c66affSColin Finck /* transmit descriptor, software style 2 */
386*c2c66affSColin Finck typedef struct _TRANSMIT_DESCRIPTOR
387*c2c66affSColin Finck {
388*c2c66affSColin Finck   ULONG  TBADR;         /* transmit buffer address */
389*c2c66affSColin Finck   USHORT BCNT;          /* two's compliment buffer byte count - OR with 0xf000 */
390*c2c66affSColin Finck   USHORT FLAGS;         /* flags */
391*c2c66affSColin Finck   USHORT TRC;           /* transmit retry count (AND with 0x000f */
392*c2c66affSColin Finck   USHORT FLAGS2;        /* more flags */
393*c2c66affSColin Finck   ULONG  RES;           /* reserved */
394*c2c66affSColin Finck } TRANSMIT_DESCRIPTOR, *PTRANSMIT_DESCRIPTOR;
395*c2c66affSColin Finck 
396*c2c66affSColin Finck /* transmit descriptor flags */
397*c2c66affSColin Finck #define TD1_BPE         0x80    /* bus parity error */
398*c2c66affSColin Finck #define TD1_ENP         0x100   /* end of packet */
399*c2c66affSColin Finck #define TD1_STP         0x200   /* start of packet */
400*c2c66affSColin Finck #define TD1_DEF         0x400   /* frame transmission deferred */
401*c2c66affSColin Finck #define TD1_ONE         0x800   /* exactly one retry was needed for transmission */
402*c2c66affSColin Finck #define TD1_MORE        0x1000  /* more than 1 transmission retry required - same as LTINT */
403*c2c66affSColin Finck #define TD1_LTINT       0x1000  /* suppress transmit success interrupt - same as MORE */
404*c2c66affSColin Finck #define TD1_ADD_FCS     0x2000  /* force fcs generation - same as NO_FCS */
405*c2c66affSColin Finck #define TD1_NO_FCS      0x2000  /* prevent fcs generation - same as ADD_FCS */
406*c2c66affSColin Finck #define TD1_ERR         0x4000  /* an error bit is set */
407*c2c66affSColin Finck #define TD1_OWN         0x8000  /* buffer ownership */
408*c2c66affSColin Finck 
409*c2c66affSColin Finck /* transmit descriptor flags2 flags */
410*c2c66affSColin Finck #define TD2_RTRY        0x400   /* retry error */
411*c2c66affSColin Finck #define TD2_LCAR        0x800   /* loss of carrier */
412*c2c66affSColin Finck #define TD2_LCOL        0x1000  /* late collision */
413*c2c66affSColin Finck #define TD2_EXDEF       0x2000  /* excessive deferral */
414*c2c66affSColin Finck #define TD2_UFLO        0x4000  /* buffer underflow */
415*c2c66affSColin Finck #define TD2_BUFF        0x8000  /* buffer error */
416