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 "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.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 99Built in 10Mbps only ethernet on Compaq Presario 7900 series 100desktops (21143, non-MII) 101.It 102Built in ethernet on LinkSys EtherFast 10/100 Instant GigaDrive (DM9102, MII) 103.It 104Kingston KNE100TX (21143, MII) 105.It 106D-Link DFE-570TX (21143, MII, quad port) 107.It 108NDC SOHOware SFA110 (98713A) 109.It 110SVEC PN102-TX (98713) 111.It 112CNet Pro120A (98715A or 98713A) and CNet Pro120B (98715) 113.It 114Compex RL100-TX (98713 or 98713A) 115.It 116LinkSys LNE100TX (PNIC 82c168, 82c169) 117.It 118NetGear FA310-TX Rev. D1, D2 or D3 (PNIC 82c169) 119.It 120Matrox FastNIC 10/100 (PNIC 82c168, 82c169) 121.It 122Kingston KNE110TX (PNIC 82c169) 123.It 124LinkSys LNE100TX v2.0 (PNIC II 82c115) 125.It 126Jaton XpressNet (Davicom DM9102) 127.It 128Alfa Inc GFC2204 (ASIX AX88140A) 129.It 130CNet Pro110B (ASIX AX88140A) 131.El 132.Pp 133The 134.Nm 135driver supports the following media types: 136.Pp 137.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 138.It autoselect 139Enable autoselection of the media type and options. 140The user can manually override 141the autoselected mode by adding media options to the 142.Pa /etc/rc.conf 143file. 144.Pp 145Note: the built-in NWAY autonegotiation on the original PNIC 82c168 146chip is horribly broken and is not supported by the 147.Nm 148driver at this time: the chip will operate in any speed or duplex 149mode, however these must be set manually. The original 82c168 appears 150on very early revisions of the LinkSys LNE100TX and Matrox FastNIC. 151.It 10baseT/UTP 152Set 10Mbps operation. The 153.Ar mediaopt 154option can also be used to enable 155.Ar full-duplex 156operation. Not specifying 157.Ar full duplex 158implies 159.Ar half-duplex 160mode. 161.It 100baseTX 162Set 100Mbps (fast ethernet) operation. The 163.Ar mediaopt 164option can also be used to enable 165.Ar full-duplex 166operation. Not specifying 167.Ar full duplex 168implies 169.Ar half-duplex 170mode. 171.El 172.Pp 173The 174.Nm 175driver supports the following media options: 176.Pp 177.Bl -tag -width xxxxxxxxxxxxxxxxxxxx 178.It full-duplex 179Force full duplex operation. The interface will operate in 180half duplex mode if this media option is not specified. 181.El 182.Pp 183Note that the 100baseTX media type may not be available on certain 184Intel 21143 adapters which support 10mbps media attachments only. 185For more information on configuring this device, see 186.Xr ifconfig 8 . 187.Sh DIAGNOSTICS 188.Bl -diag 189.It "dc%d: couldn't map ports/memory" 190A fatal initialization error has occurred. 191.It "dc%d: couldn't map interrupt" 192A fatal initialization error has occurred. 193.It "dc%d: watchdog timeout" 194A packet was queued for transmission and a transmit command was 195issued, however the device failed to acknowledge the transmission 196before a timeout expired. This can happen if the device is unable 197to deliver interrupts for some reason, of if there is a problem with 198the network connection (cable). 199.It "dc%d: no memory for rx list" 200The driver failed to allocate an mbuf for the receiver ring. 201.It "dc%d: TX underrun -- increasing TX threshold" 202The device generated a transmit underrun error while attempting to 203DMA and transmit a packet. This happens if the host is not able to 204DMA the packet data into the NIC's FIFO fast enough. The driver 205will dynamically increase the transmit start threshold so that 206more data must be DMAed into the FIFO before the NIC will start 207transmitting it onto the wire. 208.It "dc%d: TX underrun -- using store and forward mode" 209The device continued to generate transmit underruns even after all 210possible transmit start threshold settings had been tried, so the 211driver programmed the chip for store and forward mode. In this mode, 212the NIC will not begin transmission until the entire packet has been 213transfered into its FIFO memory. 214.It "dc%d: chip is in D3 power state -- setting to D0" 215This message applies only to adapters which support power 216management. Some operating systems place the controller in low power 217mode when shutting down, and some PCI BIOSes fail to bring the chip 218out of this state before configuring it. The controller loses all of 219its PCI configuration in the D3 state, so if the BIOS does not set 220it back to full power mode in time, it won't be able to configure it 221correctly. The driver tries to detect this condition and bring 222the adapter back to the D0 (full power) state, but this may not be 223enough to return the driver to a fully operational condition. If 224you see this message at boot time and the driver fails to attach 225the device as a network interface, you will have to perform second 226warm boot to have the device properly configured. 227.Pp 228Note that this condition only occurs when warm booting from another 229operating system. If you power down your system prior to booting 230.Fx , 231the card should be configured correctly. 232.El 233.Sh SEE ALSO 234.Xr arp 4 , 235.Xr netintro 4 , 236.Xr ifconfig 8 , 237.Xr ng_ether 8 238.Rs 239.%T ADMtek AL981, AL983 and AL985 data sheets 240.%O http://www.admtek.com.tw 241.Re 242.Rs 243.%T ASIX Electronics AX88140A and AX88141 data sheets 244.%O http://www.asix.com.tw 245.Re 246.Rs 247.%T Davicom DM9102 data sheet 248.%O http://www.davicom8.com 249.Re 250.Rs 251.%T Intel 21143 Hardware Reference Manual 252.%O http://developer.intel.com 253.Re 254.Rs 255.%T Macronix 98713/A, 98715/A and 98725 data sheets 256.%O http://www.macronix.com 257.Re 258.Rs 259.%T Macronix 98713/A and 98715/A app notes 260.%O http://www.macronix.com 261.Re 262.Sh HISTORY 263The 264.Nm 265device driver first appeared in 266.Fx 4.0 . 267.Sh AUTHORS 268The 269.Nm 270driver was written by 271.An Bill Paul Aq wpaul@ee.columbia.edu . 272.Sh BUGS 273The Macronix application notes claim that in order to put the 274chips in normal operation, the driver must write a certian magic 275number into the CSR16 register. The numbers are documented in 276the app notes, but the exact meaning of the bits is not. 277.Pp 278The 98713A seems to have a problem with 10Mbps full duplex mode. 279The transmitter works but the receiver tends to produce many 280unexplained errors leading to very poor overall performance. The 28198715A does not exhibit this problem. All other modes on the 28298713A seem to work correctly. 283.Pp 284The original 82c168 PNIC chip has built in NWAY support which is 285used on certain early LinkSys LNE100TX and Matrox FastNIC cards, 286however it is horribly broken and difficult to use reliably. 287Consequently, autonegotiation is not currently supported for this 288chipset: the driver defaults the NIC to 10baseT half duplex, and it's 289up to the operator to manually select a different mode if necessary. 290(Later cards use an external MII transceiver to implement NWAY 291autonegotiation and work correctly.) 292.Pp 293The 294.Nm 295driver programs 82c168 and 82c169 PNIC chips to use the store and 296forward setting for the transmit start threshold by default. This 297is to work around problems with some NIC/PCI bus combinations where 298the PNIC can transmit corrupt frames when operating at 100Mbps, 299probably due to PCI DMA burst transfer errors. 300.Pp 301The 82c168 and 82c169 PNIC chips also have a receiver bug that 302sometimes manifests during periods of heavy receive and transmit 303activity, where the chip will improperly DMA received frames to 304the host. The chips appear to upload several kilobytes of garbage 305data along with the received frame data, dirtying several RX buffers 306instead of just the expected one. The 307.Nm 308driver detects this condition and will salvage the frame, however 309it incurs a serious performance penalty in the process. 310.Pp 311The PNIC chips also sometimes generate a transmit underrun error when 312the driver attempts to download the receiver filter setup frame, which 313can result in the receive filter being incorrectly programmed. The 314.Nm 315driver will watch for this condition and requeue the setup frame until 316it is transfered successfully. 317.Pp 318The ADMtek AL981 chip (and possibly the AN985 as well) has been observed 319to sometimes wedge on transmit: this appears to happen when the driver 320queues a sequence of frames which cause it to wrap from the end of the 321the transmit descriptor ring back to the beginning. The 322.Nm 323driver attempts to avoid this condition by not queing any frames past 324the end of the transmit ring during a single invocation of the 325.Fn dc_start 326routine. This workaround has a negligible impact on transmit performance. 327 328 329