Initial import from FreeBSD RELENG_4:
[dragonfly.git] / share / man / man4 / rl.4
1 .\" Copyright (c) 1997, 1998
2 .\"     Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by Bill Paul.
15 .\" 4. Neither the name of the author nor the names of any co-contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"   without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 .\" THE POSSIBILITY OF SUCH DAMAGE.
30 .\"
31 .\" $FreeBSD: src/share/man/man4/rl.4,v 1.15.2.8 2003/02/17 21:20:39 trhodes Exp $
32 .\"
33 .Dd November 4, 1998
34 .Dt RL 4
35 .Os
36 .Sh NAME
37 .Nm rl
38 .Nd RealTek 8129/8139 fast ethernet device driver
39 .Sh SYNOPSIS
40 .Cd "device rl"
41 .Sh DESCRIPTION
42 The
43 .Nm
44 driver provides support for PCI ethernet adapters and embedded
45 controllers based on the RealTek 8129 and 8139 fast ethernet controller
46 chips.
47 This includes the Allied Telesyn AT2550, Farallon NetLINE 10/100 PCI,
48 Genius GF100TXR,
49 NDC Communications NE100TX-E, OvisLink LEF-8129TX, OvisLink LEF-8139TX,
50 Netronix Inc. EA-1210 NetEther 10/100, KTX-9130TX 10/100 Fast Ethernet,
51 Encore ENL832-TX 10/100 M PCI, Longshine LCS-8038TX-R, the
52 SMC EZ Card 10/100 PCI 1211-TX, and various other cheap adapters.
53 It also supports the Accton EN1207D which has a
54 chip labeled MPX5030 (or MPX5038) which appears to be a RealTek workalike.
55 .Pp
56 The RealTek controllers use bus master DMA but do not use a
57 descriptor-based data transfer mechanism.
58 The receiver uses a
59 single fixed size ring buffer from which packets must be copied
60 into mbufs.
61 For transmission, there are only four outbound packet
62 address registers which require all outgoing packets to be stored
63 as contiguous buffers.
64 Furthermore, outbound packet buffers must
65 be longword aligned or else transmission will fail.
66 .Pp
67 The 8129 differs from the 8139 in that the 8139 has an internal
68 PHY which is controlled through special direct access registers
69 whereas the 8129 uses an external PHY via an MII bus.
70 The 8139
71 supports both 10 and 100Mbps speeds in either full or half duplex.
72 The 8129 can support the same speeds and modes given an appropriate
73 PHY chip.
74 .Pp
75 The
76 .Nm
77 driver supports the following media types:
78 .Pp
79 .Bl -tag -width xxxxxxxxxxxxxxxxxxxx
80 .It autoselect
81 Enable autoselection of the media type and options.
82 This is only
83 supported if the PHY chip attached to the RealTek controller
84 supports NWAY autonegotiation.
85 The user can manually override
86 the autoselected mode by adding media options to the
87 .Pa /etc/rc.conf
88 file.
89 .It 10baseT/UTP
90 Set 10Mbps operation.
91 The
92 .Ar mediaopt
93 option can also be used to select either
94 .Ar full-duplex
95 or
96 .Ar half-duplex
97 modes.
98 .It 100baseTX
99 Set 100Mbps (fast ethernet) operation.
100 The
101 .Ar mediaopt
102 option can also be used to select either
103 .Ar full-duplex
104 or
105 .Ar half-duplex
106 modes.
107 .El
108 .Pp
109 The
110 .Nm
111 driver supports the following media options:
112 .Pp
113 .Bl -tag -width xxxxxxxxxxxxxxxxxxxx
114 .It full-duplex
115 Force full duplex operation
116 .It half-duplex
117 Force half duplex operation.
118 .El
119 .Pp
120 Note that the 100baseTX media type is only available if supported
121 by the adapter.
122 For more information on configuring this device, see
123 .Xr ifconfig 8 .
124 .Sh DIAGNOSTICS
125 .Bl -diag
126 .It "rl%d: couldn't map memory"
127 A fatal initialization error has occurred.
128 .It "rl%d: couldn't map interrupt"
129 A fatal initialization error has occurred.
130 .It "rl%d: watchdog timeout"
131 The device has stopped responding to the network, or there is a problem with
132 the network connection (cable).
133 .It "rl%d: no memory for rx list"
134 The driver failed to allocate an mbuf for the receiver ring.
135 .It "rl%d: no memory for tx list"
136 The driver failed to allocate an mbuf for the transmitter ring when
137 allocating a pad buffer or collapsing an mbuf chain into a cluster.
138 .It "rl%d: chip is in D3 power state -- setting to D0"
139 This message applies only to adapters which support power
140 management.
141 Some operating systems place the controller in low power
142 mode when shutting down, and some PCI BIOSes fail to bring the chip
143 out of this state before configuring it.
144 The controller loses all of
145 its PCI configuration in the D3 state, so if the BIOS does not set
146 it back to full power mode in time, it won't be able to configure it
147 correctly.
148 The driver tries to detect this condition and bring
149 the adapter back to the D0 (full power) state, but this may not be
150 enough to return the driver to a fully operational condition.
151 If
152 you see this message at boot time and the driver fails to attach
153 the device as a network interface, you will have to perform second
154 warm boot to have the device properly configured.
155 .Pp
156 Note that this condition only occurs when warm booting from another
157 operating system.
158 If you power down your system prior to booting
159 .Fx ,
160 the card should be configured correctly.
161 .El
162 .Sh SEE ALSO
163 .Xr arp 4 ,
164 .Xr miibus 4 ,
165 .Xr netintro 4 ,
166 .Xr ng_ether 4 ,
167 .Xr ifconfig 8
168 .Rs
169 .%B The RealTek 8129 and 8139 datasheets
170 .%O ftp.realtek.com.tw:/lancard/data sheet
171 .Re
172 .Sh HISTORY
173 The
174 .Nm
175 device driver first appeared in
176 .Fx 3.0 .
177 .Sh AUTHORS
178 The
179 .Nm
180 driver was written by
181 .An Bill Paul Aq wpaul@ctr.columbia.edu .
182 .Sh BUGS
183 Since outbound packets must be longword aligned, the transmit
184 routine has to copy an unaligned packet into an mbuf cluster buffer
185 before transmission.
186 The driver abuses the fact that the cluster buffer
187 pool is allocated at system startup time in a contiguous region starting
188 at a page boundary.
189 Since cluster buffers are 2048 bytes, they are
190 longword aligned by definition.
191 The driver probably should not be
192 depending on this characteristic.
193 .Pp
194 The RealTek data sheets are of especially poor quality,
195 and there is a lot of information missing
196 particularly concerning the receiver operation.
197 One particularly
198 important fact that the data sheets fail to mention relates to the
199 way in which the chip fills in the receive buffer.
200 When an interrupt
201 is posted to signal that a frame has been received, it is possible that
202 another frame might be in the process of being copied into the receive
203 buffer while the driver is busy handling the first one.
204 If the driver
205 manages to finish processing the first frame before the chip is done
206 DMAing the rest of the next frame, the driver may attempt to process
207 the next frame in the buffer before the chip has had a chance to finish
208 DMAing all of it.
209 .Pp
210 The driver can check for an incomplete frame by inspecting the frame
211 length in the header preceding the actual packet data: an incomplete
212 frame will have the magic length of 0xFFF0.
213 When the driver encounters
214 this value, it knows that it has finished processing all currently
215 available packets.
216 Neither this magic value nor its significance are
217 documented anywhere in the RealTek data sheets.