1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
3 <book id="TulipUserGuide">
5 <title>Tulip Driver User's Guide</title>
9 <firstname>Jeff</firstname>
10 <surname>Garzik</surname>
13 <email>jgarzik@pobox.com</email>
21 <holder>Jeff Garzik</holder>
26 This documentation is free software; you can redistribute
27 it and/or modify it under the terms of the GNU General Public
28 License as published by the Free Software Foundation; either
29 version 2 of the License, or (at your option) any later
34 This program is distributed in the hope that it will be
35 useful, but WITHOUT ANY WARRANTY; without even the implied
36 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
37 See the GNU General Public License for more details.
41 You should have received a copy of the GNU General Public
42 License along with this program; if not, write to the Free
43 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
48 For more details see the file COPYING in the source
49 distribution of Linux.
57 <title>Introduction</title>
59 The Tulip Ethernet Card Driver
60 is maintained by Jeff Garzik (<email>jgarzik@pobox.com</email>).
64 The Tulip driver was developed by Donald Becker and changed by
65 Jeff Garzik, Takashi Manabe and a cast of thousands.
69 For 2.4.x and later kernels, the Linux Tulip driver is available at
70 <ULink URL="http://sourceforge.net/projects/tulip/">http://sourceforge.net/projects/tulip/</ULink>
74 This driver is for the Digital "Tulip" Ethernet adapter interface.
75 It should work with most DEC 21*4*-based chips/ethercards, as well as
76 with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and ASIX.
80 The original author may be reached as becker@scyld.com, or C/O
81 Scyld Computing Corporation,
82 410 Severn Ave., Suite 210,
87 Additional information on Donald Becker's tulip.c
88 is available at <ULink URL="http://www.scyld.com/network/tulip.html">http://www.scyld.com/network/tulip.html</ULink>
93 <chapter id="drvr-compat">
94 <title>Driver Compatibility</title>
97 This device driver is designed for the DECchip "Tulip", Digital's
98 single-chip ethernet controllers for PCI (now owned by Intel).
99 Supported members of the family
100 are the 21040, 21041, 21140, 21140A, 21142, and 21143. Similar work-alike
101 chips from Lite-On, Macronics, ASIX, Compex and other listed below are also
106 These chips are used on at least 140 unique PCI board designs. The great
107 number of chips and board designs supported is the reason for the
108 driver size and complexity. Almost of the increasing complexity is in the
109 board configuration and media selection code. There is very little
110 increasing in the operational critical path length.
114 <chapter id="board-settings">
115 <title>Board-specific Settings</title>
118 PCI bus devices are configured by the system at boot time, so no jumpers
119 need to be set on the board. The system BIOS preferably should assign the
120 PCI INTA signal to an otherwise unused system IRQ line.
124 Some boards have EEPROMs tables with default media entry. The factory default
125 is usually "autoselect". This should only be overridden when using
126 transceiver connections without link beat e.g. 10base2 or AUI, or (rarely!)
127 for forcing full-duplex when used with old link partners that do not do
132 <chapter id="driver-operation">
133 <title>Driver Operation</title>
135 <sect1><title>Ring buffers</title>
138 The Tulip can use either ring buffers or lists of Tx and Rx descriptors.
139 This driver uses statically allocated rings of Rx and Tx descriptors, set at
140 compile time by RX/TX_RING_SIZE. This version of the driver allocates skbuffs
141 for the Rx ring buffers at open() time and passes the skb->data field to the
142 Tulip as receive data buffers. When an incoming frame is less than
143 RX_COPYBREAK bytes long, a fresh skbuff is allocated and the frame is
144 copied to the new skbuff. When the incoming frame is larger, the skbuff is
145 passed directly up the protocol stack and replaced by a newly allocated
150 The RX_COPYBREAK value is chosen to trade-off the memory wasted by
151 using a full-sized skbuff for small frames vs. the copying costs of larger
152 frames. For small frames the copying cost is negligible (esp. considering
153 that we are pre-loading the cache with immediately useful header
154 information). For large frames the copying cost is non-trivial, and the
155 larger copy might flush the cache of useful data. A subtle aspect of this
156 choice is that the Tulip only receives into longword aligned buffers, thus
157 the IP header at offset 14 isn't longword aligned for further processing.
158 Copied frames are put into the new skbuff at an offset of "+2", thus copying
159 has the beneficial effect of aligning the IP header and preloading the
165 <sect1><title>Synchronization</title>
167 The driver runs as two independent, single-threaded flows of control. One
168 is the send-packet routine, which enforces single-threaded use by the
169 dev->tbusy flag. The other thread is the interrupt handler, which is single
170 threaded by the hardware and other software.
174 The send packet thread has partial control over the Tx ring and 'dev->tbusy'
175 flag. It sets the tbusy flag whenever it's queuing a Tx packet. If the next
176 queue slot is empty, it clears the tbusy flag when finished otherwise it sets
177 the 'tp->tx_full' flag.
181 The interrupt handler has exclusive control over the Rx ring and records stats
182 from the Tx ring. (The Tx-done interrupt can't be selectively turned off, so
183 we can't avoid the interrupt overhead by having the Tx routine reap the Tx
184 stats.) After reaping the stats, it marks the queue entry as empty by setting
185 the 'base' to zero. Iff the 'tp->tx_full' flag is set, it clears both the
186 tx_full and tbusy flags.
193 <chapter id="errata">
194 <title>Errata</title>
197 The old DEC databooks were light on details.
198 The 21040 databook claims that CSR13, CSR14, and CSR15 should each be the last
199 register of the set CSR12-15 written. Hmmm, now how is that possible?
203 The DEC SROM format is very badly designed not precisely defined, leading to
204 part of the media selection junkheap below. Some boards do not have EEPROM
205 media tables and need to be patched up. Worse, other boards use the DEC
206 design kit media table when it isn't correct for their board.
210 We cannot use MII interrupts because there is no defined GPIO pin to attach
211 them. The MII transceiver status is polled using an kernel timer.
215 <chapter id="changelog">
216 <title>Driver Change History</title>
218 <sect1><title>Version 0.9.14 (February 20, 2001)</title>
220 <listitem><para>Fix PNIC problems (Manfred Spraul)</para></listitem>
221 <listitem><para>Add new PCI id for Accton comet</para></listitem>
222 <listitem><para>Support Davicom tulips</para></listitem>
223 <listitem><para>Fix oops in eeprom parsing</para></listitem>
224 <listitem><para>Enable workarounds for early PCI chipsets</para></listitem>
225 <listitem><para>IA64, hppa csr0 support</para></listitem>
226 <listitem><para>Support media types 5, 6</para></listitem>
227 <listitem><para>Interpret a bit more of the 21142 SROM extended media type 3</para></listitem>
228 <listitem><para>Add missing delay in eeprom reading</para></listitem>
232 <sect1><title>Version 0.9.11 (November 3, 2000)</title>
234 <listitem><para>Eliminate extra bus accesses when sharing interrupts (prumpf)</para></listitem>
235 <listitem><para>Barrier following ownership descriptor bit flip (prumpf)</para></listitem>
236 <listitem><para>Endianness fixes for >14 addresses in setup frames (prumpf)</para></listitem>
237 <listitem><para>Report link beat to kernel/userspace via netif_carrier_*. (kuznet)</para></listitem>
238 <listitem><para>Better spinlocking in set_rx_mode.</para></listitem>
239 <listitem><para>Fix I/O resource request failure error messages (DaveM catch)</para></listitem>
240 <listitem><para>Handle DMA allocation failure.</para></listitem>
244 <sect1><title>Version 0.9.10 (September 6, 2000)</title>
246 <listitem><para>Simple interrupt mitigation (via jamal)</para></listitem>
247 <listitem><para>More PCI ids</para></listitem>
251 <sect1><title>Version 0.9.9 (August 11, 2000)</title>
253 <listitem><para>More PCI ids</para></listitem>
257 <sect1><title>Version 0.9.8 (July 13, 2000)</title>
259 <listitem><para>Correct signed/unsigned comparison for dummy frame index</para></listitem>
260 <listitem><para>Remove outdated references to struct enet_statistics</para></listitem>
264 <sect1><title>Version 0.9.7 (June 17, 2000)</title>
266 <listitem><para>Timer cleanups (Andrew Morton)</para></listitem>
267 <listitem><para>Alpha compile fix (somebody?)</para></listitem>
271 <sect1><title>Version 0.9.6 (May 31, 2000)</title>
273 <listitem><para>Revert 21143-related support flag patch</para></listitem>
274 <listitem><para>Add HPPA/media-table debugging printk</para></listitem>
278 <sect1><title>Version 0.9.5 (May 30, 2000)</title>
280 <listitem><para>HPPA support (willy@puffingroup)</para></listitem>
281 <listitem><para>CSR6 bits and tulip.h cleanup (Chris Smith)</para></listitem>
282 <listitem><para>Improve debugging messages a bit</para></listitem>
283 <listitem><para>Add delay after CSR13 write in t21142_start_nway</para></listitem>
284 <listitem><para>Remove unused ETHER_STATS code</para></listitem>
285 <listitem><para>Convert 'extern inline' to 'static inline' in tulip.h (Chris Smith)</para></listitem>
286 <listitem><para>Update DS21143 support flags in tulip_chip_info[]</para></listitem>
287 <listitem><para>Use spin_lock_irq, not _irqsave/restore, in tulip_start_xmit()</para></listitem>
288 <listitem><para>Add locking to set_rx_mode()</para></listitem>
289 <listitem><para>Fix race with chip setting DescOwned bit (Hal Murray)</para></listitem>
290 <listitem><para>Request 100% of PIO and MMIO resource space assigned to card</para></listitem>
291 <listitem><para>Remove error message from pci_enable_device failure</para></listitem>
295 <sect1><title>Version 0.9.4.3 (April 14, 2000)</title>
297 <listitem><para>mod_timer fix (Hal Murray)</para></listitem>
298 <listitem><para>PNIC2 resuscitation (Chris Smith)</para></listitem>
302 <sect1><title>Version 0.9.4.2 (March 21, 2000)</title>
304 <listitem><para>Fix 21041 CSR7, CSR13/14/15 handling</para></listitem>
305 <listitem><para>Merge some PCI ids from tulip 0.91x</para></listitem>
306 <listitem><para>Merge some HAS_xxx flags and flag settings from tulip 0.91x</para></listitem>
307 <listitem><para>asm/io.h fix (submitted by many) and cleanup</para></listitem>
308 <listitem><para>s/HAS_NWAY143/HAS_NWAY/</para></listitem>
309 <listitem><para>Cleanup 21041 mode reporting</para></listitem>
310 <listitem><para>Small code cleanups</para></listitem>
314 <sect1><title>Version 0.9.4.1 (March 18, 2000)</title>
316 <listitem><para>Finish PCI DMA conversion (davem)</para></listitem>
317 <listitem><para>Do not netif_start_queue() at end of tulip_tx_timeout() (kuznet)</para></listitem>
318 <listitem><para>PCI DMA fix (kuznet)</para></listitem>
319 <listitem><para>eeprom.c code cleanup</para></listitem>
320 <listitem><para>Remove Xircom Tulip crud</para></listitem>