This is a subset of the documentation. To use this driver you MUST have the full package "z8530drv-2.4c.dl1bke.tar.gz" from either ftp.pspt.fi, sunsite.unc.edu or db0bm.automation.fh-aachen.de. Do not try to use the utilities from z8530drv-utils-3.0 as they will not work with the 2.4 series of the driver! --------------------------------------------------------------------------- SCC.C - Linux driver for Z8530 based HDLC cards for AX.25 ******************************************************************** (c) 1993,1997 by Joerg Reuter DL1BKE portions (c) 1993 Guido ten Dolle PE1NNZ for the complete copyright notice see >> Copying.Z8530DRV << ******************************************************************** 1. Initialization of the driver =============================== To use the driver, 3 steps must be performed: 1. if compiled as module: loading the module 2. Setup of hardware, MODEM and KISS parameters with sccinit 3. Attachment of each channel in the packet software 1.1 Loading the module ====================== (If you're going to compile the driver as a part of the kernel image, skip this chapter and continue with 1.2) Before you can use a module, you'll have to load it with insmod scc.o please read 'man insmod' that comes with modutils. You should include the insmod in one of the /etc/rc.d/rc.* files, and don't forget to insert a call of sccinit after that. It will read your 1.2. /etc/z8530drv.rc ===================== To setup all parameters you must run /sbin/sccinit from one of your rc.*-files. This has to be done BEFORE the start of NET or axattach. Sccinit reads the file /etc/z8530drv.rc and sets the hardware, MODEM and KISS parameters. A sample file is delivered with this package. Change it to your needs. The file itself consists of two main sections. 1.2.1 configuration of hardware parameters ========================================== The hardware setup section defines the following parameters for each Z8530: chip 1 data_a 0x300 # data port A ctrl_a 0x304 # control port A data_b 0x301 # data port B ctrl_b 0x305 # control port B irq 5 # IRQ No. 5 pclock 4915200 # clock board BAYCOM # hardware type escc no # enhanced SCC chip? (8580/85180/85280) vector 0 # latch for interrupt vector special no # address of special function register option 0 # option to set via sfr chip - this is just a delimiter to make sccinit a bit simpler to program. A parameter has no effect. data_a - the address of the data port A of this Z8530 (needed) ctrl_a - the address of the control port A (needed) data_b - the address of the data port B (needed) ctrl_b - the address of the control port B (needed) irq - the used IRQ for this chip. Different chips can use different IRQs or the same. If they share an interrupt, it needs to be specified within one chip-definition only. pclock - the clock at the PCLK pin of the Z8530 (option, 4915200 is default), measured in Hertz board - the "type" of the board: SCC type value --------------------------------- PA0HZP SCC card PA0HZP EAGLE card EAGLE PC100 card PC100 PRIMUS-PC (DG9BL) card PRIMUS BayCom (U)SCC card BAYCOM escc - if you want support for ESCC chips (8580, 85180, 85280), set this to "yes" (option, defaults to "no") vector - address of the vector latch (aka "intack port") for PA0HZP cards. There can be only one vector latch for all chips! (option, defaults to 0) special - address of the special function register on several cards. (option, defaults to 0) option - The value you write into that register (option, default is 0) You can specify up to four chips (8 channels). If this is not enough, just change #define MAXSCC 4 to a higher value. Example for the BayCom USCC: ---------------------------- chip 1 data_a 0x300 # data port A ctrl_a 0x304 # control port A data_b 0x301 # data port B ctrl_b 0x305 # control port B irq 5 # IRQ No. 5 (#) board BAYCOM # hardware type (*) # # SCC chip 2 # chip 2 data_a 0x302 ctrl_a 0x306 data_b 0x303 ctrl_b 0x307 board BAYCOM An example for a PA0HZP card: ----------------------------- chip 1 data_a 0x153 data_b 0x151 ctrl_a 0x152 ctrl_b 0x150 irq 9 pclock 4915200 board PA0HZP vector 0x168 escc no # # # chip 2 data_a 0x157 data_b 0x155 ctrl_a 0x156 ctrl_b 0x154 irq 9 pclock 4915200 board PA0HZP vector 0x168 escc no A DRSI would should probably work with this: -------------------------------------------- (actually: two DRSI cards...) chip 1 data_a 0x303 data_b 0x301 ctrl_a 0x302 ctrl_b 0x300 irq 7 pclock 4915200 board DRSI escc no # # # chip 2 data_a 0x313 data_b 0x311 ctrl_a 0x312 ctrl_b 0x310 irq 7 pclock 4915200 board DRSI escc no Note that you cannot use the on-board baudrate generator off DRSI cards. Use "mode dpll" for clock source (see below). This is based on information provided by Mike Bilow (and verified by Paul Helay) The utility "gencfg" -------------------- 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 skeleton z8530drv.rc for the OptoSCC to stdout. 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.2 channel configuration =========================== The channel definition is divided into three sub sections for each channel: An example for /dev/scc0: # DEVICE device /dev/scc0 # the device for the following params # MODEM / BUFFERS speed 1200 # the default baudrate clock dpll # clock source: # dpll = normal halfduplex operation # external = MODEM provides own Rx/Tx clock # divider = use full duplex divider if # installed (1) mode nrzi # HDLC encoding mode # nrzi = 1k2 MODEM, G3RUH 9k6 MODEM # nrz = DF9IC 9k6 MODEM # rxbuffers 8 # number of rx buffers allocated # (option, default is 4) txbuffers 16 # number of tx buffers allocated # (option, default is 16) bufsize 384 # size of buffers. Note that this must include # the AX.25 header, not only the data field! # (optional, defaults to 384) # 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 parameter... Please note that you can initialize the board only once after boot. You can change all parameters but "mode" and "clock" later with the Sccparam program or through KISS. Just to avoid security 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). 2. Attachment of a channel by your AX.25 software ================================================= 2.1 KA9Q NOS derivates ====================== 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