1.\" $NetBSD: le.4,v 1.18 2002/02/07 03:15:08 ross Exp $ 2.\" 3.\" Copyright (c) 1992, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" This software was developed by the Computer Systems Engineering group 7.\" at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8.\" contributed to Berkeley. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 3. All advertising materials mentioning features or use of this software 19.\" must display the following acknowledgement: 20.\" This product includes software developed by the University of 21.\" California, Berkeley and its contributors. 22.\" 4. Neither the name of the University nor the names of its contributors 23.\" may be used to endorse or promote products derived from this software 24.\" without specific prior written permission. 25.\" 26.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36.\" SUCH DAMAGE. 37.\" 38.\" from: Header: le.4,v 1.2 92/10/13 05:31:33 leres Exp 39.\" from: @(#)le.4 8.1 (Berkeley) 6/9/93 40.\" 41.Dd April 27, 2001 42.Dt LE 4 43.Os 44.Sh NAME 45.Nm le 46.Nd AMD 7990, 79C90, 79C960, 79C970 LANCE Ethernet interface driver 47.Sh SYNOPSIS 48.Ss ISA boards 49.Cd "nele0 at isa? port 0x320 irq 9 drq 7 # NE2100" 50.Cd "le* at nele?" 51.Cd "bicc0 at isa? port 0x320 irq 10 drq 7 # BICC Isolan" 52.Cd "le* at bicc?" 53.Cd "depca0 at isa? port 0x300 iomem 0xc8000 iosiz 0x8000 irq 5 # DEC DEPCA" 54.Cd "le* at depca?" 55.Cd "le* at isapnp? # ISA-Plug-and-Play adapters" 56.Ss EISA boards 57.Cd "depca* at eisa? slot ? # DEC DE422" 58.Cd "le* at depca?" 59.Ss MCA boards 60.Cd "le* at mca? slot ? # SKNET Personal/MC2+" 61.Ss PCI boards and mainboard adapters 62.Cd "le* at pci? dev? function ?" 63.Ss TURBOchannel PMAD-A or onboard (alpha, pmax) 64.Cd "le* at tc? slot ? offset ?" 65.Ss alpha 66.Cd "le* at ioasic? offset ?" 67.Ss amiga 68.Cd "le* at zbus0" 69.Ss atari 70.Cd "le0 at vme0 irq 4 # BVME410" 71.Cd "le0 at vme0 irq 5 # Riebl/PAM" 72.Ss hp300 73.Cd "le* at dio? scode ?" 74.Ss mvme68k 75.Cd "le0 at pcc? ipl 3 # MVME147" 76.Ss news68k 77.Cd "le0 at hb0 addr 0xe0f00000 ipl 4" 78.Ss newsmips 79.Cd "le0 at hb0 addr 0xbff80000 level 1" 80.Ss pmax 81.Cd "le* at ioasic? offset ?" 82.Cd "le* at ibus0 addr ?" 83.Ss sparc and sparc64 84.Cd "le* at sbus? slot ? offset ?" 85.Cd "le* at ledma0 slot ? offset ?" 86.Cd "le* at lebuffer? slot ? offset ?" 87.Ss sun3 88.Cd "le0 at obio0 addr 0x120000 ipl 3" 89.Cd "options LANCE_REVC_BUG" 90.Ss vax 91.Cd "le0 at vsbus0 csr 0x200e0000" 92.Sh DESCRIPTION 93The 94.Nm 95interface provides access to a 96.Tn Ethernet 97network via the 98.Tn AMD 99Am7990 and Am79C90 (CMOS, pin-compatible) 100.Tn LANCE 101(Local Area Network Controller - Ethernet) chip set. 102.Pp 103The 104.Nm 105driver also supports PCnet-PCI cards based on the 106.Tn AMD 79c970 107chipset, which is a single-chip implementation of a 108.Tn LANCE 109chip and 110.Tn PCI 111bus interface. 112.Pp 113Each of the host's network addresses 114is specified at boot time with an 115.Dv SIOCSIFADDR 116.Xr ioctl 2 . 117The 118.Nm 119interface employs the Address Resolution Protocol (ARP) described in 120.Xr arp 4 121to dynamically map between Internet and 122.Tn Ethernet 123addresses on the local network. 124.Pp 125Selective reception of multicast Ethernet frames is provided 126by a 64-bit mask; multicast destination addresses are hashed to a 127bit entry using the Ethernet CRC function. 128.Pp 129The use of 130.Qq trailer 131encapsulation to minimize copying data on input and output is 132supported by the interface but offers no advantage on systems with 133large page sizes. 134The use of trailers is automatically negotiated with 135.Tn ARP . 136This negotiation may be disabled, on a per-interface basis, with 137.Xr ifconfig 8 . 138.Sh HARDWARE 139.Ss amiga 140The 141.Nm 142interface supports the following Zorro II expansion cards: 143.Bl -tag -width "AMERISTAR" -offset indent 144.It Em A2065 145Commodore's Ethernet card, manufacturer\ 514, product\ 112 146.It Em AMERISTAR 147Ameristar's Ethernet card, manufacturer\ 1053, product\ 1 148.It Em ARIADNE 149Village Tronic's Ethernet card, manufacturer\ 2167, product\ 201 150.El 151.Pp 152The A2065 and Ameristar Ethernet cards supports only manual media selection. 153.Pp 154The Ariadne card supports a software media selection for its two 155different connectors: 156.Pp 157.Bl -tag -width xxxxxxxxxxxxxx 158.It 10Base2/BNC 159also known as thinwire-Ethernet 160.It 10BaseT/UTP 161also known as twisted pair 162.El 163.Pp 164The Ariadne card uses an autoselect between UTP and BNC, so it uses 165UTP when an active UTP line is connected or otherwise BNC. 166See 167.Xr ifmedia 4 168for media selection options for 169.Xr ifconfig 8 . 170.Ss ISA 171The ISA-bus Ethernet cards supported by the 172.Nm 173interface are: 174.Pp 175.Bl -tag -width xxxx -offset indent -compact 176.It BICC Isolan 177.It Novell NE2100 178.It Digital DEPCA 179.El 180.Ss EISA 181The EISA-bus Ethernet cards supported by the 182.Nm 183interface are: 184.Pp 185.Bl -tag -width xxxx -offset indent -compact 186.It DEC DE422 187.El 188.Ss MCA 189The MCA-bus Ethernet cards supported by the 190.Nm 191interface are: 192.Pp 193.Bl -tag -width xxxx -offset indent -compact 194.It SKNET Personal MC2 195.It SKNET MC2+ 196.El 197.Ss pmax 198All 199.Tn LANCE 200interfaces on 201.Tn DECstations 202are supported, as are interfaces on 203.Tn "Alpha AXP" 204machines with a 205.Tn TURBOchannel 206bus. 207.Pp 208No support is provided for switching between media ports. 209The 210.Tn DECstation 2113100 provides both AUI and BNC (thinwire or 10base2) connectors. 212Port selection is via a manual switch and is not software configurable. 213.Pp 214The 215.Tn DECstation 216model 5000/200 217.Tn PMAD-AA 218baseboard device provides only a BNC connector. 219.Pp 220The 221.Nm ioasic 222baseboard devices and the 223.Tn PMAD-AA 224.Tn TURBOchannel 225option card provide only an AUI port. 226.Ss sparc 227The 228.Tn Sbus 229.Tn Ethernet 230cards supported by the 231.Nm 232interface include: 233.Bl -tag -width xxxx -offset indent -compact 234.It SBE/S 235.Tn SCSI 236and Buffered 237.Tn Ethernet 238(sun part 501-1860) 239.It FSBE/S 240Fast 241.Tn SCSI 242and Buffered 243.Tn Ethernet 244(sun part 501-2015) 245.El 246.Pp 247Interfaces attached to an 248.Sy ledma0 249on SPARC systems typically have have two types of connectors: 250.Pp 251.Bl -tag -offset indent -width xxxxxxxxxxxxxxxxxx 252.It AUI/DIX 253Standard 15 pin connector 254.It 10BaseT 255UTP, also known as twisted pair 256.El 257.Pp 258The appropriate connector can be selected by supplying a 259.Cm media 260parameter to 261.Xr ifconfig 8 . 262The supported arguments for 263.Cm media 264are: 265.Bl -tag -offset indent -width xxxxxxxxxxxxxxxxxx 266.It Sy 10base5/AUI 267to select the AUI connector, or 268.It Sy 10baseT/UTP 269to select the UTP connector. 270.El 271.Pp 272If a 273.Cm media 274parameter is not specified, a default connector is selected for 275use by examining all media types for carrier. 276The first connector on which a carrier is detected will be selected. 277Additionally, if carrier is dropped on a port, the driver will 278switch between the possible ports until one with carrier is found. 279.Sh DIAGNOSTICS 280.Bl -diag 281.It "le%d: overflow" 282More packets came in from the Ethernet than there was space in the 283receive buffers. 284Packets were missed. 285.It "le%d: receive buffer error" 286Ran out of buffer space, packet dropped. 287.It "le%d: lost carrier" 288The Ethernet carrier disappeared during an attempt to transmit. 289It will finish transmitting the current packet, 290but will not automatically retry transmission if there is a collision. 291.It "le%d: excessive collisions, tdr %d" 292Ethernet extremely busy or jammed, 293outbound packets dropped after 16 attempts to retransmit. 294.Pp 295.Sy TDR 296is 297.Qq Time Domain Reflectometry . 298The 299.Tn LANCE 300TDR value is an internal counter of the interval between the start 301of a transmission, and the occurrence of a collision. 302This value can be used to determine the distance from the Ethernet 303tap to the point on the Ethernet cable that is shorted or open 304(unterminated). 305.It "le%d: dropping chained buffer" 306Packet didn't fit into a single receive buffer, packet dropped. 307Since the 308.Nm 309driver allocates buffers large enough to receive the maximum size 310.Tn Ethernet 311packet, this means some other station on the LAN transmitted a 312packet larger than allowed by the 313.Tn Ethernet 314standard. 315.It "le%d: transmit buffer error" 316.Tn LANCE 317ran out of buffer before finishing the transmission of a packet. 318If this error occurs, the driver software has a bug. 319.It "le%d: underflow" 320.Tn LANCE 321ran out of buffer before finishing the transmission of a packet. 322If this error occurs, the driver software has a bug. 323.It "le%d: controller failed to initialize" 324Driver failed to start the AM7990 325.Tn LANCE . 326This is potentially a hardware failure. 327.It "le%d: memory error" 328.Tn RAM 329failed to respond within the timeout when the 330.Tn LANCE 331wanted to read or write it. 332This is potentially a hardware failure. 333.It "le%d: receiver disabled" 334The 335.Tn LANCE 336receiver was turned off due to an error. 337.It "le%d: transmitter disabled" 338The 339.Tn LANCE 340transmitter was turned off due to an error. 341.El 342.Sh SEE ALSO 343.Xr arp 4 , 344.Xr ifmedia 4 , 345.Xr inet 4 , 346.Xr intro 4 , 347.Xr mca 4 , 348.Xr ifconfig 8 349.Rs 350.%R "Am79C90 - CMOS Local Area Network Controller for Ethernet" 351.%D May 1994 352.%N 17881 353.%O Advanced Micro Devices 354.Re 355.Sh HISTORY 356The pmax 357.Nm 358driver is derived from a 359.Nm 360driver that first appeared in 361.Bx 4.4 . 362Support for multiple bus attachments first appeared in 363.Nx 1.2 . 364.Pp 365The 366.Tn Amiga 367.Nm 368interface first appeared in 369.Nx 1.0 370.Pp 371The Ariadne Ethernet card first appeared with the 372.Tn Amiga 373ae interface in 374.Nx 1.1 375and was converted to the 376.Tn Amiga 377.Nm 378interface in 379.Nx 1.3 380.Sh BUGS 381The Am7990 Revision C chips have a bug which causes garbage to 382be inserted in front of the received packet occasionally. 383The work-around is to ignore packets with an invalid destination 384address (garbage will usually not match), by double-checking the 385destination address of every packet in the driver. 386This work-around is enabled with the 387.Dv LANCE_REVC_BUG 388kernel option. 389.Pp 390When 391.Dv LANCE_REVC_BUG 392is enabled, the 393.Nm 394driver executes one or two calls to an inline Ethernet address 395comparison function for every received packet. 396On the 397.Tn mc68000 398it is exactly eight instructions of 16-bits each. 399There is one comparison for each unicast packet, and two 400comparisons for each broadcast packet. 401.Pp 402In summary, the cost of the LANCE_REVC_BUG option is: 403.Bl -enum -compact 404.It 405loss of multicast support, and 406.It 407eight extra 408.Tn CPU 409instructions per received packet, sometimes sixteen, 410depending on both the processor, and the type of packet. 411.El 412.Pp 413All sun3 systems are presumed to have this bad revision of the Am7990, 414until proven otherwise. 415Alas, the only way to prove what revision of the chip is in a 416particular system is inspection of the date code on the chip package, 417to compare against a list of what chip revisions were fabricated 418between which dates. 419.Pp 420Alas, the Am7990 chip is so old that 421.Tn AMD 422has 423.Qq de-archived 424the production information about it; pending a search elsewhere, 425we don't know how to identify the revision C chip from the date 426codes. 427.Pp 428On all pmax front-ends, performance is impaired by hardware which 429forces a software copy of packets to and from DMA buffers. 430The 431.Nm ioasic 432machines and the 433.Tn DECstation 4343100 must 435copy packets to and from non-contiguous DMA buffers. 436The 437.Tn DECstation 4385000/200 and the 439.Tn PMAD-AA 440must copy to and from an onboard SRAM DMA buffer. 441The CPU overhead is noticeable, but all machines 442can sustain full 10 Mb/s media speed. 443