sethdlc man page
sethdlc — get/set Linux HDLC packet radio modem driver port information
sethdlc [ -bdhs ] [-i device]
sethdlc [-i device] -c cal
sethdlc -p [-i device] [ mode mode ] [ io iobase ] [ irq irq ] [ dma dma ] [ dma2 dma2 ] [ serio seriobase ] [ pario pariobase ] [ midiio midiiobase ] [ options options ]
sethdlc -a [-i device] [ txd txdelay ] [ txtail txtail ] [ slot slottime ] [ ppersist ppersistence ] [ full ] [ half ]
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 -p option, sethdlc sets and/or reports the port configuration.
With the -a option, sethdlc sets and/or reports the AX.25 channel access parameters. These parameters can also be set with the kissparms utility.
With the -c option, sethdlc instructs the driver to send a calibration pattern for cal seconds.
Without the -p, -a and -c option, 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 sethdlc. Specifying additional options, sethdlc may display additional information.
sethdlc accepts the following options:
Trace the bits at the output of the demodulator, after RX clock recovery. This option is only available if sethdlc and the soundcard modem kernel driver is compiled with debugging support on. This is useful for driver debugging.
Trace DCD, PTT and other status information on stdout. sethdlc displays two times per second a line containing these informations.
Display an overview of the available command line parameters and exit.
The device argument specifies the HDLC modem device which should be configured or interrogated. It will usually have the following form: bc[0-3] for the baycom driver and sm[0-3] for the soundcard modem driver.
Trace the bits at the demodulator output, before 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 par96.
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 mode parameter sets the type of hardware and the operating mode of the driver. ser12 and par96 are valid modes for the baycom driver. A star "*" may be added to enable software DCD. The mode string format of the soundmodem driver is as follows: hw:mode. hw may be either sbc, wss or wssfdx. 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). The mode portion may be afsk1200 or fsk9600. Optionally, the receive and transmit modes may be different (hw:txmode.rxmode).
The ioport parameter sets the I/O port address. Typical values for the ser12 modem are 0x3f8, 0x2f8, 0x3e8 or 0x2e8, for the par96 modem 0x378, 0x278 or 0x3bc, for the sbc modems 0x220 and for the wss modems 0x530, 0x608, 0xe80 or 0xf40.
The irq parameter sets the hardware IRQ number. Typical values for the ser12 modem are 4 and 3, for the par96 modem 7 or 5, for the sbc modems are 7 or 5 and for the wss 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 dma parameter sets the hardware DMA number. Typical values for the sbc modems are 1 or 0 and for the wss 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 dma2 parameter sets the second hardware DMA number. This is only needed for full duplex operation with the soundmodem driver.
The 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 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 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 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 txdelay sets the transmitter keyup delay time. Unlike kissparms, the unit is tens of ms. 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 txtail sets the time PTT is held after the last packet. Unlike kissparms, the unit is tens of ms. Do not set this value to 0. Most modems need some extra time to actually clock the last bits out to the transmitter.
The slottime parameter specifies how often the channel access algorithm is executed. Unlike kissparms, the unit is tens of ms. Unless you have very specific requirements, set this to 100ms (i.e. 10).
The 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)
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. DAMA.
half sets the modem to half duplex mode.
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 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:
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
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 not 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 ioperm and/or iopl.
It is important that the audio levels of your radio match those of the soundcard. To help achieve this, there are two utilities: smdiag and smmixer. 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.
CAUTION: Using an invalid port can lock up your machine.
smdiag (8), smmixer (8), kissparms (8), linux/drivers/net/hdlcdrv.c, linux/drivers/net/baycom.c, linux/drivers/net/soundmodem.c
sethdlc was written by Thomas Sailer, HB9JNX/AE4WA (firstname.lastname@example.org). Inspired by setserial.