xref: /openbsd-src/share/man/man4/dc.4 (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1.\"	$OpenBSD: dc.4,v 1.47 2011/07/27 00:50:23 sthen Exp $
2.\"
3.\" Copyright (c) 1997, 1998, 1999
4.\"	Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by Bill Paul.
17.\" 4. Neither the name of the author nor the names of any co-contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"   without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
25.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31.\" THE POSSIBILITY OF SUCH DAMAGE.
32.\"
33.\" $FreeBSD: src/share/man/man4/dc.4,v 1.1 1999/12/04 17:41:24 wpaul Exp $
34.\"
35.Dd $Mdocdate: July 27 2011 $
36.Dt DC 4
37.Os
38.Sh NAME
39.Nm dc
40.Nd "DEC/Intel 21140/21142/21143/21145 and clones 10/100 Ethernet device"
41.Sh SYNOPSIS
42.Cd "dc* at pci?"
43.Cd "dc* at cardbus?"
44.Cd "amphy* at mii?"
45.Cd "bmtphy* at mii?"
46.Cd "dcphy* at mii?"
47.Cd "icsphy* at mii?"
48.Cd "lxtphy* at mii?"
49.Cd "mtdphy* at mii?"
50.Cd "nsphy* at mii?"
51.Cd "nsphyter* at mii?"
52.Cd "sqphy* at mii?"
53.Cd "tqphy* at mii?"
54.Sh DESCRIPTION
55The
56.Nm
57driver provides support for several PCI, Mini PCI, and CardBus Fast Ethernet
58adapters and embedded controllers based on the following chipsets:
59.Pp
60.Bl -bullet -compact -offset indent
61.It
62DEC 21140 PCI
63.It
64DEC/Intel 21143 PCI and CardBus
65.It
66Intel 21145 PCI
67.It
68Macronix 98713, 98713A, 98715, 98715A, 98725, 98727 and 98732
69.It
70Davicom DM9100, DM9102, and DM9102A
71.It
72ASIX Electronics AX88140A and AX88141
73.It
74ADMtek AL981 Comet, AN983 Centaur-P and ADM9511/ADM9513 Centaur-II PCI
75.It
76ADMtek AN985 Centaur-C CardBus
77.It
78Lite-On 82c168 and 82c169 PNIC
79.It
80Lite-On/Macronix 82c115 PNIC II
81.It
82Xircom X3201-based CardBus
83.El
84.Pp
85All of these chips have the same general register layout, DMA
86descriptor format and method of operation.
87All of the clone chips are based on the 21143 design with
88various modifications.
89(The 21140 is an older version of the 21143.)
90The 21143 itself has support for 10baseT, BNC, AUI, MII and symbol
91media attachments, 10 and 100Mbps speeds in full or half duplex,
92and built-in NWAY autonegotiation.
93The 21143 also offers several receive filter programming options including
94perfect filtering, inverse perfect filtering and hash table filtering.
95The 21145 seems to be 10Mbps only and has an additional (unsupported)
96HomePNA PHY.
97.Pp
98Some clone chips duplicate the 21143 fairly closely while others
99only maintain superficial similarities.
100Some support only MII media attachments.
101Others use different receiver filter programming mechanisms.
102At least one supports only chained DMA descriptors
103(most support both chained descriptors and contiguously allocated
104fixed size rings).
105Some chips (especially the PNIC) also have peculiar bugs.
106The
107.Nm
108driver does its best to provide generalized support for all
109of these chipsets in order to keep special case code to a minimum.
110.Pp
111These chips are used by many vendors, which makes it
112difficult to provide a complete list of all supported cards.
113The following NICs are known to work with the
114.Nm
115driver at this time:
116.Pp
117.Bl -bullet -compact -offset indent
118.It
119Digital DE500-BA 10/100 (21143, non-MII)
120.It
121Built-in DE500-BA on DEC Alpha workstations (21143, non-MII)
122.It
123Built-in Ethernet on Linksys EtherFast 10/100 Instant GigaDrive (DM9102, MII)
124.It
125Kingston KNE100TX (21143, MII)
126.It
127D-Link DFE-570TX (21143, MII, quad port)
128.It
129NDC SOHOware SFA110A (98713A)
130.It
131NDC SOHOware SFA110A Rev B4 (98715AEC-C)
132.It
133SVEC PN102-TX (98713)
134.It
135CNet Pro120A (98715A or 98713A) and CNet Pro120B (98715)
136.It
137Compex RL100-TX (98713 or 98713A)
138.It
139Linksys LNE100TX (PNIC 82c168, 82c169)
140.It
141NetGear FA310-TX Rev. D1, D2 or D3 (PNIC 82c169)
142.It
143Matrox FastNIC 10/100 (PNIC 82c168, 82c169)
144.It
145Kingston KNE110TX (PNIC 82c169)
146.It
147Linksys LNE100TX v2.0 (PNIC II 82c115)
148.It
149Jaton XpressNet (Davicom DM9102)
150.It
151Alfa Inc GFC2204 (ASIX AX88140A)
152.It
153CNet Pro110B (ASIX AX88140A)
154.It
155Linksys LNE100TX v4.x (ADMtek AN983 Centaur-P)
156.It
157Xircom CardBus, including RealPort models (Xircom X3201)
158.It
159IBM EtherJet 10/100 CardBus (Intel 21143)
160.It
161Accton EN1217 (98715) and EN2242 (ADMtek Centaur)
162.It
163Mototech ME316 (ADMtek Centaur)
164.It
165Conexant LANfinity RS7112 Mini PCI
166.El
167.Pp
168The
169.Nm
170driver supports the following media types:
171.Bl -tag -width full-duplex
172.It autoselect
173Enable autoselection of the media type and options.
174The user can manually override
175the autoselected mode by adding media options to the
176.Xr hostname.if 5
177file.
178.Pp
179Note: the built-in NWAY autonegotiation on the original PNIC 82c168
180chip is horribly broken and is not supported by the
181.Nm
182driver at this time: the chip will operate in any speed or duplex
183mode, however these must be set manually.
184The original 82c168 appears on very early revisions of the Linksys LNE100TX
185and Matrox FastNIC.
186.It 10baseT
187Set 10Mbps operation.
188The
189.Ar mediaopt
190option can also be used to enable
191.Ar full-duplex
192operation.
193Not specifying
194.Ar full duplex
195implies
196.Ar half-duplex
197mode.
198.It 100baseTX
199Set 100Mbps (Fast Ethernet) operation.
200The
201.Ar mediaopt
202option can also be used to enable
203.Ar full-duplex
204operation.
205Not specifying
206.Ar full duplex
207implies
208.Ar half-duplex
209mode.
210.El
211.Pp
212The
213.Nm
214driver supports the following media options:
215.Bl -tag -width full-duplex
216.It full-duplex
217Force full duplex operation.
218The interface will operate in half duplex mode if this media option
219is not specified.
220.El
221.Pp
222Note that the 100baseTX media type may not be available on certain
223Intel 21143 adapters which support 10Mbps media attachments only.
224The Intel 21145 supports 10Mbps half-duplex only.
225.Pp
226For more information on configuring this device, see
227.Xr ifconfig 8 .
228.Sh DIAGNOSTICS
229.Bl -diag
230.It "dc%d: couldn't map ports/memory"
231A fatal initialization error has occurred.
232.It "dc%d: couldn't map interrupt"
233A fatal initialization error has occurred.
234.It "dc%d: watchdog timeout"
235A packet was queued for transmission and a transmit command was
236issued, however the device failed to acknowledge the transmission
237before a timeout expired.
238This can happen if the device is unable to deliver interrupts for some
239reason, or if there is a problem with the network connection (cable).
240.It "dc%d: no memory for rx list"
241The driver failed to allocate an mbuf for the receiver ring.
242.It "dc%d: TX underrun -- increasing TX threshold"
243The device generated a transmit underrun error while attempting to
244DMA and transmit a packet.
245This happens if the host is not able to DMA the packet data into the NIC's
246FIFO fast enough.
247The driver will dynamically increase the transmit start threshold so that
248more data must be DMAed into the FIFO before the NIC will start
249transmitting it onto the wire.
250.It "dc%d: TX underrun -- using store and forward mode"
251The device continued to generate transmit underruns even after all
252possible transmit start threshold settings had been tried, so the
253driver programmed the chip for store and forward mode.
254In this mode, the NIC will not begin transmission until the entire packet
255has been transferred into its FIFO memory.
256.It "dc%d: chip is in D3 power state -- setting to D0"
257This message applies only to adapters which support power management.
258Some operating systems place the controller in low power
259mode when shutting down, and some PCI BIOSes fail to bring the chip
260out of this state before configuring it.
261The controller loses all of its PCI configuration in the D3 state,
262so if the BIOS does not set it back to full power mode in time,
263it won't be able to configure it correctly.
264The driver tries to detect this condition and bring
265the adapter back to the D0 (full power) state, but this may not be
266enough to return the driver to a fully operational condition.
267If you see this message at boot time and the driver fails to attach
268the device as a network interface, you will have to perform a second
269warm boot to have the device properly configured.
270.Pp
271Note that this condition only occurs when warm booting from another
272operating system.
273If you power down your system prior to booting
274.Ox ,
275the card should be configured correctly.
276.El
277.Sh SEE ALSO
278.Xr amphy 4 ,
279.Xr arp 4 ,
280.Xr bmtphy 4 ,
281.Xr cardbus 4 ,
282.Xr dcphy 4 ,
283.Xr icsphy 4 ,
284.Xr ifmedia 4 ,
285.Xr intro 4 ,
286.Xr lxtphy 4 ,
287.Xr mtdphy 4 ,
288.Xr netintro 4 ,
289.Xr nsphy 4 ,
290.Xr nsphyter 4 ,
291.Xr pci 4 ,
292.Xr sqphy 4 ,
293.Xr tqphy 4 ,
294.Xr hostname.if 5 ,
295.Xr ifconfig 8
296.Rs
297.%T ADMtek AL981 and AL983 data sheets
298.%O http://www.admtek.com.tw
299.Re
300.Rs
301.%T ASIX Electronics AX88140A and AX88141 data sheets
302.%O http://www.asix.com.tw
303.Re
304.Rs
305.%T Davicom DM9102 data sheet
306.%O http://www.davicom8.com
307.Re
308.Rs
309.%T Intel 21143 Hardware Reference Manual
310.%O http://developer.intel.com
311.Re
312.Rs
313.%T Macronix 98713/A, 98715/A and 98725 data sheets
314.%O http://www.macronix.com
315.Re
316.Rs
317.%T Macronix 98713/A and 98715/A app notes
318.%O http://www.macronix.com
319.Re
320.Sh HISTORY
321The
322.Nm
323device driver first appeared in
324.Fx 4.0 .
325.Ox
326support was added in
327.Ox 2.7 .
328.Sh AUTHORS
329.An -nosplit
330The
331.Nm
332driver was written by
333.An Bill Paul Aq wpaul@ee.columbia.edu
334and ported to
335.Ox
336by
337.An Aaron Campbell Aq aaron@openbsd.org .
338.Sh BUGS
339The Macronix application notes claim that in order to put the
340chips in normal operation, the driver must write a certain magic
341number into the CSR16 register.
342The numbers are documented in the app notes, but the exact meaning of the
343bits is not.
344.Pp
345The 98713A seems to have a problem with 10Mbps full duplex mode.
346The transmitter works but the receiver tends to produce many
347unexplained errors leading to very poor overall performance.
348The 98715A does not exhibit this problem.
349All other modes on the 98713A seem to work correctly.
350.Pp
351The original 82c168 PNIC chip has built-in NWAY support which is
352used on certain early Linksys LNE100TX and Matrox FastNIC cards,
353however it is horribly broken and difficult to use reliably.
354Consequently, autonegotiation is not currently supported for this
355chipset: the driver defaults the NIC to 10baseT half duplex, and it's
356up to the operator to manually select a different mode if necessary.
357(Later cards use an external MII transceiver to implement NWAY
358autonegotiation and work correctly.)
359.Pp
360The
361.Nm
362driver programs 82c168 and 82c169 PNIC chips to use the store and
363forward setting for the transmit start threshold by default.
364This is to work around problems with some NIC/PCI bus combinations where
365the PNIC can transmit corrupt frames when operating at 100Mbps,
366probably due to PCI DMA burst transfer errors.
367.Pp
368The 82c168 and 82c169 PNIC chips also have a receiver bug that
369sometimes manifests during periods of heavy receive and transmit
370activity, where the chip will improperly DMA received frames to
371the host.
372The chips appear to upload several kilobytes of garbage
373data along with the received frame data, dirtying several RX buffers
374instead of just the expected one.
375The
376.Nm
377driver detects this condition and will salvage the frame, however
378it incurs a serious performance penalty in the process.
379.Pp
380The PNIC chips also sometimes generate a transmit underrun error when
381the driver attempts to download the receiver filter setup frame, which
382can result in the receive filter being incorrectly programmed.
383The
384.Nm
385driver will watch for this condition and requeue the setup frame until
386it is transferred successfully.
387.Pp
388The ADMtek AL981 chip (and possibly the AN983 as well) has been observed
389to sometimes wedge on transmit: this appears to happen when the driver
390queues a sequence of frames which cause it to wrap from the end of
391the transmit descriptor ring back to the beginning.
392The
393.Nm
394driver attempts to avoid this condition by not queuing any frames past
395the end of the transmit ring during a single invocation of the
396.Fn dc_start
397routine.
398This workaround has a negligible impact on transmit performance.
399.Pp
400The
401.Fn mii_tick
402function does not currently run for ASIX boards, meaning cable disconnects
403and reconnects can go unnoticed.
404The AX88140A and AX88141 data sheets indicate that they don't have RX or TX
405state registers (the bits are reserved).
406Therefore, we can't seem to reliably detect when the adapter is idle.
407.Pp
408The Davicom interfaces require a grossly high PCI latency timer value to
409function properly.
410This means when a Davicom adapter is present in the machine, it is given
411an unfairly high amount of bandwidth on the PCI bus, unnecessarily taking
412time away from other devices.
413Therefore, Davicom network cards are not recommended for use with
414.Ox .
415Be careful; some motherboards have Davicom interfaces built-in.
416