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