1998-11-07 17:40:18 +00:00
|
|
|
.\" Copyright (c) 1997, 1998
|
|
|
|
.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" 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. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by Bill Paul.
|
|
|
|
.\" 4. Neither the name of the author nor the names of any co-contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1998-11-07 17:40:18 +00:00
|
|
|
.\"
|
1998-11-07 17:54:11 +00:00
|
|
|
.Dd November 4, 1998
|
1999-11-15 23:14:32 +00:00
|
|
|
.Dt RL 4
|
1998-11-07 17:40:18 +00:00
|
|
|
.Os FreeBSD
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rl
|
|
|
|
.Nd
|
|
|
|
RealTek 8129/8139 fast ethernet device driver
|
|
|
|
.Sh SYNOPSIS
|
2000-01-23 16:13:26 +00:00
|
|
|
.Cd "device rl"
|
1998-11-07 17:40:18 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver provides support for PCI ethernet adapters and embedded
|
|
|
|
controllers based on the RealTek 8129 and 8139 fast ethernet controller
|
2000-03-01 14:50:24 +00:00
|
|
|
chips.
|
|
|
|
This includes the Allied Telesyn AT2550, Genius GF100TXR,
|
1998-11-07 17:40:18 +00:00
|
|
|
NDC Communications NE100TX-E, OvisLink LEF-8129TX, OvisLink LEF-8139TX,
|
|
|
|
Netronix Inc. EA-1210 NetEther 10/100, KTX-9130TX 10/100 Fast Ethernet,
|
1998-12-07 00:35:06 +00:00
|
|
|
Encore ENL832-TX 10/100 M PCI, Longshine LCS-8038TX-R, the
|
1998-12-24 18:52:47 +00:00
|
|
|
SMC EZ Card 10/100 PCI 1211-TX, and various other cheap adapters.
|
1998-12-07 00:35:06 +00:00
|
|
|
It also supports the Accton EN1207D which has a
|
1998-11-18 21:05:11 +00:00
|
|
|
chip labeled MPX5030 (or MPX5038) which appears to be a RealTek workalike.
|
1998-11-07 17:40:18 +00:00
|
|
|
.Pp
|
|
|
|
The RealTek controllers use bus master DMA but do not use a
|
2000-03-01 14:50:24 +00:00
|
|
|
descriptor-based data transfer mechanism.
|
|
|
|
The receiver uses a
|
1998-11-07 17:40:18 +00:00
|
|
|
single fixed size ring buffer from which packets must be copied
|
2000-03-01 14:50:24 +00:00
|
|
|
into mbufs.
|
|
|
|
For transmission, there are only four outbound packet
|
1998-11-07 17:40:18 +00:00
|
|
|
address registers which require all outgoing packets to be stored
|
2000-03-01 14:50:24 +00:00
|
|
|
as contiguous buffers.
|
|
|
|
Furthermore, outbound packet buffers must
|
1998-11-07 17:40:18 +00:00
|
|
|
be longword aligned or else transmission will fail.
|
|
|
|
.Pp
|
1998-12-24 18:52:47 +00:00
|
|
|
The 8129 differs from the 8139 in that the 8139 has an internal
|
1998-11-07 17:40:18 +00:00
|
|
|
PHY which is controlled through special direct access registers
|
2000-03-01 14:50:24 +00:00
|
|
|
whereas the 8129 uses an external PHY via an MII bus.
|
|
|
|
The 8139
|
1998-11-07 17:40:18 +00:00
|
|
|
supports both 10 and 100Mbps speeds in either full or half duplex.
|
|
|
|
The 8129 can support the same speeds and modes given an appropriate
|
|
|
|
PHY chip.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver supports the following media types:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
|
|
|
.It autoselect
|
2000-03-01 14:50:24 +00:00
|
|
|
Enable autoselection of the media type and options.
|
|
|
|
This is only
|
1998-11-07 17:40:18 +00:00
|
|
|
supported if the PHY chip attached to the RealTek controller
|
2000-03-01 14:50:24 +00:00
|
|
|
supports NWAY autonegotiation.
|
|
|
|
The user can manually override
|
1998-11-07 17:40:18 +00:00
|
|
|
the autoselected mode by adding media options to the
|
|
|
|
.Pa /etc/rc.conf
|
1999-03-25 00:52:44 +00:00
|
|
|
file.
|
1998-11-07 17:40:18 +00:00
|
|
|
.It 10baseT/UTP
|
2000-03-01 14:50:24 +00:00
|
|
|
Set 10Mbps operation.
|
|
|
|
The
|
1998-11-07 17:40:18 +00:00
|
|
|
.Ar mediaopt
|
|
|
|
option can also be used to select either
|
|
|
|
.Ar full-duplex
|
|
|
|
or
|
2001-02-01 16:38:02 +00:00
|
|
|
.Ar half-duplex
|
|
|
|
modes.
|
1998-11-07 17:40:18 +00:00
|
|
|
.It 100baseTX
|
2000-03-01 14:50:24 +00:00
|
|
|
Set 100Mbps (fast ethernet) operation.
|
|
|
|
The
|
1998-11-07 17:40:18 +00:00
|
|
|
.Ar mediaopt
|
|
|
|
option can also be used to select either
|
|
|
|
.Ar full-duplex
|
|
|
|
or
|
|
|
|
.Ar half-duplex
|
|
|
|
modes.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver supports the following media options:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
|
|
|
.It full-duplex
|
|
|
|
Force full duplex operation
|
|
|
|
.It half-duplex
|
|
|
|
Force half duplex operation.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Note that the 100baseTX media type is only available if supported
|
|
|
|
by the adapter.
|
|
|
|
For more information on configuring this device, see
|
|
|
|
.Xr ifconfig 8 .
|
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
.Bl -diag
|
|
|
|
.It "rl%d: couldn't map memory"
|
|
|
|
A fatal initialization error has occurred.
|
|
|
|
.It "rl%d: couldn't map interrupt"
|
|
|
|
A fatal initialization error has occurred.
|
|
|
|
.It "rl%d: watchdog timeout"
|
|
|
|
The device has stopped responding to the network, or there is a problem with
|
|
|
|
the network connection (cable).
|
|
|
|
.It "rl%d: no memory for rx list"
|
|
|
|
The driver failed to allocate an mbuf for the receiver ring.
|
|
|
|
.It "rl%d: no memory for tx list"
|
1998-12-07 18:14:30 +00:00
|
|
|
The driver failed to allocate an mbuf for the transmitter ring when
|
1998-11-07 17:40:18 +00:00
|
|
|
allocating a pad buffer or collapsing an mbuf chain into a cluster.
|
|
|
|
.It "rl%d: chip is in D3 power state -- setting to D0"
|
|
|
|
This message applies only to adapters which support power
|
2000-03-01 14:50:24 +00:00
|
|
|
management.
|
|
|
|
Some operating systems place the controller in low power
|
1998-11-07 17:40:18 +00:00
|
|
|
mode when shutting down, and some PCI BIOSes fail to bring the chip
|
2000-03-01 14:50:24 +00:00
|
|
|
out of this state before configuring it.
|
|
|
|
The controller loses all of
|
1998-11-07 17:40:18 +00:00
|
|
|
its PCI configuration in the D3 state, so if the BIOS does not set
|
|
|
|
it back to full power mode in time, it won't be able to configure it
|
2000-03-01 14:50:24 +00:00
|
|
|
correctly.
|
|
|
|
The driver tries to detect this condition and bring
|
1998-11-07 17:40:18 +00:00
|
|
|
the adapter back to the D0 (full power) state, but this may not be
|
2000-03-01 14:50:24 +00:00
|
|
|
enough to return the driver to a fully operational condition.
|
|
|
|
If
|
1998-11-07 17:40:18 +00:00
|
|
|
you see this message at boot time and the driver fails to attach
|
|
|
|
the device as a network interface, you will have to perform second
|
|
|
|
warm boot to have the device properly configured.
|
|
|
|
.Pp
|
|
|
|
Note that this condition only occurs when warm booting from another
|
2000-03-01 14:50:24 +00:00
|
|
|
operating system.
|
|
|
|
If you power down your system prior to booting
|
1998-11-07 17:40:18 +00:00
|
|
|
.Fx ,
|
|
|
|
the card should be configured correctly.
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr arp 4 ,
|
|
|
|
.Xr netintro 4 ,
|
2000-05-04 17:40:13 +00:00
|
|
|
.Xr ng_ether 4 ,
|
|
|
|
.Xr ifconfig 8
|
1998-11-07 17:40:18 +00:00
|
|
|
.Rs
|
|
|
|
.%B The RealTek 8129 and 8139 datasheets
|
|
|
|
.%O ftp.realtek.com.tw:/lancard/data sheet
|
|
|
|
.Re
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device driver first appeared in
|
|
|
|
.Fx 3.0 .
|
1999-08-15 10:48:36 +00:00
|
|
|
.Sh AUTHORS
|
1998-11-07 17:40:18 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver was written by
|
|
|
|
.An Bill Paul Aq wpaul@ctr.columbia.edu .
|
|
|
|
.Sh BUGS
|
|
|
|
Since outbound packets must be longword aligned, the transmit
|
|
|
|
routine has to copy an unaligned packet into an mbuf cluster buffer
|
2000-03-01 14:50:24 +00:00
|
|
|
before transmission.
|
|
|
|
The driver abuses the fact that the cluster buffer
|
1998-11-07 17:40:18 +00:00
|
|
|
pool is allocated at system startup time in a contiguous region starting
|
2000-03-01 14:50:24 +00:00
|
|
|
at a page boundary.
|
|
|
|
Since cluster buffers are 2048 bytes, they are
|
|
|
|
longword aligned by definition.
|
|
|
|
The driver probably should not be
|
1998-11-07 17:40:18 +00:00
|
|
|
depending on this characteristic.
|
|
|
|
.Pp
|
|
|
|
The RealTek data sheets are of especially poor quality: the grammar
|
|
|
|
and spelling are awful and there is a lot of information missing,
|
2000-03-01 14:50:24 +00:00
|
|
|
particularly concerning the receiver operation.
|
|
|
|
One particularly
|
1998-11-07 17:40:18 +00:00
|
|
|
important fact that the data sheets fail to mention relates to the
|
2000-03-01 14:50:24 +00:00
|
|
|
way in which the chip fills in the receive buffer.
|
|
|
|
When an interrupt
|
1998-11-07 17:40:18 +00:00
|
|
|
is posted to signal that a frame has been received, it is possible that
|
|
|
|
another frame might be in the process of being copied into the receive
|
2000-03-01 14:50:24 +00:00
|
|
|
buffer while the driver is busy handling the first one.
|
|
|
|
If the driver
|
1998-11-07 17:40:18 +00:00
|
|
|
manages to finish processing the first frame before the chip is done
|
|
|
|
DMAing the rest of the next frame, the driver may attempt to process
|
|
|
|
the next frame in the buffer before the chip has had a chance to finish
|
|
|
|
DMAing all of it.
|
|
|
|
.Pp
|
|
|
|
The driver can check for an incomplete frame by inspecting the frame
|
2001-02-18 10:25:42 +00:00
|
|
|
length in the header preceding the actual packet data: an incomplete
|
2000-03-02 14:54:02 +00:00
|
|
|
frame will have the magic length of 0xFFF0.
|
|
|
|
When the driver encounters
|
1998-11-07 17:40:18 +00:00
|
|
|
this value, it knows that it has finished processing all currently
|
2000-03-01 14:50:24 +00:00
|
|
|
available packets.
|
|
|
|
Neither this magic value nor its significance are
|
1998-11-07 17:40:18 +00:00
|
|
|
documented anywhere in the RealTek data sheets.
|