=============================================================================
	     ADVANTECH CAN comunication cards Linux device driver
		        Installation & Program Guide
	           Copyright (C) 2006, ADVANTECH Co, Ltd.
=============================================================================
Contents

1. Introduction
2. Installation
3. Configure device
4. How to test the driver
5. User space program for this driver

-----------------------------------------------------------------------------
1. Introduction
   
   ADVANTECH CAN comunication cards device driver, Ver. 2.6,
   it is a migration from can4linux 3.4 and compatibale with can4linux 3.4,
   the application for can4linux driver can run on advcan driver without any modification.

   now it supports following boards.
    
    - PCI-1680	   : 2 port Isolated PCI CAN-bus Card.
    - MIC-3680	   : 2 port Isolated PCI CAN-bus Card.
    - UNO-2052(E)  : 2 port Isolated UNO-2052(E) onboard PCI CAN device
    - PCM-3680	   : 2 port Isolated PC/104 CAN-bus Card.
	 
   In ADVANTECH's ftp sites, you may always find latest driver at
   ftp://ftp.ADVANTECH.com  or ftp://ftp.ADVANTECH.com.tw.

   This version of driver can be installed as Loadable Module (Module driver).
   Before you install the driver, please refer to hardware installation 
   procedure in the User's Manual.

2. Installation

   2.1 Hardware installation

       Just install the card into your computer, please refer to hardware
       installation procedure in the User's Manual.
       (if in UNO2052(E),this step does not need)       

   2.2 Login as 'root' before executing the following instructions.

   2.3 Uncompress driver

   	2.3.1 # tar zxvf advcan_vM_NN_suse9_2.tar.gz
   	2.3.2 # cd advcan_vM_NN_suse9_2/driver
    
   2.4 Install driver module
   
   	2.4.1 Go to the /driver directory

   	2.4.2 # make install    //install driver advcan.ko
                           
	2.4.4 # make nodes	//create device nodes
	
   	2.4.3 uninstall driver
         # make uninstall  // move the installed driver module and node in /dev
         
3.  Configure device
    The driver itself is highly configurable using the /proc interface of the LINUX kernel. 
    3.1 The following listing shows a typical configuration with four boards: 
	$ grep . /proc/sys/Can/*
	/proc/sys/Can/AccCode:  -1       -1      -1      -1      -1       -1      -1      -1
	/proc/sys/Can/AccMask:  -1       -1      -1      -1      -1       -1      -1      -1
	/proc/sys/Can/Base:     800      672     832     896     684      696     856     872
	/proc/sys/Can/Baud:     125      125     125     250     125      125     125     250
	/proc/sys/Can/Chipset:  SJA1000
	/proc/sys/Can/IOModel:  pppppppp
	/proc/sys/Can/IRQ:      5        7       3       5       5       7       3       5
	/proc/sys/Can/Outc:     250      250     250     0       250     250     250     0
	/proc/sys/Can/Overrun:  0        0       0       0       0       0       0       0
	/proc/sys/Can/RxErr:    0        0       0       0       0       0       0       0
	/proc/sys/Can/Timeout:  100      100     100     100     100     100     100     100
	/proc/sys/Can/TxErr:    0        0       0       0       0       0       0       0
	/proc/sys/Can/dbgMask:  0
	/proc/sys/Can/version:  advcan-2.6
	
    3.2 The following sections are describing the configuration entries.
    	They can be specified in advisa.conf or advpci.conf under ./etc directory. 
	1. AccCode/AccMask 
	    contents of the message acceptance mask and acceptance code registers of 
	    82x200/SJA1000 compatible CAN controllers (see can_ioctl()). 
	2. Base 
	    CAN controllers base address for each board. Depending of the IOModel 
	    entry that can be a memory or I/O address. (don't modify it if device is  
	    PCI boards) 
	3. Baud 
	    used bit rate for this board in Kbit/s 
	4. Chipset 
	    name of the supported CAN chip used with this boards Read only for this version. 
	5. IOModel 
	    one letter for each port. Read-only. Read the CAN register access model. 
	    The following models are currently supported: 
		m - memory access, the registers are directly mapped into memory(PCM-3680) 
		p - port I/O, 80x86 specific I/O address range (PCI-1680,MIC-3680,UNO-2052(E) ) 
	6. IRQ 
	    used IRQ numbers, one value for each board. (don't modify it if device is  PCI boards) 
	7. Outc
	    value of the output control register of the CAN controller.
	8. Overrun 
	    counter for overrun conditions in the CAN controller 
	9. RxErr 
	    counter for CAN controller rx error conditions 
	10. Timeout 
	     time out value for waiting for a successful transmission 
	11. TxErr 
	     counter for CAN controller tx error conditions 
	12. version 
	read only entry containing the drivers version number 

    3.3 load host specific CAN configuration
    	For initially writing these sysctl entries after loading the driver (or at any time) a 
        shell script utility does exist. It uses a board configuration file that is written 
        over /proc/sys/Can . 
		# utils/cansetup etc/advpci.conf
	or, for isa device,
		# utils/cansetup etc/advisa.conf
	Note: *.conf files are located in the etc/ directory.

4. How to test the driver
   Change to ../example and check with "readme" for details.
              
5. User space program for this driver   
   5.1 Include file
   	  To program for this driver, the user must include the 
   	  "can4linux.h" head file. You also can copy this head 
   	  file to your owner work dirctory and include it. For 
   	  more details please refer to ../Advcan Manual.
   5.2 other information
        please view the example
