summaryrefslogtreecommitdiffstats
path: root/hdlcutil/sethdlc.8
blob: d232b6cd0d2eda7f273ea6b703ae487f90ffedfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
.\" Copyright 1996 Thomas Sailer (sailer@ife.ee.ethz.ch)
.\" May be distributed under the GNU General Public License
.\"
.\" portions from setserial.8 by Rickard E. Faith (faith@cs.unc.edu)
.\" "
.TH SETHDLC 8 "1 October 1996" "Sethdlc 0.1" "Linux Programmer's Manual"
.SH NAME
sethdlc \- get/set Linux HDLC packet radio modem driver port information
.SH SYNOPSIS
.B sethdlc
.B "[ \-bdhs ]"
.B "[\-i device]"

.B "sethdlc [\-i device] -c"
cal

.B "sethdlc\ -p"
.B "[\-i\ device]"
.BR "[\ mode\ " mode "\ ]"
.BR "[\ io\ " iobase "\ ]"
.BR "[\ irq\ " irq "\ ]"
.BR "[\ dma\ " dma "\ ]"
.BR "[\ dma2\ " dma2 "\ ]"
.BR "[\ serio\ " seriobase "\ ]"
.BR "[\ pario\ " pariobase "\ ]"
.BR "[\ midiio\ " midiiobase "\ ]"
.BR "[\ options\ " options "\ ]"

.B "sethdlc\ -a"
.B "[\-i\ device]"
.BR "[\ txd\ " txdelay "\ ]"
.BR "[\ txtail\ " txtail "\ ]"
.BR "[\ slot\ " slottime "\ ]"
.BR "[\ ppersist\ " ppersistence "\ ]"
.BR "[\ full\ ]"
.BR "[\ half\ ]"


.SH DESCRIPTION
.B sethdlc
is a program designed to set and/or report the configuration information
associated with a soundcard radio modem port.  This information includes the
modem type, what I/O port, IRQ and DMA channel a particular modem
port is using, and where to output a transmitter keying (PTT) signal.

With the
.B \-p
option,
.B sethdlc
sets and/or reports the port configuration.

With the
.B \-a
option,
.B sethdlc
sets and/or reports the AX.25 channel access parameters. These parameters can also
be set with the
.I kissparms
utility.

With the
.B \-c
option,
.B sethdlc
instructs the driver to send a calibration pattern for
.I cal
seconds.

Without the 
.B \-p,
.B \-a
and
.B \-c
option,
.B sethdlc
will stay in the foreground and display received packets. The AX.25 header
and eventually a FlexNet compressed header are decoded. CTRL-C terminates
.B sethdlc.
Specifying additional options, 
.B sethdlc
may display additional information.


.SH OPTIONS
.B sethdlc
accepts the following options:

.TP
.B \-b
Trace the bits at the output of the demodulator, after RX clock recovery. 
This option is only available if \fBsethdlc\fP
and the soundcard modem kernel driver is compiled with debugging support on.
This is useful for driver debugging.
.TP
.B \-d
Trace DCD, PTT and other status information on stdout. \fBsethdlc\fP
displays two times per second a line containing these informations.
.TP
.B \-h
Display an overview of the available command line parameters and exit.
.TP
.B \-i
The
.I device
argument specifies the HDLC modem device which should be configured or
interrogated.  It will usually have the following form:
\fIbc[0-3]\fP for the baycom driver and
\fIsm[0-3]\fP for the soundcard modem driver.
.TP
.B \-s
Trace the bits at the demodulator output, \fIbefore\fP
the RX clock recovery, to stdout. This option is only available the modem driver
is compiled with debugging support on. It may not be available on some modem, such 
as the \fIpar96\fP.

.SH PARAMETERS
The following parameters can be assigned to a soundcard radio modem port.

All numerical parameter values are assumed to be in decimal unless preceeded by "0x".

The
.B mode
parameter sets the type of hardware and the operating mode of the driver.
\fIser12\fP and \fIpar96\fP are valid modes for the \fBbaycom\fP driver.
A star "\fI*\fP" may be added to enable software DCD. The \fBmode\fP string
format of the \fBsoundmodem\fP driver is as follows: \fIhw:mode\fP.
\fIhw\fP may be either \fIsbc\fP, \fIwss\fP or \fIwssfdx\fP. The first
one specifies SoundBlaster compatible soundcards, the second one
WindowsSoundSystem compatible hardware, and the third one WSS fullduplex
operation (which currently works with Crystal Semiconductor Chipsets
CS423[126]). The \fImode\fP portion may be \fIafsk1200\fP or \fIfsk9600\fP.
Optionally, the receive and transmit modes may be different
(\fIhw:txmode.rxmode\fP).

The
.B ioport
parameter sets the I/O port address. Typical values for the \fIser12\fP modem are
0x3f8, 0x2f8, 0x3e8 or 0x2e8, for the \fIpar96\fP modem 0x378, 0x278 or 0x3bc, for
the \fIsbc\fP modems 0x220 and for the \fIwss\fP modems 0x530, 0x608, 0xe80 or 0xf40.

The
.B irq
parameter sets the hardware IRQ number. Typical values for the \fIser12\fP modem are
4 and 3, for the \fIpar96\fP modem 7 or 5, for the \fIsbc\fP modems are 7 or 5 and for
the \fIwss\fP modems, any free IRQ from the set 2, 7, 9, 10, 11 will do. The driver
automatically configures the WSS soundcard to the correct IRQ.

