xref: /OK3568_Linux_fs/kernel/Documentation/networking/device_drivers/hamradio/z8530drv.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun.. include:: <isonum.txt>
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun=========================================================
5*4882a593SmuzhiyunSCC.C - Linux driver for Z8530 based HDLC cards for AX.25
6*4882a593Smuzhiyun=========================================================
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThis is a subset of the documentation. To use this driver you MUST have the
10*4882a593Smuzhiyunfull package from:
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunInternet:
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun    1. ftp://ftp.ccac.rwth-aachen.de/pub/jr/z8530drv-utils_3.0-3.tar.gz
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun    2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils_3.0-3.tar.gz
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunPlease note that the information in this document may be hopelessly outdated.
19*4882a593SmuzhiyunA new version of the documentation, along with links to other important
20*4882a593SmuzhiyunLinux Kernel AX.25 documentation and programs, is available on
21*4882a593Smuzhiyunhttp://yaina.de/jreuter
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunCopyright |copy| 1993,2000 by Joerg Reuter DL1BKE <jreuter@yaina.de>
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunportions Copyright |copy| 1993 Guido ten Dolle PE1NNZ
26*4882a593Smuzhiyun
27*4882a593Smuzhiyunfor the complete copyright notice see >> Copying.Z8530DRV <<
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun1. Initialization of the driver
30*4882a593Smuzhiyun===============================
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunTo use the driver, 3 steps must be performed:
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun     1. if compiled as module: loading the module
35*4882a593Smuzhiyun     2. Setup of hardware, MODEM and KISS parameters with sccinit
36*4882a593Smuzhiyun     3. Attach each channel to the Linux kernel AX.25 with "ifconfig"
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunUnlike the versions below 2.4 this driver is a real network device
39*4882a593Smuzhiyundriver. If you want to run xNOS instead of our fine kernel AX.25
40*4882a593Smuzhiyunuse a 2.x version (available from above sites) or read the
41*4882a593SmuzhiyunAX.25-HOWTO on how to emulate a KISS TNC on network device drivers.
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun1.1 Loading the module
45*4882a593Smuzhiyun======================
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun(If you're going to compile the driver as a part of the kernel image,
48*4882a593Smuzhiyun skip this chapter and continue with 1.2)
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunBefore you can use a module, you'll have to load it with::
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun	insmod scc.o
53*4882a593Smuzhiyun
54*4882a593Smuzhiyunplease read 'man insmod' that comes with module-init-tools.
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunYou should include the insmod in one of the /etc/rc.d/rc.* files,
57*4882a593Smuzhiyunand don't forget to insert a call of sccinit after that. It
58*4882a593Smuzhiyunwill read your /etc/z8530drv.conf.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun1.2. /etc/z8530drv.conf
61*4882a593Smuzhiyun=======================
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunTo setup all parameters you must run /sbin/sccinit from one
64*4882a593Smuzhiyunof your rc.*-files. This has to be done BEFORE you can
65*4882a593Smuzhiyun"ifconfig" an interface. Sccinit reads the file /etc/z8530drv.conf
66*4882a593Smuzhiyunand sets the hardware, MODEM and KISS parameters. A sample file is
67*4882a593Smuzhiyundelivered with this package. Change it to your needs.
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunThe file itself consists of two main sections.
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun1.2.1 configuration of hardware parameters
72*4882a593Smuzhiyun==========================================
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunThe hardware setup section defines the following parameters for each
75*4882a593SmuzhiyunZ8530::
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun    chip    1
78*4882a593Smuzhiyun    data_a  0x300                   # data port A
79*4882a593Smuzhiyun    ctrl_a  0x304                   # control port A
80*4882a593Smuzhiyun    data_b  0x301                   # data port B
81*4882a593Smuzhiyun    ctrl_b  0x305                   # control port B
82*4882a593Smuzhiyun    irq     5                       # IRQ No. 5
83*4882a593Smuzhiyun    pclock  4915200                 # clock
84*4882a593Smuzhiyun    board   BAYCOM                  # hardware type
85*4882a593Smuzhiyun    escc    no                      # enhanced SCC chip? (8580/85180/85280)
86*4882a593Smuzhiyun    vector  0                       # latch for interrupt vector
87*4882a593Smuzhiyun    special no                      # address of special function register
88*4882a593Smuzhiyun    option  0                       # option to set via sfr
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun
91*4882a593Smuzhiyunchip
92*4882a593Smuzhiyun	- this is just a delimiter to make sccinit a bit simpler to
93*4882a593Smuzhiyun	  program. A parameter has no effect.
94*4882a593Smuzhiyun
95*4882a593Smuzhiyundata_a
96*4882a593Smuzhiyun	- the address of the data port A of this Z8530 (needed)
97*4882a593Smuzhiyunctrl_a
98*4882a593Smuzhiyun	- the address of the control port A (needed)
99*4882a593Smuzhiyundata_b
100*4882a593Smuzhiyun	- the address of the data port B (needed)
101*4882a593Smuzhiyunctrl_b
102*4882a593Smuzhiyun	- the address of the control port B (needed)
103*4882a593Smuzhiyun
104*4882a593Smuzhiyunirq
105*4882a593Smuzhiyun	- the used IRQ for this chip. Different chips can use different
106*4882a593Smuzhiyun	  IRQs or the same. If they share an interrupt, it needs to be
107*4882a593Smuzhiyun	  specified within one chip-definition only.
108*4882a593Smuzhiyun
109*4882a593Smuzhiyunpclock  - the clock at the PCLK pin of the Z8530 (option, 4915200 is
110*4882a593Smuzhiyun	  default), measured in Hertz
111*4882a593Smuzhiyun
112*4882a593Smuzhiyunboard
113*4882a593Smuzhiyun	- the "type" of the board:
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun	   =======================  ========
116*4882a593Smuzhiyun	   SCC type                 value
117*4882a593Smuzhiyun	   =======================  ========
118*4882a593Smuzhiyun	   PA0HZP SCC card          PA0HZP
119*4882a593Smuzhiyun	   EAGLE card               EAGLE
120*4882a593Smuzhiyun	   PC100 card               PC100
121*4882a593Smuzhiyun	   PRIMUS-PC (DG9BL) card   PRIMUS
122*4882a593Smuzhiyun	   BayCom (U)SCC card       BAYCOM
123*4882a593Smuzhiyun	   =======================  ========
124*4882a593Smuzhiyun
125*4882a593Smuzhiyunescc
126*4882a593Smuzhiyun	- if you want support for ESCC chips (8580, 85180, 85280), set
127*4882a593Smuzhiyun	  this to "yes" (option, defaults to "no")
128*4882a593Smuzhiyun
129*4882a593Smuzhiyunvector
130*4882a593Smuzhiyun	- address of the vector latch (aka "intack port") for PA0HZP
131*4882a593Smuzhiyun	  cards. There can be only one vector latch for all chips!
132*4882a593Smuzhiyun	  (option, defaults to 0)
133*4882a593Smuzhiyun
134*4882a593Smuzhiyunspecial
135*4882a593Smuzhiyun	- address of the special function register on several cards.
136*4882a593Smuzhiyun	  (option, defaults to 0)
137*4882a593Smuzhiyun
138*4882a593Smuzhiyunoption  - The value you write into that register (option, default is 0)
139*4882a593Smuzhiyun
140*4882a593SmuzhiyunYou can specify up to four chips (8 channels). If this is not enough,
141*4882a593Smuzhiyunjust change::
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun	#define MAXSCC 4
144*4882a593Smuzhiyun
145*4882a593Smuzhiyunto a higher value.
146*4882a593Smuzhiyun
147*4882a593SmuzhiyunExample for the BAYCOM USCC:
148*4882a593Smuzhiyun----------------------------
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun::
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun	chip    1
153*4882a593Smuzhiyun	data_a  0x300                   # data port A
154*4882a593Smuzhiyun	ctrl_a  0x304                   # control port A
155*4882a593Smuzhiyun	data_b  0x301                   # data port B
156*4882a593Smuzhiyun	ctrl_b  0x305                   # control port B
157*4882a593Smuzhiyun	irq     5                       # IRQ No. 5 (#)
158*4882a593Smuzhiyun	board   BAYCOM                  # hardware type (*)
159*4882a593Smuzhiyun	#
160*4882a593Smuzhiyun	# SCC chip 2
161*4882a593Smuzhiyun	#
162*4882a593Smuzhiyun	chip    2
163*4882a593Smuzhiyun	data_a  0x302
164*4882a593Smuzhiyun	ctrl_a  0x306
165*4882a593Smuzhiyun	data_b  0x303
166*4882a593Smuzhiyun	ctrl_b  0x307
167*4882a593Smuzhiyun	board   BAYCOM
168*4882a593Smuzhiyun
169*4882a593SmuzhiyunAn example for a PA0HZP card:
170*4882a593Smuzhiyun-----------------------------
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun::
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun	chip 1
175*4882a593Smuzhiyun	data_a 0x153
176*4882a593Smuzhiyun	data_b 0x151
177*4882a593Smuzhiyun	ctrl_a 0x152
178*4882a593Smuzhiyun	ctrl_b 0x150
179*4882a593Smuzhiyun	irq 9
180*4882a593Smuzhiyun	pclock 4915200
181*4882a593Smuzhiyun	board PA0HZP
182*4882a593Smuzhiyun	vector 0x168
183*4882a593Smuzhiyun	escc no
184*4882a593Smuzhiyun	#
185*4882a593Smuzhiyun	#
186*4882a593Smuzhiyun	#
187*4882a593Smuzhiyun	chip 2
188*4882a593Smuzhiyun	data_a 0x157
189*4882a593Smuzhiyun	data_b 0x155
190*4882a593Smuzhiyun	ctrl_a 0x156
191*4882a593Smuzhiyun	ctrl_b 0x154
192*4882a593Smuzhiyun	irq 9
193*4882a593Smuzhiyun	pclock 4915200
194*4882a593Smuzhiyun	board PA0HZP
195*4882a593Smuzhiyun	vector 0x168
196*4882a593Smuzhiyun	escc no
197*4882a593Smuzhiyun
198*4882a593SmuzhiyunA DRSI would should probably work with this:
199*4882a593Smuzhiyun--------------------------------------------
200*4882a593Smuzhiyun(actually: two DRSI cards...)
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun::
203*4882a593Smuzhiyun
204*4882a593Smuzhiyun	chip 1
205*4882a593Smuzhiyun	data_a 0x303
206*4882a593Smuzhiyun	data_b 0x301
207*4882a593Smuzhiyun	ctrl_a 0x302
208*4882a593Smuzhiyun	ctrl_b 0x300
209*4882a593Smuzhiyun	irq 7
210*4882a593Smuzhiyun	pclock 4915200
211*4882a593Smuzhiyun	board DRSI
212*4882a593Smuzhiyun	escc no
213*4882a593Smuzhiyun	#
214*4882a593Smuzhiyun	#
215*4882a593Smuzhiyun	#
216*4882a593Smuzhiyun	chip 2
217*4882a593Smuzhiyun	data_a 0x313
218*4882a593Smuzhiyun	data_b 0x311
219*4882a593Smuzhiyun	ctrl_a 0x312
220*4882a593Smuzhiyun	ctrl_b 0x310
221*4882a593Smuzhiyun	irq 7
222*4882a593Smuzhiyun	pclock 4915200
223*4882a593Smuzhiyun	board DRSI
224*4882a593Smuzhiyun	escc no
225*4882a593Smuzhiyun
226*4882a593SmuzhiyunNote that you cannot use the on-board baudrate generator off DRSI
227*4882a593Smuzhiyuncards. Use "mode dpll" for clock source (see below).
228*4882a593Smuzhiyun
229*4882a593SmuzhiyunThis is based on information provided by Mike Bilow (and verified
230*4882a593Smuzhiyunby Paul Helay)
231*4882a593Smuzhiyun
232*4882a593SmuzhiyunThe utility "gencfg"
233*4882a593Smuzhiyun--------------------
234*4882a593Smuzhiyun
235*4882a593SmuzhiyunIf you only know the parameters for the PE1CHL driver for DOS,
236*4882a593Smuzhiyunrun gencfg. It will generate the correct port addresses (I hope).
237*4882a593SmuzhiyunIts parameters are exactly the same as the ones you use with
238*4882a593Smuzhiyunthe "attach scc" command in net, except that the string "init" must
239*4882a593Smuzhiyunnot appear. Example::
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun	gencfg 2 0x150 4 2 0 1 0x168 9 4915200
242*4882a593Smuzhiyun
243*4882a593Smuzhiyunwill print a skeleton z8530drv.conf for the OptoSCC to stdout.
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun::
246*4882a593Smuzhiyun
247*4882a593Smuzhiyun	gencfg 2 0x300 2 4 5 -4 0 7 4915200 0x10
248*4882a593Smuzhiyun
249*4882a593Smuzhiyundoes the same for the BAYCOM USCC card. In my opinion it is much easier
250*4882a593Smuzhiyunto edit scc_config.h...
251*4882a593Smuzhiyun
252*4882a593Smuzhiyun
253*4882a593Smuzhiyun1.2.2 channel configuration
254*4882a593Smuzhiyun===========================
255*4882a593Smuzhiyun
256*4882a593SmuzhiyunThe channel definition is divided into three sub sections for each
257*4882a593Smuzhiyunchannel:
258*4882a593Smuzhiyun
259*4882a593SmuzhiyunAn example for scc0::
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun	# DEVICE
262*4882a593Smuzhiyun
263*4882a593Smuzhiyun	device scc0	# the device for the following params
264*4882a593Smuzhiyun
265*4882a593Smuzhiyun	# MODEM / BUFFERS
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun	speed 1200		# the default baudrate
268*4882a593Smuzhiyun	clock dpll		# clock source:
269*4882a593Smuzhiyun				# 	dpll     = normal half duplex operation
270*4882a593Smuzhiyun				# 	external = MODEM provides own Rx/Tx clock
271*4882a593Smuzhiyun				#	divider  = use full duplex divider if
272*4882a593Smuzhiyun				#		   installed (1)
273*4882a593Smuzhiyun	mode nrzi		# HDLC encoding mode
274*4882a593Smuzhiyun				#	nrzi = 1k2 MODEM, G3RUH 9k6 MODEM
275*4882a593Smuzhiyun				#	nrz  = DF9IC 9k6 MODEM
276*4882a593Smuzhiyun				#
277*4882a593Smuzhiyun	bufsize	384		# size of buffers. Note that this must include
278*4882a593Smuzhiyun				# the AX.25 header, not only the data field!
279*4882a593Smuzhiyun				# (optional, defaults to 384)
280*4882a593Smuzhiyun
281*4882a593Smuzhiyun	# KISS (Layer 1)
282*4882a593Smuzhiyun
283*4882a593Smuzhiyun	txdelay 36              # (see chapter 1.4)
284*4882a593Smuzhiyun	persist 64
285*4882a593Smuzhiyun	slot    8
286*4882a593Smuzhiyun	tail    8
287*4882a593Smuzhiyun	fulldup 0
288*4882a593Smuzhiyun	wait    12
289*4882a593Smuzhiyun	min     3
290*4882a593Smuzhiyun	maxkey  7
291*4882a593Smuzhiyun	idle    3
292*4882a593Smuzhiyun	maxdef  120
293*4882a593Smuzhiyun	group   0
294*4882a593Smuzhiyun	txoff   off
295*4882a593Smuzhiyun	softdcd on
296*4882a593Smuzhiyun	slip    off
297*4882a593Smuzhiyun
298*4882a593SmuzhiyunThe order WITHIN these sections is unimportant. The order OF these
299*4882a593Smuzhiyunsections IS important. The MODEM parameters are set with the first
300*4882a593Smuzhiyunrecognized KISS parameter...
301*4882a593Smuzhiyun
302*4882a593SmuzhiyunPlease note that you can initialize the board only once after boot
303*4882a593Smuzhiyun(or insmod). You can change all parameters but "mode" and "clock"
304*4882a593Smuzhiyunlater with the Sccparam program or through KISS. Just to avoid
305*4882a593Smuzhiyunsecurity holes...
306*4882a593Smuzhiyun
307*4882a593Smuzhiyun(1) this divider is usually mounted on the SCC-PBC (PA0HZP) or not
308*4882a593Smuzhiyun    present at all (BayCom). It feeds back the output of the DPLL
309*4882a593Smuzhiyun    (digital pll) as transmit clock. Using this mode without a divider
310*4882a593Smuzhiyun    installed will normally result in keying the transceiver until
311*4882a593Smuzhiyun    maxkey expires --- of course without sending anything (useful).
312*4882a593Smuzhiyun
313*4882a593Smuzhiyun2. Attachment of a channel by your AX.25 software
314*4882a593Smuzhiyun=================================================
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun2.1 Kernel AX.25
317*4882a593Smuzhiyun================
318*4882a593Smuzhiyun
319*4882a593SmuzhiyunTo set up an AX.25 device you can simply type::
320*4882a593Smuzhiyun
321*4882a593Smuzhiyun	ifconfig scc0 44.128.1.1 hw ax25 dl0tha-7
322*4882a593Smuzhiyun
323*4882a593SmuzhiyunThis will create a network interface with the IP number 44.128.20.107
324*4882a593Smuzhiyunand the callsign "dl0tha". If you do not have any IP number (yet) you
325*4882a593Smuzhiyuncan use any of the 44.128.0.0 network. Note that you do not need
326*4882a593Smuzhiyunaxattach. The purpose of axattach (like slattach) is to create a KISS
327*4882a593Smuzhiyunnetwork device linked to a TTY. Please read the documentation of the
328*4882a593Smuzhiyunax25-utils and the AX.25-HOWTO to learn how to set the parameters of
329*4882a593Smuzhiyunthe kernel AX.25.
330*4882a593Smuzhiyun
331*4882a593Smuzhiyun2.2 NOS, NET and TFKISS
332*4882a593Smuzhiyun=======================
333*4882a593Smuzhiyun
334*4882a593SmuzhiyunSince the TTY driver (aka KISS TNC emulation) is gone you need
335*4882a593Smuzhiyunto emulate the old behaviour. The cost of using these programs is
336*4882a593Smuzhiyunthat you probably need to compile the kernel AX.25, regardless of whether
337*4882a593Smuzhiyunyou actually use it or not. First setup your /etc/ax25/axports,
338*4882a593Smuzhiyunfor example::
339*4882a593Smuzhiyun
340*4882a593Smuzhiyun	9k6	dl0tha-9  9600  255 4 9600 baud port (scc3)
341*4882a593Smuzhiyun	axlink	dl0tha-15 38400 255 4 Link to NOS
342*4882a593Smuzhiyun
343*4882a593SmuzhiyunNow "ifconfig" the scc device::
344*4882a593Smuzhiyun
345*4882a593Smuzhiyun	ifconfig scc3 44.128.1.1 hw ax25 dl0tha-9
346*4882a593Smuzhiyun
347*4882a593SmuzhiyunYou can now axattach a pseudo-TTY::
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun	axattach /dev/ptys0 axlink
350*4882a593Smuzhiyun
351*4882a593Smuzhiyunand start your NOS and attach /dev/ptys0 there. The problem is that
352*4882a593SmuzhiyunNOS is reachable only via digipeating through the kernel AX.25
353*4882a593Smuzhiyun(disastrous on a DAMA controlled channel). To solve this problem,
354*4882a593Smuzhiyunconfigure "rxecho" to echo the incoming frames from "9k6" to "axlink"
355*4882a593Smuzhiyunand outgoing frames from "axlink" to "9k6" and start::
356*4882a593Smuzhiyun
357*4882a593Smuzhiyun	rxecho
358*4882a593Smuzhiyun
359*4882a593SmuzhiyunOr simply use "kissbridge" coming with z8530drv-utils::
360*4882a593Smuzhiyun
361*4882a593Smuzhiyun	ifconfig scc3 hw ax25 dl0tha-9
362*4882a593Smuzhiyun	kissbridge scc3 /dev/ptys0
363*4882a593Smuzhiyun
364*4882a593Smuzhiyun
365*4882a593Smuzhiyun3. Adjustment and Display of parameters
366*4882a593Smuzhiyun=======================================
367*4882a593Smuzhiyun
368*4882a593Smuzhiyun3.1 Displaying SCC Parameters:
369*4882a593Smuzhiyun==============================
370*4882a593Smuzhiyun
371*4882a593SmuzhiyunOnce a SCC channel has been attached, the parameter settings and
372*4882a593Smuzhiyunsome statistic information can be shown using the param program::
373*4882a593Smuzhiyun
374*4882a593Smuzhiyun	dl1bke-u:~$ sccstat scc0
375*4882a593Smuzhiyun
376*4882a593Smuzhiyun	Parameters:
377*4882a593Smuzhiyun
378*4882a593Smuzhiyun	speed       : 1200 baud
379*4882a593Smuzhiyun	txdelay     : 36
380*4882a593Smuzhiyun	persist     : 255
381*4882a593Smuzhiyun	slottime    : 0
382*4882a593Smuzhiyun	txtail      : 8
383*4882a593Smuzhiyun	fulldup     : 1
384*4882a593Smuzhiyun	waittime    : 12
385*4882a593Smuzhiyun	mintime     : 3 sec
386*4882a593Smuzhiyun	maxkeyup    : 7 sec
387*4882a593Smuzhiyun	idletime    : 3 sec
388*4882a593Smuzhiyun	maxdefer    : 120 sec
389*4882a593Smuzhiyun	group       : 0x00
390*4882a593Smuzhiyun	txoff       : off
391*4882a593Smuzhiyun	softdcd     : on
392*4882a593Smuzhiyun	SLIP        : off
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun	Status:
395*4882a593Smuzhiyun
396*4882a593Smuzhiyun	HDLC                  Z8530           Interrupts         Buffers
397*4882a593Smuzhiyun	-----------------------------------------------------------------------
398*4882a593Smuzhiyun	Sent       :     273  RxOver :     0  RxInts :   125074  Size    :  384
399*4882a593Smuzhiyun	Received   :    1095  TxUnder:     0  TxInts :     4684  NoSpace :    0
400*4882a593Smuzhiyun	RxErrors   :    1591                  ExInts :    11776
401*4882a593Smuzhiyun	TxErrors   :       0                  SpInts :     1503
402*4882a593Smuzhiyun	Tx State   :    idle
403*4882a593Smuzhiyun
404*4882a593Smuzhiyun
405*4882a593SmuzhiyunThe status info shown is:
406*4882a593Smuzhiyun
407*4882a593Smuzhiyun==============	==============================================================
408*4882a593SmuzhiyunSent		number of frames transmitted
409*4882a593SmuzhiyunReceived	number of frames received
410*4882a593SmuzhiyunRxErrors	number of receive errors (CRC, ABORT)
411*4882a593SmuzhiyunTxErrors	number of discarded Tx frames (due to various reasons)
412*4882a593SmuzhiyunTx State	status of the Tx interrupt handler: idle/busy/active/tail (2)
413*4882a593SmuzhiyunRxOver		number of receiver overruns
414*4882a593SmuzhiyunTxUnder		number of transmitter underruns
415*4882a593SmuzhiyunRxInts		number of receiver interrupts
416*4882a593SmuzhiyunTxInts		number of transmitter interrupts
417*4882a593SmuzhiyunEpInts		number of receiver special condition interrupts
418*4882a593SmuzhiyunSpInts		number of external/status interrupts
419*4882a593SmuzhiyunSize		maximum size of an AX.25 frame (*with* AX.25 headers!)
420*4882a593SmuzhiyunNoSpace		number of times a buffer could not get allocated
421*4882a593Smuzhiyun==============	==============================================================
422*4882a593Smuzhiyun
423*4882a593SmuzhiyunAn overrun is abnormal. If lots of these occur, the product of
424*4882a593Smuzhiyunbaudrate and number of interfaces is too high for the processing
425*4882a593Smuzhiyunpower of your computer. NoSpace errors are unlikely to be caused by the
426*4882a593Smuzhiyundriver or the kernel AX.25.
427*4882a593Smuzhiyun
428*4882a593Smuzhiyun
429*4882a593Smuzhiyun3.2 Setting Parameters
430*4882a593Smuzhiyun======================
431*4882a593Smuzhiyun
432*4882a593Smuzhiyun
433*4882a593SmuzhiyunThe setting of parameters of the emulated KISS TNC is done in the
434*4882a593Smuzhiyunsame way in the SCC driver. You can change parameters by using
435*4882a593Smuzhiyunthe kissparms program from the ax25-utils package or use the program
436*4882a593Smuzhiyun"sccparam"::
437*4882a593Smuzhiyun
438*4882a593Smuzhiyun     sccparam <device> <paramname> <decimal-|hexadecimal value>
439*4882a593Smuzhiyun
440*4882a593SmuzhiyunYou can change the following parameters:
441*4882a593Smuzhiyun
442*4882a593Smuzhiyun===========   =====
443*4882a593Smuzhiyunparam	      value
444*4882a593Smuzhiyun===========   =====
445*4882a593Smuzhiyunspeed         1200
446*4882a593Smuzhiyuntxdelay       36
447*4882a593Smuzhiyunpersist       255
448*4882a593Smuzhiyunslottime      0
449*4882a593Smuzhiyuntxtail        8
450*4882a593Smuzhiyunfulldup       1
451*4882a593Smuzhiyunwaittime      12
452*4882a593Smuzhiyunmintime       3
453*4882a593Smuzhiyunmaxkeyup      7
454*4882a593Smuzhiyunidletime      3
455*4882a593Smuzhiyunmaxdefer      120
456*4882a593Smuzhiyungroup         0x00
457*4882a593Smuzhiyuntxoff         off
458*4882a593Smuzhiyunsoftdcd       on
459*4882a593SmuzhiyunSLIP          off
460*4882a593Smuzhiyun===========   =====
461*4882a593Smuzhiyun
462*4882a593Smuzhiyun
463*4882a593SmuzhiyunThe parameters have the following meaning:
464*4882a593Smuzhiyun
465*4882a593Smuzhiyunspeed:
466*4882a593Smuzhiyun     The baudrate on this channel in bits/sec
467*4882a593Smuzhiyun
468*4882a593Smuzhiyun     Example: sccparam /dev/scc3 speed 9600
469*4882a593Smuzhiyun
470*4882a593Smuzhiyuntxdelay:
471*4882a593Smuzhiyun     The delay (in units of 10 ms) after keying of the
472*4882a593Smuzhiyun     transmitter, until the first byte is sent. This is usually
473*4882a593Smuzhiyun     called "TXDELAY" in a TNC.  When 0 is specified, the driver
474*4882a593Smuzhiyun     will just wait until the CTS signal is asserted. This
475*4882a593Smuzhiyun     assumes the presence of a timer or other circuitry in the
476*4882a593Smuzhiyun     MODEM and/or transmitter, that asserts CTS when the
477*4882a593Smuzhiyun     transmitter is ready for data.
478*4882a593Smuzhiyun     A normal value of this parameter is 30-36.
479*4882a593Smuzhiyun
480*4882a593Smuzhiyun     Example: sccparam /dev/scc0 txd 20
481*4882a593Smuzhiyun
482*4882a593Smuzhiyunpersist:
483*4882a593Smuzhiyun     This is the probability that the transmitter will be keyed
484*4882a593Smuzhiyun     when the channel is found to be free.  It is a value from 0
485*4882a593Smuzhiyun     to 255, and the probability is (value+1)/256.  The value
486*4882a593Smuzhiyun     should be somewhere near 50-60, and should be lowered when
487*4882a593Smuzhiyun     the channel is used more heavily.
488*4882a593Smuzhiyun
489*4882a593Smuzhiyun     Example: sccparam /dev/scc2 persist 20
490*4882a593Smuzhiyun
491*4882a593Smuzhiyunslottime:
492*4882a593Smuzhiyun     This is the time between samples of the channel. It is
493*4882a593Smuzhiyun     expressed in units of 10 ms.  About 200-300 ms (value 20-30)
494*4882a593Smuzhiyun     seems to be a good value.
495*4882a593Smuzhiyun
496*4882a593Smuzhiyun     Example: sccparam /dev/scc0 slot 20
497*4882a593Smuzhiyun
498*4882a593Smuzhiyuntail:
499*4882a593Smuzhiyun     The time the transmitter will remain keyed after the last
500*4882a593Smuzhiyun     byte of a packet has been transferred to the SCC. This is
501*4882a593Smuzhiyun     necessary because the CRC and a flag still have to leave the
502*4882a593Smuzhiyun     SCC before the transmitter is keyed down. The value depends
503*4882a593Smuzhiyun     on the baudrate selected.  A few character times should be
504*4882a593Smuzhiyun     sufficient, e.g. 40ms at 1200 baud. (value 4)
505*4882a593Smuzhiyun     The value of this parameter is in 10 ms units.
506*4882a593Smuzhiyun
507*4882a593Smuzhiyun     Example: sccparam /dev/scc2 4
508*4882a593Smuzhiyun
509*4882a593Smuzhiyunfull:
510*4882a593Smuzhiyun     The full-duplex mode switch. This can be one of the following
511*4882a593Smuzhiyun     values:
512*4882a593Smuzhiyun
513*4882a593Smuzhiyun     0:   The interface will operate in CSMA mode (the normal
514*4882a593Smuzhiyun	  half-duplex packet radio operation)
515*4882a593Smuzhiyun     1:   Fullduplex mode, i.e. the transmitter will be keyed at
516*4882a593Smuzhiyun	  any time, without checking the received carrier.  It
517*4882a593Smuzhiyun	  will be unkeyed when there are no packets to be sent.
518*4882a593Smuzhiyun     2:   Like 1, but the transmitter will remain keyed, also
519*4882a593Smuzhiyun	  when there are no packets to be sent.  Flags will be
520*4882a593Smuzhiyun	  sent in that case, until a timeout (parameter 10)
521*4882a593Smuzhiyun	  occurs.
522*4882a593Smuzhiyun
523*4882a593Smuzhiyun     Example: sccparam /dev/scc0 fulldup off
524*4882a593Smuzhiyun
525*4882a593Smuzhiyunwait:
526*4882a593Smuzhiyun     The initial waittime before any transmit attempt, after the
527*4882a593Smuzhiyun     frame has been queue for transmit.  This is the length of
528*4882a593Smuzhiyun     the first slot in CSMA mode.  In full duplex modes it is
529*4882a593Smuzhiyun     set to 0 for maximum performance.
530*4882a593Smuzhiyun     The value of this parameter is in 10 ms units.
531*4882a593Smuzhiyun
532*4882a593Smuzhiyun     Example: sccparam /dev/scc1 wait 4
533*4882a593Smuzhiyun
534*4882a593Smuzhiyunmaxkey:
535*4882a593Smuzhiyun     The maximal time the transmitter will be keyed to send
536*4882a593Smuzhiyun     packets, in seconds.  This can be useful on busy CSMA
537*4882a593Smuzhiyun     channels, to avoid "getting a bad reputation" when you are
538*4882a593Smuzhiyun     generating a lot of traffic.  After the specified time has
539*4882a593Smuzhiyun     elapsed, no new frame will be started. Instead, the trans-
540*4882a593Smuzhiyun     mitter will be switched off for a specified time (parameter
541*4882a593Smuzhiyun     min), and then the selected algorithm for keyup will be
542*4882a593Smuzhiyun     started again.
543*4882a593Smuzhiyun     The value 0 as well as "off" will disable this feature,
544*4882a593Smuzhiyun     and allow infinite transmission time.
545*4882a593Smuzhiyun
546*4882a593Smuzhiyun     Example: sccparam /dev/scc0 maxk 20
547*4882a593Smuzhiyun
548*4882a593Smuzhiyunmin:
549*4882a593Smuzhiyun     This is the time the transmitter will be switched off when
550*4882a593Smuzhiyun     the maximum transmission time is exceeded.
551*4882a593Smuzhiyun
552*4882a593Smuzhiyun     Example: sccparam /dev/scc3 min 10
553*4882a593Smuzhiyun
554*4882a593Smuzhiyunidle:
555*4882a593Smuzhiyun     This parameter specifies the maximum idle time in full duplex
556*4882a593Smuzhiyun     2 mode, in seconds.  When no frames have been sent for this
557*4882a593Smuzhiyun     time, the transmitter will be keyed down.  A value of 0 is
558*4882a593Smuzhiyun     has same result as the fullduplex mode 1. This parameter
559*4882a593Smuzhiyun     can be disabled.
560*4882a593Smuzhiyun
561*4882a593Smuzhiyun     Example: sccparam /dev/scc2 idle off	# transmit forever
562*4882a593Smuzhiyun
563*4882a593Smuzhiyunmaxdefer
564*4882a593Smuzhiyun     This is the maximum time (in seconds) to wait for a free channel
565*4882a593Smuzhiyun     to send. When this timer expires the transmitter will be keyed
566*4882a593Smuzhiyun     IMMEDIATELY. If you love to get trouble with other users you
567*4882a593Smuzhiyun     should set this to a very low value ;-)
568*4882a593Smuzhiyun
569*4882a593Smuzhiyun     Example: sccparam /dev/scc0 maxdefer 240	# 2 minutes
570*4882a593Smuzhiyun
571*4882a593Smuzhiyun
572*4882a593Smuzhiyuntxoff:
573*4882a593Smuzhiyun     When this parameter has the value 0, the transmission of packets
574*4882a593Smuzhiyun     is enable. Otherwise it is disabled.
575*4882a593Smuzhiyun
576*4882a593Smuzhiyun     Example: sccparam /dev/scc2 txoff on
577*4882a593Smuzhiyun
578*4882a593Smuzhiyungroup:
579*4882a593Smuzhiyun     It is possible to build special radio equipment to use more than
580*4882a593Smuzhiyun     one frequency on the same band, e.g. using several receivers and
581*4882a593Smuzhiyun     only one transmitter that can be switched between frequencies.
582*4882a593Smuzhiyun     Also, you can connect several radios that are active on the same
583*4882a593Smuzhiyun     band.  In these cases, it is not possible, or not a good idea, to
584*4882a593Smuzhiyun     transmit on more than one frequency.  The SCC driver provides a
585*4882a593Smuzhiyun     method to lock transmitters on different interfaces, using the
586*4882a593Smuzhiyun     "param <interface> group <x>" command.  This will only work when
587*4882a593Smuzhiyun     you are using CSMA mode (parameter full = 0).
588*4882a593Smuzhiyun
589*4882a593Smuzhiyun     The number <x> must be 0 if you want no group restrictions, and
590*4882a593Smuzhiyun     can be computed as follows to create restricted groups:
591*4882a593Smuzhiyun     <x> is the sum of some OCTAL numbers:
592*4882a593Smuzhiyun
593*4882a593Smuzhiyun
594*4882a593Smuzhiyun     ===  =======================================================
595*4882a593Smuzhiyun     200  This transmitter will only be keyed when all other
596*4882a593Smuzhiyun	  transmitters in the group are off.
597*4882a593Smuzhiyun     100  This transmitter will only be keyed when the carrier
598*4882a593Smuzhiyun	  detect of all other interfaces in the group is off.
599*4882a593Smuzhiyun     0xx  A byte that can be used to define different groups.
600*4882a593Smuzhiyun	  Interfaces are in the same group, when the logical AND
601*4882a593Smuzhiyun	  between their xx values is nonzero.
602*4882a593Smuzhiyun     ===  =======================================================
603*4882a593Smuzhiyun
604*4882a593Smuzhiyun     Examples:
605*4882a593Smuzhiyun
606*4882a593Smuzhiyun     When 2 interfaces use group 201, their transmitters will never be
607*4882a593Smuzhiyun     keyed at the same time.
608*4882a593Smuzhiyun
609*4882a593Smuzhiyun     When 2 interfaces use group 101, the transmitters will only key
610*4882a593Smuzhiyun     when both channels are clear at the same time.  When group 301,
611*4882a593Smuzhiyun     the transmitters will not be keyed at the same time.
612*4882a593Smuzhiyun
613*4882a593Smuzhiyun     Don't forget to convert the octal numbers into decimal before
614*4882a593Smuzhiyun     you set the parameter.
615*4882a593Smuzhiyun
616*4882a593Smuzhiyun     Example: (to be written)
617*4882a593Smuzhiyun
618*4882a593Smuzhiyunsoftdcd:
619*4882a593Smuzhiyun     use a software dcd instead of the real one... Useful for a very
620*4882a593Smuzhiyun     slow squelch.
621*4882a593Smuzhiyun
622*4882a593Smuzhiyun     Example: sccparam /dev/scc0 soft on
623*4882a593Smuzhiyun
624*4882a593Smuzhiyun
625*4882a593Smuzhiyun4. Problems
626*4882a593Smuzhiyun===========
627*4882a593Smuzhiyun
628*4882a593SmuzhiyunIf you have tx-problems with your BayCom USCC card please check
629*4882a593Smuzhiyunthe manufacturer of the 8530. SGS chips have a slightly
630*4882a593Smuzhiyundifferent timing. Try Zilog...  A solution is to write to register 8
631*4882a593Smuzhiyuninstead to the data port, but this won't work with the ESCC chips.
632*4882a593Smuzhiyun*SIGH!*
633*4882a593Smuzhiyun
634*4882a593SmuzhiyunA very common problem is that the PTT locks until the maxkeyup timer
635*4882a593Smuzhiyunexpires, although interrupts and clock source are correct. In most
636*4882a593Smuzhiyuncases compiling the driver with CONFIG_SCC_DELAY (set with
637*4882a593Smuzhiyunmake config) solves the problems. For more hints read the (pseudo) FAQ
638*4882a593Smuzhiyunand the documentation coming with z8530drv-utils.
639*4882a593Smuzhiyun
640*4882a593SmuzhiyunI got reports that the driver has problems on some 386-based systems.
641*4882a593Smuzhiyun(i.e. Amstrad) Those systems have a bogus AT bus timing which will
642*4882a593Smuzhiyunlead to delayed answers on interrupts. You can recognize these
643*4882a593Smuzhiyunproblems by looking at the output of Sccstat for the suspected
644*4882a593Smuzhiyunport. If it shows under- and overruns you own such a system.
645*4882a593Smuzhiyun
646*4882a593SmuzhiyunDelayed processing of received data: This depends on
647*4882a593Smuzhiyun
648*4882a593Smuzhiyun- the kernel version
649*4882a593Smuzhiyun
650*4882a593Smuzhiyun- kernel profiling compiled or not
651*4882a593Smuzhiyun
652*4882a593Smuzhiyun- a high interrupt load
653*4882a593Smuzhiyun
654*4882a593Smuzhiyun- a high load of the machine --- running X, Xmorph, XV and Povray,
655*4882a593Smuzhiyun  while compiling the kernel... hmm ... even with 32 MB RAM ...  ;-)
656*4882a593Smuzhiyun  Or running a named for the whole .ampr.org domain on an 8 MB
657*4882a593Smuzhiyun  box...
658*4882a593Smuzhiyun
659*4882a593Smuzhiyun- using information from rxecho or kissbridge.
660*4882a593Smuzhiyun
661*4882a593SmuzhiyunKernel panics: please read /linux/README and find out if it
662*4882a593Smuzhiyunreally occurred within the scc driver.
663*4882a593Smuzhiyun
664*4882a593SmuzhiyunIf you cannot solve a problem, send me
665*4882a593Smuzhiyun
666*4882a593Smuzhiyun- a description of the problem,
667*4882a593Smuzhiyun- information on your hardware (computer system, scc board, modem)
668*4882a593Smuzhiyun- your kernel version
669*4882a593Smuzhiyun- the output of cat /proc/net/z8530
670*4882a593Smuzhiyun
671*4882a593Smuzhiyun4. Thor RLC100
672*4882a593Smuzhiyun==============
673*4882a593Smuzhiyun
674*4882a593SmuzhiyunMysteriously this board seems not to work with the driver. Anyone
675*4882a593Smuzhiyungot it up-and-running?
676*4882a593Smuzhiyun
677*4882a593Smuzhiyun
678*4882a593SmuzhiyunMany thanks to Linus Torvalds and Alan Cox for including the driver
679*4882a593Smuzhiyunin the Linux standard distribution and their support.
680*4882a593Smuzhiyun
681*4882a593Smuzhiyun::
682*4882a593Smuzhiyun
683*4882a593Smuzhiyun	Joerg Reuter	ampr-net: dl1bke@db0pra.ampr.org
684*4882a593Smuzhiyun			AX-25   : DL1BKE @ DB0ABH.#BAY.DEU.EU
685*4882a593Smuzhiyun			Internet: jreuter@yaina.de
686*4882a593Smuzhiyun			WWW     : http://yaina.de/jreuter
687