xref: /freebsd/share/man/man4/dc.4 (revision 96f2e892a7800333782a28a14d335ac59d7354ae)
196f2e892SBill Paul.\" Copyright (c) 1997, 1998, 1999
296f2e892SBill Paul.\"	Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
396f2e892SBill Paul.\"
496f2e892SBill Paul.\" Redistribution and use in source and binary forms, with or without
596f2e892SBill Paul.\" modification, are permitted provided that the following conditions
696f2e892SBill Paul.\" are met:
796f2e892SBill Paul.\" 1. Redistributions of source code must retain the above copyright
896f2e892SBill Paul.\"    notice, this list of conditions and the following disclaimer.
996f2e892SBill Paul.\" 2. Redistributions in binary form must reproduce the above copyright
1096f2e892SBill Paul.\"    notice, this list of conditions and the following disclaimer in the
1196f2e892SBill Paul.\"    documentation and/or other materials provided with the distribution.
1296f2e892SBill Paul.\" 3. All advertising materials mentioning features or use of this software
1396f2e892SBill Paul.\"    must display the following acknowledgement:
1496f2e892SBill Paul.\"	This product includes software developed by Bill Paul.
1596f2e892SBill Paul.\" 4. Neither the name of the author nor the names of any co-contributors
1696f2e892SBill Paul.\"    may be used to endorse or promote products derived from this software
1796f2e892SBill Paul.\"   without specific prior written permission.
1896f2e892SBill Paul.\"
1996f2e892SBill Paul.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
2096f2e892SBill Paul.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2196f2e892SBill Paul.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2296f2e892SBill Paul.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
2396f2e892SBill Paul.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2496f2e892SBill Paul.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2596f2e892SBill Paul.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2696f2e892SBill Paul.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2796f2e892SBill Paul.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2896f2e892SBill Paul.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2996f2e892SBill Paul.\" THE POSSIBILITY OF SUCH DAMAGE.
3096f2e892SBill Paul.\"
3196f2e892SBill Paul.\" $FreeBSD$
3296f2e892SBill Paul.\"
3396f2e892SBill Paul.Dd November 20, 1999
3496f2e892SBill Paul.Dt DC 4 i386
3596f2e892SBill Paul.Os FreeBSD
3696f2e892SBill Paul.Sh NAME
3796f2e892SBill Paul.Nm dc
3896f2e892SBill Paul.Nd
3996f2e892SBill PaulDEC/Intel 21143 and clone 10/100 ethernet driver
4096f2e892SBill Paul.Sh SYNOPSIS
4196f2e892SBill Paul.Cd "controller miibus0"
4296f2e892SBill Paul.Cd "device dc0"
4396f2e892SBill Paul.Sh DESCRIPTION
4496f2e892SBill PaulThe
4596f2e892SBill Paul.Nm
4696f2e892SBill Pauldriver provides support for several PCI fast ethernet adapters and
4796f2e892SBill Paulembedded controllers based on the following chipsets:
4896f2e892SBill Paul.Pp
4996f2e892SBill Paul.Bl -bullet -compact -offset indent
5096f2e892SBill Paul.It
5196f2e892SBill PaulDEC/Intel 21143
5296f2e892SBill Paul.It
5396f2e892SBill PaulMacronix 98713, 98713A, 98715, 98715A and 98725
5496f2e892SBill Paul.It
5596f2e892SBill PaulDavicom DM9100 and DM9102
5696f2e892SBill Paul.It
5796f2e892SBill PaulASIX Electronics AX88140A and AX88141
5896f2e892SBill Paul.It
5996f2e892SBill PaulADMtek AL981 Comet and AN985 Centaur
6096f2e892SBill Paul.It
6196f2e892SBill PaulLite-On 82c168 and 82c169 PNIC
6296f2e892SBill Paul.It
6396f2e892SBill PaulLite-On/Macronix 82c115 PNIC II
6496f2e892SBill Paul.El
6596f2e892SBill Paul.Pp
6696f2e892SBill PaulAll of these chips have the same general register layout, DMA
6796f2e892SBill Pauldescriptor format and method of operation. All of the clone chips
6896f2e892SBill Paulare based on the 21143 design with various modifications. The
6996f2e892SBill Paul21143 itself has support for 10baseT, BNC, AUI, MII and symbol
7096f2e892SBill Paulmedia attachments, 10 and 100Mbps speeds in full or half duplex,
7196f2e892SBill Paulbuilt in NWAY autonegotiation and wake on LAN. The 21143 also
7296f2e892SBill Pauloffers several receive filter programming options including
7396f2e892SBill Paulperfect filtering, inverse perfect filtering and hash table
7496f2e892SBill Paulfiltering.
7596f2e892SBill Paul.Pp
7696f2e892SBill PaulSome clone chips duplicate the 21143 fairly closely while others
7796f2e892SBill Paulonly maintain superficial simularities. Some support only MII
7896f2e892SBill Paulmedia attachments. Others use different receiver filter programming
7996f2e892SBill Paulmechanisms. At least one supports only chained DMA descriptors
8096f2e892SBill Paul(most support both chained descriptors and contiguously allocated
8196f2e892SBill Paulfixed size rings). Some chips (especially the PNIC) also have
8296f2e892SBill Paulpeculiar bugs. The
8396f2e892SBill Paul.Nm
8496f2e892SBill Pauldriver does its best to provide generalized support for all
8596f2e892SBill Paulof these chipsets in order to keep special case code to a minimun.
8696f2e892SBill Paul.Pp
8796f2e892SBill PaulThese chips are used by many vendors which makes it
8896f2e892SBill Pauldifficult provide a complete list of all supported cards. The
8996f2e892SBill Paulfollowing NICs are known to work with the
9096f2e892SBill Paul.Nm
9196f2e892SBill Pauldriver at this time:
9296f2e892SBill Paul.Pp
9396f2e892SBill Paul.Bl -bullet -compact -offset indent
9496f2e892SBill Paul.It
9596f2e892SBill PaulDigital DE500-BA 10/100 (21143, non-MII)
9696f2e892SBill Paul.It
9796f2e892SBill PaulBuilt in DE500-BA on DEC Alpha workstations (21143, non-MII)
9896f2e892SBill Paul.It
9996f2e892SBill PaulKingston KNE100TX (21143, MII)
10096f2e892SBill Paul.It
10196f2e892SBill PaulD-Link DFE-570TX (21143, MII, quad port)
10296f2e892SBill Paul.It
10396f2e892SBill PaulNDC SOHOware SFA110 (98513A)
10496f2e892SBill Paul.It
10596f2e892SBill PaulSVEC PN102-TX (98713)
10696f2e892SBill Paul.It
10796f2e892SBill PaulCNet Pro120A (98715A or 9713A) and CNet Pro120B (98715)
10896f2e892SBill Paul.It
10996f2e892SBill PaulCompex RL100-TX (98713 or 98713A)
11096f2e892SBill Paul.It
11196f2e892SBill PaulLinkSys LNE100TX (PNIC 82c168, 82c169)
11296f2e892SBill Paul.It
11396f2e892SBill PaulNetGear FA310-TX Rev. D1, D2 or D3 (PNIC 82c169)
11496f2e892SBill Paul.It
11596f2e892SBill PaulMatrox FastNIC 10/100 (PNIC 82c168, 82c169)
11696f2e892SBill Paul.It
11796f2e892SBill PaulKingston KNE110TX (PNIC 82c169)
11896f2e892SBill Paul.It
11996f2e892SBill PaulLinkSys LNE100TX v2.0 (PNIC II 82c115)
12096f2e892SBill Paul.It
12196f2e892SBill PaulJaton XpressNet (Davicom DM9102)
12296f2e892SBill Paul.It
12396f2e892SBill PaulAlfa Inc GFC2204 (ASIX AX88140A)
12496f2e892SBill Paul.It
12596f2e892SBill PaulCNet Pro110B (ASIX AX88140A)
12696f2e892SBill Paul.El
12796f2e892SBill Paul.Pp
12896f2e892SBill PaulThe
12996f2e892SBill Paul.Nm
13096f2e892SBill Pauldriver supports the following media types:
13196f2e892SBill Paul.Pp
13296f2e892SBill Paul.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
13396f2e892SBill Paul.It autoselect
13496f2e892SBill PaulEnable autoselection of the media type and options.
13596f2e892SBill PaulThe user can manually override
13696f2e892SBill Paulthe autoselected mode by adding media options to the
13796f2e892SBill Paul.Pa /etc/rc.conf
13896f2e892SBill Paulfile.
13996f2e892SBill Paul.Pp
14096f2e892SBill PaulNote: the built-in NWAY autonegotiation on the original PNIC 82c168
14196f2e892SBill Paulchip is horribly broken and is not supported by the
14296f2e892SBill Paul.Nm
14396f2e892SBill Pauldriver at this time: the chip will operate in any speed or duplex
14496f2e892SBill Paulmode, however these must be set manually. The original 82c168 appears
14596f2e892SBill Paulon very early revisions of the LinkSys LNE100TX and Matrox FastNIC.
14696f2e892SBill Paul.It 10baseT/UTP
14796f2e892SBill PaulSet 10Mbps operation. The
14896f2e892SBill Paul.Ar mediaopt
14996f2e892SBill Pauloption can also be used to enable
15096f2e892SBill Paul.Ar full-duplex
15196f2e892SBill Pauloperation. Not specifying
15296f2e892SBill Paul.Ar full duplex
15396f2e892SBill Paulimplies
15496f2e892SBill Paul.Ar half-duplex
15596f2e892SBill Paulmode.
15696f2e892SBill Paul.It 100baseTX
15796f2e892SBill PaulSet 100Mbps (fast ethernet) operation. The
15896f2e892SBill Paul.Ar mediaopt
15996f2e892SBill Pauloption can also be used to enable
16096f2e892SBill Paul.Ar full-duplex
16196f2e892SBill Pauloperation. Not specifying
16296f2e892SBill Paul.Ar full duplex
16396f2e892SBill Paulimplies
16496f2e892SBill Paul.Ar half-duplex
16596f2e892SBill Paulmode.
16696f2e892SBill Paul.El
16796f2e892SBill Paul.Pp
16896f2e892SBill PaulThe
16996f2e892SBill Paul.Nm
17096f2e892SBill Pauldriver supports the following media options:
17196f2e892SBill Paul.Pp
17296f2e892SBill Paul.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
17396f2e892SBill Paul.It full-duplex
17496f2e892SBill PaulForce full duplex operation. The interface will operate in
17596f2e892SBill Paulhalf duplex mode if this media option is not specified.
17696f2e892SBill Paul.El
17796f2e892SBill Paul.Pp
17896f2e892SBill PaulNote that the 100baseTX media type may not be available on certain
17996f2e892SBill PaulIntel 21143 adapters which support 10mbps media attachments only.
18096f2e892SBill PaulFor more information on configuring this device, see
18196f2e892SBill Paul.Xr ifconfig 8 .
18296f2e892SBill Paul.Sh DIAGNOSTICS
18396f2e892SBill Paul.Bl -diag
18496f2e892SBill Paul.It "dc%d: couldn't map ports/memory"
18596f2e892SBill PaulA fatal initialization error has occurred.
18696f2e892SBill Paul.It "dc%d: couldn't map interrupt"
18796f2e892SBill PaulA fatal initialization error has occurred.
18896f2e892SBill Paul.It "dc%d: watchdog timeout"
18996f2e892SBill PaulA packet was queued for transmission and a transmit command was
19096f2e892SBill Paulissued, however the device failed to acknowledge the transmission
19196f2e892SBill Paulbefore a timeout expired. This can happen if the device is unable
19296f2e892SBill Paulto deliver interrupts for some reason, of if there is a problem with
19396f2e892SBill Paulthe network connection (cable).
19496f2e892SBill Paul.It "dc%d: no memory for rx list"
19596f2e892SBill PaulThe driver failed to allocate an mbuf for the receiver ring.
19696f2e892SBill Paul.It "dc%d: TX underrun -- increasing TX threshold"
19796f2e892SBill PaulThe device generated a transmit underrun error while attempting to
19896f2e892SBill PaulDMA and transmit a packet. This happens if the host is not able to
19996f2e892SBill PaulDMA the packet data into the NIC's FIFO fast enough. The driver
20096f2e892SBill Paulwill dynamically increase the transmit start threshold so that
20196f2e892SBill Paulmore data must be DMAed into the FIFO before the NIC will start
20296f2e892SBill Paultransmitting it onto the wire.
20396f2e892SBill Paul.It "dc%d: TX underrun -- using store and forward mode"
20496f2e892SBill PaulThe device continued to generate transmit underruns even after all
20596f2e892SBill Paulpossible transmit start threshold settings had been tried, so the
20696f2e892SBill Pauldriver programmed the chip for store and forward mode. In this mode,
20796f2e892SBill Paulthe NIC will not begin transmission until the entire packet has been
20896f2e892SBill Paultransfered into its FIFO memory.
20996f2e892SBill Paul.It "dc%d: chip is in D3 power state -- setting to D0"
21096f2e892SBill PaulThis message applies only to adapters which support power
21196f2e892SBill Paulmanagement. Some operating systems place the controller in low power
21296f2e892SBill Paulmode when shutting down, and some PCI BIOSes fail to bring the chip
21396f2e892SBill Paulout of this state before configuring it. The controller loses all of
21496f2e892SBill Paulits PCI configuration in the D3 state, so if the BIOS does not set
21596f2e892SBill Paulit back to full power mode in time, it won't be able to configure it
21696f2e892SBill Paulcorrectly. The driver tries to detect this condition and bring
21796f2e892SBill Paulthe adapter back to the D0 (full power) state, but this may not be
21896f2e892SBill Paulenough to return the driver to a fully operational condition. If
21996f2e892SBill Paulyou see this message at boot time and the driver fails to attach
22096f2e892SBill Paulthe device as a network interface, you will have to perform second
22196f2e892SBill Paulwarm boot to have the device properly configured.
22296f2e892SBill Paul.Pp
22396f2e892SBill PaulNote that this condition only occurs when warm booting from another
22496f2e892SBill Pauloperating system. If you power down your system prior to booting
22596f2e892SBill Paul.Fx ,
22696f2e892SBill Paulthe card should be configured correctly.
22796f2e892SBill Paul.El
22896f2e892SBill Paul.Sh SEE ALSO
22996f2e892SBill Paul.Xr arp 4 ,
23096f2e892SBill Paul.Xr netintro 4 ,
23196f2e892SBill Paul.Xr ifconfig 8
23296f2e892SBill Paul.Rs
23396f2e892SBill Paul.%T ADMtek AL981, AL983 and AL985 data sheets
23496f2e892SBill Paul.%O http://www.admtek.com.tw
23596f2e892SBill Paul.Re
23696f2e892SBill Paul.Rs
23796f2e892SBill Paul.%T ASIX Electronics AX88140A and AX88141 data sheets
23896f2e892SBill Paul.%O http://www.asix.com.tw
23996f2e892SBill Paul.Re
24096f2e892SBill Paul.Rs
24196f2e892SBill Paul.%T Davicom DM9102 data sheet
24296f2e892SBill Paul.%O http://www.davicom8.com
24396f2e892SBill Paul.Re
24496f2e892SBill Paul.Rs
24596f2e892SBill Paul.%T Intel 21143 Hardware Reference Manual
24696f2e892SBill Paul.%O http://developer.intel.com
24796f2e892SBill Paul.Re
24896f2e892SBill Paul.Rs
24996f2e892SBill Paul.%T Macronix 98713/A, 98715/A and 98725 data sheets
25096f2e892SBill Paul.%O http://www.macronix.com
25196f2e892SBill Paul.Re
25296f2e892SBill Paul.Rs
25396f2e892SBill Paul.%T Macronix 98713/A and 98715/A app notes
25496f2e892SBill Paul.%O http://www.macronix.com
25596f2e892SBill Paul.Re
25696f2e892SBill Paul.Sh HISTORY
25796f2e892SBill PaulThe
25896f2e892SBill Paul.Nm
25996f2e892SBill Pauldevice driver first appeared in
26096f2e892SBill Paul.Fx 4.0 .
26196f2e892SBill Paul.Sh AUTHORS
26296f2e892SBill PaulThe
26396f2e892SBill Paul.Nm
26496f2e892SBill Pauldriver was written by
26596f2e892SBill Paul.An Bill Paul Aq wpaul@ee.columbia.edu .
26696f2e892SBill Paul.Sh BUGS
26796f2e892SBill PaulThe Macronix application notes claim that in order to put the
26896f2e892SBill Paulchips in normal operation, the driver must write a certian magic
26996f2e892SBill Paulnumber into the CSR16 register. The numbers are documented in
27096f2e892SBill Paulthe app notes, but the exact meaning of the bits is not.
27196f2e892SBill Paul.Pp
27296f2e892SBill PaulThe 98713A seems to have a problem with 10Mbps full duplex mode.
27396f2e892SBill PaulThe transmitter works but the receiver tends to produce many
27496f2e892SBill Paulunexplained errors leading to very poor overall performance. The
27596f2e892SBill Paul98715A does not exhibit this problem. All other modes on the
27696f2e892SBill Paul98713A seem to work correctly.
27796f2e892SBill Paul.Pp
27896f2e892SBill PaulThe original 82c168 PNIC chip has built in NWAY support which is
27996f2e892SBill Paulused on certain early LinkSys LNE100TX and Matrox FastNIC cards,
28096f2e892SBill Paulhowever it is horribly broken and difficult to use reliably.
28196f2e892SBill PaulConsequently, autonegotiation is not currently supported for this
28296f2e892SBill Paulchipset: the driver defaults the NIC to 10baseT half duplex, and it's
28396f2e892SBill Paulup to the operator to manually select a different mode if necessary.
28496f2e892SBill Paul(Later cards use an external MII transceiver to implement NWAY
28596f2e892SBill Paulautonegotiation and work correctly.)
28696f2e892SBill Paul.Pp
28796f2e892SBill PaulThe
28896f2e892SBill Paul.Nm
28996f2e892SBill Pauldriver programs 82c168 and 82c169 PNIC chips to use the store and
29096f2e892SBill Paulforward setting for the transmit start threshold by default. This
29196f2e892SBill Paulis to work around problems with some NIC/PCI bus combinations where
29296f2e892SBill Paulthe PNIC can transmit corrupt frames when operating at 100Mbps,
29396f2e892SBill Paulprobably due to PCI DMA burst transfer errors.
29496f2e892SBill Paul.Pp
29596f2e892SBill PaulThe 82c168 abd 82c169 PNIC chips also have a receiver bug that
29696f2e892SBill Paulsometimes manifests during periods of heavy receive and transmit
29796f2e892SBill Paulactivity, where the chip will improperly DMA received frames to
29896f2e892SBill Paulthe host. The chips appear to upload several kilobytes of garbage
29996f2e892SBill Pauldata along with the received frame data, dirtying several RX buffers
30096f2e892SBill Paulinstead of just the expected one. The
30196f2e892SBill Paul.Nm
30296f2e892SBill Pauldriver detects this condition and will salvage the frame, however
30396f2e892SBill Paulit incurs a serious performance penalty in the process.
30496f2e892SBill Paul.Pp
30596f2e892SBill PaulThe PNIC chips also sometimes generate a transmit underrun error when
30696f2e892SBill Paulthe driver attempts to download the receiver filter setup frame, which
30796f2e892SBill Paulcan result in the receive filter being incorrectly programmed. The
30896f2e892SBill Paul.Nm
30996f2e892SBill Pauldriver will watch for this condition and requeue the setup frame until
31096f2e892SBill Paulit is transfered successfully.
31196f2e892SBill Paul.Pp
31296f2e892SBill PaulThe ADMtek AL981 chip (and possibly the AN985 as well) has been observed
31396f2e892SBill Paulto sometimes wedge on transmit: this appears to happen when the driver
31496f2e892SBill Paulqueues a sequence of frames which cause it to wrap from the end of the
31596f2e892SBill Paulthe transmit descriptor ring back to the beginning. The
31696f2e892SBill Paul.Nm
31796f2e892SBill Pauldriver attempts to avoid this condition by not queing any frames past
31896f2e892SBill Paulthe end of the transmit ring during a single invocation of the
31996f2e892SBill Paul.Fn dc_start
32096f2e892SBill Paulroutine. This workaround has a negligible impact on transmit performance.
32196f2e892SBill Paul
32296f2e892SBill Paul
323