home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / misc / linuxhow.zip / ETHERNET.HOW < prev    next >
Internet Message Format  |  1993-09-14  |  50KB

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