home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / pcmcia-h < prev    next >
Encoding:
Text File  |  1996-07-11  |  48.1 KB  |  1,048 lines

  1.   Linux PCMCIA HOWTO
  2.   David Hinds, dhinds@allegro.stanford.edu
  3.   v1.63, 27 December 1995
  4.  
  5.   This document describes how to install and use PCMCIA Card Services
  6.   for Linux, and answers some frequently asked questions.  The latest
  7.   version of this document can always be found at hyper.stanford.edu in
  8.   /pub/pcmcia/doc.  An HTML version is at
  9.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html
  10.  
  11.   1.  General information and hardware requirements
  12.  
  13.   1.1.  Introduction
  14.  
  15.   Card Services for Linux is a complete PCMCIA support package.  It
  16.   includes a set of loadable kernel modules that implement a version of
  17.   the PCMCIA Card Services applications program interface, a set of
  18.   client drivers for specific cards, and a card manager daemon that can
  19.   respond to card insertion and removal events, loading and unloading
  20.   drivers on demand.  It supports ``hot swapping'' of PCMCIA cards, so
  21.   cards can be inserted and ejected at any time.
  22.  
  23.   This software is still under development.  It probably contains bugs,
  24.   and should be used with caution.  I'll do my best to fix problems that
  25.   are reported to me, but if you don't tell me, I may never know.  If
  26.   you use this code, I hope you will send me your experiences, good or
  27.   bad!
  28.  
  29.   If you have any suggestions for how this document could be improved,
  30.   please let me know (dhinds@allegro.stanford.edu).
  31.  
  32.   1.2.  Copyright notice and disclaimer
  33.  
  34.   Copyright (c) 1995 David A. Hinds
  35.  
  36.   This document may be reproduced or distributed in any form without my
  37.   prior permission.  Parts of this document may be distributed, provided
  38.   that this copyright message and a pointer to the complete document are
  39.   included.  Specifically, it may be included in commercial
  40.   distributions without my prior consent.  However, I would like to be
  41.   informed of such usage.
  42.  
  43.   This document may be translated into any language, provided this
  44.   copyright statement is left intact.
  45.  
  46.   This document is provided ``as is'', with no explicit or implied
  47.   warranties.  Use the information in this document at your own risk.
  48.  
  49.   1.3.  What is the latest version, and where can I get it?
  50.  
  51.   The current major release of Card Services is version 2.8, and minor
  52.   updates or bug fixes are numbered 2.8.1, 2.8.2, and so on.
  53.  
  54.   Source code for the latest version is available from
  55.   hyper.stanford.edu in the /pub/pcmcia directory, as pcmcia-
  56.   cs-2.8.?.tar.gz.  There will usually be several versions here.  I
  57.   generally only keep the latest minor release for a given major
  58.   release.  New major releases may contain relatively untested code, so
  59.   I also keep the latest version of the previous major release as a
  60.   relatively stable fallback; the current fallback is 2.7.6.  It is up
  61.   to you to decide which version is more appropriate, but the CHANGES
  62.   file will summarize the most important differences.
  63.  
  64.   hyper.stanford.edu is mirrored at sunsite.unc.edu in
  65.   /pub/Linux/kernel/pcmcia.  I'll also try to upload major releases to
  66.   tsx-11.mit.edu under /pub/linux/packages/laptops/pcmcia now and then.
  67.  
  68.   If you do not feel up to compiling the PCMCIA drivers from scratch,
  69.   pre-compiled drivers are included with current releases of most of the
  70.   major Linux distributions, including Slackware, Red Hat, Caldera, and
  71.   Yggdrasil, among others.
  72.  
  73.   1.4.  What systems are supported?
  74.  
  75.   This code should run on almost any Linux-capable laptop.  All common
  76.   PCMCIA controllers are supported, including Intel, Cirrus, Vadem,
  77.   VLSI, Ricoh, and Databook chips.  Custom controllers used in IBM and
  78.   Toshiba laptops are also supported.  Several people use the package on
  79.   desktop systems with PCMCIA card adapters.
  80.  
  81.   The Motorola 6AHC05GA controller used in some Hyundai laptops is not
  82.   supported.  The custom PCMCIA controller in the HP Omnibook 600 is
  83.   also unsupported.
  84.  
  85.   1.5.  What PCMCIA cards are supported?
  86.  
  87.   The current release includes drivers for a variety of ethernet cards,
  88.   a driver for modem and serial port cards, several SCSI adapter
  89.   drivers, and memory card drivers that should support most SRAM cards
  90.   and some flash cards.  The SUPPORTED.CARDS file included with each
  91.   release of Card Services lists all cards that are known to work in at
  92.   least one actual system.
  93.  
  94.   The likelihood that a card not on the supported list will work depends
  95.   on the type of card.  Essentially all modems should work with the
  96.   supplied driver.  Some network cards may work if they are OEM versions
  97.   of supported cards.  Other types of IO cards (hard drives, sound
  98.   cards, etc) will not work until someone writes the appropriate
  99.   drivers.
  100.  
  101.   1.6.  When will card X be supported?
  102.  
  103.   Unfortunately, they do not pay me to write device drivers, so if you
  104.   would like to have a driver for your favorite card, you are probably
  105.   going to have to do at least some of the work.  The SUPPORTED.CARDS
  106.   file mentions some cards for which driver work is currently in
  107.   progress.  I will try to help where I can.
  108.  
  109.   1.7.  Mailing list
  110.  
  111.   I maintain a database and mailing list of Linux PCMCIA users.  This is
  112.   used to announce new releases of the PCMCIA package.  To be included,
  113.   send me the following:
  114.  
  115.   ╖  Your name and email address
  116.  
  117.   ╖  What kind of laptop are you using?
  118.  
  119.   ╖  What PCMCIA controller is reported by the probe command?
  120.  
  121.   ╖  What PCMCIA cards are you using?
  122.  
  123.   ╖  Any special settings you use: compilation options, irq and port
  124.      settings, /etc/pcmcia/config.opts changes, insmod options, etc.
  125.   You can also register via the WWW: see
  126.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html for instructions.
  127.  
  128.   There is also a Linux mailing list devoted to laptop issues, the
  129.   ``linux-laptop'' list.  For more information, send a message
  130.   containing the word ``help'' to majordomo@vger.rutgers.edu.
  131.  
  132.   2.  Compilation, installation, and configuration
  133.  
  134.   2.1.  Prerequisites and kernel setup
  135.  
  136.   The following things should be installed on your system before you
  137.   start installing PCMCIA:
  138.  
  139.   ╖  One of the following kernels: 1.2.8 through 1.2.13, 1.3.30, 1.3.37,
  140.      or 1.3.39 through 1.3.45.
  141.  
  142.   ╖  A current (1.2.8) set of module utilities.
  143.  
  144.   ╖  (Optional) the ``Forms'' X11 user interface toolkit.
  145.  
  146.   The latest version requires a kernel version 1.2.8 or higher, or a
  147.   development kernel 1.3.30 or higher.  It has been tested with 1.3.30,
  148.   1.3.37, 1.3.39, 1.3.43, and 1.3.45.  1.3.38 is definitely broken, and
  149.   1.3.31 to 1.3.36 are untested.  It also requires a relatively recent
  150.   set of module utilities.  If your man page for insmod describes the
  151.   [symbol=value ...] syntax, your utilities are current enough.  There
  152.   are no kernel patches specifically for PCMCIA.
  153.  
  154.   You need to have a complete linux source tree for your kernel, not
  155.   just an up-to-date kernel image, to compile the PCMCIA package.  The
  156.   PCMCIA modules contain some references to kernel source files.  While
  157.   you may want to build a new kernel to remove unnecessary drivers,
  158.   installing PCMCIA does not require you to do so.
  159.  
  160.   Current kernel sources and patches are available from sunsite.unc.edu
  161.   in /pub/Linux/kernel/v1.2, or from tsx-11.mit.edu in
  162.   /pub/linux/sources/system/v1.2.  Current module utilities can be found
  163.   in the same places, in the file modules-1.2.8.tgz.
  164.  
  165.   When configuring your kernel, if you plan on using a PCMCIA ethernet
  166.   card, you should turn on networking support but turn off the normal
  167.   Linux network card drivers, including the ``pocket and portable
  168.   adapters''.  The PCMCIA network card drivers are all implemented as
  169.   loadable modules.  Any drivers compiled into your kernel will only
  170.   waste space.
  171.  
  172.   If you want to use SLIP, PPP, or PLIP, you do need to either configure
  173.   your kernel with these enabled, or use the loadable module versions of
  174.   these drivers.  There is an unfortunate deficiency in the kernel
  175.   config process in 1.2.X kernels, in that it is not possible to set
  176.   configuration options (like SLIP compression) for a loadable module,
  177.   so it is probably better to just link SLIP into the kernel if you need
  178.   it.
  179.  
  180.   If you will be using a PCMCIA SCSI adapter, you should enable
  181.   CONFIG_SCSI when configuring your kernel.  Also, enable any top level
  182.   drivers (SCSI disk, tape, cdrom, generic) that you expect to use.  All
  183.   low-level drivers for particular host adapters should be disabled, as
  184.   they will just take up space.
  185.  
  186.   If your kernel is compiled with CONFIG_MODVERSIONS enabled, for kernel
  187.   symbol version checking, the configure script will check for the
  188.   existence of /usr/include/linux/modversions.h, the symbol version
  189.   database.  This is created by running ``make dep'' in the kernel
  190.   source tree.
  191.  
  192.   This package includes an X-based card status utility called cardinfo.
  193.   This utility is based on a public domain user interface toolkit called
  194.   the Forms Library, which you will need to install before building
  195.   cardinfo.  A binary distribution is on hyper.stanford.edu in
  196.   /pub/pcmcia/extras: there are both a.out and ELF versions of the
  197.   library.
  198.  
  199.   2.2.  Installation
  200.  
  201.   Here is a synopsis of the installation process:
  202.  
  203.   ╖  Unpack pcmcia-cs-2.8.?.tar.gz in /usr/src.
  204.  
  205.   ╖  Run ``make config'' in the new pcmcia-cs-2.8.? directory.
  206.  
  207.   ╖  Run ``make all'', then ``make install''.
  208.  
  209.   ╖  Customize /etc/rc.d/rc.pcmcia and the files in /etc/pcmcia for your
  210.      site.
  211.  
  212.   Running ``make config'' prompts for a few configuration options, and
  213.   checks out your system to verify that it satisfies all prerequisites
  214.   for installing PCMCIA support.  In most cases, you'll be able to just
  215.   accept all the default configuration options.  Be sure to carefully
  216.   check the output of this command in case there are problems.
  217.  
  218.   If you are compiling the PCMCIA stuff for installation on another
  219.   machine, specify an alternate target directory when prompted by the
  220.   configure script.  This should be an absolute path.  All the PCMCIA
  221.   tools will be installed relative to this directory.  You will then be
  222.   able to tar this directory tree and copy to your target machine, and
  223.   unpack relative to its root directory to install everything in the
  224.   proper places.
  225.  
  226.   If you are cross compiling on another machine, you may want to specify
  227.   alternate names for the compiler and linker.  This may also be helpful
  228.   on mixed a.out and ELF systems.  The script will also prompt for
  229.   additional compiler flags for debugging.
  230.  
  231.   There are a few kernel configuration options that affect the PCMCIA
  232.   tools.  The configuration script can deduce these from the running
  233.   kernel (the most common case).  Alternatively, if you are compiling
  234.   for installation on another machine, it can read the configuration
  235.   from a kernel source tree, or each option can be set interactively.
  236.  
  237.   Running ``make all'' followed by ``make install'' will build and then
  238.   install the kernel modules and utility programs.  Kernel modules are
  239.   installed under /lib/modules/<version>/pcmcia.  The cardmgr and
  240.   cardctl programs are installed in /sbin.  If cardinfo is built, it is
  241.   installed in /usr/bin/X11.
  242.  
  243.   Configuration files will be installed in the /etc/pcmcia directory.
  244.   If you are installing over an older version, the new config files will
  245.   be installed with a ``.N'' suffix -- you should replace or update your
  246.   existing files by hand.
  247.  
  248.   If you don't know what kind of PCMCIA controller chip you have, you
  249.   can use the probe utility in the cardmgr/ subdirectory to determine
  250.   this.  There are two major types: the Databook TCIC-2 type and the
  251.   Intel i82365SL-compatible type.
  252.  
  253.   A user-level daemon processes card insertion and removal events.  This
  254.   is called cardmgr.  It is similar in function to Barry Jaspan's
  255.   pcmciad in earlier PCMCIA releases.  Cardmgr reads a configuration
  256.   file describing known PCMCIA cards from /etc/pcmcia/config.  This file
  257.   also specifies what resources can be allocated for use by PCMCIA
  258.   devices, and may need to be customized for your system.  See the
  259.   pcmcia man page for more information about this file.
  260.  
  261.   The script rc.pcmcia, installed in /etc/rc.d, controls starting up and
  262.   shutting down the PCMCIA system.  ``make install'' will use the probe
  263.   command to determine your controller type and modify rc.pcmcia
  264.   appropriately.  You should add a line to your system startup file
  265.   /etc/rc.d/rc.M to invoke this:
  266.  
  267.        /etc/rc.d/rc.pcmcia start
  268.  
  269.   In a few cases, the probe command will be unable to determine your
  270.   controller type automatically.  The Tadpole P1000 and some other PCI-
  271.   based laptops have a special Cirrus PCI-to-PCMCIA bridge chip that
  272.   can't be detected by probe.  If you have one of these systems, you'll
  273.   need to edit rc.pcmcia by hand to load the i82365 module.
  274.  
  275.   2.3.  Site-specific configuration options
  276.  
  277.   Card Services should automatically avoid allocating IO ports and
  278.   interrupts already in use by other standard devices.  It will also
  279.   attempt to detect conflicts with unknown devices, but this is not
  280.   completely reliable.  In some cases, you may need to explicitly
  281.   exclude resources for a device in /etc/pcmcia/config.opts.
  282.  
  283.   Here are some resource settings for specific laptop types.
  284.  
  285.   ╖  On the AMS SoundPro, exclude irq 10.
  286.  
  287.   ╖  On the BMX 486DX2-66, exclude irq 5, irq 9.
  288.  
  289.   ╖  On the Chicony NB5, use memory 0xda000-0xdffff.
  290.  
  291.   ╖  On the NEC Versa M, exclude irq 9, port 0x2e0-2ff.
  292.  
  293.   ╖  On the NEC Versa P/75, exclude irq 5, irq 9.
  294.  
  295.   ╖  On the NEC Versa S, exclude irq 9, irq 12.
  296.  
  297.   ╖  On the ProStar 9200, Altima Virage, and Acquiline Hurricane
  298.      DX4-100, exclude irq 5, port 0x330-0x35f.  Maybe use memory
  299.      0xd8000-0xdffff.
  300.  
  301.   ╖  On the TI TravelMate 5000, use memory 0xd4000-0xdffff.
  302.  
  303.   ╖  On the Toshiba T4900 CT, exclude irq 5, port 0x2e0-0x2e8, port
  304.      0x330-0x338.
  305.  
  306.   ╖  On the Twinhead 5100, HP 4000, Sharp PC-8700 and PC-8900, exclude
  307.      irq 9 (sound), irq 12.
  308.  
  309.   ╖  On an MPC 800 Series, exclude irq 5, port 0x300-0x30f for the CD-
  310.      ROM.
  311.  
  312.   Some PCMCIA controllers have optional features that may or may not be
  313.   implemented in a particular system.  It is generally impossible for a
  314.   socket driver to detect if these features are implemented.  Check the
  315.   man page for your driver to see what optional features may be enabled.
  316.  
  317.   The low level socket drivers, tcic and i82365, have numerous bus
  318.   timing parameters that may need to be adjusted for systems with
  319.   particularly fast processors.  Symptoms of timing problems include
  320.   card recognition problems, lock-ups under heavy loads, high error
  321.   rates, or poor device performance.  Check the corresponding man pages
  322.   for more details, but here is a brief summary:
  323.  
  324.   ╖  Cirrus controllers have numerous configurable timing parameters.
  325.      The most important is the freq_bypass flag which changes the
  326.      multiplier for the PCMCIA bus clock to slow down all operations.
  327.  
  328.   ╖  The Cirrus PD6729 PCI controller has the fast_pci flag, which
  329.      should be set if the PCI bus speed is greater than 25 MHz.
  330.  
  331.   ╖  For Vadem VG-468 controllers and Databook TCIC-2 controllers, the
  332.      async_clock flag changes the relative clocking of PCMCIA bus and
  333.      host bus cycles.  Setting this flag adds extra wait states to some
  334.      operations.
  335.  
  336.   ╖  The pcmcia_core module has the cis_speed parameter for changing the
  337.      memory speed used for accessing a card's Card Information Structure
  338.      (CIS).  On some systems with fast bus clocks, increasing this
  339.      parameter (i.e., slowing down card accesses) may be beneficial.
  340.  
  341.   All these options should be configured by modifying the top of
  342.   /etc/rc.d/rc.pcmcia.  For example:
  343.  
  344.        # Should be either i82365 or tcic
  345.        PCIC=i82365
  346.        # Put socket driver timing parameters here
  347.        PCIC_OPTS="async_clock=1"
  348.        # Put pcmcia_core options here
  349.        CORE_OPTS="cis_speed=500"
  350.  
  351.   On some systems using Cirrus controllers, including the NEC Versa M,
  352.   the BIOS puts the controller in a special suspended state at system
  353.   startup time.  On these systems, the probe command will fail to find
  354.   any known PCMCIA controller.  If this happens, edit
  355.   /etc/rc.d/rc.pcmcia by hand as follows:
  356.  
  357.        # Should be either i82365 or tcic
  358.        PCIC=i82365
  359.        # Put socket driver timing parameters here
  360.        PCIC_OPTS="wakeup=1"
  361.  
  362.   If you have an ARM Pentium-90 or Midwest Micro Soundbook Plus laptop,
  363.   use the combination ``freq_bypass=1 cmd_time=8'' to slow down your
  364.   PCMCIA bus cycles.  On a Midwest Micro Soundbook Elite, try
  365.   ``cmd_time=12''.  These may help on other very fast systems that use
  366.   the non-PCI Cirrus chip (the PD672x).
  367.   2.4.  What about installation on Red Hat and Caldera?
  368.  
  369.   Red Hat and Caldera have a System V-ish arrangement for system startup
  370.   files.  The PCMCIA installation scripts will automatically detect this
  371.   and adjust accordingly.  The rc.pcmcia script will be installed as
  372.   /etc/rc.d/init.d/pcmcia.  There is no need to edit any of the Caldera
  373.   startup scripts to enable PCMCIA: it will happen automatically.
  374.  
  375.   A separate configuration file, /etc/sysconfig/pcmcia, will be created
  376.   for startup options.  If you need to change any module options (like
  377.   the PCIC= or PCIC_OPTS= settings), edit this config file rather than
  378.   the actual PCMCIA startup script.  This file will not be overwritten
  379.   by subsequent installs.
  380.  
  381.   Previous releases used the /etc/sysconfig/pcmcia-scripts directory in
  382.   place of /etc/pcmcia.  The current release instead uses /etc/pcmcia
  383.   for all systems, and will move /etc/sysconfig/pcmcia-scripts to
  384.   /etc/pcmcia if it is present.
  385.  
  386.   2.5.  Why don't you distribute PCMCIA binaries?
  387.  
  388.   For me, distributing binaries is a significant hassle.  It is
  389.   complicated because some features can only be selected at compile
  390.   time, and because the PCMCIA modules are somewhat dependent on having
  391.   the ``right'' kernel configuration.  So, I would probably need to
  392.   distribute precompiled modules along with matching kernels.  Beyond
  393.   this, the greatest need for precompiled modules is when installing
  394.   Linux on a clean system.  This typically requires setting up PCMCIA so
  395.   that it can be used in the installation process for a particular Linux
  396.   distribution.  Each Linux distribution has its own procedures, and it
  397.   is not feasible for me to provide boot and root disks for even just
  398.   the common combinations of drivers and distributions.
  399.  
  400.   PCMCIA is now a part of many of the major Linux distributions,
  401.   including Red Hat, Caldera, Slackware, Yggdrasil, and Nascent
  402.   Technology.
  403.  
  404.   2.6.  Problems loading kernel modules
  405.  
  406.   The configure script will normally ensure that the PCMCIA modules are
  407.   compatible with your kernel.  So, module loading problems generally
  408.   indicate that the user has interfered with the normal installation
  409.   process in some way.  Some module loading errors are sent directly to
  410.   the Linux console.  Other errors are recorded in the system log file,
  411.   normally /usr/adm/messages.  To track down a problem, be sure to check
  412.   both locations, to pin down which module is actually causing trouble.
  413.  
  414.   Some of the PCMCIA modules require kernel services that may or may not
  415.   be present, depending on kernel configuration.  For instance, the SCSI
  416.   card drivers require that the kernel be configured with SCSI support,
  417.   and the network drivers require a networking kernel.  If a kernel
  418.   lacks a necessary feature, insmod may report undefined symbols and
  419.   refuse to load a module.
  420.  
  421.   If insmod reports ``wrong version'' errors, it means that the module
  422.   was compiled for a different kernel version than your system is
  423.   actually running.  This might occur if modules compiled on one machine
  424.   are copied to another machine with a different configuration, or if
  425.   the kernel is reconfigured after PCMCIA is installed.
  426.  
  427.   A final source of module loading errors is when the modules and kernel
  428.   were compiled with different settings of CONFIG_MODVERSIONS.  If a
  429.   module with version checking is loaded against a kernel without
  430.   version checking, insmod will complain about undefined symbols.
  431.   2.7.  Problems with the card status change interrupt
  432.  
  433.   In most cases, the socket driver (i82365 or tcic) will automatically
  434.   probe and select an appropriate interrupt to signal card status
  435.   changes.  The automatic interrupt probe doesn't work on some Intel-
  436.   compatible controllers, including Cirrus chips and the chips used in
  437.   some IBM ThinkPads.  If a device is inactive at probe time, its
  438.   interrupt may also appear to be available.  In these cases, the socket
  439.   driver may pick an interrupt that is used by another device.
  440.  
  441.   With the i82365 and tcic drivers, the irq_mask option can be used to
  442.   limit the interrupts that will be tested.  This mask limits the set of
  443.   interrupts that can be used by PCMCIA cards as well as for monitoring
  444.   card status changes.  The cs_irq option can also be used to explicitly
  445.   set the interrupt to be used for monitoring card status changes.
  446.  
  447.   If you can't find an interrupt number that works, there is also a
  448.   polled status mode: both i82365 and tcic will accept a
  449.   poll_interval=100 option, to poll for card status changes once per
  450.   second.
  451.  
  452.   All these options should be set in the PCIC_OPTS= line in either
  453.   /etc/rc.d/rc.pcmcia or /etc/sysconfig/pcmcia, depending on your site
  454.   setup.
  455.  
  456.   The most common problem of this type seems to be a conflict with a
  457.   PS/2 pointer device on interrupt 12.  In this case, edit rc.pcmcia so
  458.   the PCIC_OPTS= line reads:
  459.  
  460.        PCIC_OPTS="irq_mask=0xefff"
  461.  
  462.   3.  Usage and features
  463.  
  464.   3.1.  How do I tell if it is working?
  465.  
  466.   The cardmgr daemon normally beeps when a card is inserted, and the
  467.   tone of the beeps indicates the status of the newly inserted card.
  468.   Two high beeps indicate the card was identified and configured
  469.   successfully.  A high beep followed by a lower beep indicates that the
  470.   card was identified, but could not be configured for some reason.  One
  471.   low beep indicates that the card could not be identified.
  472.  
  473.   If you are running X, the new cardinfo utility produces a slick
  474.   graphical display showing the current status of all PCMCIA sockets.
  475.  
  476.   If the modules are all loaded correctly, the output of the lsmod
  477.   command should look like the following, with no cards inserted:
  478.  
  479.        Module:        #pages:  Used by:
  480.        ds                 2
  481.        i82365             2
  482.        pcmcia_core        6    [ds i82365]
  483.  
  484.   All the PCMCIA modules and the cardmgr daemon send status messages to
  485.   the system log.  This will usually be /usr/adm/messages.  This file
  486.   should be the first place to look when tracking down a problem.  When
  487.   submitting a bug report, always include the contents of this file.
  488.   Cardmgr also records some current device information for each socket
  489.   in /etc/stab.  Here is a sample /etc/stab listing:
  490.  
  491.        Socket 0: Adaptec APA-1460 SlimSCSI
  492.        0       aha152x_cs      0       sda     8       0
  493.        Socket 1: Serial or Modem Card
  494.        1       serial_cs       0       cua1    5       65
  495.  
  496.   For the lines describing devices, the first field is the socket, the
  497.   second is the driver name, the third is used to number multiple
  498.   devices associated with the same driver, the fourth is the device
  499.   name, and the final two fields are the major and minor device numbers
  500.   for this device.
  501.  
  502.   3.2.  How do I use my PCMCIA ethernet card?
  503.  
  504.   Linux ethernet-type network interfaces normally have names like eth0,
  505.   eth1, and so on.  The ifconfig command is used to view or modify the
  506.   state of a network interface.  A peculiarity of Linux is that network
  507.   interfaces do not have corresponding device files under /dev, so don't
  508.   be surprised when you can't find them.
  509.  
  510.   When a PCMCIA ethernet card is detected, it will be assigned the first
  511.   free interface name, which will probably be eth0.  Cardmgr will run
  512.   the /etc/pcmcia/network script to configure the interface.
  513.  
  514.   Do not configure your PCMCIA ethernet card in /etc/rc.d/rc.inet1,
  515.   since the card may not be present when this script is executed.
  516.   Comment out everything except the loopback stuff in rc.inet1.  If your
  517.   system has an automatic network configuration procedure, you should
  518.   indicate that you do not have a network card installed.  Instead, edit
  519.   the /etc/pcmcia/network.opts file to match your local network setup.
  520.   The network and network.opts scripts will be executed only when your
  521.   ethernet card is actually present.
  522.  
  523.   3.3.  How do I use my PCMCIA modem card?
  524.  
  525.   Linux serial devices are accessed via the /dev/cua* and /dev/ttyS*
  526.   special device files.  The ttyS* devices are for incoming connections,
  527.   such as directly connected terminals.  The cua* devices are for
  528.   outgoing connections, such as modems.  The configuration of a serial
  529.   device can be examined and modified with the setserial command.
  530.  
  531.   When a PCMCIA serial or modem card is detected, it will be assigned to
  532.   the first available serial device slot.  This will usually be
  533.   /dev/cua1 or /dev/cua2, depending on the number of built-in serial
  534.   ports.  The default serial device script, /etc/pcmcia/serial, will
  535.   link the appropriate device file to /dev/modem as a convenience.
  536.  
  537.   If you are using more than one PCMCIA modem, use /etc/stab or cardinfo
  538.   to find out which device corresponds to each modem.
  539.  
  540.   Do not try to use /etc/rc.d/rc.serial to configure a PCMCIA modem.
  541.   This script should only be used to configure non-removable devices.
  542.   Modify /etc/pcmcia/serial.opts if you want to do anything special to
  543.   set up your modem.
  544.  
  545.   If a PCMCIA modem is already configured when Linux boots, it may be
  546.   incorrectly identified as an ordinary built-in serial port.  This is
  547.   harmless, however, when the PCMCIA drivers take control of the modem,
  548.   it will be assigned a different device slot.  It is best to either
  549.   parse /etc/stab or use /dev/modem, rather than expecting a PCMCIA
  550.   modem to always have the same device assignment.
  551.  
  552.   3.4.  How do I use my PCMCIA SCSI card?
  553.  
  554.   The Qlogic FastSCSI, New Media Bus Toaster, and Adaptec APA-1460
  555.   SlimSCSI cards work under Card Services.  The PCMCIA driver modules
  556.   for these cards are built by linking some PCMCIA-specific code (in
  557.   qlogic_cs.c and toaster_cs.c) with a normal Linux SCSI driver.  The
  558.   Qlogic PCMCIA driver links with the normal QLogic driver.  The Bus
  559.   Toaster PCMCIA driver, which also supports the Adaptec SlimSCSI, links
  560.   with the Adaptec 152x driver.
  561.  
  562.   When a new SCSI host adapter is detected, the SCSI drivers will probe
  563.   for devices.  Check /usr/adm/messages to make sure your devices are
  564.   detected properly.  New SCSI devices will be assigned to the first
  565.   available SCSI device files.  The first SCSI disk will be /dev/sda,
  566.   the first SCSI tape will be /dev/st0, and the first CDROM will be
  567.   /dev/scd0.
  568.  
  569.   With 1.3.X kernels, the PCMCIA core drivers are able to find out from
  570.   the kernel which SCSI devices are connected to a card.  They will be
  571.   listed in /etc/stab, and the SCSI configuration script,
  572.   /etc/pcmcia/scsi, will be called once for each attached device, to
  573.   either configure or shut down that device.  The default script does
  574.   not take any actions to configure SCSI devices, but will properly
  575.   unmount filesystems on SCSI devices when a card is removed.
  576.  
  577.   With 1.2.X kernels, the PCMCIA drivers cannot automatically deduce
  578.   which devices are associated with a particular SCSI adapter.  Instead,
  579.   if you have one normal SCSI device configuration, you may list these
  580.   devices in /etc/pcmcia/scsi.opts.  For example, if you normally have a
  581.   SCSI disk and a CD-ROM, you would use:
  582.  
  583.        # For 1.2 kernels: list of attached devices
  584.        SCSI_DEVICES="sda scd0"
  585.  
  586.   Always turn on SCSI devices before powering up your laptop, or before
  587.   inserting the adapter card, so that the SCSI bus is properly
  588.   terminated when the adapter is configured.  Also be very careful about
  589.   ejecting a SCSI adapter.  Be sure that all associated SCSI devices are
  590.   unmounted and closed before ejecting the card.  The best way to ensure
  591.   this is to use either cardctl or cardinfo to request card removal
  592.   before physically ejecting the card.  For now, all SCSI devices should
  593.   be powered up before plugging in a SCSI adapter, and should stay
  594.   connected until after you unplug the adapter and/or power down your
  595.   laptop.
  596.  
  597.   With 1.2.X kernels, the SCSI configuration script is called just once
  598.   to either configure or shut down a SCSI adapter.  In this situation,
  599.   the SCSI script will not be able to determine when it is safe to eject
  600.   the adapter.  It is up to the user to ensure that all SCSI devices are
  601.   closed before ejecting the card.
  602.  
  603.   There is a potential complication when using these cards that does not
  604.   arise with ordinary ISA bus adapters.  The SCSI bus carries a
  605.   ``termination power'' signal that is necessary for proper operation of
  606.   ordinary passive SCSI terminators.  PCMCIA SCSI adapters do not supply
  607.   termination power, so if it is required, an external device must
  608.   supply it.  Some external SCSI devices may be configured to supply
  609.   termination power.  Others, such as the Zip Drive and the Syquest EZ-
  610.   Drive, use active terminators that do not depend on it.  In some
  611.   cases, it may be necessary to use a special terminator block such as
  612.   the APS SCSI Sentry 2, which has an external power supply.  When
  613.   configuring your SCSI device chain, be aware of whether or not any of
  614.   your devices require or can provide termination power.
  615.  
  616.   The Adaptec APA-460 SlimSCSI adapter is not supported.  This card was
  617.   originally sold under the Trantor name, and when Adaptec merged with
  618.   Trantor, they continued to sell the Trantor card with an Adaptec
  619.   label.  The APA-460 is not compatible with any existing Linux driver.
  620.   I'm not sure how hard it would be to write a driver; I don't think
  621.   anyone has been able to obtain the technical information from Adaptec.
  622.  
  623.   The (unsupported) Trantor SlimSCSI can be identified by the following:
  624.  
  625.        Trantor / Adaptec APA-460 SlimSCSI
  626.        FCC ID: IE8T460
  627.        Shipped with SCSIworks! driver software
  628.  
  629.   The (supported) Adaptec SlimSCSI can be identified by the following:
  630.  
  631.        Adaptec APA-1460 SlimSCSI
  632.        FCC ID: FGT1460
  633.        P/N: 900100
  634.        Shipped with EZ-SCSI driver software
  635.  
  636.   3.5.  How do I use my PCMCIA memory card?
  637.  
  638.   The default memory card startup script will create block and character
  639.   devices for accessing a card's first common memory and attribute
  640.   memory regions.  Check the man pages for all the details, but the
  641.   devices you'll probably be using will be /dev/mem0c (character device)
  642.   or /dev/mem0b (block device).  The block device is used for disk-like
  643.   access (creating and mounting filesystems, etc).  The character device
  644.   is for "raw" reads and writes at arbitrary locations.
  645.  
  646.   To use a flash memory card as an ordinary disk-like block device,
  647.   first create a ``flash translation layer'' partition on the device
  648.   with the ftl_format command:
  649.  
  650.        ftl_format -i /dev/mem0c
  651.  
  652.   Note that this command accesses the card through the ``raw'' memory
  653.   card interface.  Once formatted, the card can be accessed as an
  654.   ordinary block device via the ftl_cs driver.  For example:
  655.        mke2fs /dev/ftl0
  656.        mount -t ext2 /dev/ftl0 /mnt
  657.  
  658.   There are two major formats for flash memory cards: the ``flash
  659.   translation layer'' style, and the Microsoft Flash File System.  The
  660.   FTL format is generally more flexible because it allows any ordinary
  661.   high-level filesystem (ext2, ms-dos, etc) to be used on a flash card
  662.   as if it were an ordinary disk device.  The FFS is a complete new
  663.   filesystem type.  Linux cannot currently handle cards formated with
  664.   FFS.
  665.  
  666.   3.6.  How do I tell cardmgr how to identify a new card?
  667.  
  668.   Assuming that your card is supported by an existing driver, all that
  669.   needs to be done is to add an entry to /etc/pcmcia/config to tell
  670.   cardmgr how to identify the card, and which driver(s) need to be
  671.   linked up to this card.  Check the man page for pcmcia for more
  672.   information about the config file format.  If you insert an unknown
  673.   card, cardmgr will normally record some identification information in
  674.   /usr/adm/messages that can be used to construct the config entry.
  675.  
  676.   Here is an example of how cardmgr will report an unsupported card in
  677.   /usr/adm/messages.
  678.  
  679.        cardmgr[460]: unsupported card in socket 1
  680.        cardmgr[460]: version info: "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  681.  
  682.   The corresponding entry in /etc/pcmcia/config would be:
  683.  
  684.        card "Megahertz XJ2288 V.34 Fax Modem"
  685.          version "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  686.          bind "serial_cs"
  687.  
  688.   You can use ``*'' to match strings that don't need to match exactly,
  689.   like version numbers.  When making new config entries, be careful to
  690.   copy the strings exactly, preserving case and blank spaces.  Also be
  691.   sure that the config entry has the same number of strings as are
  692.   reported in the log file.
  693.  
  694.   After editing /etc/pcmcia/config, you can signal cardmgr to reload the
  695.   file with:
  696.  
  697.        kill -HUP `cat /var/run/cardmgr.pid`
  698.  
  699.   If you do set up an entry for a new card, please send me a copy so
  700.   that I can include it in the standard config file.
  701.  
  702.   3.7.  How do I control which interrupts and ports are used by a
  703.   device?
  704.  
  705.   In theory, it should not really matter which interrupt is allocated to
  706.   which device, as long as two devices are not configured to use the
  707.   same interrupt.  In /etc/pcmcia/config.opts you'll find a place for
  708.   excluding interrupts that are used by non-PCMCIA devices.
  709.  
  710.   Note that the interrupt used to monitor card status changes is chosen
  711.   by the low-level socket driver module (i82365 or tcic) before cardmgr
  712.   parses /etc/pcmcia/config, so it is not affected by changes to this
  713.   file.  To set this interrupt, use the irq_mask or cs_irq options when
  714.   the socket driver is loaded, in /etc/rc.d/rc.pcmcia.
  715.  
  716.   All the client card drivers have a parameter called irq_mask for
  717.   specifying which interrupts they may try to allocate.  Each bit of
  718.   irq_mask corresponds to one irq line: bit 0 is irq 0, bit 1 is irq 1,
  719.   and so on.  So, a mask of 0x1200 would correspond to irq 9 and irq 12.
  720.   To limit a driver to use only one specific interrupt, its irq_mask
  721.   should have only one bit set.  These driver options should be set in
  722.   your /etc/pcmcia/config file.  For example:
  723.  
  724.        device "serial_cs"
  725.          module "serial_cs" opts "irq_mask=0x1100"
  726.          ...
  727.  
  728.   would specify that the serial driver should only use irq 8 or irq 12.
  729.   Note that Card Services will never allocate an interrupt that is
  730.   already in use by another device, or an interrupt that is excluded in
  731.   the config file.
  732.  
  733.   There is no way to directly specify the I/O addresses for a PCMCIA
  734.   card to use.  The /etc/pcmcia/config.opts file allows you to specify
  735.   ranges of ports available for use by all PCMCIA devices.
  736.  
  737.   After modifying /etc/pcmcia/config, you can restart cardmgr with
  738.   ``kill -HUP''.
  739.  
  740.   3.8.  When is it safe to insert or eject a PCMCIA card?
  741.  
  742.   In theory, you can insert and remove PCMCIA cards at any time.
  743.   However, it is a good idea not to eject a card that is currently being
  744.   used by an application program.  Kernels older than 1.1.77 would often
  745.   lock up when serial/modem cards were ejected, but this should be fixed
  746.   now.
  747.  
  748.   3.9.  How do I unload PCMCIA drivers?
  749.  
  750.   To unload the entire PCMCIA package, invoke rc.pcmcia with:
  751.  
  752.        /etc/rc.d/rc.pcmcia stop
  753.  
  754.   This script will take several seconds to run, to give all client
  755.   drivers time to shut down gracefully.  If a PCMCIA device is currently
  756.   in use, the shutdown will fail.
  757.  
  758.   3.10.  How does Card Services deal with suspend/resume?
  759.  
  760.   Card Services can be compiled with support for APM (Advanced Power
  761.   Management) if you've installed this package on your system.  The
  762.   current release of Stephen Rothwell's APM support package is version
  763.   0.5.  Unlike the 0.4 release, 0.5 does not require a special patch to
  764.   work with PCMCIA.  The PCMCIA modules will automatically be configured
  765.   for APM if a compatible version is detected on your system.
  766.  
  767.   Without resorting to APM, you can do ``cardctl suspend'' before
  768.   suspending your laptop, and ``cardctl resume'' after resuming, to
  769.   properly shut down and restart your PCMCIA cards.  This will not work
  770.   with a PCMCIA modem that is in use, because the serial driver isn't
  771.   able to save and restore the modem operating parameters.
  772.  
  773.   APM seems to be unstable on some systems.  If you experience trouble
  774.   with APM and PCMCIA on your system, try to narrow down the problem to
  775.   one package or the other before reporting a bug.
  776.  
  777.   APM is currently being maintained by Rick Faith ().
  778.  
  779.   3.11.  How do I turn off a PCMCIA card without ejecting it?
  780.  
  781.   Use either the cardctl or cardinfo command.  ``cardctl suspend #''
  782.   will suspend one socket, and turn off its power.  The corresponding
  783.   resume command will wake up the card in its previous state.
  784.  
  785.   4.  Problems with specific cards
  786.  
  787.   4.1.  Why doesn't my modem work?
  788.  
  789.   That's a broad question, but here's a quick troubleshooting guide.
  790.  
  791.   ╖  Is your card recognized as a modem?  Check /usr/adm/messages and
  792.      make sure that cardmgr identifies the card correctly and starts up
  793.      the serial_cs driver.  If it doesn't, you may need to add a new
  794.      entry to your /etc/pcmcia/config file so that it will be identified
  795.      properly.  See section ``3.6'' for details.
  796.  
  797.   ╖  Is the modem configured successfully by serial_cs?  Again, check
  798.      /usr/adm/messages and look for messages from the serial_cs driver.
  799.      If you see ``register_serial() failed'', you may have an I/O port
  800.      conflict with another device.  Another tip-off of a conflict is if
  801.      the device is reported to be an 8250; most modern PCMCIA modems
  802.      should be identified as 16550A UART's.  If you think you're seeing
  803.      a port conflict, edit /etc/pcmcia/config.opts and exclude the port
  804.      range that was allocated for the modem.
  805.  
  806.   ╖  Is there an interrupt conflict?  If /usr/adm/messages looks good,
  807.      but the modem just doesn't seem to work, try using setserial to
  808.      change the irq to 0, and see if the modem works.  This causes the
  809.      serial driver to use a slower polled mode instead of using
  810.      interrupts.  If this seems to fix the problem, it is likely that
  811.      some other device in your system is using the interrupt selected by
  812.      serial_cs.  You should add a line to /etc/pcmcia/config.opts to
  813.      exclude this interrupt.
  814.  
  815.   ╖  If the modem seems to work only really, really slowly, this is an
  816.      almost certain indicator of an interrupt conflict.
  817.  
  818.   ╖  Make sure your problem is really a PCMCIA one.  It may help to see
  819.      if the card works under DOS with the vendor's drivers.  Also, don't
  820.      test the card with something complex like SLIP until you are sure
  821.      you can make simple connections.  If simple things work but SLIP
  822.      does not, your problem is most likely with SLIP, not with PCMCIA.
  823.  
  824.   4.2.  Why doesn't my ethernet card work?
  825.  
  826.   Here's another quick troubleshooting guide.
  827.  
  828.   ╖  Is your card recognized as an ethernet card?  Check
  829.      /usr/adm/messages and make sure that cardmgr identifies the card
  830.      correctly and starts up one of the network drivers.  If it doesn't,
  831.      your card might still be usable if it is compatible with a
  832.      supported card.  This will be most easily done if the card claims
  833.      to be "NE2000 compatible".
  834.  
  835.   ╖  Is the card configured properly?  If you are using a supported
  836.      card, and it was recognized by cardmgr, but still doesn't work,
  837.      there might be an interrupt or port conflict with another device.
  838.      Find out what resources the card is using (from /usr/adm/messages),
  839.      and try excluding these in /etc/pcmcia/config.opts to force the
  840.      card to use something different.
  841.  
  842.   ╖  If your card seems to be configured properly, but sometimes locks
  843.      up, particularly under high load, you may need to try changing your
  844.      socket driver timing parameters.  See section ``2.3'' for more
  845.      information.
  846.  
  847.   ╖  Make sure your problem is really a PCMCIA one.  It may help to see
  848.      see if the card works under DOS with the vendor's drivers.  Double
  849.      check your modifications to the /etc/pcmcia/network.opts script.
  850.      Make sure your drop cable, ``T'' jack, terminator, etc are working.
  851.  
  852.   Here are some comments about specific cards:
  853.  
  854.   ╖  With Socket EA and 3Com 3c589 cards, you need to pick the
  855.      transceiver type (10base2, 10baseT, AUI) when the driver module is
  856.      loaded.  Make sure that the transceiver type reported in
  857.      /usr/adm/messages matches your connection.
  858.  
  859.   ╖  The Farallon EtherWave is actually based on the 3Com 3c589, with a
  860.      special transceiver.  Though the EtherWave uses 10baseT-style
  861.      connections, its transceiver requires that the 3c589 be configured
  862.      in 10base2 mode.
  863.  
  864.   ╖  If you have trouble with an IBM CCAE, NE4100, Thomas Conrad, or
  865.      Kingston adapter, try increasing the memory access time with the
  866.      mem_speed=# option to the pcnet_cs module definition.  Try speeds
  867.      of up to 1000 (in nanoseconds).
  868.  
  869.   ╖  For the New Media Ethernet adapter, on some systems, it may be
  870.      necessary to increase the IO port access time with the io_speed=#
  871.      option when the pcmcia_core module is loaded.  Edit CORE_OPTS in
  872.      /etc/rc.d/rc.pcmcia to set this option.
  873.  
  874.   ╖  The New Media Ethernet driver has a bug that causes connections to
  875.      slow down severely over time.  Currently, there is no fix for this
  876.      bug.
  877.  
  878.   4.3.  How do I select the transceiver type for my 3c589 card?
  879.  
  880.   It would be nice if the driver could autodetect the difference between
  881.   a 10baseT and a 10base2 connection, but I don't know how to do that.
  882.   For now, you need to edit /etc/pcmcia/config and add an if_port=#
  883.   option to the 3c589_cs module definition.  Check the tc589_cs man page
  884.   for more details, but to select 10base2 (also known as BNC, or thin
  885.   net, or coax), change:
  886.  
  887.        module "3c589_cs"
  888.  
  889.   to:
  890.  
  891.        module "3c589_cs" opts "if_port=3"
  892.  
  893.   4.4.  How do I add support for an NE2000-compatible ethernet card?
  894.  
  895.   First, see if the card is already recognized by cardmgr.  Some cards
  896.   not listed in SUPPORTED.CARDS are actually OEM versions of cards that
  897.   are supported.  If you find a card like this, let me know so I can add
  898.   it to the list.
  899.  
  900.   If your card is not recognized, follow the instructions in section
  901.   ``3.6'' to create a config entry for your card, but bind the card to
  902.   the memory card driver, pcmem_cs for now.  Restart cardmgr to use the
  903.   new updated config file.
  904.  
  905.   You will need to know your card's hardware ethernet address.  This
  906.   address is a series of six two-digit hex numbers, often printed on the
  907.   card itself.  If it is not printed on the card, you may be able to use
  908.   a DOS driver to display the address.  In any case, once you know it,
  909.   run:
  910.  
  911.        dd if=/dev/pcmem0a count=20 | od -Ax -t x1
  912.  
  913.   and search the output for your address.  Record the hex offset of the
  914.   first byte of the address.  Now, edit modules/pcnet_cs.c and find the
  915.   hw_info structure.  You'll need to create a new entry for your card.
  916.   The first field is a descriptive name.  The next field is the offset
  917.   multiplied by two.  The next three fields are the first three bytes of
  918.   the hardware address.  The final field contains some flags for
  919.   specific card features; to start, try setting it to 0.
  920.  
  921.   After editing pcnet_cs.c, compile and install the new module.  Edit
  922.   /etc/pcmcia/config again, and change the card binding from pcmem_cs to
  923.   pcnet_cs.  Follow the instructions for reloading the config file, and
  924.   you should be all set.  Please send me copies of your new hw_info and
  925.   config entries.
  926.  
  927.   If you can't find your card's hardware address in the hex dump, as a
  928.   method of last resort, it is possible to ``hardwire'' the address when
  929.   the pcnet_cs module is initialized.  Edit /etc/pcmcia/config and add a
  930.   hw_addr= option, like so:
  931.  
  932.        module "pcnet_cs" opts "hw_addr=0x00,0x80,0xc8,0x01,0x02,0x03"
  933.  
  934.   Substitute your own card's hardware address in the appropriate spot,
  935.   of course.
  936.  
  937.   4.5.  How do I use my PCMCIA floppy interface?
  938.  
  939.   The PCMCIA floppy interface used in the Compaq Aero and a few other
  940.   laptops is not yet supported by this package.  If your laptop can
  941.   initialize this card before Linux boots, you should be able to use it
  942.   by telling Card Services to ignore that socket.  Note that you will
  943.   not be able to hot swap this card.
  944.  
  945.   The snag in supporting the Aero floppy is that the Aero seems to use a
  946.   proprietary PCMCIA controller to support DMA to the floppy.  Without
  947.   knowing exactly how this is done, there isn't any way to implement
  948.   support under Linux.
  949.  
  950.   To configure Card Services to ignore a socket, use the ignore=#
  951.   parameter when you load the i82365 or tcic driver.  See the man pages
  952.   for more details.
  953.  
  954.   4.6.  What's up with support for Xircom cards?
  955.  
  956.   Xircom does not share technical information about its cards without a
  957.   non-disclosure agreement.  This means that it is not really possible
  958.   to develop freely distributable drivers for Xircom cards without doing
  959.   legally dubious things like reverse engineering DOS drivers.
  960.  
  961.   There is some indication that Xircom may start supporting Linux
  962.   directly.  Xircom tech support says that future products will include
  963.   Linux drivers.  Their plans for older Xircom products are less clear.
  964.  
  965.   The Xircom CreditCard Ethernet+Modem II card can be used as a modem
  966.   under Linux, with no special configuration.
  967.  
  968.   5.  Debugging tips and programming information
  969.  
  970.   5.1.  How can I submit a helpful bug report?
  971.  
  972.   Here are some things that should be included in all bug reports:
  973.  
  974.   ╖  Your system type, and the output of the probe command
  975.  
  976.   ╖  What PCMCIA cards you are using
  977.  
  978.   ╖  Your Linux kernel version, and PCMCIA version
  979.  
  980.   ╖  The contents of the config.out file
  981.  
  982.   ╖  Any changes you've made to the startup files in /etc/pcmcia, or to
  983.      rc.pcmcia
  984.   ╖  Contents of /usr/adm/messages, even if you don't see anything that
  985.      looks interesting.
  986.  
  987.   If your problem involves a kernel fault, the register dump from the
  988.   fault is only useful if you can track down the fault address, EIP.  If
  989.   it is in the main kernel, look up the address in System.map to
  990.   identify the function at fault.  If the fault is in a loadable module,
  991.   it is a bit harder to trace.  With the current module tools, ``ksyms
  992.   -m'' will report the base address of each loadable module.  Pick the
  993.   module that contains the EIP address, and subtract its base address
  994.   from EIP to get an offset inside that module.  Then, run gdb on that
  995.   module, and look up the offset with the list command.  This will only
  996.   work if you've compiled that module with -g to include debugging
  997.   information.
  998.  
  999.   Send bug reports to dhinds@allegro.stanford.edu.  I prefer to handle
  1000.   bug reports by email -- please avoid calling me at home or at work.
  1001.   You can also submit bug reports via the WWW: see
  1002.   http://hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html for details.
  1003.  
  1004.   5.2.  Low level PCMCIA debugging aids
  1005.  
  1006.   The PCMCIA modules contain a lot of conditionally-compiled debugging
  1007.   code.  Most of this code is under control of the PCMCIA_DEBUG
  1008.   preprocessor define.  If this is undefined, debugging code will not be
  1009.   compiled.  If set to 0, the code is compiled but inactive.  Larger
  1010.   numbers specify increasing levels of verbosity.  Each module built
  1011.   with PCMCIA_DEBUG defined will have an integer parameter, pc_debug,
  1012.   that controls the verbosity of its output.  This can be adjusted when
  1013.   the module is loaded, so output can be controlled on a per-module
  1014.   basis without recompiling.
  1015.  
  1016.   There are a few debugging tools in the debug_tools/ subdirectory of
  1017.   the PCMCIA distribution.  The dump_tcic and dump_i365 utilities
  1018.   generate complete register dumps of the PCMCIA controllers, and decode
  1019.   a lot of the register information.  They are most useful if you have
  1020.   access to a datasheet for the corresponding controller chip.  The
  1021.   dump_tuples utility lists a card's CIS (Card Information Structure),
  1022.   and decodes some of the important bits.  And the dump_cisreg utility
  1023.   displays a card's local configuration registers.
  1024.  
  1025.   The pcmem_cs memory card driver is also sometimes useful for
  1026.   debugging.  It can be bound to any PCMCIA card, and does not interfere
  1027.   with other drivers.  It can be used to directly access any card's
  1028.   attribute memory or common memory.
  1029.  
  1030.   5.3.  How do I write a Card Services driver for card X?
  1031.  
  1032.   The Linux PCMCIA Programmer's Guide is the best documentation for the
  1033.   Linux PCMCIA interface.  The latest version is always available from
  1034.   cb-iris.stanford.edu in /pub/pcmcia/doc.
  1035.  
  1036.   For devices that are close relatives of normal ISA devices, you'll
  1037.   probably be able to use parts of existing Linux drivers.  In some
  1038.   cases, the biggest stumbling block will be modifying an existing
  1039.   driver so that it can handle adding and removing devices after boot
  1040.   time.  Of the current drivers, the memory card driver is the only
  1041.   ``self-contained'' driver that does not depend on other parts of the
  1042.   Linux kernel to do most of the dirty work.
  1043.  
  1044.   I've written a skeleton driver with lots of comments that explains a
  1045.   lot of how a driver communicates with Card Services; you'll find this
  1046.   in the PCMCIA source distribution in modules/skeleton.c.
  1047.  
  1048.