This is a subset of the documentation. To use this driver you MUST have the full package from: Internet: ========= ftp.ucsd.edu:/hamradio/packet/tcpip/incoming/z8530drv-1.8.dl1bke.tar.gz and various mirrors (i.e. nic.switch.ch) AX.25 BBS ========= UNIX @ DB0ACH.#NRW.DEU.EU, subject: Z8530D18.Pxx/Pyy (AX.25 call: DB0ACH-8) and various BBS that received the file through AUTO7P or 7PSERV with the filename Z8530D18.TGZ --------------------------------------------------------------------------- !! Version 1.8 !! !! Deutscher Text siehe scc_ger.doc !! !! perhaps somebody could correct the English documentation (grammar, !! spelling)? !! !! BTW: REAL programmers don't document... !! SCC.C - Linux driver for Z8530 based HDLC cards for AX.25 ******************************************************************** (c) 1994 by Joerg Reuter DL1BKE portions (c) 1994 Hans Alblas PE1AYX and (c) 1993 Guido ten Dolle PE1NNZ for the complete copyright notice see >> Copying.Z8530DRV << ******************************************************************** 0. Installation of the package ============================== Run SCC-Install. If one (or more) of the patches fails PLEASE consult chapter 2 (and READ IT of course!) 1. Initialization and attachment of the channels ================================================ To use the driver, 3 steps must be performed: 1. Global initialization of the driver in the kernel 2. Setup of parameters with sccinit 2. Attachment of each channel in the packet software The global initialization is needed to reset all SCCs and to install a common interrupt handler. Also, the hardware addresses of the chips are defined in this step. In the second step, each channel is set up for the intended use. 1.1. Initialization =================== Initialization of the hardware is performed by setting the defines and variables in the file "/linux/drivers/char/scc_config.h". You can change a number of parameters. ################################################################################################ # For OptoSCC card e.g: # int Nchips = 2 ; /* number of chips */ io_port Vector_Latch = 0x168 ; /* addr. of INTACK-Latch (0 for poll mode) */ int Ivec = 9 ; /* interrupt vector */ long Clock = 4915200 ; /* frequency of the scc clock */ char Pclk = 1 ; /* use PCLK (1) or RTxC (0) */ char Board = PA0HZP ; /* what type of SCC card do you use? */ int Option = 0 ; /* command for extra hardware */ io_port Special_Port = 0 ; /* port address for special hardware */ /* (for EAGLE, PC100, PRIMUS, DRSI) */ /* ^ never remove the semicolon !! */ /* Channel A B Chip */ /* ============ ======== */ /* Control ports: */ io_port SCC_ctrl[MAXSCC * 2] = {0x152, 0x150, /* ...one... */ 0x156, 0x154, /* ...two... */ 0, 0, /* ...three... */ 0, 0}; /* ...four... */ /* Data ports: */ io_port SCC_data[MAXSCC * 2] = {0x153, 0x151, /* ...one... */ 0x157, 0x155, /* ...two... */ 0, 0, /* ...three... */ 0, 0}; /* ...four... */ /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */ /* Chip */ /* ======== */ int SCC_Enhanced[MAXSCC] = {0, /* ...one... */ 0, /* ...two... */ 0, /* ...three... */ 0}; /* ...four... */ /* some useful #defines. You might need them or not */ #define VERBOSE_BOOTMSG 1 #undef SCC_DELAY /* perhaps a 486DX2 is a *bit* too fast */ #undef SCC_LDELAY /* slow it even a bit more down */ #undef DONT_CHECK /* don't look if the SCCs you specified are available */ /*********** END OF CONFIGURATION PARAMETERS ********************************************/ ################################################################################################ # For Baycom (U)SCC card e.g: # int Nchips = 2 ; /* number of chips */ io_port Vector_Latch = 0 ; /* addr. of INTACK-Latch (0 for poll mode) */ int Ivec = 7 ; /* interrupt vector */ long Clock = 4915200 ; /* frequency of the scc clock */ char Board = BAYCOM ; /* what type of SCC card do you use? */ int Option = 0 ; /* command for extra hardware */ io_port Special_Port = 0 ; /* port address for special hardware */ /* (for EAGLE, PC100, PRIMUS, DRSI) */ /* ^ never remove the semicolon !! */ /* Channel A B Chip */ /* ============ ======== */ /* Control ports: */ io_port SCC_ctrl[MAXSCC * 2] = {0x304, 0x305, /* ...one... */ 0x306, 0x307, /* ...two... */ 0, 0, /* ...three... */ 0, 0}; /* ...four... */ /* Data ports: */ io_port SCC_data[MAXSCC * 2] = {0x300, 0x301, /* ...one... */ 0x302, 0x303, /* ...two... */ 0, 0, /* ...three... */ 0, 0}; /* ...four... */ /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */ /* Chip */ /* ======== */ int SCC_Enhanced[MAXSCC] = {0, /* ...one... */ 0, /* ...two... */ 0, /* ...three... */ 0}; /* ...four... */ /* some useful #defines. You might need them or not */ #define VERBOSE_BOOTMSG 1 #undef SCC_DELAY /* perhaps a 486DX2 is a *bit* too fast */ #undef SCC_LDELAY /* slow it even a bit more down */ #undef DONT_CHECK /* don't look if the SCCs you specified are available */ After you changed a parameter you have to recompile a new kernel image file. The channel number ranges from 0 to (2 * Nchips) - 1, where Nchips is the number of chips. The crystal clock is specified as 4.9152 MHz. Other frequencies can be used, and this parameter should be adjusted accordingly. You can define your scc type with Board SCC type value --------------------------------- PA0HZP SCC card PA0HZP EAGLE card EAGLE PC100 card PC100 PRIMUS-PC (DG9BL) card PRIMUS BayCom (U)SCC card BAYCOM NOTE: ===== If you only know the parameters for the PE1CHL driver for DOS, run gencfg. It will generate the correct port addresses (I hope). Its parameters are exactly the same as the ones you use with the "attach scc" command in net, except that the string "init" must not appear. Example: gencfg 2 0x150 4 2 0 1 0x168 9 4915200 will print a short form of scc_config.h for the OptoSCC to stdout. ("short" <=> few comments). gencfg 2 0x300 2 4 5 -4 0 7 4915200 0x10 does the same for the BayCom USCC card. I my opinion it is much easier to edit scc_config.h... 1.2 initializing the driver on bootup ===================================== To setup a number parameters you must run /sbin/sccinit from one of your rc.*-files. This has to be done BEFORE the start of NET or the ax25attach. Sccinit reads the file /etc/z8530drv.rc and sets the MODEM and KISS parameters. A sample file is delivered with this package. Change it to your needs: Each channel definition is divided into three sections. An example for /dev/sc1: # DEVICE device /dev/sc1 # the device for the following params # MODEM speed 1200 # the default baudrate clock dpll # clock source: # dpll = normal halfduplex operation # external = MODEM provides own Rx/Tx clock # divider = use fullduplex divider if # installed (1) mode nrzi # HDLC encoding mode # nrzi = 1k2 MODEM, G3RUH 9k6 MODEM # nrz = DF9IC 9k6 MODEM # KISS (Layer 1) txdelay 36 # (see chapter 1.4) persist 64 slot 8 tail 8 fulldup 0 wait 12 min 3 maxkey 7 idle 3 maxdef 120 group 0 txoff off softdcd on slip off The order WITHIN these sections is unimportant. The order OF these sections IS important. The MODEM parameters are set with the first recognized KISS paramer... Please note that you can initialize the board only once after boot. You can change all paramters but "mode" and "clock" later with the Sccparam program or through KISS. Just to avoid securety holes... (1) this divider is usually mounted on the SCC-PBC (PA0HZP) or not present at all (BayCom). It feeds back the output of the DPLL (digital pll) as transmit clock. Using this mode without a divider installed will normally result in keying the transceiver until maxkey expires --- of course without sending anything (useful). 1.3. Attach commands ==================== When the linux has startup, the SCC driver has been initialized, you can attach the channels in your packet software. This is done by open the scc devices by using the attach asy command. The SCC-drivers emulates the scc devices as serial asy ports, this means e.g. that the baudrate can be set in the attach command. Example Wampes: ############################################################################################# # Wampes device attach # NOTE: Interfacename and the device must be the same!! # Usage: attach asy 0 0 slip|vjslip|ax25ui|ax25i|nrs|kissui