			    AIC7xxx Driver for Linux

Introduction
----------------------------
The AIC7xxx SCSI driver adds support for Adaptec (http://www.adaptec.com)
SCSI controllers and chipsets. Major portions of the driver and driver
development are shared between both Linux and FreeBSD. Support for the
AIC-7xxx chipsets have been in the default Linux kernel since approximately
linux-1.1.x and fairly stable since linux-1.2.x, and are also in FreeBSD
2.1.0 or later.

  Supported cards/chipsets
  ----------------------------
    Adaptec Cards
    ----------------------------
    AHA-274x
    AHA-274xT               
    AHA-2842
    AHA-2910B               
    AHA-2940               
    AHA-2940W              
    AHA-2940U              
    AHA-2940UW
    AHA-2940AU             
    AHA-2944D              
    AHA-2944WD
    AHA-2944UD
    AHA-2944UWD
    AHA-3940
    AHA-3940U
    AHA-3940W
    AHA-3940UW
    AHA-3985
    AHA-3985U
    AHA-3985W
    AHA-3985UW

    Motherboard Chipsets
    ----------------------------
    AIC-777x   
    AIC-785x
    AIC-786x
    AIC-787x
    AIC-788x
    AIC-7895

    Bus Types
    ----------------------------
    W - Wide SCSI, SCSI-3, 16bit bus, 68pin connector, will also support
        SCSI-1/SCSI-2 50pin devices, transfer rates up to 20MB/s.
    U - Ultra SCSI, transfer rates up to 40MB/s.
    D - Differential SCSI.
    T - Twin Channel SCSI. Up to 14 SCSI devices.

    AHA-274x - EISA SCSI controller
    AHA-284x - VLB SCSI controller
    AHA-29xx - PCI SCSI controller
    AHA-394x - PCI controllers with two separate SCSI controllers on-board.
    AHA-398x - PCI RAID controllers with three separate SCSI controllers
               on-board.

    NOTE: The AHA-2920 is NOT an AIC-7xxx based controller, and is not
          handled by this driver.

  People
  ------------------------------
    Justin T Gibbs  gibbs@plutotech.com
      (BSD Driver Author)
    Dan Eischen     deischen@iworks.InterWorks.org
      (Original Linux Driver Co-maintainer)
    Dean Gehnert    deang@teleport.com
      (Original Linux FTP/patch maintainer)
    Jess Johnson    jester@frenzy.com
      (AIC7xxx FAQ author)
    Doug Ledford    dledford@dialnet.net
      (Current Linux aic7xxx-5.x.x Driver/Patch/FTP/FAQ maintainer)
    
    Special thanks go to John Aycock (aycock@cpsc.ucalgary.ca), the original
    author of the driver. John has since retired from the project. Thanks
    again for all his work!
    
  Mailing list
  ------------------------------
    There is a mailing list available for users who want to track development
    and converse with other users and developers. This list is for both
    FreeBSD and Linux support of the AIC7xxx chipsets.

    To subscribe to the AIC7xxx mailing list send mail to the list server,
    with "subscribe AIC7xxx" in the body (no Subject: required):
        To: majordomo@FreeBSD.ORG
        ---
        subscribe AIC7xxx

    To unsubscribe from the list, send mail to the list server with:
        To: majordomo@FreeBSD.ORG
        ---
        unsubscribe AIC7xxx

    Send regular messages and replies to: AIC7xxx@FreeBSD.ORG
    
  Boot Command line options
  ------------------------------
    "aic7xxx=reverse_scan" - Have the driver register the SCSI cards in the
        reverse of the normal order.  This may help those people who have more
        than one PCI Adaptec controller force the correct controller to be
        scsi0 under linux so that their boot hard drive is also sda under
        linux
    "aic7xxx=extended" - Force the driver to detect extended drive translation
        on your controller.  This helps those people who have cards without
        a SEEPROM make sure that linux and all other operating systems think
        the same way about your hard drives.
    "aic7xxx=irq_trigger:x" - Replace x with either 0 or 1 to force the kernel
        to use the correct IRQ type for your card.  This only applies to EISA
        based controllers.  On these controllers, 0 is for Edge triggered
        interrupts, and 1 is for Level triggered interrupts.  If you aren't
        sure or don't know which IRQ trigger type your EISA card uses, then
        let the kernel autodetect the trigger type.
    "aic7xxx=verbose" - This option can be used in one of two ways.  If you
        simply specify aic7xxx=verbose, then the kernel will automatically pick
        the default set of verbose messages for you to see.  Alternatively, you
        can specify the command as "aic7xxx=verbose:0xXXXX" where the X entries
        are replaced with hexadecimal digits.  This option is a bit field type
        option.  For a full listing of the available options, search for the
        #define VERBOSE_xxxxxx lines in the aic7xxx.c file.  If you want verbose
        messages, then it is recommended that you simply use the aic7xxx=verbose
        variant of this command.
    "aic7xxx=7895_irq_hack:x" - This option enables some work around code to
        fix a bug in the Tyan Thunder II motherboard BIOS.  The BIOS
        incorrectly sets the IRQs on the two channels of the 7895 to two
        different values even though the motherboard hardware doesn't support
        this mode of operation.  The valid values for x are: 0 to force
        both channels to use the IRQ assigned to Channel A, 1 to force both
        channels to use the IRQ assigned to Channel B, and -1 will disable
        this horrible abomination of a hack.  The default is disabled (-1).
    "aic7xxx=pci_parity:x" - This option controls whether or not the driver
        enables PCI parity error checking on the PCI bus.  By default, this
        checking is disabled.  To enable the checks, simply specify pci_parity
        with no value afterwords.  To reverse the parity from even to odd,
        supply any number other than 0 or 255.  In short:
          pci_parity     - Even parity checking (even is the normal PCI parity)
          pci_parity:x   - Where x > 0, Odd parity checking
          pci_parity:0   - No check (default)
        NOTE: In order to get Even PCI parity checking, you must use the
        version of the option that does not include the : and a number at
        the end (unless you want to enter exactly 2^32 - 1 as the number).
    "aic7xxx=tag_info:{{8,8..},{8,8..},..}" - This option is used to enable
        tagged queueing on specific devices.  As of driver version 5.0.6, we
        now globally enable tagged queueing by default, but we also disable
        tagged queueing on all individual devices by default.  In order to
        enable tagged queueing for certian devices at boot time, a user may
        use this boot param.  The driver will then parse this message out
        and enable the specific device entries that are present based upon
        the value given.  The param line is parsed in the following manner:

          { - first instance indicates the start of this parameter values
              second instance is the start of entries for a particular
              device entry
          } - end the entries for a particular host adapter, or end the entire
              set of parameter entries
          , - move to next entry.  Inside of a set of device entries, this
              moves us to the next device on the list.  Outside of device
              entries, this moves us to the next host adapter
          . - Same effect as , but is safe to use with insmod.
          x - the number to enter into the array at this position.  
              0 = Enable tagged queueing on this device and use the default
                  queue depth
              1-254 = Enable tagged queueing on this device and use this
                      number as the queue depth
              255 = Disable tagged queueing on this device.
              Note: anything above 32 for an actual queue depth is wasteful
                    and not recommended.

        A few examples of how this can be used:

        tag_info:{{8,12,,0,,255,4}}
          This line will only effect the first aic7xxx card registered.  It
          will set scsi id 0 to a queue depth of 8, id 1 to 12, leave id 2
          at the default, set id 3 to tagged queueing enabled and use the
          default queue depth, id 4 default, id 5 disabled, and id 6 to 4.
          Any not specified entries stay at the default value, repeated
          commas with no value specified will simply increment to the next id
          without changing anything for the missing values.

        tag_info:{{8,8},,{8,8}}
          First adapter, scsi id 0 to 8, id 1 to 8, remainder stay at their
          default.  Second adapter stays entirely at default.  Third
          adapter, id 0 to 8, id 1 to 8, remainder at default (identical to
          first adapter).

        tag_info:{,,,{,,,64}}
          First, second, and third adapters at default values.  Fourth
          adapter, id 3 to 64.  Notice that leading commas simply increment
          what the first number effects, and there are no need for trailing
          commas.  When you close out an adapter, or the entire entry,
          anything not explicitly set stays at the default value.

        A final note on this option.  The scanner I used for this isn't
        perfect or highly robust.  If you mess the line up, the worst that
        should happen is that the line will get ignored.  If you don't
        close out the entire entry with the final bracket, then any other
        aic7xxx options after this will get ignored.  So, in general, be
        sure of what you are entering, and after you have it right, just
        add it to the lilo.conf file so there won't be any mistakes.  As
        a means of checking this parser, the entire tag_info array for
        each card is now printed out in the /proc/scsi/aic7xxx/x file.  You
        can use that to verify that your options were parsed correctly. 
        
    Boot command line options may be combined to form the proper set of options
    a user might need.  For example, the following is valid:
    
    aic7xxx=verbose,extended,irq_trigger:1
    
    The only requirement is that individual options be separated by a comma on
    the command line.
        
  Module Loading command options
  ------------------------------
    When loading the aic7xxx driver as a module, the exact same options are
    available to the user.  However, the syntax to specify the options changes
    slightly.  For insmod, you need to wrap the aic7xxx= argument in quotes
    and replace all ',' with '.'.  So, for example, a valid insmod line
    would be:

    insmod aic7xxx aic7xxx='verbose.irq_trigger:1.extended'

    This line should result in the *exact* same behaviour as if you typed
    it in at the lilo prompt and the driver was compiled into the kernel
    instead of being a module.  The reason for the single quote is so that
    the shell won't try to interpret anything in the line, such as {. 
    Insmod assumes any options starting with a letter instead of a number
    is a character string (which is what we want) and by switching all of
    the commas to periods, insmod won't interpret this as more than one
    string and write junk into our binary image.  I consider it a bug in
    the insmod program that even if you wrap your string in quotes (quotes
    that pass the shell mind you and that insmod sees) it still treates
    a comma inside of those quotes as starting a new variable, resulting
    in memory scribbles if you don't switch the commas to periods.


  Kernel Compile options
  ------------------------------
    The various kernel compile time options for this driver are now fairly
    well documented in the file Documentation/Configure.help.  In order to
    see this documentation, you need to use one of the advanced configuration
    programs (menuconfig and xconfig).  If you are using the "make menuconfig"
    method of configuring your kernel, then you would simply highlight the
    option in question and hit the F1 key.  If you are using the "make xconfig"
    method of configuring your kernel, then simply click on the help button next
    to the option you have questions about.  The help information from the
    Configure.help file will then get automatically displayed.

  /proc support
  ------------------------------
    The /proc support for the AIC7xxx can be found in the /proc/scsi/aic7xxx/
    directory. That directory contains a file for each SCSI controller in
    the system. Each file presents the current configuration and transfer
    statistics (enabled with #define in aic7xxx.c) for each controller.

    Thanks to Michael Neuffer for for his upper-level SCSI help, and
    Matthew Jacob for statistics support.

  FTP sites
  ------------------------------
    ftp://ftp.dialnet.net/pub/linux/aic7xxx/
      - Primary site for Doug Ledford developed driver releases
      - US Linux mirror of Teleport site
    ftp://ftp.pcnet.com/users/eischen/Linux/
      - Dan Eischen's driver distribution area
    ftp://ekf2.vsb.cz/pub/linux/kernel/aic7xxx/ftp.teleport.com/
      - European Linux mirror of Teleport site


Dean W. Gehnert
deang@teleport.com

$Revision: 3.0 $

Modified by Doug Ledford 1998
