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