home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / misc / linhowto.zip / ETHERNET.HOW next >
Internet Message Format  |  1993-10-08  |  40KB

  1. From: Paul Gortmaker <paul@cain.mmtc.rmit.oz.au>
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers
  3. Subject: Linux Ethernet HOWTO
  4. Keywords: Linux, Ethernet, TCP/IP, NET-2
  5. Followup-To: poster
  6. Approved: linux-announce@tc.cornell.edu (Matt Welsh)
  7.  
  8. Archive-Name: linux/howto/ethernet
  9. Last-Modified: August 28, 1993
  10.  
  11. Linux Ethernet HOWTO v0.1 -- Last updated August 28, 1993
  12. ---------------------------------------------------------------------------
  13. 0. Introduction
  14.  
  15.     This is the Ethernet-HOWTO, which is a compilation of information
  16.     about which ethernet devices can be used for Linux, and how to
  17.     set them up.
  18.  
  19.     This Ethernet-HOWTO is by Donald J. Becker and Paul Gortmaker.
  20.     It covers what cards you should and shouldn't buy; how to set
  21.     them up, how to run more than one, and other common problems and
  22.     questions. It does *not* cover the software end of things, as that
  23.     is covered in the NET-2 HOWTO. You can freely distribute this 
  24.     document as long as you distribute an original copy with the 
  25.     author's names intact.
  26.  
  27.     Most of this information came from Donald J. Becker 
  28.     <becker@super.org> who is responsible for writing and 
  29.     supporting most of the ethernet drivers that are presently
  30.     available. Bj0rn Ekwall <bj0rn@blox.se> is responsible for
  31.     the D-Link pocket driver. A special thanks to others who have helped
  32.     with the device drivers and testing.
  33.  
  34. 0.1 Disclaimer
  35.  
  36.     This document is *not* gospel. However, it is probably the most
  37.     up to date info that you will be able to find. Nobody is responsible
  38.     for what happens to your hardware but yourself. If your ethercard
  39.     goes up in smoke (...nearly impossible!) we take no responsibility.
  40.  
  41. 0.2 Questions already?
  42.  
  43.         If you have questions about your ethernet card, please READ this
  44.     document first. You may also want to join the NET channel of the
  45.     Linux-activists mailing list by sending mail to
  46.                 linux-activists-request@niksula.hut.fi
  47.         with the line
  48.                 X-Mn-Admin: join NET
  49.         at the top of the message body (not the subject). Note that the NET
  50.     channel is primarily used for discussion of the networking code, and
  51.     you may not see much discussion about a particular driver.
  52.         Furthermore keep in mind that the NET channel is for development
  53.     discussions only. General questions on how to configure your system
  54.     should be directed to comp.os.linux.help unless you are actively
  55.     involved in the development of part of the networking for Linux.
  56.  
  57. 0.3 Related Documentation
  58.  
  59.     Much of this info came from small files and saved postings by Donald
  60.     himself. These can be found in /pub/linux/info on ftp.super.org
  61.     [192.31.192.1] Of course, if you are setting up an Ethernet card,
  62.     then you will want to read the NET-2 HOWTO so that you can actually
  63.     do something with it.
  64.  
  65. 0.4 New versions of this document
  66.  
  67.         New versions of this document can be retrieved via anonymous
  68.         FTP from sunsite.unc.edu:/pub/Linux/docs/HOWTO/*.  It will also be
  69.     posted to the newsgroup comp.os.linux.announce.
  70.  
  71. 0.5 Feedback
  72.  
  73.     Any corrections can be sent to one of us (paul@cain.mmtc.rmit.oz.au
  74.     or becker@super.org) We will *attempt* to keep this up to date as
  75.     more drivers become available, and as NET-2 matures.
  76.  
  77. 1. Supported Ethernet Cards for Linux
  78.  
  79.     The only thing that one needs to use an ethernet card with Linux 
  80.     is the appropriate driver. For this, it is essential that the man-
  81.     ufacturer will release the technical programming information to
  82.     the general public without you (or anyone) having to sign your life
  83.     away. A good guide for the likelihood of getting documentation
  84.     (or, if you aren't writing code, the likelihood that someone
  85.     else will write that driver you really, really need)
  86.     is the availability of the Crynwr (nee Clarkson) packet
  87.     driver.  Given the documentation, you can write a driver for
  88.     your card and use it for Linux, at least in theory.
  89.  
  90.     Most cards come with drivers for MS-DOS interfaces such as
  91.     NDIS and ODI, but these are useless for Linux.  Many people
  92.     have suggested directly linking them in or automatic
  93.     translation, but this is nearly impossible.  The MS-DOS
  94.     drivers expect to be in 16 bit mode and hook into "software
  95.     interrupts", both incompatible with the Linux kernel.  This
  96.     incompatibility is actually a feature, as some Linux drivers
  97.     are considerably better than their MS-DOS counterparts.  The
  98.     "8390" series drivers, for instance, use ping-pong transmit
  99.     buffers, which are only now being introduced in the MS-DOS world.
  100.  
  101.     Keep in mind that PC ethercards have the widest variety of
  102.     interfaces (shared memory, programmed I/O, bus-master, or slave
  103.     DMA) of any computer hardware for anything, and supporting a
  104.     new ethercard sometimes requires re-thinking most of the
  105.     lower-level networking code.  Also, similar product numbers
  106.     don't always indicate similar products.  For instance, the
  107.     3c50* product line is wildly different between members.
  108.  
  109.     Here is what drivers are and aren't available.
  110.  
  111. 1.1 3com Ethernet cards
  112.  
  113.     Supported:
  114.         3c503, 3c503/16 --
  115.             3Com shared-memory ethercards.  They also have a
  116.                 programmed I/O mode that doesn't use the 8390 
  117.             facilities (their engineers found too many bugs!)  
  118.             It should be about the same speed as the same bus 
  119.             width WD80x3, but I don't have a 16 bit version 
  120.             to benchmark. Unless you are a light user, spend
  121.             the extra money and get the 16 bit model, as the
  122.             savings aren't huge. The 3c503 does not have "EEPROM
  123.             setup", so the diagnostic/setup program isn't needed 
  124.             before running the card with Linux. The shared memory 
  125.             address of the 3c503 is set using jumpers that
  126.                 are shared with the boot PROM address.  This is
  127.             confusing to people familiar with other ISA cards, 
  128.             where you always leave the jumper set to "disable" 
  129.             unless you have a boot PROM. The Linux 3c503 driver 
  130.             will work with the 3c503 programmed-I/O mode, but this 
  131.                 is slower and less reliable than shared memory mode.
  132.  
  133.             Also, programmed-I/O mode is not tested when updating
  134.             the drivers, and the deadman (deadcard?) check code 
  135.             may be falsely triggered on some machines.
  136.             The IRQ line is set in software, with no hints
  137.             from e.g. EEPROM.  Unlike the MS-DOS driver, the 
  138.             Linux driver has capability to autoIRQ: it uses the 
  139.             first available IRQ line in {5,2,3,4}, selected each 
  140.             time the card is 'ifconfig'ed.  (Older driver versions 
  141.             selected the IRQ at boot time.)  The ioctl() call 
  142.             in 'ifconfig' will return EAGAIN if no IRQ line is 
  143.             available at that time. 
  144.  
  145.         3c509 --
  146.             A new card for 3Com. It should be cheap and have
  147.             excellent performance. The drawbacks are that it
  148.             _requires_ very low interrupt latency, and it isn't
  149.             rated for bus speeds greater than 8Mhz. The driver is 
  150.             written, working, and included in pl12. But it
  151.             seems to triggers a Linux TCP bug, so it's not built
  152.             as part of the default kernel.
  153.  
  154.             There is also an alpha version of a Linux 3c509
  155.             diagnostic and EEPROM setup program, but for now
  156.             users that don't like the defaults should use the
  157.             MS-DOS EEPROM setup program.
  158.  
  159.         3c579 --
  160.             The EISA version of the 509. The current EISA version
  161.             uses the same 16 bit wide chip rather than a 32 bit
  162.             interface, so the performance increase isn't stunning.
  163.             The 3c509 driver should work with the EISA
  164.             version, but I have neither an EISA machine nor
  165.             a 3c579 to test it on.
  166.  
  167.     Unsupported:
  168.  
  169.         3c501 --
  170.             Too brain-damaged to use. Available surplus from many
  171.             places. Avoid it like the plague. However, if you are
  172.             a bit of a masochist, there is some code in /pub/linux
  173.             on ftp.super.org --> look for 3c501.c Again, do not
  174.             purchase this card, even as a joke.  It's performance
  175.             is horrible, and it breaks in many ways.  
  176.  
  177.             For those not yet convinced, the 3c501 can only do one
  178.             thing at a time -- while you are removing one packet
  179.             from the single-packet buffer it cannot receive
  180.             another packet, nor can it receive a packet while are
  181.             loading a transmit packet.  This was fine for a
  182.             network between two 8088-based computers where
  183.             processing each packet and replying took 10's of
  184.             msecs, but modern networks send back-to-back
  185.             packets for almost every transaction.
  186.  
  187.         3c505 --
  188.             Not available at present.
  189.  
  190.         3c507 --
  191.             Not available at present.
  192.  
  193. 1.2 Western Digital / SMC Cards
  194.  
  195.     The ethernet part of Western Digital has been bought by SMC.  The
  196.     SMC Elite and SMC Elite Plus are the same as late-model WD8003 
  197.     and WD8013 cards.
  198.  
  199.     Supported:
  200.  
  201.         WD8003, WD8013, SMC Elite, SMC Elite Plus --
  202.             A shared memory design by Western Digital. The
  203.             8 bit 8003 is slightly less expensive, but only
  204.             worth the savings for light use. Over the
  205.             years the design has added more registers and an
  206.             EEPROM.  Clones usually go by the '8013' name, and 
  207.             usually use a non-EEPROM (jumpered) design. This part
  208.             of WD has been sold to SMC, so you'll usually see 
  209.             something link SMC/WD8013 or SMC Elite Plus (WD8013).  
  210.             The shared memory makes the cards 10-20% faster,
  211.             especially with larger packets. More importantly
  212.             (to me at least) it avoids a few bugs in the
  213.             programmed-I/O mode of the 8390, allows safe
  214.             multi-threaded access to the packet buffer, and 
  215.             doesn't have a programmed-I/O data register that 
  216.             hangs your machine during warm-boot probes.  
  217.  
  218. 1.3 NExxxx Cards
  219.  
  220.     The prefix "NE" came from Novell Ethernet.  Novell followed the 
  221.     cheapest NatSemi databook design and sold the manufacturing rights 
  222.     (spun off?) Eagle, just to get reasonably-priced ethercards into 
  223.     the market.
  224.  
  225.     Supported:
  226.  
  227.         NE1000, NE2000 --
  228.             The now-generic name for a bare-bones design around 
  229.             the NatSemi 8390. They use programmed I/O rather than
  230.             shared memory, leading to easier installation but 
  231.             slightly lower performance and a few problems. Again,
  232.             the savings of using an 8 bit NE1000 over the NE2000
  233.             are only warranted if you expect light use. Some 
  234.             recently introduced NE2000 clones use the National
  235.             Semiconductor "AT/LANTic" 83905 chip, which offers 
  236.             a shared memory mode similar to the 8013 and EEPROM
  237.             or software configuration. Some problems can arise
  238.             with poor clones. See the question and answer section
  239.             later in this document, and the section on clones.
  240.  
  241.         NE1500, NE2100 --
  242.             The AT1500 driver, recently added to the list of
  243.             supported cards, also supports the NE1500, NE2100 and
  244.             clones. The driver shipped with pl12 kernel doesn't 
  245.             detect non-AT1500 cards with autoprobe, but will work 
  246.             fine if you specify the base address explicitly and 
  247.             jumper for DMA channel 5.
  248.  
  249. 1.3 Hewlett Packard Cards
  250.  
  251.     HP-LAN ethercards: Nicely made, but hard to find.  The model
  252.     numbers don't encode anything, so you'll have to go by the 
  253.     description. 
  254.  
  255.     Supported:
  256.  
  257.          272[45]* series, 27245, 27247, 27250 --
  258.             They use programmed I/O, similar to the NE*000 boards,
  259.             but the data transfer port can be "turned off" when 
  260.             you aren't accessing it, avoiding problem with 
  261.             autoprobing drivers. Note that few people seem to use 
  262.             them, and I've had conflicting reports about changes 
  263.             between versions with the same model number -- later
  264.             versions may not work.
  265.  
  266. 1.4 D-Link 
  267.  
  268.     There is a file /usr/src/linux/net/inet/README.DLINK that you
  269.     should read if you are going to use D-Link stuff. Note, however 
  270.     that the installation info in this file is no longer valid, as it
  271.     applied to pre NET-2 kernels. It is now a part of the standard kernel.
  272.     
  273.     Supported:
  274.  
  275.         DE-600 --
  276.             Laptop users and other folk who might want a quick 
  277.             way to put their computer onto the ethernet may want 
  278.             to use this. The driver is included with the default 
  279.             kernel source tree as of pl12 and possibly earlier. 
  280.             Bjorn Ekwall <bj0rn@blox.se> wrote the original. 
  281.             Expect about 80kb/s transfer speed from this via the 
  282.             parallel port. The file mentioned above contains 
  283.             a "Known Problems and..." section. I will not repeat 
  284.             it here. But you should read it.  (Hint applied gently 
  285.             with a sledgehammer.)
  286.  
  287.         DE100, DE200, DE-220-T --
  288.             The manual says that it is 100% compatible with the
  289.             NE2000.  This is not true. You should call them and tell
  290.             them you are using their card with Linux, and that they
  291.             should correct their documentation.  Some pre-0.99pl12 
  292.             driver versions may have trouble recognizing the DE2** 
  293.             series as 16 bit cards, and these cards are the most 
  294.             widely reported as having the spurious transfer address
  295.             mismatch errors.
  296.  
  297. 1.5 Cabletron
  298.  
  299.     Yes, another one of these companies that won't release its
  300.     programming information. They waited for months before actually
  301.     confirming that all their information was proprietary. If you feel
  302.     like asking them why they don't want to release their info so that
  303.     people can use their cards, write to pkelly@ctron.com. You should
  304.     read section 8.1 of this document, as it has specific information
  305.     pertaining to Cabletron.
  306.  
  307.     Supported:
  308.  
  309.         E10**, E10**-x, E20**, E20**-x --
  310.             These are NEx000 almost-clones that are reported to work
  311.             with the standard NEx000 drivers, thanks to a 
  312.             ctron-specific check during the probe. If there are 
  313.             any problems, they are unlikely to be fixed, as the 
  314.             programming information is unavailable.
  315.  
  316.     Unsupported:
  317.  
  318.         E21** --
  319.             Again, there is not much one can do when the
  320.             programming information is proprietary. Feel free
  321.             to ask pkelly@ctron.com.  This is the only 8390-base
  322.             ethercard series that isn't supported by Linux.
  323.  
  324. 1.6    Allied Telesis:
  325.  
  326.     Allied Telesis is the worlds largest maker of separate
  327.     transceivers thanks to their low prices, and they now have a
  328.     series of low-cost ethercards using the 79C960 version of the AMD
  329.     LANCE.  These are bus-master cards, and thus probably the fastest
  330.     ISA bus ethercards available (although the 3c509 has lower latency
  331.     thanks to predictive interrupts).  The driver for the AT1500
  332.     series is new in the 0.99pl12 kernel, but it won't work
  333.     "out-of-the-box" with >16M machines.  (NB This isn't a fundamental
  334.     limitation, so stop pointing and laughing at the ISA bus.  The
  335.     driver just needs a hook to allocate low-memory buffers for the
  336.     bus-master DMA, and should be just as fast on >16M systems.)
  337.  
  338.     The current (pl12) driver defaults to DMA5.  Future driver
  339.     versions may figure out a way to autoDMA.
  340.  
  341.     There is a special $20 one-unit-only evaluation offer on the AT1500T
  342.     (the TP-only model) until mid-September 1993.  The normal list
  343.     price is $80-$100.
  344.     
  345.  
  346. 1.6 Other (less common card supplier) Companies
  347.  
  348.     Arcnet:
  349.         There is no Arcnet driver for Linux. Feel free to write a 
  350.         driver.  There might be people with home systems
  351.         that will be able to use it with discarded hardware. 
  352.         With the very low cost and better performance of ethernet,
  353.         I expect that most places will be giving away their Arcnet
  354.         hardware for free.
  355.  
  356.         An advantage of Arcnet is that all of the cards have identical
  357.         interfaces, so once a driver is available it will work for everyone.
  358.  
  359.     Digital / DEC
  360.         There is an alpha version of a driver for the early model DEC
  361.         DEPCA.  DEC is refusing to release information on the later
  362.         models.  (The rumor is that they don't have enough money to
  363.         write and print one!)
  364.  
  365.     Intel:
  366.         Not too many of these cards around at present. The Intel Ether-
  367.         Express is unsupported at present.
  368.  
  369.     PureData:
  370.         The PureData PDUC8028 and PDI8023 series of cards are reported
  371.         to work, thanks to special probe code contributed by Mike
  372.         Jagdis <jaggy@purplet.demon.co.uk>.  The support is integrated
  373.         with the WD driver.
  374.  
  375.     Xircom:
  376.         Another group that won't release documentation. No cards 
  377.         supported.  Don't look for any support in the future unless 
  378.         they release their programming information. And this is
  379.         highly unlikely, as they *forbid* you from even reverse-
  380.         engineering their drivers. Here is some of the results from
  381.         people who have tried to deal with Xircom.
  382.  
  383.         "I had no end of problems trying to work with Xircom.  
  384.         After spending months talking to them and working up a
  385.         prospectus, I was told that no information would be forthcoming
  386.         and that they were not interested in markets other than the
  387.         ISA/DOS market. (I was trying to interface the pocket adapters
  388.         to an Amiga). I won't work with them anymore and I won't
  389.         recommend their products to anyone." 
  390.  
  391.         "They (Xircom) won't give it (programming info.) out. BSDI
  392.         was was able to get the spec and write a driver for it, but
  393.         only by promising not to give out the source."
  394.  
  395.     Zenith:
  396.         The Zenith Z-note is unsupported at present.
  397.  
  398. 2. Clones of popular Ethernet cards.
  399.  
  400.     Due to the popular design of some cards,  different companies will
  401.     make "clones" or replicas of the original card. However, one must
  402.     be careful, as some of these clones are not 100% compatible, and
  403.     can be troublesome. Some common problems with "not-quite-clones"
  404.     are noted in the question and answer section of this document.
  405.  
  406. 2.1 WD80x3 Clones that are reported to work.
  407.  
  408.     AT-LAN-TEC 8013
  409.     PureData (not a 8013 clone, but the 8013 driver has special code)
  410.     LANNET LEC-45
  411.     PE-8013 (WD-8013 Compatible)
  412.  
  413. 2.2 NE2000 Clones that are reported to work.
  414.  
  415.     Alta Combo NE2000 clone
  416.     Aritsoft LANtastic AE-2 (OK, but has flawed error-reporting registers)
  417.     Asante Etherpak 2001/2003
  418.     AT-LAN-TEC NE2000 clone (uses Winbond chip that traps SCSI drivers)
  419.     Cabletron products: E10**,  E10**-x,  E20**, E20**-x
  420.     Cnet UTP 10baseT (NE 2000 emulation)
  421.     D-Link Ethernet II (bad clones, but the driver checks for them)
  422.     4-Dimension FD0490 EtherBoard16
  423.     LTC E-NET/16 P/N: 8300-200-002 (lipka@lip.hanse.de)
  424.     Network Solutions HE-203
  425.     SIIG Inc E-Lan/200 (NE 2000 comp.)
  426.     SVEC 4 Dimension Ethernet
  427.  
  428. 3 The Card to buy is....
  429.  
  430.     For impatient users that just want a quick, cheap answer the 
  431.     summary is: get 16 bit thinnet 8013 cards. For more detail as
  432.     to the who what where and why, read on.
  433.  
  434. 3.1 Eight bit vs 16 bit.
  435.  
  436.     Unless you are a light user, or are confined to using the smaller
  437.     ISA slot, the use of the 8 bit cards like the wd8003 and the 3c503
  438.     is really not worth the cost savings. Get the 8013 or the 3c503/16
  439.     instead.
  440.  
  441. 3.2 Prices are a bit steep for the XXXX card.
  442.  
  443.     I keep track of the current low-price vendors, just because it's
  444.     asked so often.  Call AT-LAN-TEC at 301-948-7070.  Ask for their
  445.     technical support person, "Vincent Bono".  As with all purchases,
  446.     you should indicate you are buying this for a Linux system.
  447.     The last I checked the price for 10 NE2000s was $690, or $69 ea.!
  448.     NB Their current NE2000 clone is a model that "traps" other
  449.     drivers that probe into their address space.
  450.  
  451.     AT-LAN-TEC also carries a clone, non-EEPROM 8013 board for $89,
  452.     and a NE2100 clone.  Either is a better choice if the very lowest
  453.     price isn't essential. 
  454.  
  455.     I've also ordered Alta "Combo" NE2000 cards from Network Express
  456.     (aka Main Street Computers) in Fl.  A bit more expensive, but
  457.     they have bigger ads in Computer Shopper. If you are looking for
  458.     prices on your own, try the back of LAN magazine.
  459.  
  460.     Currently (late Aug. '93) there is a market-share war going on in
  461.     the ethercard business.  Both Allied-Telesis and Accton have
  462.     special evaluation deals going on if you call them directly and
  463.     reference the right advertisement.  (AT1500T $20, max. one, and
  464.     Accton NE2000 clone $30+$5s&h, max. 2.)
  465.  
  466. 3.3 Type of cable that your card should support.
  467.  
  468.     Unless you have to conform to an existing network, you will want
  469.     to use thinnet or thin ethernet cable. This is the style with the
  470.     standard BNC connectors. See the next section on concerns with
  471.     different types of ethernet cable.
  472.  
  473.     Most ethercards also come in a "Combo" version for only $10-$20 more.
  474.     These have both twisted pair and thinnet transceiver built-in,
  475.     allowing you to change your mind later.
  476.  
  477. 4. Cables, Coax, Twisted pairs etc.
  478.    
  479.     If you are starting a network from scratch, it's considerably less
  480.     expensive to use thin ethernet, RG58 co-ax cable with BNC connectors,
  481.     than old-fashioned thick ethernet, RG-5 cable with N connectors, or
  482.     10baseT, twisted pair telco-style cables with RJ-45 "phone"
  483.     connectors.
  484.  
  485. 4.1 Thin Ethernet (thinnet).
  486.  
  487.     Thin ethernet is the "ether of choice".  The cable is inexpensive.  If
  488.     you are making your own cables solid-core RG58A is $0.09/ft. and
  489.     stranded RG58AU is $0.15/ft.  Twist-on BNC connectors are < $2 ea.,
  490.     and other misc. pieces are similarly inexpensive.  It is essential
  491.     that you properly terminate each end of the cable with 50 ohm
  492.     terminators, so budget $2 ea. for a pair.  It's also vital that
  493.     your cable have no "stubs" -- the 'T' connectors must be attached
  494.     directly to the ethercards.
  495.  
  496. 4.2 Twisted Pair.
  497.  
  498.     Twisted pair networks require active hubs, which start around $300,
  499.     and the raw cable cost can actually be higher than thinnet.  They are
  500.     usually sold using the claim that you can use your existing telephone
  501.     wiring, but it's a rare installation where that turns out to be the
  502.     case.  The claim that you can upgrade to higher speeds is also
  503.     suspect, as most proposed schemes use higher-grade (read $$) cable and
  504.     more sophisticated termination ($$$) than you would likely install on
  505.     speculation.
  506.  
  507. 4.3 Thick Ethernet.
  508.  
  509.     Thick ethernet is mostly obsolete, and is usually used only to remain
  510.     compatible with an existing implementation.  You can stretch the rules
  511.     and connect short spans of thick and thin ethernet together with a
  512.     passive $3 N-to-BNC connector, and that's often the best solution to
  513.     expanding an existing thicknet.  A correct (but expensive) solution is
  514.     to use a repeater in this case.
  515.  
  516. 5 Technical Information.
  517.  
  518.     For those who want to play with the present drivers, or try to make
  519.     up their own driver for a card that is presently unsupported, this
  520.     information should be useful. If you do not fall into this category,
  521.     then perhaps you will want to skip this section.
  522.  
  523. 5.1 Probed Addresses.
  524.  
  525.     While trying to determine what ethernet card is there, the following
  526.     addresses are autoprobed, assuming the type and specs of the card
  527.     have not been set in the kernel. In /usr/src/linux/net/inet/CONFIG,
  528.     one can set the cards that are compiled in to the kernel. As of 
  529.     0.99pl12, doing a "make config" will ask what cards are to be 
  530.     supported. The file names below are in /usr/src/linux/net/inet/
  531.     ----------------------------------------------------------------
  532.     wd.c:   0x300, 0x280, 0x380, 0x240
  533.     3c503:  0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2a0, 0x2e0
  534.     ne.c:   0x300, 0x280, 0x320, 0x340, 0x360
  535.     hp.c:   0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240
  536.     lance.c:0x300, 0x320, 0x340, 0x360
  537.     ----------------------------------------------------------------
  538.     There are some NE2000 clone ethercards out there that are waiting black
  539.     holes for autoprobe drivers.  While many NE2000 clones are
  540.     safe until they are enabled, some can't be reset to a safe mode.
  541.     These dangerous ethercards will hang any I/O access to their
  542.     "dataports".  The typical dangerous locations are:
  543.  
  544.     Ethercard jumpered base     Dangerous locations (base + 0x10 - 0x1f)
  545.         0x300 *                0x310-0x317
  546.         0x320                0x330-0x337
  547.         0x340                0x350-0x357
  548.         0x360                0x370-0x377
  549.  
  550.     * The 0x300 location is the traditional place to put an ethercard, but
  551.     it's also a popular place to put other devices (often SCSI
  552.     controllers).  The 0x320 location is often the next one chosen, but
  553.     that's bad for for the AHA1542 driver probe.  The 0x360 location is
  554.     bad, because it conflicts with the parallel port at 0x378.
  555.  
  556.     To avoid these lurking ethercard, here are the things you can do:
  557.  
  558.         o Probe for the device's BIOS in memory space.  This is easy
  559.       and always safe, but it only works for cards that always have
  560.       BIOSes, like primary SCSI controllers.
  561.  
  562.     o Avoid probing any of the above locations until you think
  563.       you've located your device.  The NE2000 clones have a reset range
  564.       from <base>+0x18 - <base>+0x1f that will read as 0xff, so probe
  565.       there first if possible.  It's also safe to probe in the 8390
  566.       space at <base>+0x00 - <base>+0x0f, but that area will return
  567.       quasi-random values
  568.  
  569.     o If you must probe in the dangerous range, for instance if your
  570.       target device has only a few port locations, first check that
  571.       there isn't an NE2000 there. You can see how to do this by 
  572.       looking at the probe code in /usr/src/linux/net/inet/ne.c
  573.  
  574. 5.2 Skeleton / Prototype Driver.
  575.  
  576.     OK. So you have decided that you want to write a driver for the
  577.     Foobar Ethernet card, as you have the programming information,
  578.     and it hasn't been done yet. (...these are the two main require-
  579.     ments ;-) You can use the skeleton network driver that is provided
  580.     with the Linux kernel source tree. It can be found in the file
  581.     /usr/src/linux/net/inet/README.DRIVERS as of 0.99pl12, and later.
  582.  
  583.     It's also very useful to look at the Crynwr (nee Clarkson) driver
  584.     for your target ethercard, if it's available.  Russ Nelson
  585.     <nelson@crynwr.com> wrote most of these, and he has been very
  586.     helpful with his code reviews of the current Linux drivers.
  587.  
  588. 5.3 Driver Interface to the Kernel
  589.  
  590.     Here are some notes that may help when trying to figure out what
  591.     the code in the driver segments is doing, or perhaps what it is
  592.     supposed to be doing.
  593.  
  594.     -----------------------------------------------------
  595.  
  596.     int ethif_init(struct device *dev)
  597.     {
  598.         ...
  599.         dev->send_packet = &ei_send_packet;
  600.         dev->open = &ei_open;
  601.         dev->stop = &ei_close;
  602.         dev->hard_start_xmit = &ei_start_xmit;
  603.         ...
  604.     }
  605.  
  606.     int ethif_init(struct device *dev)
  607.  
  608.     This function is put into the device structure in Space.c.  It is
  609.     called only at boot time, and returns '0' iff the ethercard 'dev'
  610.     exists.
  611.  
  612.     -----------------------------------------------------
  613.  
  614.     static int ei_open(struct device *dev)
  615.     static int ei_close(struct device *dev)
  616.  
  617.     This routine opens and initializes the board in response to an
  618.     socket ioctl() usually called by 'config' or 'ifconfig'.  It is
  619.     commonly stuffed into the 'struct device' by ethif_init().
  620.  
  621.     The inverse routine is ei_close(), which should shut down the
  622.     ethercard, free the IRQs and DMA channels if the hardware permits,
  623.     and turn off anything that will save power (like the transceiver).
  624.  
  625.     (Note: As of NET-2, the relevant program is '/etc/ifconfig' - and
  626.     the device *can* be turned off or on via passing 'up' or 'down'
  627.     to 'ifconfig' from the command line with the device name.)
  628.  
  629.     -----------------------------------------------------
  630.  
  631.     static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
  632.         dev->hard_start_xmit = &ei_start_xmit;
  633.  
  634.     This routine puts packets to be transmitted into the hardware.  It
  635.     is usually stuffed into the 'struct device' by ethif_init().
  636.  
  637.     When the hardware can't accept additional packets it should set
  638.     the dev->tbusy flag.  When additional room is available, usually
  639.     during a transmit-complete interrupt, dev->tbusy should be cleared
  640.     and the higher levels informed with mark_bh(INET_BH).
  641.     [[Note: pre0.99.4 kernels didn't use this interface for all packets.]]
  642.     
  643.     -----------------------------------------------------
  644.  
  645.     ...
  646.         if (dev_rint(buffer, length, is_skb ? IN_SKBUFF : 0, dev))
  647.            stats->rx_dropped++;
  648.     ...
  649.     A received packet is passed to the higher levels using dev_rint().
  650.     If the unadorned packet data in a memory buffer, dev_rint will copy
  651.     it into a 'skbuff' for you.  Otherwise a new skbuff should be
  652.     kmalloc()ed, filled, and passed to dev_rint() with the IN_SKBUFF flag.
  653.  
  654.     -----------------------------------------------------
  655.  
  656. 5.4 Interrupts and Linux
  657.     There are two kinds of interrupt handlers in Linux:
  658.     fast ones and slow ones. You decide what kind you are installing by
  659.     the flags you pass to irqaction().  The fast ones, such as the serial
  660.     interrupt handler, run with _all_ interrupts disabled.  The normal
  661.     interrupt handlers, such as the one for ethercard drivers, runs with
  662.     other interrupts enabled.
  663.  
  664.     There is a two-level interrupt structure.  The "fast" part handles the
  665.     device register, removes the packets, and perhaps sets a flag.   After
  666.     it is done, and interrupts are re-enabled, the slow part is run if the
  667.     flag is set.
  668.  
  669.     The flag between the two parts is set by:
  670.         mark_bh(INET_BH);
  671.  
  672.     Usually this flag is set within dev_rint() during a received-packet
  673.     interrupt, and set directly by the device driver during a
  674.     transmit-complete interrupt.
  675.  
  676.     You might wonder why all interrupt handlers cannot run in
  677.     "normal mode" with other interrupts enabled.  Ross Biro uses this
  678.     scenario to illustrate the problem:
  679.         o You get a serial interrupt, and start processing it.
  680.               The serial interrupt is now masked.
  681.         o You get a network interrupt, and you start transferring
  682.               a maximum-sized 1500 byte packet from the card.
  683.         o Another character comes in, but this time the interrupts
  684.           are masked!
  685.  
  686.     The "fast" interrupt structure solves this problem by allowing
  687.     bounded-time interrupt handlers to run without the risk of leaving
  688.     their interrupt lines masked by another interrupt request.
  689.  
  690.     There is an additional distinction between fast and slow interrupt
  691.     handlers -- the arguments passed to the handler.  A "slow" handler is
  692.     defined as
  693.  
  694.         static void
  695.         handle_interrupt(int reg_ptr)
  696.         {
  697.             int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2);
  698.             struct device *dev = irq2dev_map[irq];
  699.         ...
  700.  
  701.     While a fast handler gets the interrupt number directly
  702.  
  703.         static void
  704.         handle_fast_interrupt(int irq)
  705.         {
  706.         ...
  707.  
  708.     --------------------------------------------------------------
  709.  
  710. 5.4 Unresolved Questions / Concerns
  711.  
  712.     There may be some benefit from processing packet data as it is
  713.     transferred to and from the ethercard, especially with very fast
  714.     processors transferring data to a slow ethercard.  As I see it this
  715.     question has multiple parts:
  716.         1) Is there any useful processing power available, perhaps
  717.            during the ISA bus recovery period, or while the 8390
  718.            remote DMA is preparing for another transfer??
  719.         2) Is there any useful but simple work that can be done
  720.            between/during each word of the copy, such as calculating
  721.            a CRC, or discarding obviously unwanted packets??
  722.         3) would the complexity of an interface to do this make future
  723.            ethercard drivers impossible??
  724.  
  725.     There should be a better structure than Space.c  Drivers should be
  726.     able to autoprobe for all installed ethercards rather than just
  727.     quitting after finding the first.  I've written code to do this,
  728.     but the constant promise (threat?) of DDI has prevented me from
  729.     making it standard.
  730.  
  731.     A related topic is the problem of driver probes corrupting
  732.     unrelated hardware. Even worse is a probe into a dataport that
  733.     isn't set up to transfer data, which will freeze the machine.  The
  734.     common suggestion is a boot-time device registry that records
  735.     already-used I/O ports and shared memory.
  736.  
  737. 6 Possible Problems, Questions and Troubleshooting.
  738.  
  739.     This section tries to answer any unresolved questions, and not so
  740.     common solutions to common problems.
  741.  
  742. 6.01 Problem with NE2000 Clones -- "DMA address mismatch"
  743.  
  744.     Is the chip a real NatSemi 8390? (DP8390, DP83901, DP83902 or DP83905)?
  745.     If not, some clone chips don't correctly implement the transfer
  746.     verification register.  MS-DOS drivers never do error checking, 
  747.     so it doesn't matter to them.
  748.  
  749.     Are most of the messages off by a factor of 2?
  750.     If so:    Are you using the NE2000 in a 16 bit slot?
  751.         Is it jumpered to use only 8 bit transfers?
  752.     The Linux driver expects a NE2000 to be a 16 bit slot.  A NE1000 can
  753.     be in either size slot.  This problem can also occur with some clones,
  754.     notably D-Link 16 bit cards, that don't have the correct ID bytes
  755.     in the station address PROM. [[ This should be fixed in pl12.]]
  756.  
  757.     Are you running the bus faster than 8Mhz?
  758.     If you can change the speed (faster or slower), see if that
  759.     makes a difference.  Most NE2000 clones will run at 16Mhz, but
  760.     some may not.  Changing speed can also mask a noisy bus.
  761.  
  762.     What other devices are on the bus?
  763.     If moving the devices around changes the reliability, then you
  764.     have a bus noise problem -- just what that error message was
  765.     designed to detect.  Congratulations, you've probably found the
  766.     source of other problems as well.
  767.  
  768. 6.02 Problem with NE2000 Clones -- Machine Hangs during Boot.
  769.  
  770.     Problem:  The machine hangs during boot right after the "8390..."  or
  771.           "WD...." message.  Removing the NE2000 fixes the problem.
  772.  
  773.     Solution: Change your NE2000 base address to 0x360 (or 0x340 for
  774.           pl12 or later kernels.)
  775.  
  776.     Reason:   Your NE2000 clone isn't a good enough clone.  An active 
  777.           NE2000 is a bottomless pit that will trap any driver
  778.           autoprobing in its space.  The other ethercard drivers take
  779.           great pain to reset the NE2000 so that it's safe, but some
  780.           clones cannot be reset.  Clone chips to watch out for: 
  781.           Winbond 83C901.  Changing the NE2000 to a less-popular
  782.           address will move it out of the way of other autoprobes, 
  783.           allowing your machine to boot.  
  784.  
  785.     Problem:  The machine hangs during the SCSI probe at boot.
  786.  
  787.     Solution: It's the same problem as above, change the 
  788.           ethercard's address.
  789.  
  790.     Problem:  The machine hangs during the soundcard probe at boot.
  791.  
  792.     Solution: No, that's really during the silent SCSI probe, and it's
  793.               the same problem as above.
  794.  
  795.  
  796. 6.03 Detected Non-existent Ethercard
  797.  
  798.     Problem:  A WD80*3 is falsely detected.  Removing the sound or 
  799.           MIDI card eliminates the "detected" message.
  800.  
  801.     Solution: Update your ethercard driver: new versions include an
  802.           additional sanity check.
  803.  
  804.     Reason:   Some MIDI ports happen to produce the same checksum as a 
  805.           WD ethercard.
  806.  
  807. 6.04 Error messages from the 80*3
  808.  
  809.     Problem:  You get messages such as the following with your 80*3:
  810.             eth0: bogus packet size, status = ........
  811.             kmalloc called with impossibly large argument (65400)
  812.             eth0: Couldn't allocate sk_buff of size 65400
  813.             eth0: receiver overrun
  814.  
  815.     Reason:   There is a shared memory problem.
  816.  
  817.     Solution: If the problem is sparodic, you have hardware problems.
  818.           Typical problems that are easy to fix are board conflicts, 
  819.           having cache or "shadow ROM" enabled for that region, or 
  820.           running your bus faster than 8Mhz.  There are also a 
  821.           surprising number of memory failures on ethernet cards, 
  822.           so run a diagnostic program if you have one for your 
  823.           ethercard.
  824.  
  825.           If the problem is continual, and you have have to reboot
  826.           to fix the problem, record the boot-time probe message 
  827.           and mail it to becker@super.org  Take particular note of
  828.           the shared memory location.
  829.  
  830. 6.05 Choosing the Interrupt of the 3c503 
  831.  
  832.     Problem:  The 3c503 picks IRQ n at boot, but this is needed for some
  833.           other device which needs IRQ n. (eg. CD ROM driver, etc.)
  834.           Can this be fixed without compiling this into the kernel?
  835.  
  836.     Solution: The 3c503 driver probes for a free IRQ line in the order
  837.           {5, 9, 3, 4}, and it should pick a line which isn't being 
  838.           used.  The pre-pl12 (SLS 1.02) driver picked the IRQ line 
  839.           at boot-time, and the current driver (pl12) chooses when
  840.           the card is open()/'ifconfig'ed.
  841.  
  842.           Alternately, you can fix the IRQ at boot by passing 
  843.           parameters via LILO.  The following selects IRQ9, base 
  844.           location 0x300, <ignored value>, and if_port #1 (the 
  845.           external transceiver).  
  846.             lilo: linux ether=9,0x300,0,1,eth0
  847.  
  848.           The following selects IRQ3, probes for the base location,
  849.           <ignored value>, and the default if_port #0 (the internal 
  850.           transceiver) 
  851.             lilo: linux ether=3,0,0,0,eth0
  852.  
  853. 6.06 Choosing the Output of the 3c503 (thicknet vs. thinnet)
  854.  
  855.     Problem:  The supplied 3c503 drivers don't use the AUI (thicknet) port.
  856.           How does one choose it over the default thinnet port?
  857.  
  858.     Solution: The 3c503 AUI port can be selected at boot-time with 0.99pl12
  859.           and later.  The selection is overloaded onto the low bit of 
  860.           the currently-unused dev->rmem_start variable, so a boot-time
  861.           parameter of:
  862.             lilo: linux ether=0,0,0,1,eth0
  863.           should work.  A boot line to force IRQ 5, port base 0x300, 
  864.           and use an external transceiver is:
  865.             lilo: linux ether=5,0x300,0,1,eth0
  866.  
  867. 6.07 Using More than one Ethernet Card. (eg. a gateway machine.)
  868.  
  869.     Problem:  What needs to be done so that Linux can run two 
  870.           ethernet cards?
  871.  
  872.     Solution: Add another entry to Space.c, naming it "eth1" instead 
  873.           of "eth0".  If you want routing to work well you should
  874.           use a recent kernel, say 0.99pl11 or later.  You may also
  875.           want to verify that your driver writer kept all of the
  876.           per-card variables in 'dev->priv'.  Most do, but the pl12
  877.           AT1500/LANCE driver has a single static low-memory buffer.
  878.  
  879. 7 Networking with a Laptop Computer
  880.     There are currently only a few ways to put your laptop on a network.
  881.     You can use the NET-2 SLIP code (and run at serial line speeds);
  882.     you can buy one of the few laptops that come with a NE2000-compatible
  883.     ethercard or PCMCIA slot built-in; you can get a laptop with a 
  884.     docking station and plug in an ISA ethercard; or you can use a 
  885.     parallel port Ethernet adapter such as the D-Link DE-600.
  886.  
  887. 7.1 Option 1 -- using SLIP
  888.  
  889.     This is the cheapest solution, but by far the most difficult. Also,
  890.     you will not get very high transmission rates. Since SLIP is not
  891.     really related to ethernet cards, it will not be discussed further
  892.     here. See the NET-2 HOWTO.
  893.  
  894. 7.2 Option 2 -- NE2000 Compatible Card built in or PCMCIA slot and ethercard.
  895.  
  896.     The second solution severely limits your laptop choices and is fairly
  897.     expensive.  Be sure to read the specifications carefully, you may find
  898.     that you will have to buy an additional non-standard transceiver to
  899.     actually put the machine on a network.
  900.  
  901. 7.3 Option 3 -- ISA Ethercard in the Docking Station.
  902.  
  903.     I recommend the third solution.  Docking stations for laptops typically
  904.     cost about $250 and provide two full-size ISA slots, two serial and one
  905.     parallel port.  Most (all?) docking stations are powered off of the
  906.     laptop's batteries, and a few allow adding extra batteries in the
  907.     docking station if you use short ISA cards.  You can add an inexpensive
  908.     ethercard and enjoy full-speed ethernet performance.
  909.  
  910. 7.4 Option 4 -- Pocket / Parallel port Adaptors.
  911.  
  912.     The "pocket" ethernet adaptors may also fit your need.
  913.     Until recently they actually costed more than a docking station and
  914.     cheap ethercard, and most tie you down with a wall-brick power supply.
  915.     The only pocket adaptor driver right now is for the D-Link.
  916.     I'm also working on a driver for the AT-LAN-TEC/RealTek pocket adaptor.
  917.     Most other companies, especially Xircom, treat the programming
  918.     information as a trade secret, so support will likely be slow in
  919.     coming.
  920.  
  921.     You can sometimes avoid the wall-brick with the adaptors by buying
  922.     or making a cable that draws power from the laptop's keyboard
  923.     port.
  924.     
  925.  
  926. 8 Miscellaneous.
  927.  
  928.     Any other associated stuff that didn't fit in anywhere else gets
  929.     dumped here. It may not be relevant, and it may not be of general
  930.     interest but it is here anyway.
  931.  
  932. 8.1 The Cabletron Story. (...as related by Donald J. Becker)
  933.  
  934.     This is a rather funny story, albeit true. -- Enjoy! P.G.
  935.  
  936.         I contacted Cabletron in early December 1992 for 
  937.     programming information 11, 1992 (I had called and sent 
  938.     several earlier messages).  I was referred through several 
  939.     different people, and each one took several days to 
  940.     respond before they forwarded me to the next.  Eventually 
  941.     I was told I should deal with their (outside?) developer 
  942.     Mr. Dev.Null.  I persisted, and around March it seemed 
  943.     that I had finally succeed: Cabletron offered to send me 
  944.     an evaluation board (unrequested) and everything I needed 
  945.     to use it (what I wanted).  The hardware showed up right 
  946.     away, and I waited, expecting the the programming 
  947.     information information as well.  About a month later I 
  948.     contacted them, and they told me that "all I needed to use 
  949.     it" was the standard MS-DOS NDIS drivers, a binary on 
  950.     standard driver disk.  The disk envelope was covered in 
  951.     legalese, including no-disassembly, no-reverse-engineering 
  952.     clauses.  It was May (and a few email exchanges later) 
  953.     before I figured out that I had been "slow rolled", and 
  954.     had wasted about 20 hours on this particular windmill.  
  955.  
  956.     The story isn't over yet.  People have written to me say 
  957.     they have vetoed several medium-sized purchases from 
  958.     Cabletron based on the lack of Linux drivers.  Cabletron 
  959.     must have noticed this because yesterday I got a call 
  960.     _from_ Cabletron (the first!) stating that they will be 
  961.     independently writing a Linux driver.  Of course, their 
  962.     lawyers probably haven't read the GPL yet...  
  963.     
  964.  
  965.  
  966.         ----------- end of Ethernet HOWTO ------------
  967.  
  968.  
  969.