This is a collections of user-level programs to check out the basic
functionality of an ethercard. The programs can read (and sometimes
write) the EEPROM setup table of software-configured cards.
These program also provide example code for accessing hardware device
from a user-level program in Linux. All of them enable access to I/O space
registers using ioperm() or iopl() . Several (e.g. e21.c) access ISA shared memory regions using mmap()
.
The MII diagnostic monitors the link status as
reported by the MII
management registers. It works with many (but not all) of the Fast Ethernet
device drivers. This is the only diagnostic program usable with non-root
capabilities.
Use the '-w' option to continue to monitor the MII link status. The '-A'
(set autonegotiate options) and '-F' (set forced media type) options are
usable with superuser permissions.
PCI adapters
- Digital Tulip (DC21040 series) diagnostics, C
source code.
- Intel EtherExpress PCI Pro10/100 series
diagnostics, C source code.
- SMC EPIC (SMC83c170 series) diagnostics, C source
code.
- RealTek (RTL8129 series) diagnostics, C source
code.
- 3Com Vortex, Boomerang and Cyclone (3c590 and
3c900 series) diagnostic, C source code.
- PCI NE2000 clone diagnostics
- This diagnostic works with several different PCI types, notably those
based on the WinBond and RealTek chips. EEPROM information is only
available with the RealTek RTL8029 chip.
- Packet Engines/Symbios "Yellowfin"
diagnostics
Non-PCI adapters
- 3Com 3c509 ISA EtherLink III diagnostics, C source
code.
- This program tests the detection and activation of the ISA card only.
The
setup program is available seperately.
- 3Com 3c515 ISA Fast EtherLink diagnostics,
C source code.
- This program reports the registers of the ISA card only.
-
HP PCLAN+ diagnostics, C source code.
-
NE2000 diagnostics, C source code.
- AT-Lan-Tec/RealTek diagnostics, C source code.
- And if you don't have the kernel source, you'll need the
header file.
- Cabletron E21xx diagnostics, C source code.
- AT1700 diagnostics and setup.
- C source code for a program that extensively tests the multicast filter
(-m) and can write the EEPROM configuration register
(-P -Q ).
- Intel Ethernet Express diagnostics, C source
code.
Setup Programs
National Semiconductor DP83905 AT/Lantic setup program,
C source code.
- The AT/Lantic chip is used in the NE2000+ and many other software-configured
NE2000 clones.
3Com EtherLink III family (3c509, 3c529, 3c579, and 3c589) setup program.
- This program displays the registers and currently programmed settings. It allows the
base I/O address, IRQ, and transceiver port settings to be changed.
Compiling the Diagnotic and Setup Programs
All source code files have the suggested compile command at the end of
the file. In most cases the only requirement is that the program must be
compiled with the '-O' flag so that I/O operations are properly inlined.
All source files are stand-alone, with two exceptions:
- The atp.c diagnostic program requires atp.h
- Diagnostic programs that recognize MII transceivers may optionally be
compiled with the -DLIBMII flag and linked against libmii.c.
Using the PCI Diagnostic programs
The PCI diagnostic programs have a consistent basic interface, with
extensions as needed for special functionality. The /proc/pci pseudo-file
is read to determine the cards installed, and they are checked the order
listed. That means that the currently running kernel must be compiled with
PCI, and the /proc pseudo-file-system must be mounted. Most Linux
distributions do this by default.
Basic diagnostic options
The following options are implemented with all diagnostic programs:
- -# N
- Describe or perform operations only the the Nth adapter found.
- -a
- Show all registers
- -D
- Increase the debugging level.
- -e
- Show the EEPROM contents. With some diagnostic programs, "-e -e" shows
additional details.
- -E
- Do an Emergency rewrite of a completely corrupted EEPROM. This option
is not actually implemented for most adapter types, and should never be
used.
- -f
- Force operations. This option causes the diagnostic program to
proceed even if it detects that the adapter is currently active.
- -F media-type
- Set the transceiver selection to the specified type. Valid media
types are 10baseT, 10base2, 10base5, AUI.
- -m
- Show MII registers. With many diagnostic programs "-m -m" shows
additional details or polls the MII registers for one minute, reporting any
status changes.
- -p I/O-port
- Specify the I/O port at which to find a single card. This option is
primarily for ISA adapters, but may be useful in special cases with PCI
adapters.
- -q
- Quiet mode. But diagnostic program tend to be verbose anyway.
- -t
- Run a functionality test appropriate to the chip, typically a memory
or loopback test.
- -v
- Increase the verbosity level. Additional "-v" options increase the
level further.
- -V
- Show the program version information.
- -w
- Write the EEPROM with the specified updated values.
- -?
- Emit usage information.
MII diagnostic basic options
Adapters with MII transceivers (all recent adapters running at 100mbps)
support the follwing options:
- -A link-type
- Set the link capabilities we advertise using autonegotiation. Valid values are
100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD, 10baseT, 10baseT-FD,
and 10baseT-HD. The abbreviations HD and FD stand for full-duplex and
half-duplex. The 100baseTx and 10baseT settings advertise
both duplex values.
If more detailed control is required, the exact register setting may
be specified with as a hexadecimal number e.g. 01e0.
- -m
- Show MII registers. With many diagnostic programs "-m -m" shows
additional details or polls the MII registers for one minute, reporting any
status changes.
Configuration setup basic options
A few Diagnostics can optionally write the EEPROM configuration.
While they have hardware-specific limitations, the typical options are:
- -w
- Write the EEPROM with the specified updated values.
Some programs require "-w -w" to actually write the values.
Recommended use is to try the intended settings without "-w", and then
appended it to the command line when you are satisfied that the updates
are specified correctly.
- -F 10baseT|10baseT|10base2|10base5|AUI
- Set the default transceiver type.
Acceptable values are chip or board specific.
"10base5" is an alias for "AUI".
10baseT+ is a 10baseT transceiver with reduced receive squelch
threshold, a non-standard setting intended for lossy or overly long cables.
- -P I/O-port
- Set the card's I/O address to the specified value. Acceptable values are
chip specific.
- -Q IRQ
- Set the card to use the specified IRQ (interrupt line). Acceptable
values are chip specific. Note: In rare cases a board may not conform to
usual pin wiring order and the actual IRQ line used may differ from that
specified and reported.