tulip-user.tmpl
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:12k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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