1 This is a subset of the documentation. To use this driver you MUST have the
7 1. ftp://ftp.ccac.rwth-aachen.de/pub/jr/z8530drv-utils-3.0-1.tar.gz
9 2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils-3.0-1.tar.gz
11 3. ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz
12 If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz
14 Please note that the information in this document may be hopelessly outdated.
15 A new version of the documentation, along with links to other important
16 Linux Kernel AX.25 documentation and programs, is available on
19 -----------------------------------------------------------------------------
22 SCC.C - Linux driver for Z8530 based HDLC cards for AX.25
24 ********************************************************************
26 (c) 1993,1998 by Joerg Reuter DL1BKE <jreuter@poboxes.com>
28 portions (c) 1993 Guido ten Dolle PE1NNZ
30 for the complete copyright notice see >> Copying.Z8530DRV <<
32 ********************************************************************
35 1. Initialization of the driver
36 ===============================
38 To use the driver, 3 steps must be performed:
40 1. if compiled as module: loading the module
41 2. Setup of hardware, MODEM and KISS parameters with sccinit
42 3. Attach each channel to the Linux kernel AX.25 with "ifconfig"
44 Unlike the versions below 2.4 this driver is a real network device
45 driver. If you want to run xNOS instead of our fine kernel AX.25
46 use a 2.x version (available from above sites) or read the
47 AX.25-HOWTO on how to emulate a KISS TNC on network device drivers.
50 1.1 Loading the module
51 ======================
53 (If you're going to compile the driver as a part of the kernel image,
54 skip this chapter and continue with 1.2)
56 Before you can use a module, you'll have to load it with
60 please read 'man insmod' that comes with modutils.
62 You should include the insmod in one of the /etc/rc.d/rc.* files,
63 and don't forget to insert a call of sccinit after that. It
64 will read your /etc/z8530drv.conf.
66 1.2. /etc/z8530drv.conf
67 =======================
69 To setup all parameters you must run /sbin/sccinit from one
70 of your rc.*-files. This has to be done BEFORE you can
71 "ifconfig" an interface. Sccinit reads the file /etc/z8530drv.conf
72 and sets the hardware, MODEM and KISS parameters. A sample file is
73 delivered with this package. Change it to your needs.
75 The file itself consists of two main sections.
77 1.2.1 configuration of hardware parameters
78 ==========================================
80 The hardware setup section defines the following parameters for each
84 data_a 0x300 # data port A
85 ctrl_a 0x304 # control port A
86 data_b 0x301 # data port B
87 ctrl_b 0x305 # control port B
89 pclock 4915200 # clock
90 board BAYCOM # hardware type
91 escc no # enhanced SCC chip? (8580/85180/85280)
92 vector 0 # latch for interrupt vector
93 special no # address of special function register
94 option 0 # option to set via sfr
97 chip - this is just a delimiter to make sccinit a bit simpler to
98 program. A parameter has no effect.
100 data_a - the address of the data port A of this Z8530 (needed)
101 ctrl_a - the address of the control port A (needed)
102 data_b - the address of the data port B (needed)
103 ctrl_b - the address of the control port B (needed)
105 irq - the used IRQ for this chip. Different chips can use different
106 IRQs or the same. If they share an interrupt, it needs to be
107 specified within one chip-definition only.
109 pclock - the clock at the PCLK pin of the Z8530 (option, 4915200 is
110 default), measured in Hertz
112 board - the "type" of the board:
115 ---------------------------------
116 PA0HZP SCC card PA0HZP
119 PRIMUS-PC (DG9BL) card PRIMUS
120 BayCom (U)SCC card BAYCOM
122 escc - if you want support for ESCC chips (8580, 85180, 85280), set
123 this to "yes" (option, defaults to "no")
125 vector - address of the vector latch (aka "intack port") for PA0HZP
126 cards. There can be only one vector latch for all chips!
127 (option, defaults to 0)
129 special - address of the special function register on several cards.
130 (option, defaults to 0)
132 option - The value you write into that register (option, default is 0)
134 You can specify up to four chips (8 channels). If this is not enough,
141 Example for the BAYCOM USCC:
142 ----------------------------
145 data_a 0x300 # data port A
146 ctrl_a 0x304 # control port A
147 data_b 0x301 # data port B
148 ctrl_b 0x305 # control port B
149 irq 5 # IRQ No. 5 (#)
150 board BAYCOM # hardware type (*)
161 An example for a PA0HZP card:
162 -----------------------------
188 A DRSI would should probably work with this:
189 --------------------------------------------
190 (actually: two DRSI cards...)
214 Note that you cannot use the on-board baudrate generator off DRSI
215 cards. Use "mode dpll" for clock source (see below).
217 This is based on information provided by Mike Bilow (and verified
223 If you only know the parameters for the PE1CHL driver for DOS,
224 run gencfg. It will generate the correct port addresses (I hope).
225 Its parameters are exactly the same as the ones you use with
226 the "attach scc" command in net, except that the string "init" must
229 gencfg 2 0x150 4 2 0 1 0x168 9 4915200
231 will print a skeleton z8530drv.conf for the OptoSCC to stdout.
233 gencfg 2 0x300 2 4 5 -4 0 7 4915200 0x10
235 does the same for the BAYCOM USCC card. In my opinion it is much easier
236 to edit scc_config.h...
239 1.2.2 channel configuration
240 ===========================
242 The channel definition is divided into three sub sections for each
249 device scc0 # the device for the following params
253 speed 1200 # the default baudrate
254 clock dpll # clock source:
255 # dpll = normal half duplex operation
256 # external = MODEM provides own Rx/Tx clock
257 # divider = use full duplex divider if
259 mode nrzi # HDLC encoding mode
260 # nrzi = 1k2 MODEM, G3RUH 9k6 MODEM
261 # nrz = DF9IC 9k6 MODEM
263 bufsize 384 # size of buffers. Note that this must include
264 # the AX.25 header, not only the data field!
265 # (optional, defaults to 384)
269 txdelay 36 # (see chapter 1.4)
284 The order WITHIN these sections is unimportant. The order OF these
285 sections IS important. The MODEM parameters are set with the first
286 recognized KISS parameter...
288 Please note that you can initialize the board only once after boot
289 (or insmod). You can change all parameters but "mode" and "clock"
290 later with the Sccparam program or through KISS. Just to avoid
293 (1) this divider is usually mounted on the SCC-PBC (PA0HZP) or not
294 present at all (BayCom). It feeds back the output of the DPLL
295 (digital pll) as transmit clock. Using this mode without a divider
296 installed will normally result in keying the transceiver until
297 maxkey expires --- of course without sending anything (useful).
299 2. Attachment of a channel by your AX.25 software
300 =================================================
305 To set up an AX.25 device you can simply type:
307 ifconfig scc0 44.128.1.1 hw ax25 dl0tha-7
309 This will create a network interface with the IP number 44.128.20.107
310 and the callsign "dl0tha". If you do not have any IP number (yet) you
311 can use any of the 44.128.0.0 network. Note that you do not need
312 axattach. The purpose of axattach (like slattach) is to create a KISS
313 network device linked to a TTY. Please read the documentation of the
314 ax25-utils and the AX.25-HOWTO to learn how to set the parameters of
317 2.2 NOS, NET and TFKISS
318 =======================
320 Since the TTY driver (aka KISS TNC emulation) is gone you need
321 to emulate the old behaviour. The cost of using these programs is
322 that you probably need to compile the kernel AX.25, regardless of whether
323 you actually use it or not. First setup your /etc/ax25/axports,
326 9k6 dl0tha-9 9600 255 4 9600 baud port (scc3)
327 axlink dl0tha-15 38400 255 4 Link to NOS
329 Now "ifconfig" the scc device:
331 ifconfig scc3 44.128.1.1 hw ax25 dl0tha-9
333 You can now axattach a pseudo-TTY:
335 axattach /dev/ptys0 axlink
337 and start your NOS and attach /dev/ptys0 there. The problem is that
338 NOS is reachable only via digipeating through the kernel AX.25
339 (disastrous on a DAMA controlled channel). To solve this problem,
340 configure "rxecho" to echo the incoming frames from "9k6" to "axlink"
341 and outgoing frames from "axlink" to "9k6" and start:
345 Or simply use "kissbridge" coming with z8530drv-utils:
347 ifconfig scc3 hw ax25 dl0tha-9
348 kissbridge scc3 /dev/ptys0
351 3. Adjustment and Display of parameters
352 =======================================
354 3.1 Displaying SCC Parameters:
355 ==============================
357 Once a SCC channel has been attached, the parameter settings and
358 some statistic information can be shown using the param program:
360 dl1bke-u:~$ sccstat scc0
382 HDLC Z8530 Interrupts Buffers
383 -----------------------------------------------------------------------
384 Sent : 273 RxOver : 0 RxInts : 125074 Size : 384
385 Received : 1095 TxUnder: 0 TxInts : 4684 NoSpace : 0
386 RxErrors : 1591 ExInts : 11776
387 TxErrors : 0 SpInts : 1503
391 The status info shown is:
393 Sent - number of frames transmitted
394 Received - number of frames received
395 RxErrors - number of receive errors (CRC, ABORT)
396 TxErrors - number of discarded Tx frames (due to various reasons)
397 Tx State - status of the Tx interrupt handler: idle/busy/active/tail (2)
398 RxOver - number of receiver overruns
399 TxUnder - number of transmitter underruns
400 RxInts - number of receiver interrupts
401 TxInts - number of transmitter interrupts
402 EpInts - number of receiver special condition interrupts
403 SpInts - number of external/status interrupts
404 Size - maximum size of an AX.25 frame (*with* AX.25 headers!)
405 NoSpace - number of times a buffer could not get allocated
407 An overrun is abnormal. If lots of these occur, the product of
408 baudrate and number of interfaces is too high for the processing
409 power of your computer. NoSpace errors are unlikely to be caused by the
410 driver or the kernel AX.25.
413 3.2 Setting Parameters
414 ======================
417 The setting of parameters of the emulated KISS TNC is done in the
418 same way in the SCC driver. You can change parameters by using
419 the kissparms program from the ax25-utils package or use the program
422 sccparam <device> <paramname> <decimal-|hexadecimal value>
424 You can change the following parameters:
427 ------------------------
445 The parameters have the following meaning:
448 The baudrate on this channel in bits/sec
450 Example: sccparam /dev/scc3 speed 9600
453 The delay (in units of 10 ms) after keying of the
454 transmitter, until the first byte is sent. This is usually
455 called "TXDELAY" in a TNC. When 0 is specified, the driver
456 will just wait until the CTS signal is asserted. This
457 assumes the presence of a timer or other circuitry in the
458 MODEM and/or transmitter, that asserts CTS when the
459 transmitter is ready for data.
460 A normal value of this parameter is 30-36.
462 Example: sccparam /dev/scc0 txd 20
465 This is the probability that the transmitter will be keyed
466 when the channel is found to be free. It is a value from 0
467 to 255, and the probability is (value+1)/256. The value
468 should be somewhere near 50-60, and should be lowered when
469 the channel is used more heavily.
471 Example: sccparam /dev/scc2 persist 20
474 This is the time between samples of the channel. It is
475 expressed in units of 10 ms. About 200-300 ms (value 20-30)
476 seems to be a good value.
478 Example: sccparam /dev/scc0 slot 20
481 The time the transmitter will remain keyed after the last
482 byte of a packet has been transferred to the SCC. This is
483 necessary because the CRC and a flag still have to leave the
484 SCC before the transmitter is keyed down. The value depends
485 on the baudrate selected. A few character times should be
486 sufficient, e.g. 40ms at 1200 baud. (value 4)
487 The value of this parameter is in 10 ms units.
489 Example: sccparam /dev/scc2 4
492 The full-duplex mode switch. This can be one of the following
495 0: The interface will operate in CSMA mode (the normal
496 half-duplex packet radio operation)
497 1: Fullduplex mode, i.e. the transmitter will be keyed at
498 any time, without checking the received carrier. It
499 will be unkeyed when there are no packets to be sent.
500 2: Like 1, but the transmitter will remain keyed, also
501 when there are no packets to be sent. Flags will be
502 sent in that case, until a timeout (parameter 10)
505 Example: sccparam /dev/scc0 fulldup off
508 The initial waittime before any transmit attempt, after the
509 frame has been queue for transmit. This is the length of
510 the first slot in CSMA mode. In full duplex modes it is
511 set to 0 for maximum performance.
512 The value of this parameter is in 10 ms units.
514 Example: sccparam /dev/scc1 wait 4
517 The maximal time the transmitter will be keyed to send
518 packets, in seconds. This can be useful on busy CSMA
519 channels, to avoid "getting a bad reputation" when you are
520 generating a lot of traffic. After the specified time has
521 elapsed, no new frame will be started. Instead, the trans-
522 mitter will be switched off for a specified time (parameter
523 min), and then the selected algorithm for keyup will be
525 The value 0 as well as "off" will disable this feature,
526 and allow infinite transmission time.
528 Example: sccparam /dev/scc0 maxk 20
531 This is the time the transmitter will be switched off when
532 the maximum transmission time is exceeded.
534 Example: sccparam /dev/scc3 min 10
537 This parameter specifies the maximum idle time in full duplex
538 2 mode, in seconds. When no frames have been sent for this
539 time, the transmitter will be keyed down. A value of 0 is
540 has same result as the fullduplex mode 1. This parameter
543 Example: sccparam /dev/scc2 idle off # transmit forever
546 This is the maximum time (in seconds) to wait for a free channel
547 to send. When this timer expires the transmitter will be keyed
548 IMMEDIATELY. If you love to get trouble with other users you
549 should set this to a very low value ;-)
551 Example: sccparam /dev/scc0 maxdefer 240 # 2 minutes
555 When this parameter has the value 0, the transmission of packets
556 is enable. Otherwise it is disabled.
558 Example: sccparam /dev/scc2 txoff on
561 It is possible to build special radio equipment to use more than
562 one frequency on the same band, e.g. using several receivers and
563 only one transmitter that can be switched between frequencies.
564 Also, you can connect several radios that are active on the same
565 band. In these cases, it is not possible, or not a good idea, to
566 transmit on more than one frequency. The SCC driver provides a
567 method to lock transmitters on different interfaces, using the
568 "param <interface> group <x>" command. This will only work when
569 you are using CSMA mode (parameter full = 0).
570 The number <x> must be 0 if you want no group restrictions, and
571 can be computed as follows to create restricted groups:
572 <x> is the sum of some OCTAL numbers:
574 200 This transmitter will only be keyed when all other
575 transmitters in the group are off.
576 100 This transmitter will only be keyed when the carrier
577 detect of all other interfaces in the group is off.
578 0xx A byte that can be used to define different groups.
579 Interfaces are in the same group, when the logical AND
580 between their xx values is nonzero.
583 When 2 interfaces use group 201, their transmitters will never be
584 keyed at the same time.
585 When 2 interfaces use group 101, the transmitters will only key
586 when both channels are clear at the same time. When group 301,
587 the transmitters will not be keyed at the same time.
589 Don't forget to convert the octal numbers into decimal before
590 you set the parameter.
592 Example: (to be written)
595 use a software dcd instead of the real one... Useful for a very
598 Example: sccparam /dev/scc0 soft on
604 If you have tx-problems with your BayCom USCC card please check
605 the manufacturer of the 8530. SGS chips have a slightly
606 different timing. Try Zilog... A solution is to write to register 8
607 instead to the data port, but this won't work with the ESCC chips.
610 A very common problem is that the PTT locks until the maxkeyup timer
611 expires, although interrupts and clock source are correct. In most
612 cases compiling the driver with CONFIG_SCC_DELAY (set with
613 make config) solves the problems. For more hints read the (pseudo) FAQ
614 and the documentation coming with z8530drv-utils.
616 I got reports that the driver has problems on some 386-based systems.
617 (i.e. Amstrad) Those systems have a bogus AT bus timing which will
618 lead to delayed answers on interrupts. You can recognize these
619 problems by looking at the output of Sccstat for the suspected
620 port. If it shows under- and overruns you own such a system.
622 Delayed processing of received data: This depends on
626 - kernel profiling compiled or not
628 - a high interrupt load
630 - a high load of the machine --- running X, Xmorph, XV and Povray,
631 while compiling the kernel... hmm ... even with 32 MB RAM ... ;-)
632 Or running a named for the whole .ampr.org domain on an 8 MB
635 - using information from rxecho or kissbridge.
637 Kernel panics: please read /linux/README and find out if it
638 really occurred within the scc driver.
640 If you cannot solve a problem, send me
642 - a description of the problem,
643 - information on your hardware (computer system, scc board, modem)
644 - your kernel version
645 - the output of cat /proc/net/z8530
650 Mysteriously this board seems not to work with the driver. Anyone
651 got it up-and-running?
654 Many thanks to Linus Torvalds and Alan Cox for including the driver
655 in the Linux standard distribution and their support.
657 Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org
658 AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU
659 Internet: jreuter@poboxes.com
660 WWW : http://www.rat.de/jr/