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