3 .\" Copyright (c) 1997 Joerg Wunsch
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\" $FreeBSD: src/share/man/man4/man4.i386/rdp.4,v 1.5.2.4 2001/08/17 13:08:46 ru Exp $
30 .\" " (emacs disconfusion)
36 .Nd Ethernet driver for RealTek RTL 8002 pocket ethernet
38 .Cd "device rdp0 at isa? port 0x378 irq 7"
39 .Cd "device rdp0 at isa? port 0x378 irq 7 flags 0x2"
43 device driver supports RealTek RTL 8002-based pocket ethernet adapters,
44 connected to a standard parallel port.
46 These adapters seem to belong to the cheaper choices among pocket
47 ethernet adapters. The RTL 8002 is the central part, containing an
48 interface to BNC and UTP (10 Mbit/s) media, as well as a host
49 interface that is designed to talk to standard parallel printer
50 adapters. For the full ethernet adapter to work, it is completed by
51 an external RAM used as the Tx and Rx packet buffer (16 K x 4 for the
52 RTL 8002), and an EEPROM to hold the assigned ethernet hardware
53 address. For the RTL 8002, the EEPROM can be either a standard 93C46
54 serial EEPROM (which seems to be a common choice), or a 74S288
55 parallel one. The latter variant needs the device configuration flag
58 Since standard printer adapters seem to vary wildly among their timing
59 requirements, there are currently two possible choices for the way
60 data are being exchanged between the pocket ethernet adapter and the
61 printer interface. The default is the fastest mode the RTL 8002
62 supports. If the printer adapter to use is particularly slow (which
63 can be noticed by watching the ethernet wire for crippled packets, or
64 by not seeing correclty received packets), the configuration flag 0x2
65 can be set in order to throttle down the
67 driver. Note that in fast mode, the data rate is assymetric, sending
68 is a little faster (up to two times) than receiving. Rates like 150
69 KB/s for sending and 80 KB/s for receiving are common. For slow mode,
70 both rates are about the same, and in the range of 50 KB/s through 70
71 KB/s. As always, your mileage may vary.
73 In case the adapter isn't recognized at boot-time, setting the
77 might help in diagnosing the reason. Since the RTL 8002 requires
78 the availability of a working interrupt for the printer adapter (unlike
83 driver fails to attach if the ethernet adapter cannot assert an
84 interrupt at probe time.
86 The RTL 8002 doesn't support (hardware) multicast.
90 driver internally sets a flag so it gets probed very early. This way,
91 it is possible to configure both, an
95 driver into the same kernel. If no RTL 8002 hardware is present, probing
96 will eventually detect the printer driver.
98 .Dl "rdp0: configured IRQ (7) cannot be asserted by device"
100 The probe routine was unable to get the RTL 8002 asserting an interrupt
101 request through the printer adapter.
103 .Dl "rdp0: failed to find a valid hardware address in EEPROM"
105 Since there doesn't seem to be a standard place for storing the hardware
106 ethernet address within the EEPROM, the
108 driver walks the entire (serial) EEPROM contents until it finds something
109 that looks like a valid ethernet hardware address, based on the IEEE's
110 OUI assignments. This diagnostic tells the driver was unable to find
111 one. Note: it might as well be the current adapter is one of the rare
112 examples with a 74S288 EEPROM, so
116 .Dl "rdp0: Device timeout"
118 After initiating a packet transmission, the ethernet adapter didn't
119 return a notification of the (successful or failed) transmission. The
120 hardware is likely to be wedged, and is being reset.
126 This driver was written by
128 based on RealTek's packet driver for the RTL 8002, as well as on some
129 description of the successor chip, RTL 8012, gracefully provided by
132 There are certainly many of them.
136 driver wants to probe its hardware at boot-time, the adapter needs
137 to be present then in order to be detected.
139 Only two out of the eight different speed modes RealTek's packet
140 driver could handle are implemented. Thus there might be hardware
141 where even the current slow mode is too fast.
143 There should be a DMA transfer test in the probe routine that figures
144 out the usable mode automatically.
146 Abusing a standard printer interface for data exchange is error-prone.
147 Occasional stuck hardware shouldn't surprise too much, hopefully the
148 timeout routine will catch these cases. Flood-pinging is a good
149 example of triggering this problem. Likewise, albeit BPF is of course
150 supported, it's certainly a bad idea attempting to watch a crowded
151 ethernet wire using promiscuous mode.
153 Since the RTL 8002 has only 4 KB of Rx buffer space (2 x 2 KB are used
154 as Tx buffers), the usual NFS deadlock with large packets arriving too
155 quickly could happen if a machine using the
157 driver NFS-mounts some fast server with the standard NFS blocksize of
158 8 KB. (Since NFS can only retransmit entire NFS packets, the same
159 packet will be retransmitted over and over again.)
161 The heuristic to find out the ethernet hardware address from the
162 EEPROM sucks, but seems to be the only sensible generic way that
163 doesn't depend on the actual location in EEPROM. RealTek's sample
164 driver placed it directly at address 0, other vendors picked something
165 like 15, with other junk in front of it that must not be confused with
166 a valid ethernet address.
168 The driver should support the successor chip RTL 8012, which seems to
169 be available and used these days. (The RTL 8002 is already somewhat
170 aged, around 1992/93.) The RTL 8012 offers support for advanced
171 printer adapter hardware, like bidirectional SPP, or EPP, which could
172 speed up the transfers substantially. The RTL 8012 also supports
173 hardware multicast, and has the ability to address 64 K x 4 packet
176 The driver should be layered upon the ppc driver, instead of working
177 standalone, and should be available as a loadable module, so the
178 device probing can be deferred until the pocket ethernet adapter has
179 actually been attached.