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