162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci==============
462306a36Sopenharmony_ci6pack Protocol
562306a36Sopenharmony_ci==============
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciThis is the 6pack-mini-HOWTO, written by
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciAndreas Könsgen DG3KQ
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci:Internet: ajk@comnets.uni-bremen.de
1262306a36Sopenharmony_ci:AMPR-net: dg3kq@db0pra.ampr.org
1362306a36Sopenharmony_ci:AX.25:    dg3kq@db0ach.#nrw.deu.eu
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciLast update: April 7, 1998
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci1. What is 6pack, and what are the advantages to KISS?
1862306a36Sopenharmony_ci======================================================
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci6pack is a transmission protocol for data exchange between the PC and
2162306a36Sopenharmony_cithe TNC over a serial line. It can be used as an alternative to KISS.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci6pack has two major advantages:
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci- The PC is given full control over the radio
2662306a36Sopenharmony_ci  channel. Special control data is exchanged between the PC and the TNC so
2762306a36Sopenharmony_ci  that the PC knows at any time if the TNC is receiving data, if a TNC
2862306a36Sopenharmony_ci  buffer underrun or overrun has occurred, if the PTT is
2962306a36Sopenharmony_ci  set and so on. This control data is processed at a higher priority than
3062306a36Sopenharmony_ci  normal data, so a data stream can be interrupted at any time to issue an
3162306a36Sopenharmony_ci  important event. This helps to improve the channel access and timing
3262306a36Sopenharmony_ci  algorithms as everything is computed in the PC. It would even be possible
3362306a36Sopenharmony_ci  to experiment with something completely different from the known CSMA and
3462306a36Sopenharmony_ci  DAMA channel access methods.
3562306a36Sopenharmony_ci  This kind of real-time control is especially important to supply several
3662306a36Sopenharmony_ci  TNCs that are connected between each other and the PC by a daisy chain
3762306a36Sopenharmony_ci  (however, this feature is not supported yet by the Linux 6pack driver).
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci- Each packet transferred over the serial line is supplied with a checksum,
4062306a36Sopenharmony_ci  so it is easy to detect errors due to problems on the serial line.
4162306a36Sopenharmony_ci  Received packets that are corrupt are not passed on to the AX.25 layer.
4262306a36Sopenharmony_ci  Damaged packets that the TNC has received from the PC are not transmitted.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciMore details about 6pack are described in the file 6pack.ps that is located
4562306a36Sopenharmony_ciin the doc directory of the AX.25 utilities package.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci2. Who has developed the 6pack protocol?
4862306a36Sopenharmony_ci========================================
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciThe 6pack protocol has been developed by Ekki Plicht DF4OR, Henning Rech
5162306a36Sopenharmony_ciDF9IC and Gunter Jost DK7WJ. A driver for 6pack, written by Gunter Jost and
5262306a36Sopenharmony_ciMatthias Welwarsky DG2FEF, comes along with the PC version of FlexNet.
5362306a36Sopenharmony_ciThey have also written a firmware for TNCs to perform the 6pack
5462306a36Sopenharmony_ciprotocol (see section 4 below).
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci3. Where can I get the latest version of 6pack for LinuX?
5762306a36Sopenharmony_ci=========================================================
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciAt the moment, the 6pack stuff can obtained via anonymous ftp from
6062306a36Sopenharmony_cidb0bm.automation.fh-aachen.de. In the directory /incoming/dg3kq,
6162306a36Sopenharmony_cithere is a file named 6pack.tgz.
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci4. Preparing the TNC for 6pack operation
6462306a36Sopenharmony_ci========================================
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ciTo be able to use 6pack, a special firmware for the TNC is needed. The EPROM
6762306a36Sopenharmony_ciof a newly bought TNC does not contain 6pack, so you will have to
6862306a36Sopenharmony_ciprogram an EPROM yourself. The image file for 6pack EPROMs should be
6962306a36Sopenharmony_ciavailable on any packet radio box where PC/FlexNet can be found. The name of
7062306a36Sopenharmony_cithe file is 6pack.bin. This file is copyrighted and maintained by the FlexNet
7162306a36Sopenharmony_citeam. It can be used under the terms of the license that comes along
7262306a36Sopenharmony_ciwith PC/FlexNet. Please do not ask me about the internals of this file as I
7362306a36Sopenharmony_cidon't know anything about it. I used a textual description of the 6pack
7462306a36Sopenharmony_ciprotocol to program the Linux driver.
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ciTNCs contain a 64kByte EPROM, the lower half of which is used for
7762306a36Sopenharmony_cithe firmware/KISS. The upper half is either empty or is sometimes
7862306a36Sopenharmony_ciprogrammed with software called TAPR. In the latter case, the TNC
7962306a36Sopenharmony_ciis supplied with a DIP switch so you can easily change between the
8062306a36Sopenharmony_citwo systems. When programming a new EPROM, one of the systems is replaced
8162306a36Sopenharmony_ciby 6pack. It is useful to replace TAPR, as this software is rarely used
8262306a36Sopenharmony_cinowadays. If your TNC is not equipped with the switch mentioned above, you
8362306a36Sopenharmony_cican build in one yourself that switches over the highest address pin
8462306a36Sopenharmony_ciof the EPROM between HIGH and LOW level. After having inserted the new EPROM
8562306a36Sopenharmony_ciand switched to 6pack, apply power to the TNC for a first test. The connect
8662306a36Sopenharmony_ciand the status LED are lit for about a second if the firmware initialises
8762306a36Sopenharmony_cithe TNC correctly.
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci5. Building and installing the 6pack driver
9062306a36Sopenharmony_ci===========================================
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ciThe driver has been tested with kernel version 2.1.90. Use with older
9362306a36Sopenharmony_cikernels may lead to a compilation error because the interface to a kernel
9462306a36Sopenharmony_cifunction has been changed in the 2.1.8x kernels.
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ciHow to turn on 6pack support:
9762306a36Sopenharmony_ci=============================
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci- In the linux kernel configuration program, select the code maturity level
10062306a36Sopenharmony_ci  options menu and turn on the prompting for development drivers.
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci- Select the amateur radio support menu and turn on the serial port 6pack
10362306a36Sopenharmony_ci  driver.
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci- Compile and install the kernel and the modules.
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ciTo use the driver, the kissattach program delivered with the AX.25 utilities
10862306a36Sopenharmony_cihas to be modified.
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci- Do a cd to the directory that holds the kissattach sources. Edit the
11162306a36Sopenharmony_ci  kissattach.c file. At the top, insert the following lines::
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci    #ifndef N_6PACK
11462306a36Sopenharmony_ci    #define N_6PACK (N_AX25+1)
11562306a36Sopenharmony_ci    #endif
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci  Then find the line:
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci    int disc = N_AX25;
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci  and replace N_AX25 by N_6PACK.
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci- Recompile kissattach. Rename it to spattach to avoid confusions.
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ciInstalling the driver:
12662306a36Sopenharmony_ci----------------------
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci- Do an insmod 6pack. Look at your /var/log/messages file to check if the
12962306a36Sopenharmony_ci  module has printed its initialization message.
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci- Do a spattach as you would launch kissattach when starting a KISS port.
13262306a36Sopenharmony_ci  Check if the kernel prints the message '6pack: TNC found'.
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci- From here, everything should work as if you were setting up a KISS port.
13562306a36Sopenharmony_ci  The only difference is that the network device that represents
13662306a36Sopenharmony_ci  the 6pack port is called sp instead of sl or ax. So, sp0 would be the
13762306a36Sopenharmony_ci  first 6pack port.
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ciAlthough the driver has been tested on various platforms, I still declare it
14062306a36Sopenharmony_ciALPHA. BE CAREFUL! Sync your disks before insmoding the 6pack module
14162306a36Sopenharmony_ciand spattaching. Watch out if your computer behaves strangely. Read section
14262306a36Sopenharmony_ci6 of this file about known problems.
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ciNote that the connect and status LEDs of the TNC are controlled in a
14562306a36Sopenharmony_cidifferent way than they are when the TNC is used with PC/FlexNet. When using
14662306a36Sopenharmony_ciFlexNet, the connect LED is on if there is a connection; the status LED is
14762306a36Sopenharmony_cion if there is data in the buffer of the PC's AX.25 engine that has to be
14862306a36Sopenharmony_citransmitted. Under Linux, the 6pack layer is beyond the AX.25 layer,
14962306a36Sopenharmony_ciso the 6pack driver doesn't know anything about connects or data that
15062306a36Sopenharmony_cihas not yet been transmitted. Therefore the LEDs are controlled
15162306a36Sopenharmony_cias they are in KISS mode: The connect LED is turned on if data is transferred
15262306a36Sopenharmony_cifrom the PC to the TNC over the serial line, the status LED if data is
15362306a36Sopenharmony_cisent to the PC.
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci6. Known problems
15662306a36Sopenharmony_ci=================
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ciWhen testing the driver with 2.0.3x kernels and
15962306a36Sopenharmony_cioperating with data rates on the radio channel of 9600 Baud or higher,
16062306a36Sopenharmony_cithe driver may, on certain systems, sometimes print the message '6pack:
16162306a36Sopenharmony_cibad checksum', which is due to data loss if the other station sends two
16262306a36Sopenharmony_cior more subsequent packets. I have been told that this is due to a problem
16362306a36Sopenharmony_ciwith the serial driver of 2.0.3x kernels. I don't know yet if the problem
16462306a36Sopenharmony_cistill exists with 2.1.x kernels, as I have heard that the serial driver
16562306a36Sopenharmony_cicode has been changed with 2.1.x.
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ciWhen shutting down the sp interface with ifconfig, the kernel crashes if
16862306a36Sopenharmony_cithere is still an AX.25 connection left over which an IP connection was
16962306a36Sopenharmony_cirunning, even if that IP connection is already closed. The problem does not
17062306a36Sopenharmony_cioccur when there is a bare AX.25 connection still running. I don't know if
17162306a36Sopenharmony_cithis is a problem of the 6pack driver or something else in the kernel.
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ciThe driver has been tested as a module, not yet as a kernel-builtin driver.
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ciThe 6pack protocol supports daisy-chaining of TNCs in a token ring, which is
17662306a36Sopenharmony_ciconnected to one serial port of the PC. This feature is not implemented
17762306a36Sopenharmony_ciand at least at the moment I won't be able to do it because I do not have
17862306a36Sopenharmony_cithe opportunity to build a TNC daisy-chain and test it.
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ciSome of the comments in the source code are inaccurate. They are left from
18162306a36Sopenharmony_cithe SLIP/KISS driver, from which the 6pack driver has been derived.
18262306a36Sopenharmony_ciI haven't modified or removed them yet -- sorry! The code itself needs
18362306a36Sopenharmony_cisome cleaning and optimizing. This will be done in a later release.
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ciIf you encounter a bug or if you have a question or suggestion concerning the
18662306a36Sopenharmony_cidriver, feel free to mail me, using the addresses given at the beginning of
18762306a36Sopenharmony_cithis file.
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ciHave fun!
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ciAndreas
192