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 20, 1999 34.Dt DC 4 i386 35.Os FreeBSD 36.Sh NAME 37.Nm dc 38.Nd 39DEC/Intel 21143 and clone 10/100 ethernet driver 40.Sh SYNOPSIS 41.Cd "controller miibus0" 42.Cd "device dc0" 43.Sh DESCRIPTION 44The 45.Nm 46driver provides support for several PCI fast ethernet adapters and 47embedded controllers based on the following chipsets: 48.Pp 49.Bl -bullet -compact -offset indent 50.It 51DEC/Intel 21143 52.It 53Macronix 98713, 98713A, 98715, 98715A and 98725 54.It 55Davicom DM9100 and DM9102 56.It 57ASIX Electronics AX88140A and AX88141 58.It 59ADMtek AL981 Comet and AN985 Centaur 60.It 61Lite-On 82c168 and 82c169 PNIC 62.It 63Lite-On/Macronix 82c115 PNIC II 64.El 65.Pp 66All of these chips have the same general register layout, DMA 67descriptor format and method of operation. All of the clone chips 68are based on the 21143 design with various modifications. The 6921143 itself has support for 10baseT, BNC, AUI, MII and symbol 70media attachments, 10 and 100Mbps speeds in full or half duplex, 71built in NWAY autonegotiation and wake on LAN. The 21143 also 72offers several receive filter programming options including 73perfect filtering, inverse perfect filtering and hash table 74filtering. 75.Pp 76Some clone chips duplicate the 21143 fairly closely while others 77only maintain superficial simularities. Some support only MII 78media attachments. Others use different receiver filter programming 79mechanisms. At least one supports only chained DMA descriptors 80(most support both chained descriptors and contiguously allocated 81fixed size rings). Some chips (especially the PNIC) also have 82peculiar bugs. The 83.Nm 84driver does its best to provide generalized support for all 85of these chipsets in order to keep special case code to a minimun. 86.Pp 87These chips are used by many vendors which makes it 88difficult provide a complete list of all supported cards. The 89following NICs are known to work with the 90.Nm 91driver at this time: 92.Pp 93.Bl -bullet -compact -offset indent 94.It 95Digital DE500-BA 10/100 (21143, non-MII) 96.It 97Built in DE500-BA on DEC Alpha workstations (21143, non-MII) 98.It 99Kingston KNE100TX (21143, MII) 100.It 101D-Link DFE-570TX (21143, MII, quad port) 102.It 103NDC SOHOware SFA110 (98513A) 104.It 105SVEC PN102-TX (98713) 106.It 107CNet Pro120A (98715A or 9713A) and CNet Pro120B (98715) 108.It 109Compex RL100-TX (98713 or 98713A) 110.It 111LinkSys LNE100TX (PNIC 82c168, 82c169) 112.It 113NetGear FA310-TX Rev. D1, D2 or D3 (PNIC 82c169) 114.It 115Matrox FastNIC 10/100 (PNIC 82c168, 82c169) 116.It 117Kingston KNE110TX (PNIC 82c169) 118.It 119LinkSys LNE100TX v2.0 (PNIC II 82c115) 120.It 121Jaton XpressNet (Davicom DM9102) 122.It 123Alfa Inc GFC2204 (ASIX AX88140A) 124.It 125CNet Pro110B (ASIX AX88140A) 126.El 127.Pp 128The 129.Nm 130driver supports the following media types: 131.Pp 132.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 133.It autoselect 134Enable autoselection of the media type and options. 135The user can manually override 136the autoselected mode by adding media options to the 137.Pa /etc/rc.conf 138file. 139.Pp 140Note: the built-in NWAY autonegotiation on the original PNIC 82c168 141chip is horribly broken and is not supported by the 142.Nm 143driver at this time: the chip will operate in any speed or duplex 144mode, however these must be set manually. The original 82c168 appears 145on very early revisions of the LinkSys LNE100TX and Matrox FastNIC. 146.It 10baseT/UTP 147Set 10Mbps operation. The 148.Ar mediaopt 149option can also be used to enable 150.Ar full-duplex 151operation. Not specifying 152.Ar full duplex 153implies 154.Ar half-duplex 155mode. 156.It 100baseTX 157Set 100Mbps (fast ethernet) operation. The 158.Ar mediaopt 159option can also be used to enable 160.Ar full-duplex 161operation. Not specifying 162.Ar full duplex 163implies 164.Ar half-duplex 165mode. 166.El 167.Pp 168The 169.Nm 170driver supports the following media options: 171.Pp 172.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 173.It full-duplex 174Force full duplex operation. The interface will operate in 175half duplex mode if this media option is not specified. 176.El 177.Pp 178Note that the 100baseTX media type may not be available on certain 179Intel 21143 adapters which support 10mbps media attachments only. 180For more information on configuring this device, see 181.Xr ifconfig 8 . 182.Sh DIAGNOSTICS 183.Bl -diag 184.It "dc%d: couldn't map ports/memory" 185A fatal initialization error has occurred. 186.It "dc%d: couldn't map interrupt" 187A fatal initialization error has occurred. 188.It "dc%d: watchdog timeout" 189A packet was queued for transmission and a transmit command was 190issued, however the device failed to acknowledge the transmission 191before a timeout expired. This can happen if the device is unable 192to deliver interrupts for some reason, of if there is a problem with 193the network connection (cable). 194.It "dc%d: no memory for rx list" 195The driver failed to allocate an mbuf for the receiver ring. 196.It "dc%d: TX underrun -- increasing TX threshold" 197The device generated a transmit underrun error while attempting to 198DMA and transmit a packet. This happens if the host is not able to 199DMA the packet data into the NIC's FIFO fast enough. The driver 200will dynamically increase the transmit start threshold so that 201more data must be DMAed into the FIFO before the NIC will start 202transmitting it onto the wire. 203.It "dc%d: TX underrun -- using store and forward mode" 204The device continued to generate transmit underruns even after all 205possible transmit start threshold settings had been tried, so the 206driver programmed the chip for store and forward mode. In this mode, 207the NIC will not begin transmission until the entire packet has been 208transfered into its FIFO memory. 209.It "dc%d: chip is in D3 power state -- setting to D0" 210This message applies only to adapters which support power 211management. Some operating systems place the controller in low power 212mode when shutting down, and some PCI BIOSes fail to bring the chip 213out of this state before configuring it. The controller loses all of 214its PCI configuration in the D3 state, so if the BIOS does not set 215it back to full power mode in time, it won't be able to configure it 216correctly. The driver tries to detect this condition and bring 217the adapter back to the D0 (full power) state, but this may not be 218enough to return the driver to a fully operational condition. If 219you see this message at boot time and the driver fails to attach 220the device as a network interface, you will have to perform second 221warm boot to have the device properly configured. 222.Pp 223Note that this condition only occurs when warm booting from another 224operating system. If you power down your system prior to booting 225.Fx , 226the card should be configured correctly. 227.El 228.Sh SEE ALSO 229.Xr arp 4 , 230.Xr netintro 4 , 231.Xr ifconfig 8 232.Rs 233.%T ADMtek AL981, AL983 and AL985 data sheets 234.%O http://www.admtek.com.tw 235.Re 236.Rs 237.%T ASIX Electronics AX88140A and AX88141 data sheets 238.%O http://www.asix.com.tw 239.Re 240.Rs 241.%T Davicom DM9102 data sheet 242.%O http://www.davicom8.com 243.Re 244.Rs 245.%T Intel 21143 Hardware Reference Manual 246.%O http://developer.intel.com 247.Re 248.Rs 249.%T Macronix 98713/A, 98715/A and 98725 data sheets 250.%O http://www.macronix.com 251.Re 252.Rs 253.%T Macronix 98713/A and 98715/A app notes 254.%O http://www.macronix.com 255.Re 256.Sh HISTORY 257The 258.Nm 259device driver first appeared in 260.Fx 4.0 . 261.Sh AUTHORS 262The 263.Nm 264driver was written by 265.An Bill Paul Aq wpaul@ee.columbia.edu . 266.Sh BUGS 267The Macronix application notes claim that in order to put the 268chips in normal operation, the driver must write a certian magic 269number into the CSR16 register. The numbers are documented in 270the app notes, but the exact meaning of the bits is not. 271.Pp 272The 98713A seems to have a problem with 10Mbps full duplex mode. 273The transmitter works but the receiver tends to produce many 274unexplained errors leading to very poor overall performance. The 27598715A does not exhibit this problem. All other modes on the 27698713A seem to work correctly. 277.Pp 278The original 82c168 PNIC chip has built in NWAY support which is 279used on certain early LinkSys LNE100TX and Matrox FastNIC cards, 280however it is horribly broken and difficult to use reliably. 281Consequently, autonegotiation is not currently supported for this 282chipset: the driver defaults the NIC to 10baseT half duplex, and it's 283up to the operator to manually select a different mode if necessary. 284(Later cards use an external MII transceiver to implement NWAY 285autonegotiation and work correctly.) 286.Pp 287The 288.Nm 289driver programs 82c168 and 82c169 PNIC chips to use the store and 290forward setting for the transmit start threshold by default. This 291is to work around problems with some NIC/PCI bus combinations where 292the PNIC can transmit corrupt frames when operating at 100Mbps, 293probably due to PCI DMA burst transfer errors. 294.Pp 295The 82c168 abd 82c169 PNIC chips also have a receiver bug that 296sometimes manifests during periods of heavy receive and transmit 297activity, where the chip will improperly DMA received frames to 298the host. The chips appear to upload several kilobytes of garbage 299data along with the received frame data, dirtying several RX buffers 300instead of just the expected one. The 301.Nm 302driver detects this condition and will salvage the frame, however 303it incurs a serious performance penalty in the process. 304.Pp 305The PNIC chips also sometimes generate a transmit underrun error when 306the driver attempts to download the receiver filter setup frame, which 307can result in the receive filter being incorrectly programmed. The 308.Nm 309driver will watch for this condition and requeue the setup frame until 310it is transfered successfully. 311.Pp 312The ADMtek AL981 chip (and possibly the AN985 as well) has been observed 313to sometimes wedge on transmit: this appears to happen when the driver 314queues a sequence of frames which cause it to wrap from the end of the 315the transmit descriptor ring back to the beginning. The 316.Nm 317driver attempts to avoid this condition by not queing any frames past 318the end of the transmit ring during a single invocation of the 319.Fn dc_start 320routine. This workaround has a negligible impact on transmit performance. 321 322 323