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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
.\" $OpenBSD: dc.4,v 1.34 2004/03/21 19:50:44 miod Exp $
.\"
.\" Copyright (c) 1997, 1998, 1999
.\" Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Bill Paul.
.\" 4. Neither the name of the author nor the names of any co-contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/share/man/man4/dc.4,v 1.1 1999/12/04 17:41:24 wpaul Exp $
.\"
.Dd November 20, 1999
.Dt DC 4
.Os
.Sh NAME
.Nm dc
.Nd DEC/Intel 21140, 21142, 21143, 21145 and clones 10/100 Ethernet driver
.Sh SYNOPSIS
.Cd "dc* at pci? dev ? function ?"
.Cd "dc* at cardbus? dev ? function ?"
.Cd "dcphy* at mii? phy ?"
.Cd "nsphy* at mii? phy ?"
.Cd "lxtphy* at mii? phy ?"
.Sh DESCRIPTION
The
.Nm
driver provides support for several PCI, MiniPCI, and CardBus Fast Ethernet
adapters and embedded controllers based on the following chipsets:
.Pp
.Bl -bullet -compact -offset indent
.It
DEC 21140 PCI
.It
DEC/Intel 21143 PCI and CardBus
.It
Intel 21145 PCI
.It
Macronix 98713, 98713A, 98715, 98715A, 98725, 98727, and 98732
.It
Davicom DM9100, DM9102, and DM9102A
.It
ASIX Electronics AX88140A and AX88141
.It
ADMtek AL981 Comet PCI and AN983 Centaur-P PCI
.It
ADMtek AN985 Centaur-C CardBus
.It
Lite-On 82c168 and 82c169 PNIC
.It
Lite-On/Macronix 82c115 PNIC II
.It
Xircom X3201-based CardBus
.El
.Pp
All of these chips have the same general register layout, DMA
descriptor format and method of operation.
All of the clone chips are based on the 21143 design with
various modifications.
(The 21140 is an older version of the 21143.)
The 21143 itself has support for 10baseT, BNC, AUI, MII and symbol
media attachments, 10 and 100Mbps speeds in full or half duplex,
built-in NWAY autonegotiation and wake on LAN.
The 21143 also offers several receive filter programming options including
perfect filtering, inverse perfect filtering and hash table filtering.
The 21145 seems to be 10 MBit/s only and has an additional (unsupported)
HomePNA PHY.
.Pp
Some clone chips duplicate the 21143 fairly closely while others
only maintain superficial similarities.
Some support only MII media attachments.
Others use different receiver filter programming mechanisms.
At least one supports only chained DMA descriptors
(most support both chained descriptors and contiguously allocated
fixed size rings).
Some chips (especially the PNIC) also have peculiar bugs.
The
.Nm
driver does its best to provide generalized support for all
of these chipsets in order to keep special case code to a minimum.
.Pp
These chips are used by many vendors, which makes it
difficult to provide a complete list of all supported cards.
The following NICs are known to work with the
.Nm
driver at this time:
.Pp
.Bl -bullet -compact -offset indent
.It
Digital DE500-BA 10/100 (21143, non-MII)
.It
Built-in DE500-BA on DEC Alpha workstations (21143, non-MII)
.It
Built-in Ethernet on LinkSys EtherFast 10/100 Instant GigaDrive (DM9102, MII)
.It
Kingston KNE100TX (21143, MII)
.It
D-Link DFE-570TX (21143, MII, quad port)
.It
NDC SOHOware SFA110A (98713A)
.It
NDC SOHOware SFA110A Rev B4 (98715AEC-C)
.It
SVEC PN102-TX (98713)
.It
CNet Pro120A (98715A or 98713A) and CNet Pro120B (98715)
.It
Compex RL100-TX (98713 or 98713A)
.It
LinkSys LNE100TX (PNIC 82c168, 82c169)
.It
NetGear FA310-TX Rev. D1, D2 or D3 (PNIC 82c169)
.It
Matrox FastNIC 10/100 (PNIC 82c168, 82c169)
.It
Kingston KNE110TX (PNIC 82c169)
.It
LinkSys LNE100TX v2.0 (PNIC II 82c115)
.It
Jaton XpressNet (Davicom DM9102)
.It
Alfa Inc GFC2204 (ASIX AX88140A)
.It
CNet Pro110B (ASIX AX88140A)
.It
LinkSys LNE100TX v4.x (ADMtek AN983 Centaur-P)
.It
Xircom CardBus, including RealPort models (Xircom X3201)
.It
IBM EtherJet 10/100 CardBus (Intel 21143)
.It
Accton EN1217 (98715) and EN2242 (ADMtek Centaur)
.It
Mototech ME316 (ADMtek Centaur)
.It
Conexant LANfinity RS7112 MiniPCI
.El
.Pp
The
.Nm
driver supports the following media types:
.Bl -tag -width full-duplex
.It autoselect
Enable autoselection of the media type and options.
The user can manually override
the autoselected mode by adding media options to the
.Xr hostname.if 5
file.
.Pp
Note: the built-in NWAY autonegotiation on the original PNIC 82c168
chip is horribly broken and is not supported by the
.Nm
driver at this time: the chip will operate in any speed or duplex
mode, however these must be set manually.
The original 82c168 appears on very early revisions of the LinkSys LNE100TX
and Matrox FastNIC.
.It 10baseT
Set 10Mbps operation.
The
.Ar mediaopt
option can also be used to enable
.Ar full-duplex
operation.
Not specifying
.Ar full duplex
implies
.Ar half-duplex
mode.
.It 100baseTX
Set 100Mbps (Fast Ethernet) operation.
The
.Ar mediaopt
option can also be used to enable
.Ar full-duplex
operation.
Not specifying
.Ar full duplex
implies
.Ar half-duplex
mode.
.El
.Pp
The
.Nm
driver supports the following media options:
.Bl -tag -width full-duplex
.It full-duplex
Force full duplex operation.
The interface will operate in half duplex mode if this media option
is not specified.
.El
.Pp
Note that the 100baseTX media type may not be available on certain
Intel 21143 adapters which support 10Mbps media attachments only.
The Intel 21145 supports 10 MBit/s half-duplex only.
For more information on configuring this device, see
.Xr ifconfig 8 .
.Sh DIAGNOSTICS
.Bl -diag
.It "dc%d: couldn't map ports/memory"
A fatal initialization error has occurred.
.It "dc%d: couldn't map interrupt"
A fatal initialization error has occurred.
.It "dc%d: watchdog timeout"
A packet was queued for transmission and a transmit command was
issued, however the device failed to acknowledge the transmission
before a timeout expired.
This can happen if the device is unable to deliver interrupts for some
reason, or if there is a problem with the network connection (cable).
.It "dc%d: no memory for rx list"
The driver failed to allocate an mbuf for the receiver ring.
.It "dc%d: TX underrun -- increasing TX threshold"
The device generated a transmit underrun error while attempting to
DMA and transmit a packet.
This happens if the host is not able to DMA the packet data into the NIC's
FIFO fast enough.
The driver will dynamically increase the transmit start threshold so that
more data must be DMAed into the FIFO before the NIC will start
transmitting it onto the wire.
.It "dc%d: TX underrun -- using store and forward mode"
The device continued to generate transmit underruns even after all
possible transmit start threshold settings had been tried, so the
driver programmed the chip for store and forward mode.
In this mode, the NIC will not begin transmission until the entire packet
has been transferred into its FIFO memory.
.It "dc%d: chip is in D3 power state -- setting to D0"
This message applies only to adapters which support power management.
Some operating systems place the controller in low power
mode when shutting down, and some PCI BIOSes fail to bring the chip
out of this state before configuring it.
The controller loses all of its PCI configuration in the D3 state,
so if the BIOS does not set it back to full power mode in time,
it won't be able to configure it correctly.
The driver tries to detect this condition and bring
the adapter back to the D0 (full power) state, but this may not be
enough to return the driver to a fully operational condition.
If you see this message at boot time and the driver fails to attach
the device as a network interface, you will have to perform a second
warm boot to have the device properly configured.
.Pp
Note that this condition only occurs when warm booting from another
operating system.
If you power down your system prior to booting
.Ox ,
the card should be configured correctly.
.El
.Sh SEE ALSO
.Xr arp 4 ,
.Xr cardbus 4 ,
.Xr dcphy 4 ,
.Xr ifmedia 4 ,
.Xr intro 4 ,
.Xr lxtphy 4 ,
.Xr netintro 4 ,
.Xr nsphy 4 ,
.Xr pci 4 ,
.Xr hostname.if 5 ,
.Xr ifconfig 8
.Rs
.%T ADMtek AL981 and AL983 data sheets
.%O http://www.admtek.com.tw
.Re
.Rs
.%T ASIX Electronics AX88140A and AX88141 data sheets
.%O http://www.asix.com.tw
.Re
.Rs
.%T Davicom DM9102 data sheet
.%O http://www.davicom8.com
.Re
.Rs
.%T Intel 21143 Hardware Reference Manual
.%O http://developer.intel.com
.Re
.Rs
.%T Macronix 98713/A, 98715/A and 98725 data sheets
.%O http://www.macronix.com
.Re
.Rs
.%T Macronix 98713/A and 98715/A app notes
.%O http://www.macronix.com
.Re
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 4.0 .
.Ox
support was added in
.Ox 2.7 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Bill Paul Aq wpaul@ee.columbia.edu
and ported to
.Ox
by
.An Aaron Campbell Aq aaron@openbsd.org .
.Sh BUGS
The Macronix application notes claim that in order to put the
chips in normal operation, the driver must write a certain magic
number into the CSR16 register.
The numbers are documented in the app notes, but the exact meaning of the
bits is not.
.Pp
The 98713A seems to have a problem with 10Mbps full duplex mode.
The transmitter works but the receiver tends to produce many
unexplained errors leading to very poor overall performance.
The 98715A does not exhibit this problem.
All other modes on the 98713A seem to work correctly.
.Pp
The original 82c168 PNIC chip has built-in NWAY support which is
used on certain early LinkSys LNE100TX and Matrox FastNIC cards,
however it is horribly broken and difficult to use reliably.
Consequently, autonegotiation is not currently supported for this
chipset: the driver defaults the NIC to 10baseT half duplex, and it's
up to the operator to manually select a different mode if necessary.
(Later cards use an external MII transceiver to implement NWAY
autonegotiation and work correctly.)
.Pp
The
.Nm
driver programs 82c168 and 82c169 PNIC chips to use the store and
forward setting for the transmit start threshold by default.
This is to work around problems with some NIC/PCI bus combinations where
the PNIC can transmit corrupt frames when operating at 100Mbps,
probably due to PCI DMA burst transfer errors.
.Pp
The 82c168 and 82c169 PNIC chips also have a receiver bug that
sometimes manifests during periods of heavy receive and transmit
activity, where the chip will improperly DMA received frames to
the host.
The chips appear to upload several kilobytes of garbage
data along with the received frame data, dirtying several RX buffers
instead of just the expected one.
The
.Nm
driver detects this condition and will salvage the frame, however
it incurs a serious performance penalty in the process.
.Pp
The PNIC chips also sometimes generate a transmit underrun error when
the driver attempts to download the receiver filter setup frame, which
can result in the receive filter being incorrectly programmed.
The
.Nm
driver will watch for this condition and requeue the setup frame until
it is transferred successfully.
.Pp
The ADMtek AL981 chip (and possibly the AN983 as well) has been observed
to sometimes wedge on transmit: this appears to happen when the driver
queues a sequence of frames which cause it to wrap from the end of
the transmit descriptor ring back to the beginning.
The
.Nm
driver attempts to avoid this condition by not queuing any frames past
the end of the transmit ring during a single invocation of the
.Fn dc_start
routine.
This workaround has a negligible impact on transmit performance.
.Pp
The
.Fn mii_tick
function does not currently run for ASIX boards, meaning cable disconnects
and reconnects can go unnoticed.
The AX88140A and AX88141 data sheets indicate that they don't have RX or TX
state registers (the bits are reserved).
Therefore, we can't seem to reliably detect when the adapter is idle.
.Pp
The Davicom interfaces require a grossly high PCI latency timer value to
function properly.
This means when a Davicom adapter is present in the machine, it is given
an unfairly high amount of bandwidth on the PCI bus, unnecessarily taking
time away from other devices.
Therefore, Davicom network cards are not recommended for use with
.Ox .
Be careful; some motherboards have Davicom interfaces built-in.
|