Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

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