Linux Driver Setup Guide for the CB31U
                                              31 / Oct. / 2001
                                             RATOC Systems,Inc. 
----------------------------------------------------------------

This document contains the instructions to set up the CB31U on 
RedHat 7.1.
If you use on the kernel 2.2.x, refer to README-E1-cb31. 


The version of Kernel/PCMCIA-CS on RedHat Linux 7.1
    Kernel version 2.4.2-2
    PCMCIA-CS version 3.1.22 (built-in)


Login as ROOT before setting up the CB31U.

 [ src ]     - source file for driver module of the CB31U
 [ samples ] - sample of header, setting files
               [2.2.x] folder is for kernel 2.2.x
               [2.4.x] folder is for kernel 2.4.x

---------------------------------------------------------------------
  Instructions for registering driver of the CB31U on RedHat 7.1
---------------------------------------------------------------------

Step1: Copying driver source file(cb31_cb.c)


     Go to scsi/pcmcia directory.
   
    #  cd /usr/src/linux-2.4.2/drivers/scsi/pcmcia


    Copy the source file(cb31main.c) to PCMCIA client's directory as follows.

    #  cp /root/cb31/src/*  .

    There are five files copyed as follows:
      cb31main.c, cb31main.h, cb31main.c, cb31main.h, ascmcode.c


Step2: Editing Makefile


    Edit Makefile as follows

      obj-$(CONFIG_PCMCIA_CB31_CB) += cb31_cb.o

    Add cb31_cb.o to list-multi.

      list-multi := qlogic_cs.o fdomain_cs.o aha152x_cs.o apa1480_cb.o cb31_cb.o

    Add object file statement for the CB31.

      cb31_cb-objs := cb31main.o ascmcode.o

      cb31_cb-objs : $(cb31_cb-objs)
           $(LD) -r -o $@ $(cb31_cb-objs)

    Refer to Makefile on [samples/2.4.x] directory.


Step3: Editing Config.in


    Add the following line after "dep_tristate '  Qlogic PCMCIA support .... ".

     'RATOC CB31 CardBus support' CONFIG_PCMCIA_CB31_CB m

    Add the following line in the middle of

      "if [ "$CONFIG_PCMCIA_QLOGIC"... "$CONFIG_PCMCIA_NINJA_SCSI" = "y" ]".


     "$CONFIG_PCMCIA_CB31_CB"="y" = 0

    Refer to Config.in on [samples/2.4.x].


Step4: Setup kernel


  (1) Execute menuconfig

    # cd /usr/src/linux-2.4.2
    # make manuconfig

    [ Linux kernel vx.x.x Configuration ... ] screen starts up.
    Select [SCSI Support -> ] from the main menu.
    Select [PCMCIA SCSI adapter support] from SCSI Support.
    Move the cursor to [ < > PCMCIA SCSI adapter support ].
    Press the space bar to change the < > to <*> so that built-in is set.
    And also move the cursor to [ < > RATOC CB31 CardBus support ].
    Press the space bar to change the < > to <M>.
    Press [ Exit ] to go back window until [ Do you wish to save your
    new kernel configuration ? ] screen shows up. Select <yes> and finish
    menuconfig.


  (2) Create module

    # make dep
    # make modules
    # make modules_install

    Created module (cb31_cb.o) will be copied to /lib/modules/2.4.2/pcmcia.


Step5: Restart the system

     # reboot


* Confirmation

   If the PCMCIA modules are loaded properly, 
   you will see the message below.

   kernel:   got res[d800:d8ff] for resource 0 of PCI device 1195:0851
   kernel: PCI: Failed to allocate resource 1 for PCI device 1195:0851
   kernel: PCI: Failed to allocate resource 6 for PCI device 1195:0851
   kernel: PCI: Enabling device 03:00.0 (0200 -> 0203)
   kernel: PCI: Setting latency timer of device 07:00.0 to 64
   kernel: cb31_cb: Total Adapters = 1


   If the CB31U is not recognized properly, please refer to /var/log/messages.


* Removal of CB31U

   The driver, cb31_cb.o does not support automatic unloading.
   You must unload the driver manually after removing CB31U.
     * Only in Turbolinux 7, it automaticly unload the driver.

    (1) Unmount the drive that mounted by the CB31U.
     For example, when /dev/sda is mounted, inputs the command as follows.

      # umount  /dev/sda

    (2) Remove the CB31U.

    (3) Unload the cb31_cb.o  with the rmmod command as follows.

      # rmmod cb31_cb

       * File extension (.o) does not necessary to be added.


* Other distributions

  Kondara MNU/Linux 2.0

    Install the driver of CB31U in the same procedure as RedHat7.1.

  Turbolinux 7

     PCMCIA module of REDHat 7.1 or Kondara MNU/Linux 2.0 is built-in
     the kernel. But, PCMCIA module of Turbolinux 7 is not built-in 
     the kernel.
     So, you must build the kernel to build in the PCMCIA module.
     Please follow the steps.

     In the 'make menuconfig', you set up PCMCIA/CardBus support as follows.
     Select the [General Setup -- >] of Mainmenu.
     Select the [ PCMCIA/CardBus support --> ]  of General Setup.
     Move the cursor to [ < > PCMCIA/CardBus support ].
     Press the space bar to change the < > to <*> so that built-in is set.
     And also move the cursor to [ [ ] CardBus support (NEW)  ].
     Press the space bar to change the [ ] to [*] so that built-in is set.

     After 'make menuconfig', you build the new kernel by 'make dep',
     'make bzImage'.
     And set up lilo for the new kernel which is built-in PCMCIA module.

     Install the driver of CB31U in the same procedure as RedHat7.1.


* Note

   When the CB31U stops during access to scsi device and display the error
   message 'cb31_abort: PCIERR' or  'cb31_reset: PCIERR', change the setting
   of PCI Burst OFF by the ascconf utility.

/END