The
.B dma
parameter sets the hardware DMA number. Typical values for the \fIsbc\fP modems are
1 or 0 and for the \fIwss\fP modems, any free DMA from 0 to 3 (except 2) will do.
The driver automatically configures the WSS soundcard to the correct DMA.
The Baycom modems do not need DMA.

The
.B dma2
parameter sets the second hardware DMA number. This is only needed for
full duplex operation with the \fBsoundmodem\fP driver.

The
.B seriobase
parameter optionally sets the address of a serial port, where
the driver will output a PTT signal at the TxD and RTS pins, and a DCD
signal at the DTR pin. As Baycom modems do have their own PTT pin, this 
parameter is not used by the Baycom modem driver.

The
.B pariobase
parameter optionally sets the address of a LPT port where
the driver will output a PTT signal on the DATA0 line and a DCD signal
on the DATA1 line. As Baycom modems do have their own PTT pin, this 
parameter is not used by the Baycom modem driver.

The
.B midiiobase
parameter optionally sets the address of a MPU401 compatible
MIDI port, where the driver will output a PTT signal. Since the MIDI port is
effectively an UART and therefore cannot output a DC signal, the output must
be fed through a retriggerable monoflop with a period of about 15ms. See
.I http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html
for a sample schematic diagram. As Baycom modems do have their own PTT pin,
this parameter is not used by the Baycom modem driver.

The
.B txdelay
sets the transmitter keyup delay time. Unlike \fIkissparms\fP, the unit is
\fItens of ms\fP. This is the time the transmitter needs to switch its PA
on and for its frequency synthesizer to settle. Typical values for a handheld
transceiver are 200ms (i.e. 20), and for a good crystal driven transceiver
20ms (i.e. 2).

The
.B txtail
sets the time PTT is held after the last packet. Unlike \fIkissparms\fP, the unit
is \fItens of ms\fP. Do not set this value to 0. Most modems need some extra
time to actually clock the last bits out to the transmitter.

The
.B slottime
parameter specifies how often the channel access algorithm is executed.
Unlike \fIkissparms\fP, the unit is \fItens of ms\fP. Unless you have very 
specific requirements, set this to 100ms (i.e. 10).

The
.B ppersist
sets how "eagerly" the station starts to transmit as soon as the channel
gets free. The optimum value is 256 divided by the number of stations on the
channel. (This should really be done automatically by the L2)

.B full
sets the modem to full duplex mode. Note that some modems do not actually support
full duplex mode, in this case this parameter makes the modem start its transmission
as soon as it gets packets from the upper layer, without waiting for the channel
to become free. This is needed by some implementations of alternative channel
access algorithms, e.g. \fIDAMA\fP.

.B half
sets the modem to half duplex mode.

.SH CONSIDERATIONS OF CONFIGURING BAYCOM PORTS
It is important to note that sethdlc merely tells the Linux kernel
where it should expect to find the I/O port and IRQ lines of a
particular serial port.  It does 
.I not
configure the hardware to use a
particular I/O port.  In order to do that, you will need to physically
program the serial board, usually by setting some jumpers or by
switching some DIP switches.

This section will provide some pointers in helping you decide how you
would like to configure your baycom ports.

The "standard MS-DOS" port associations are given below:

.nf
.RS
COM1, port 0x3f8, irq 4
COM2, port 0x2f8, irq 3
COM3, port 0x3e8, irq 4
COM4, port 0x2e8, irq 3
LPT1, port 0x378, irq 7
LPT1 (on hercules graphics adapter), port 0x3bc, irq 7
LPT1, port 0x278, irq 5
.RE
.fi

.SH CONSIDERATIONS OF CONFIGURING SOUNDCARD RADIO MODEM PORTS
Some cards need to be initialized before they act as a WSS or SoundBlaster
compatible card. This driver does \fInot\fP do this. You can use the standard
linux sound driver, if compiled as a module. Just load the sound driver
(insmod sound) and remove it again (rmmod sound). The card should then be
configured for either soundblaster or WSS compatibility. If this does not work
for some reason, you'll have to write your own soundcard configuration
utility. This is not as complicated as it sounds; it can be done from
user space (but requiring root privileges) using \fIioperm\fP and/or \fIiopl\fP.

It is important that the audio levels of your radio match those of the
soundcard. To help achieve this, there are two utilities: \fIsmdiag\fP
and \fIsmmixer\fP. See their respective manpage.

The sound driver and the soundcard modem driver are mutually exclusive, i.e. they
cannot both access the same soundcard at the same time. Even worse, the sound driver
reserves the soundcard as soon as it gets loaded. The souncard modem driver however
reserves the card only when the interface is started, i.e. during ifconfig sm[0-3] up.

9600 baud may not currently work on SoundBlaster cards with DSP revision 4.x, i.e.
SB16 and SB32 AWE. This is because they seem to not be fully backwards compatible.

.SH CAUTION
CAUTION: Using an invalid port can lock up your machine.

.SH "SEE ALSO"
.nf
.BR smdiag "\ (8), " smmixer "\ (8), " kissparms "\ (8),"
linux/drivers/net/hdlcdrv.c,
linux/drivers/net/baycom.c,
linux/drivers/net/soundmodem.c
.fi

.SH AUTHOR
sethdlc was written by Thomas Sailer, HB9JNX/AE4WA (sailer@ife.ee.ethz.ch).
Inspired by setserial.