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