home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / how_to.zip / ETHER2.HOW < prev    next >
Text File  |  1994-04-29  |  38KB  |  846 lines

  1. Archive-Name: linux/howto/ethernet/part2
  2. Last-modified: 15 Apr 94
  3.  
  4.  
  5. ---This is part 2/2---
  6.  
  7. 5.06 Programming the Intel chips (i82586 and i82593)
  8.  
  9.  These chips are used on a number of cards, namely the 3c507 ('86),
  10.  the Intel EtherExpress 16 ('86), Microdyne's exos205t ('86),
  11.  the Z-Note ('93), and the Racal-Interlan ni5210 ('86).
  12.  
  13.  Russ Nelson writes:
  14.  "Most boards based on the 82586 can reuse quite a bit of their code.
  15.  More, in fact, than the 8390-based adapters. There are only three
  16.  differences between them:
  17.  
  18.    o The code to get the Ethernet address,
  19.    o The code to trigger CA on the 82586, and
  20.    o The code to reset the 82586.
  21.  
  22.  The Intel EtherExpress 16 is an exception, as it I/O maps the 82586.
  23.  Yes, I/O maps it. Fairly clunky, but it works.
  24.  
  25.  Garrett Wollman did an AT&T driver for BSD that uses the BSD
  26.  copyright. The latest version I have (Sep '92) only uses a single
  27.  transmit buffer. You can and should do better than this if you've
  28.  got the memory. The AT&T and 3c507 adapters do; the ni5210 doesn't.
  29.  
  30.  The people at Intel gave me a very big clue on how you queue up
  31.  multiple transmit packets. You set up a list of
  32.  NOP->XMIT->NOP->XMIT->NOP->XMIT->(beginning) blocks, then you set the
  33.  "next" pointer of all the NOP blocks to themselves. Now you start
  34.  the command unit on this chain. It continually processes the first
  35.  NOP block. To transmit a packet, you stuff it into the next transmit
  36.  block, then point the NOP to it. To transmit the next packet, you
  37.  stuff the next transmit block and point the previous NOP to *it*. In
  38.  this way, you don't have to wait for the previous transmit to finish,
  39.  you can queue up multiple packets without any ambiguity as to whether
  40.  it got accepted, and you can avoid the command unit start-up delay."
  41.  
  42. 5.07 Technical information from 3Com
  43.  
  44.  From: Cameron Spitzer 764-6339 <camerons@nad.3com.com>
  45.  Subject: getting 3Com Adapter manuals
  46.  Date: Mon, 27 Sep 1993 21:17:07 +0200
  47.  
  48.  Since this is becoming a FAQ, I'm going to tread the thin
  49.  ice of No Commercial Use and answer it here.
  50.  
  51.  3Com's Ethernet Adapters are documented for driver writers
  52.  in our "Technical References" (TRs). These manuals describe
  53.  the programmer interfaces to the boards but they don't talk
  54.  about the diagnostics, installation programs, etc that end
  55.  users can see.
  56.  
  57.  The Network Adapter Division marketing department has the
  58.  TRs to give away. To keep this program efficient, we
  59.  centralized it in a thing called "CardFacts." CardFacts is
  60.  an automated phone system. You call it with a touch-tone
  61.  phone and it faxes you stuff. To get a TR, call CardFacts
  62.  at 408-727-7021. Ask it for Developer's Order Form,
  63.  document number 9070. Have your fax number ready when you
  64.  call. Fill out the order form and fax it to 408-764-5004.
  65.  Manuals are shipped by Federal Express 2nd Day Service.
  66.  
  67.  If you don't have a fax and nobody you know has a fax,
  68.  really and truly, *then* send mail to
  69.  Terry_Murphy@3Mail.3Com.com and tell her about your problem.
  70.  PLEASE use the fax thing if you possibly can.
  71.  
  72.  After you get a manual, if you still can't figure out how to
  73.  program the board, try our "CardBoard" BBS at
  74.  1-800-876-3266, and if you can't do that, write
  75.  Andy_Chan@3Mail.3com.com and ask him for alternatives. If
  76.  you have a real stumper that nobody has figured out yet, the
  77.  fellow who needs to know about it is
  78.  Steve_Lebus@3Mail.3com.com.
  79.  
  80.  There are people here who think we are too free with the
  81.  manuals, and they are looking for evidence that the system
  82.  is too expensive, or takes too much time and effort. That's
  83.  why it's important to try to use CardFacts *before* you
  84.  start calling and mailing the people I named here.
  85.  
  86.  There are even people who think we should be like Diamond
  87.  and Xircom, requiring tight "partnership" with driver
  88.  writers to prevent poorly performing drivers from getting
  89.  written. So far, 3Com customers have been really good about
  90.  this, and there's no problem with the level of requests
  91.  we've been getting. We need your continued cooperation and
  92.  restraint to keep it that way.
  93.  
  94.  Cameron Spitzer, 408-764-6339
  95.  3Com NAD
  96.  Santa Clara
  97.  work: camerons@nad.3com.com
  98.  home: cls@truffula.sj.ca.us
  99.  
  100. 5.08 Notes on AMD PCnet-ISA / LANCE Based cards (79C960)
  101.  
  102.  The AMD LANCE (Local Area Network Controller for Ethernet)
  103.  was the original offering, and has since been replaced by
  104.  the "PCnet-ISA" chip, otherwise known as the 79C960.
  105.  A relatively new chip from AMD, the 79C960, is the heart of many
  106.  new cards being released at present. Note that the name "LANCE"
  107.  has stuck, and some people will refer to the new chip by the old
  108.  name. Dave Roberts of the Network Products Division of AMD was kind
  109.  enough to contribute the following information regarding this chip:
  110.  
  111.  "As for the architecture itself, AMD developed it originally
  112.  and reduced it to a single chip -- the PCnet(tm)-ISA -- over a year
  113.  ago. It's been selling like hotcakes ever since.
  114.  
  115.  Functionally, it is equivalent to a NE1500. The register set
  116.  is identical to the old LANCE with the 1500/2100 architecture
  117.  additions. Older 1500/2100 drivers will work on the PCnet-ISA.
  118.  The NE1500 and NE2100 architecture is basically the same.
  119.  Initially Novell called it the 2100, but then tried to distinguish
  120.  between coax and 10BASE-T cards. Anything that was 10BASE-T only was
  121.  to be numbered in the 1500 range. That's the only difference.
  122.  
  123.  Many companies offer PCnet-ISA based products, including HP,
  124.  Racal-Datacom, Allied Telesis, Boca Research, Kingston Technology, etc.
  125.  The cards are basically the same except that some manufacturers
  126.  have added "jumperless" features that allow the card to
  127.  be configured in software. Most have not. AMD offers a standard
  128.  design package for a card that uses the PCnet-ISA and many
  129.  manufacturers use our design without change.
  130.  What this means is that anybody who wants to write drivers for
  131.  most PCnet-ISA based cards can just get the data-sheet from AMD. Call
  132.  our literature distribution center at (800)222-9323 and ask for the
  133.  Am79C960, PCnet-ISA data sheet. It's free.
  134.  
  135.  A quick way to understand whether the card is a "stock" card
  136.  is to just look at it. If it's stock, it should just have one large
  137.  chip on it, a crystal, a small IEEE address PROM, possibly a socket
  138.  for a boot ROM, and a connector (1, 2, or 3, depending on the media
  139.  options offered). Note that if it's a coax card, it will have some
  140.  transceiver stuff built onto it as well, but that should be near the
  141.  connector and away from the PCnet-ISA.
  142.  
  143.  The PCnet-ISA is faster than the original LANCE design and
  144.  makes better use of the available bus bandwidth. Additionally, some
  145.  LANCE bugs were corrected and many enhancements were made."
  146.  
  147.  There is also some info regarding the LANCE chip in the file
  148.  lance.c which is included in the standard kernel.
  149.  
  150. 5.09 Multicast and Promiscuous mode
  151.  
  152.  One of the things I've been working on recently is the
  153.  major remaining item on the ethercard feature list:
  154.  implementing multicast and promiscuous mode hooks.
  155.  
  156.  At first I was planning to do it while implementing either
  157.  the /dev/* or DDI interface, but that's not really the
  158.  correct way to do it. We should only enable multicast or
  159.  promiscuous modes when something wants to look at the
  160.  packets, and shut it down when that application is
  161.  finished, neither of which is strongly related to when the
  162.  hardware is opened or released.
  163.  
  164.  I'll start by discussing promiscuous mode, which is
  165.  conceptually easy to implement. For most hardware you
  166.  only have to set a register bit, and from then on you get
  167.  every packet on the wire. Well, it's almost that easy;
  168.  for some hardware you have to shut the board (potentially
  169.  dropping a few packet), reconfigure it, and then re-enable
  170.  the ethercard. This is grungy and risky, but the
  171.  alternative seems to be to have every application register
  172.  before you open the ethercard at boot-time.
  173.  
  174.  OK, so that's easy, so I'll move on something that's not
  175.  quite so obvious: Multicast. It can be done two ways:
  176.  
  177.  1) Use promiscuous mode, and a packet filter like the
  178.     Berkeley packet filter (BPF). The BPF is a pattern matching
  179.     stack language, where you write a program that picks out the
  180.     addresses you are interested in. Its advantage is that it's
  181.     very general and programmable. Its disadvantage is that there
  182.     is no general way for the kernel to avoid turning on promiscuous
  183.     mode and running every packet on the wire through every registered
  184.     packet filter. See the next section for more information on BPF.
  185.  
  186.  2) Using the built-in multicast filter that most etherchips have.
  187.  
  188.  I guess I should list what a few ethercards/chips provide:
  189.  
  190.  Chip/card  Promiscuous Multicast filter
  191.  ========================================
  192.  Seeq8001/3c501 Yes Binary filter (1)
  193.  3Com/3c509 Yes Binary filter (1)
  194.  8390  Yes Autodin II six bit hash (2) (3)
  195.  LANCE  Yes Autodin II six bit hash (2) (3)
  196.  i82586  Yes Hidden Autodin II six bit hash (2) (4)
  197.  
  198.  
  199.  (1) These cards claim to have a filter, but it's a simple
  200.  yes/no 'accept all multicast packets', or 'accept no
  201.  multicast packets'.
  202.  
  203.  (2) AUTODIN II is the standard ethernet CRC (checksum)
  204.  polynomial. In this scheme multicast addresses are hashed
  205.  and looked up in a hash table. If the corresponding bit
  206.  is enabled, this packet is accepted. Ethernet packets are
  207.  laid out so that the hardware to do this is trivial -- you
  208.  just latch six (usually) bits from the CRC circuit (needed
  209.  anyway for error checking) after the first six octets (the
  210.  destination address), and use them as an index into the
  211.  hash table (six bits == a 64-bit table).
  212.  
  213.  (3) These chips use the six bit hash, and must have the
  214.  table computed and loaded by the host. This means the
  215.  kernel must include the CRC code.
  216.  
  217.  (4) The 82586 uses the six bit hash internally, but it
  218.  computes the hash table itself from a list of multicast
  219.  addresses to accept.
  220.  
  221.  Note that none of these chips do perfect filtering, and we
  222.  still need a middle-level module to do the final
  223.  filtering. Also note that in every case we must keep a
  224.  complete list of accepted multicast addresses to recompute
  225.  the hash table when it changes.
  226.  
  227.  My first pass at device-level support is detailed in the
  228.  new outline driver skeleton.c (pl14 and up.)
  229.  
  230.  It looks like the following:
  231.  
  232.  #ifdef HAVE_MULTICAST
  233.  static void set_multicast_list(struct device *dev, int num_addrs,
  234.       void *addrs);
  235.  #endif
  236.  .
  237.  .
  238.  
  239.  ethercard_open() {
  240.  ...
  241. #ifdef HAVE_MULTICAST
  242.   dev->set_multicast_list = &set_multicast_list;
  243.  #endif
  244.  ...
  245.  
  246.  #ifdef HAVE_MULTICAST
  247.  /* Set or clear the multicast filter for this adaptor.
  248.     num_addrs == -1 Promiscuous mode, receive all packets
  249.     num_addrs == 0 Normal mode, clear multicast list
  250.     num_addrs > 0 Multicast mode, receive normal and
  251.     MC packets, and do best-effort filtering.
  252.   */
  253.  static void
  254.  set_multicast_list(struct device *dev, int num_addrs, void *addrs)
  255.  {
  256.  ...
  257.  
  258.  Any comments, criticism, etc. are welcome.
  259.  
  260.  Alan Cox adds that "...in pl14, user programs can access promiscuous
  261.  mode but not multicast mode, even though the drivers support both.
  262.  The ifconfig program allows you to mark an interface 'promisc'."
  263.  
  264. 5.10 The Berkeley Packet Filter (BPF)
  265.  
  266.  I'm not bitterly opposed to it, but I'm coming to the
  267.  conclusion that the 'bpf' functionality should not be provided
  268.  by the kernel, but should be in a (hopefully little-used)
  269.  compatibility library.
  270.  
  271.  For those not in the know: 'bpf' (the Berkeley Packet Filter)
  272.  is an mechanism for specifying to the kernel networking layers
  273.  what packets you are interested in. It's implemented as a
  274.  specialized stack language interpreter built into a low level
  275.  of the networking code. An application passes a program
  276.  written in this language to the kernel, and the kernel runs the
  277.  program on each incoming packet. If the kernel has multiple
  278.  'bpf' applications, each program is run on each packet.
  279.  
  280.  The problem is that it's difficult to deduce what kind of
  281.  packets the application is really interested in from the packet
  282.  filter program, so the general solution is to always run the
  283.  filter. Imagine a program that registers a 'bpf' program to
  284.  pick up a low data-rate stream sent to a multicast address.
  285.  Most ethernet cards have a hardware multicast address filter
  286.  implemented as a 64 entry hash table that ignores most unwanted
  287.  multicast packets, so the capability exists to make this a very
  288.  inexpensive operation. But with the BFP the kernel must switch
  289.  the interface to promiscuous mode, receive _all_ packets, and
  290.  run them through this filter. This is work, BTW, that's very
  291.  difficult to account back to the process requesting the packets.
  292.  
  293. 5.11 Unresolved questions / concerns
  294.  
  295.  There may be some benefit from processing packet data as it is
  296.  transferred to and from the ethercard, especially with very fast
  297.  processors transferring data to a slow ethercard. As I see it this
  298.  question has multiple parts:
  299.   1) Is there any useful processing power available, perhaps
  300.      during the ISA bus recovery period, or while the 8390
  301.      remote DMA is preparing for another transfer??
  302.   2) Is there any useful but simple work that can be done
  303.      between/during each word of the copy, such as calculating
  304.      a CRC, or discarding obviously unwanted packets??
  305.   3) would the complexity of an interface to do this make future
  306.      ethercard drivers impossible??
  307.  
  308.  There should be a better structure than Space.c - Drivers should be
  309.  able to autoprobe for all installed ethercards rather than just
  310.  quitting after finding the first.  I've written code to do this,
  311.  but the constant promise (threat?) of DDI has prevented me from
  312.  making it standard.
  313.  
  314.  A related topic is the problem of driver probes corrupting
  315.  unrelated hardware. Even worse is a probe into a dataport that
  316.  isn't set up to transfer data, which will freeze the machine. The
  317.  common suggestion is a boot-time device registry that records
  318.  already-used I/O ports and shared memory. This has been implemented
  319.  as of pl13, see section 5.01.
  320.  
  321. 6 Possible problems, and troubleshooting.
  322.  
  323.  This section tries to answer any unresolved questions, and not so
  324.  common solutions to common problems. They are sorted on a "per
  325.  manufacturer basis". You should have also read the relevant info.
  326.  from section 1 about your specific card. Section 8 contains more
  327.  general FAQ's.
  328.  
  329. 6.01 Problems with NE2000 (and clones)
  330.  
  331.  "DMA address mismatch"
  332.  ======================
  333.  
  334.  Is the chip a real NatSemi 8390? (DP8390, DP83901, DP83902 or DP83905)?
  335.  If not, some clone chips don't correctly implement the transfer
  336.  verification register. MS-DOS drivers never do error checking,
  337.  so it doesn't matter to them.
  338.  
  339.  Are most of the messages off by a factor of 2?
  340.  If so: Are you using the NE2000 in a 16 bit slot?
  341.   Is it jumpered to use only 8 bit transfers?
  342.  
  343.  The Linux driver expects a NE2000 to be a 16 bit slot. A NE1000 can
  344.  be in either size slot. This problem can also occur with some clones,
  345.  notably D-Link 16 bit cards, that don't have the correct ID bytes
  346.  in the station address PROM. [[ This should be fixed in pl12.]]
  347.  
  348.  Are you running the bus faster than 8Mhz?
  349.  If you can change the speed (faster or slower), see if that
  350.  makes a difference. Most NE2000 clones will run at 16Mhz, but
  351.  some may not. Changing speed can also mask a noisy bus.
  352.  
  353.  What other devices are on the bus?
  354.  If moving the devices around changes the reliability, then you
  355.  have a bus noise problem -- just what that error message was
  356.  designed to detect. Congratulations, you've probably found the
  357.  source of other problems as well.
  358.  
  359.  Machine Hangs during Boot.
  360.  ==========================
  361.  
  362.  Problem:  The machine hangs during boot right after the "8390..."  or
  363.     "WD...." message. Removing the NE2000 fixes the problem.
  364.  
  365.  Solution: Change your NE2000 base address to 0x360 (or 0x340 for
  366.     pl12 or later kernels.) Alternatively, you can use the new
  367.     device registrar implemented in pl13 (see section 5.1)
  368.  
  369.  Reason:   Your NE2000 clone isn't a good enough clone. An active
  370.     NE2000 is a bottomless pit that will trap any driver
  371.     autoprobing in its space. The other ethercard drivers take
  372.     great pain to reset the NE2000 so that it's safe, but some
  373.     clones cannot be reset. Clone chips to watch out for:
  374.     Winbond 83C901. Changing the NE2000 to a less-popular
  375.     address will move it out of the way of other autoprobes,
  376.     allowing your machine to boot.
  377.  
  378.  Problem:  The machine hangs during the SCSI probe at boot.
  379.  
  380.  Solution: It's the same problem as above, change the
  381.     ethercard's address, or use the device registrar.
  382.  
  383.  Problem:  The machine hangs during the soundcard probe at boot.
  384.  
  385.  Solution: No, that's really during the silent SCSI probe, and it's
  386.     the same problem as above.
  387.  
  388.  "eth0: DMAing conflict in ne_block_input"
  389.  =========================================
  390.  
  391.  This bug came from timer-based packet retransmissions. If you got a
  392.  timer tick _during_ a ethercard RX interrupt, and timer tick tried to
  393.  retransmit a timed-out packet, you could get a conflict. Because of
  394.  the design of the NE2000 you would have the machine hang (exactly the
  395.  same the NE2000-clone boot hangs).
  396.  
  397.  Early versions of the driver disabled interrupts for a long time,
  398.  and didn't have this problem. Later versions are fixed. (ie. kernels
  399.  after 0.99p9 should be OK.)
  400.  
  401.  NE2000 not detected at boot.
  402.  ============================
  403.  
  404.  A few people have reported a problem with detecting the Accton NE2000.
  405.  This problem occurs only at boot-time, and the card is later detected
  406.  at run-time by the identical code my (alpha-test) ne2k diagnostic
  407.  program. Accton has been very responsive, but I still haven't tracked
  408.  down what is going on. I've been unable to reproduce this problem
  409.  with the Accton cards we purchased. If you are having this problem,
  410.  please send me an immediate bug report. For that matter, if you have
  411.  an Accton card send me a success report, including the type of the
  412.  motherboard. I'm especially interested in finding out if this problem
  413.  moves with the particular ethercard, or stays with the motherboard.
  414.  
  415.  Here are some things to try, as they have fixed it for some people:
  416.  1) Change the bus speed, or just move the card to a different slot (!).
  417.  2) Change the "I/O recovery time" parameter in the BIOS
  418.     chipset configuration.
  419.  3) Make the following code change suggested by David Cutler,
  420.     <dave@dmitri.ucdavis.edu> to ne.c around line 150:
  421.  
  422.      for(i = 0; i < 32 /*sizeof(SA_prom)*/; i+=2) {
  423.  -        SA_prom[i] = inb_p(ioaddr + NE_DATAPORT);
  424.  -        SA_prom[i+1] = inb_p(ioaddr + NE_DATAPORT);
  425.  +        SA_prom[i] = inb(ioaddr + NE_DATAPORT);
  426.  +        SA_prom[i+1] = inb(ioaddr + NE_DATAPORT);
  427.          if (SA_prom[i] != SA_prom[i+1])
  428.              wordlength = 1;
  429.      }
  430.  
  431.  Yes, this removes the delay between board accesses, something that
  432.  would normally increase the likelihood of data corruption rather
  433.  than decreasing it. Note that this change is already incorporated
  434.  into pl15. If you have an older kernel, you may have to do it
  435.  yourself.
  436.  
  437. 6.02 Problems with WD80*3 cards
  438.  
  439.  Detected Non-existent Ethercard
  440.  ===============================
  441.  
  442.  Problem:  A WD80*3 is falsely detected. Removing the sound or
  443.     MIDI card eliminates the "detected" message.
  444.  
  445.  Solution: Update your ethercard driver: new versions include an
  446.     additional sanity check.
  447.  
  448.  Reason:   Some MIDI ports happen to produce the same checksum as a
  449.     WD ethercard.
  450.  
  451.  Error messages from the 80*3
  452.  ============================
  453.  
  454.  Problem:  You get messages such as the following with your 80*3:
  455.    eth0: bogus packet size, status = ........
  456.    kmalloc called with impossibly large argument (65400)
  457.    eth0: Couldn't allocate sk_buff of size 65400
  458.    eth0: receiver overrun
  459.  
  460.  Reason:   There is a shared memory problem.
  461.  
  462.  Solution: If the problem is sporadic, you have hardware problems.
  463.     Typical problems that are easy to fix are board conflicts,
  464.     having cache or "shadow ROM" enabled for that region, or
  465.     running your bus faster than 8Mhz. There are also a
  466.     surprising number of memory failures on ethernet cards,
  467.     so run a diagnostic program if you have one for your
  468.     ethercard.
  469.  
  470.     If the problem is continual, and you have have to reboot
  471.     to fix the problem, record the boot-time probe message
  472.     and mail it to becker@super.org - Take particular note of
  473.     the shared memory location.
  474.  
  475.  Will not detect my 80x3
  476.  =======================
  477.  
  478.  Reason:   The Mitsumi CD-ROM (mcd) driver probe at 0x300 will
  479.     succeed if just about *anything* is that I/O location.
  480.     This is bad news and needs to be a bit more robust. (pl15)
  481.     Once another driver registers that it "owns" an I/O
  482.     location, other drivers (incl. the wd80x3) are "locked
  483.     out" and can not probe that addr for a card.
  484.  
  485.  Solution: Recompile a new kernel without any excess drivers that
  486.     you aren't using, including the above mcd driver.
  487.     Or try moving your ethercard to a new I/O addr. Valid
  488.     I/O addr. for all the cards are listed in section 5.1
  489.     You can also point the mcd driver off in another direction
  490.     by a boot-time parameter (via LILO) such as:
  491.    "mcd=0x200,12"
  492.  
  493. 6.03 Problems with 3Com cards
  494.  
  495.  Choosing the Interrupt of the 3c503
  496.  ===================================
  497.  
  498.  Problem:  The 3c503 picks IRQ n at boot, but this is needed for some
  499.     other device which needs IRQ n. (eg. CD ROM driver, etc.)
  500.     Can this be fixed without compiling this into the kernel?
  501.  
  502.  Solution: The 3c503 driver probes for a free IRQ line in the order
  503.     {5, 9/2, 3, 4}, and it should pick a line which isn't being
  504.     used. The pre-pl12 (SLS 1.02) driver picked the IRQ line
  505.     at boot-time, and the current driver (pl12) chooses when
  506.     the card is open()/'ifconfig'ed. Note the "bug" noted in
  507.     the 3c503 section in 1.01
  508.  
  509.     Alternately, you can fix the IRQ at boot by passing
  510.     parameters via LILO. The following selects IRQ9, base
  511.     location 0x300, <ignored value>, and if_port #1 (the
  512.     external transceiver).
  513.    lilo: linux ether=9,0x300,0,1,eth0
  514.  
  515.     The following selects IRQ3, probes for the base location,
  516.     <ignored value>, and the default if_port #0 (the internal
  517.     transceiver)
  518.    lilo: linux ether=3,0,0,0,eth0
  519.  
  520.  "3c503: Configured interrupt number XX is out of range."
  521.  ========================================================
  522.  
  523.  Problem:  Whoever built your kernel fixed the ethercard IRQ at XX.
  524.  
  525.  Reason:   The above is truly evil, and worse than that, it is
  526.     not necessary. The 3c503 will autoIRQ when it gets
  527.     "ifconfig"ed, and pick one of IRQ{5, 2/9, 3, 4}.
  528.  
  529.  Solution: Use lilo to set the IRQ, or rebuild the kernel, enabling
  530.     autoIRQ by not specifying the IRQ line.
  531.  
  532.  Choosing the output of the 3c503
  533.  ================================
  534.  
  535.  Problem:  The supplied 3c503 drivers don't use the AUI (thicknet) port.
  536.     How does one choose it over the default thinnet port?
  537.  
  538.  Solution: The 3c503 AUI port can be selected at boot-time with 0.99pl12
  539.     and later. The selection is overloaded onto the low bit of
  540.     the currently-unused dev->rmem_start variable, so a boot-time
  541.     parameter of:
  542.    lilo: linux ether=0,0,0,1,eth0
  543.     should work. A boot line to force IRQ 5, port base 0x300,
  544.     and use an external transceiver is:
  545.    lilo: linux ether=5,0x300,0,1,eth0
  546.  
  547. 7 Networking with a laptop computer
  548.  
  549.  There are currently only a few ways to put your laptop on a network.
  550.  You can use the SLIP code (and run at serial line speeds);
  551.  you can buy one of the few laptops that come with a NE2000-compatible
  552.  ethercard or PCMCIA slot built-in; you can get a laptop with a
  553.  docking station and plug in an ISA ethercard; or you can use a
  554.  parallel port Ethernet adapter such as the D-Link DE-600.
  555.  
  556. 7.01 Option 1 -- using SLIP
  557.  
  558.  This is the cheapest solution, but by far the most difficult. Also,
  559.  you will not get very high transmission rates. Since SLIP is not
  560.  really related to ethernet cards, it will not be discussed further
  561.  here. See the NET-2 HOWTO.
  562.  
  563. 7.02 Option 2 -- Built in NE2000 compatible or PCMCIA Ethercard.
  564.  
  565.  The second solution severely limits your laptop choices and is fairly
  566.  expensive. Be sure to read the specifications carefully, you may find
  567.  that you will have to buy an additional non-standard transceiver to
  568.  actually put the machine on a network.
  569.  
  570.  As this area of Linux development is fairly young, I'd suggest
  571.  that you join the LAPTOPS mailing channel. See section 0.02
  572.  which describes how to join a mailing list channel. Try and
  573.  determine exactly what hardware you have (ie. card manufacturer,
  574.  PCMCIA chip controller manufacturer) and then ask on the LAPTOPS
  575.  channel. Regardless, don't expect things to be all that simple.
  576.  Expect to have to fiddle around a bit, and patch kernels, etc.
  577.  Maybe someday you will be able to type "make config" 8-)
  578.  
  579.  There is a number of programs on tsx-11.mit.edu in
  580.  /pub/linux/packages/laptops/ that you may find useful. These
  581.  range from PCMCIA Ethercard drivers to programs that communicate
  582.  with the PCMCIA controller chip. Note that these drivers are
  583.  usually tied to a specific PCMCIA chip (ie. the intel 82365
  584.  or the TCIC/2) On a brighter note, I know that people have used the
  585.  Linksys/D-Link 650 PCMCIA Ethernet PC Card with both controller
  586.  chipsets, so it *can* be done. I have also seen reports of
  587.  people using the IBM Credit Card Adapter for Ethernet with the
  588.  intel 82365 chip. This is all just from following the LAPTOPS
  589.  channel.
  590.  
  591.  The 3c589 from 3Com is supposed to look a lot like a 3c509.
  592.  
  593.  Anyway, the PCMCIA driver problem isn't specific to the Linux world.
  594.  It's been a real disaster in the MS-DOS world. In that world
  595.  people expect the hardware to work if they just follow the manual.
  596.  They might not expect it to interoperate with any other hardware
  597.  or software, or operate optimally, but they do expect that the
  598.  software shipped with the product will function. Many PCMCIA
  599.  adaptors don't pass this test.
  600.  
  601. 7.03 Option 3 -- ISA Ethercard in the Docking Station.
  602.  
  603.  I recommend the third solution. Docking stations for laptops typically
  604.  cost about $250 and provide two full-size ISA slots, two serial and one
  605.  parallel port. Most (all?) docking stations are powered off of the
  606.  laptop's batteries, and a few allow adding extra batteries in the
  607.  docking station if you use short ISA cards. You can add an inexpensive
  608.  ethercard and enjoy full-speed ethernet performance.
  609.  
  610. 7.04 Option 4 -- Pocket / parallel port adaptors.
  611.  
  612.  The "pocket" ethernet adaptors may also fit your need.
  613.  Until recently they actually costed more than a docking station and
  614.  cheap ethercard, and most tie you down with a wall-brick power supply.
  615.  At present, you can choose from the D-Link, or the RealTek adaptor.
  616.  Most other companies, especially Xircom, treat the programming
  617.  information as a trade secret, so support will likely be slow in
  618.  coming.
  619.  
  620.  You can sometimes avoid the wall-brick with the adaptors by buying
  621.  or making a cable that draws power from the laptop's keyboard
  622.  port. (This is mentioned in the info. for the AT-Lan-Tec unit.)
  623.  
  624.  The keyboard pinouts (5 pin DIN) are as follows:
  625.  
  626.   Signal/Function   Pin #
  627.   ---------------   -----
  628.   KEYCLK (clock)   1
  629.   KEYDAT (data)   2
  630.   N/C    3
  631.   Ground    4
  632.   +5 V    5
  633.  
  634.  A quick check with a voltmeter will verify which pins are 4 and 5
  635.  if you are not sure.
  636. 8 Frequently asked questions
  637.  
  638.  Here are some of the more frequently asked questions about using
  639.  Linux with an Ethernet connection. Some of the more specific
  640.  questions are sorted on a "per manufacturer basis" and are listed
  641.  in the "Troubleshooting" section. (section 6). However, since this
  642.  document is basically "old" by the time you get it, any "new" problems
  643.  will not appear here instantly. For these, I suggest that you make
  644.  efficient use of your newsreader. For example, nn users would type
  645.   nn -xX -s'3c'
  646.  to get all the news articles in your subscribed list that have
  647.  "3c" in the subject. (ie. 3com, 3c509, 3c503, etc.)
  648.  The moral: Read the man page for your newsreader.
  649.  
  650. 8.01 Just the FAQ's ma'am -- just the FAQ's.
  651.  
  652.  Q: I heard that there is an alpha driver available for my card.
  653.     Where can I get it?
  654.  
  655.  A: Assuming that it is a djb driver, it will be on ftp.super.org
  656.     in the /pub/linux/ area. Things change here quite frequently,
  657.     so just look around for it. There is usually only about 3
  658.     subdirs, so you should be able to find it. Now, if it really
  659.     is an alpha, or pre-alpha driver, then please treat it as
  660.     such. In other words, don't complain because you can't figure
  661.     out what to do with it. If you can't figure out how to install
  662.     it, then you probably shouldn't be testing it. Also, if it brings
  663.     your machine down, don't complain. Instead, send us a well
  664.     documented bug report, or even better, a patch!
  665.  
  666.  Q: Is there token ring support for Linux?
  667.  
  668.  A: No, there is no token ring support in Linux. To support token ring
  669.     requires more than only a writing a device driver, it also requires
  670.     writing the source routing routines for token ring. Given that
  671.     token ring is expensive, not fast, and will probably be swept away
  672.     by 100baseVG in a few months, it doesn't seem worth it to write
  673.     a driver. In case anyone wants to, I looked at writing a token ring
  674.     device driver, and concluded that the hardware interface
  675.     wasn't too difficult to do, but writing the support for source
  676.     routing would take significantly longer than I was willing to spend
  677.     on an expensive and dying technology.
  678.  
  679.     Alan Cox adds: "It will require [...] changes to the bottom socket
  680.     layer to support 802.2 and 802.2 based TCP/IP. Don't expect
  681.     anything soon."
  682.  
  683.  Q: Is there FDDI support for Linux?
  684.  
  685.  A: No, there is no Linux driver for any FDDI boards. I come from a
  686.     place with supercomputers, so an external observer might think
  687.     FDDI would be high on my list. But FDDI never delivered end-to-end
  688.     throughput that would justify its cost, and it seems to be a nearly
  689.     abandoned technology now that 100base{X,Anynet} seems imminent.
  690.     (And yes, I know you can now get FDDI boards for <$1K. That
  691.     seems to be a last-ditch effort to get some return on the
  692.     development investment. Where is the next generation of FDDI
  693.     going to come from?)
  694.  
  695.  Q: Can I link 10BaseT (RJ45) based systems together without a hub?
  696.  
  697.  A: You can link 2 machines easily, but no more than that, without
  698.     extra devices/gizmos. See section 4 on wiring -- it explains
  699.     how to do it. And no, you can't hack together a hub just by
  700.     crossing a few wires and stuff. It's pretty much impossible 
  701.     to do the collision signal right without duplicating a hub.
  702.  
  703.  Q: Is there IPX or Novell support available for Linux?
  704.  
  705.  A: Alan Cox writes: "The novell protocols are available from novell
  706.     for various amounts. IPX is freely documented. SPX is about $1000
  707.     but I'm told Xerox SPP is identical. _PLEASE_ has anyone got any
  708.     freely distributable Xerox SPP code/documentation? The novell
  709.     server spec costs you $15000 + royalties providing you only
  710.     want to write a client, or $30000 + royalties otherwise. Needless
  711.     to say the final output has to be binary only and subject to a
  712.     novell license. Reading their license rules by my interpretation
  713.     its also impossible for us to do because you would seem to have
  714.     to bar disassembly of your final result, which is not allowed
  715.     in the EEC.
  716.  
  717.     Bits of NCP are known, and I hope eventually enough will be known
  718.     to write limited NCP support into Linux, for the moment I'm poking
  719.     around at IPX, tho this will have to wait until the new network
  720.     code is finished.
  721.  
  722.     An Alpha test IPX protocol layer is available from me (Alan)
  723.     for pl14 or higher. People are also exploring the issue of NCP and
  724.     the new Dr Dobbs journal article on the innards of netware has
  725.     provided a core of good information."
  726.  
  727.     As an alternative, Miquel van Smoorenburg suggests the following:
  728.     "It _is_ possible to set up a dedicated PC running both novell and
  729.     the PD SOSS server and let it gateway from NFS to novell. This way
  730.     it is possible to mount the Novell drives on the Unix client.
  731.  
  732.     SOSS is a PD (perhaps with some restrictions, but freely available)
  733.     NFS server for DOS. It includes the PC/IP TCP/IP implementation
  734.     and runs on a packet driver. I have run both a Novell client
  735.     (with PDIPX, a Packet Driver IPX) and this SOSS server together
  736.     successfully."
  737.  
  738.     You can get "Stan's Own Server System" from the following location:
  739.   hilbert.wharton.upenn.edu:pub/tcpip/soss.zip
  740.     Note that this version has the IP bugs fixed and the subdirs
  741.     with extensions bug fixed. Some of the soss.zoo archives do
  742.     not contain these fixes.
  743.  
  744.  Q: What needs to be done so that Linux can run two ethernet cards?
  745.  
  746.  A: The easiest solution is to get 0.99pl13 or newer, as the hooks for
  747.     multiple ethercards are all there.
  748.     You can enable additional ethercards with LILO parameters such as:
  749.  
  750.   lilo: linux ether=5,0x300,0,1,eth0 ether=15,0x280,eth1
  751.  
  752.     These boot time arguments can be made permanent so that you
  753.     don't have to re-enter them every time. See the LILO manual.
  754.  
  755.  Q: Okay, I can run 2 cards -- can I run Linux as a gateway 
  756.     between two networks?
  757.  
  758.  A: This is really a question for the NET-HOWTO, but it is 
  759.     answered here anyways: Charles Hedrick (aka Mr. Slip)
  760.     had this to say:
  761.  
  762.     "Yes, however I'm a bit nervous about doing it. The problem isn't
  763.     functionality -- there's IP forwarding code, and as far as I know,
  764.     it works. Some people do use it. However routers need to be
  765.     particularly careful to avoid creating network problems such as
  766.     "meltdowns." The Linux IP layer doesn't have quite enough of these
  767.     protective features. It will only cause trouble if other hosts on
  768.     your network are misconfigured, and even then it probably won't
  769.     cause much trouble (assuming that only systems actually acting as
  770.     gateways are built with IP_FORWARD enabled). But I'd still rather
  771.     use a router that met all of the requirements of the host and
  772.     router requirements in the RFC's. (Note that not all other Unix
  773.     implementations do either. I'm concerned about things like not
  774.     sending ICMP responses to messages that arrive as media 
  775.     broadcasts. 386BSD looks OK, but older BSD-based implementations
  776.     often didn't do all of these checks.)
  777.  
  778.     It depends a lot on what the network is like and how critical it is.
  779.     For a home setup with a couple of hosts, I see no problem at all.
  780.     But I would not consider using Linux as a router on a large
  781.     campus network at the moment. I still think that by release 1.0,
  782.     Linux will be a reasonably well-behaved host. But I think use
  783.     as a router in critical situations should wait until somebody
  784.     has checked the ip and icmp modules for compliance with RFC 1009
  785.     and a few other specs."
  786.  
  787.  Q: I have /dev/eth0 as a link to /dev/xxx. Is this right?
  788.  
  789.  A: Contrary to what you have heard, the files in /dev/* are not used.
  790.     I originally thought that they might be an OK idea. I've since
  791.     concluded that they won't work, at least in the documented form.
  792.  
  793.  Q: Should I disable trailers when I "ifconfig" my ethercard?
  794.  
  795.  A: You can't disable trailers, and you shouldn't want to.
  796.     'Trailers' are a hack to avoid data copying in the
  797.     networking layers. The idea was to use a trivial 
  798.     fixed-size header of size 'H', put the variable-size header 
  799.     info at the end of the packet, and allocate all packets
  800.     'H' bytes before the start of a page. While it was a good
  801.     idea, it turned out to not work well in practice.
  802.     If someone suggests the use of '-trailers', note that it
  803.     is the equivalent of sacrificial goats blood. It won't do
  804.     anything to solve the problem, but if problem fixes itself then
  805.     someone can claim deep magical knowledge.
  806.  
  807. 9 Miscellaneous.
  808.  
  809.  Any other associated stuff that didn't fit in anywhere else gets
  810.  dumped here. It may not be relevant, and it may not be of general
  811.  interest but it is here anyway.
  812.  
  813. 9.01 Bad Vendors
  814.  
  815.  #define SOAPBOX
  816.  
  817.  There used to be some horror stories here about dealings with
  818.  Cabletron and Xircom. They were pretty ugly and gruesome.
  819.  Basically these companies are the ethernet equivalent of
  820.  what Diamond is to XFree86. They do not want to release
  821.  vital information on low-level programming of their hardware.
  822.  For something like Linux, where the source code for everything
  823.  is out in the open, this makes their hardware difficult or
  824.  impossible to use. However, like Diamond, when confronted
  825.  with the fact that they are losing sales from Linux/BSD users,
  826.  they basically shrug it off, saying that it is only a small
  827.  percentage of the total sales. If you can afford the time,
  828.  drop these vendors a note (via e-mail or snail-mail) and tell
  829.  them politely that the fact that they don't support open
  830.  software systems such as Linux has forced you to exclude them
  831.  from the vendors that you are purchasing hardware from. It may
  832.  not make any immediate difference, but it might make you feel
  833.  better. Besides, a few seconds of your time is a cheap price
  834.  to pay for *all* that free Linux software you are using. 8-)
  835.  
  836.  #undef SOAPBOX
  837.  
  838. 9.02 Closing
  839.  
  840.  If you have found any glaring typos, or outdated info in this
  841.  document, please let one of us know. It's getting big, and it
  842.  is easy to overlook stuff.
  843.  
  844.  Paul Gortmaker  <gpg109@rsphy1.anu.edu.au>
  845.  Donald J. Becker <becker@super.org>
  846.