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