1.\" Copyright (c) 2003 2.\" Bill Paul <wpaul@windriver.com>. 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$ 32.\" $DragonFly: src/share/man/man4/re.4,v 1.8 2008/10/09 13:45:16 sephe Exp $ 33.\" 34.Dd November 2, 2006 35.Dt RE 4 36.Os 37.Sh NAME 38.Nm re 39.Nd "RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter driver" 40.Sh SYNOPSIS 41.Cd "device miibus" 42.Cd "device re" 43.Pp 44Alternatively, to load the driver as a module at boot time, place the 45following line in 46.Pa /boot/loader.conf : 47.Bd -literal -offset indent 48if_re_load="YES" 49.Ed 50.Sh DESCRIPTION 51The 52.Nm 53driver provides support for various NICs based on the RealTek 54RTL8139C+, RTL8169, RTL8169S, RTL8110S, RTL8168S, RTL8111S and RTL8101E 55PCI and PCIe ethernet controllers. 56.Pp 57NICs based on the 588139C+ and 8101E 59are capable of 10 and 100Mbps speeds over CAT5 cable. 60NICs based on the 618169, 816xS and 811xS 62are capable of 10, 100 and 1000Mbps operation. 63.Pp 64All NICs supported by the 65.Nm 66driver have TCP/IP checksum offload and hardware VLAN tagging/insertion 67features, and use a descriptor-based DMA mechanism. They are also 68capable of TCP large send (TCP segmentation offload). 69.Pp 70The 8139C+ is a single-chip solution combining both a 10/100 MAC and PHY. 71The 8169 is a 10/100/1000 MAC only, requiring a GMII or TBI external PHY. 72The 8169S and 8110S are single-chip devices containing both a 10/100/1000 73MAC and 10/100/1000 copper PHY. Standalone 10/100/1000 cards are available 74in both 32-bit PCI and 64-bit PCI models. The 8110S is designed for 75embedded LAN-on-motherboard applications. 76.Pp 77The 8169, 8169S and 8110S also support jumbo frames, which can be configured 78via the interface MTU setting. 79Selecting an MTU larger than 1500 bytes with the 80.Xr ifconfig 8 81utility configures the adapter to receive and transmit jumbo frames. 82The maximum MTU setting for Jumbo Frames is 7426. 83This value coincides with the maximum Jumbo Frames size of 7440. 84.Pp 85The 86.Nm 87driver supports the following media types: 88.Bl -tag -width 10baseTXUTP 89.It Cm autoselect 90Enable autoselection of the media type and options. 91The user can manually override 92the autoselected mode by adding media options to 93.Xr rc.conf 5 . 94.It Cm 10baseT/UTP 95Set 10Mbps operation. 96The 97.Xr ifconfig 8 98.Ic mediaopt 99option can also be used to select either 100.Cm full-duplex 101or 102.Cm half-duplex 103modes. 104.It Cm 100baseTX 105Set 100Mbps (fast ethernet) operation. 106The 107.Xr ifconfig 8 108.Ic mediaopt 109option can also be used to select either 110.Cm full-duplex 111or 112.Cm half-duplex 113modes. 114.It Cm 1000baseT 115Set 1000baseT operation over twisted pair. 116The RealTek gigE chips support 1000Mbps in 117.Cm full-duplex 118mode only. 119.\" .It Cm 1000baseSX 120.\" Set 1000Mbps (gigabit ethernet) operation. 121.\" Both 122.\" .Cm full-duplex 123.\" and 124.\" .Cm half-duplex 125.\" modes are supported. 126.El 127.Pp 128The 129.Nm 130driver supports the following media options: 131.Bl -tag -width full-duplex 132.It Cm full-duplex 133Force full duplex operation. 134.It Cm half-duplex 135Force half duplex operation. 136.El 137.Pp 138For more information on configuring this device, see 139.Xr ifconfig 8 . 140The 141.Nm 142driver supports 143.Xr polling 4 . 144.Ss MIB Variables 145A number of per-interface variables are implemented in the 146.Va hw.re Ns Em X 147branch of the 148.Xr sysctl 3 149MIB. 150.Bl -tag -width ".Va rx_desc_count" 151.It Va rx_desc_count 152Number of RX descriptors (read-only). 153Use the tunable 154.Va hw.re.rx_desc_count 155to configure it. 156.It Va tx_desc_count 157Number of TX descriptors (read-only). 158Use the tunable 159.Va hw.re.tx_desc_count 160to configure it. 161.It Va imtype 162Interrupt moderation type. 1630 means disable interrupt moderation. 1641 means using simulated interrupt moderation (default). 1652 means using hardware interrupt moderation, 166if hardware supports it. 167Due to lack of proper document, 168hardware interrupt moderation (2) may not work as expected. 169.It Va sim_time 170If 171.Va imtype 172is set to 1, 173it controls interrupt moderation time (unit: 1us). 174It will not have any effect, 175if 176.Va imtype 177is 0 or 2. 178By default, it is set to 75us for PCIe controllers and 179125us for PCI controllers. 180.It Va hw_txtime 181If the controller does not support hardware interrupt moderation, 182then this sysctl node will not exist. 183If 184.Va imtype 185is set to 2, 186it controls TX interrupt moderation time (unit: 25us). 187It will not have any effect, 188if 189.Va imtype 190is 0 or 1. 191It is set to 5 (125us) by default. 192Due to lack of chip document, 193it may not work reliably. 194.It Va hw_rxtime 195If the controller does not support hardware interrupt moderation, 196then this sysctl node will not exist. 197If 198.Va imtype 199is set to 2, 200it controls RX interrupt moderation time (unit: 25us). 201It will not have any effect, 202if 203.Va imtype 204is 0 or 1. 205It is set to 2 (50us) by default. 206Due to lack of chip document, 207it may not work reliably. 208.El 209.Sh HARDWARE 210The 211.Nm 212driver supports RealTek RTL8139C+, RTL8169, RTL816xS, RTL811xS, 213and RTL8101E based Fast Ethernet and Gigabit Ethernet adapters including: 214.Pp 215.Bl -bullet -compact 216.It 217Alloy Computer Products EtherGOLD 1439E 10/100 (8139C+) 218.It 219Compaq Evo N1015v Integrated Ethernet (8139C+) 220.It 221Corega CG-LAPCIGT Gigabit Ethernet (8169S) 222.It 223D-Link DGE-528(T) Gigabit Ethernet (8169S) 224.It 225Gigabyte 7N400 Pro2 Integrated Gigabit Ethernet (8110S) 226.It 227LevelOne GNC-0105T (8169S) 228.It 229LinkSys EG1032 (32-bit PCI) 230.It 231PLANEX COMMUNICATIONS Inc.\& GN-1200TC (8169S) 232.It 233Xterasys XN-152 10/100/1000 NIC (8169) 234.El 235.Sh DIAGNOSTICS 236.Bl -diag 237.It "re%d: couldn't map ports" 238A fatal initialization error has occurred. 239.It "re%d: couldn't map interrupt" 240A fatal initialization error has occurred. 241.It "re%d: watchdog timeout" 242The device has stopped responding to the network, or there is a problem with 243the network connection (cable). 244.El 245.Sh SEE ALSO 246.Xr arp 4 , 247.Xr ifmedia 4 , 248.Xr miibus 4 , 249.Xr netintro 4 , 250.Xr ng_ether 4 , 251.Xr polling 4 , 252.Xr vlan 4 , 253.Xr ifconfig 8 254.Rs 255.%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets 256.%O http://www.realtek.com.tw 257.Re 258.Sh HISTORY 259The 260.Nm 261device driver first appeared in 262.Fx 5.2 263and 264.Dx 1.0 . 265.Sh AUTHORS 266The 267.Nm 268driver was written by 269.An Bill Paul Aq wpaul@windriver.com . 270.Sh BUGS 271The Xterasys XN-152 32-bit PCI NIC, which uses the RTL8169 MAC and 272Marvell 88E1000 PHY, has a defect that causes DMA corruption 273if the board is plugged into a 64-bit PCI slot. The defect 274lies in the board design, not the chip itself: the PCI REQ64# and ACK64# 275lines should be pulled high, but they are not. The result is that the 2768169 chip is tricked into performing 64-bit DMA transfers even though 277a 64-bit data path between the NIC and the bus does not actually exist. 278.Pp 279Unfortunately, it is not possible to correct this problem in software, 280however it is possible to detect it. When the 281.Nm 282driver is loaded, it will run a diagnostic routine designed to 283validate DMA operation by placing the chip in digital loopback mode 284and initiating a packet transmission. If the card functions properly, 285the transmitted data will 286be echoed back unmodified. If the echoed data is corrupt, the driver 287will print an error message on the console and abort the device attach. The 288user should insure the NIC is installed in a 32-bit PCI slot to 289avoid this problem. 290