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