xref: /OK3568_Linux_fs/kernel/Documentation/networking/6pack.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun==============
4*4882a593Smuzhiyun6pack Protocol
5*4882a593Smuzhiyun==============
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunThis is the 6pack-mini-HOWTO, written by
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunAndreas Könsgen DG3KQ
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun:Internet: ajk@comnets.uni-bremen.de
12*4882a593Smuzhiyun:AMPR-net: dg3kq@db0pra.ampr.org
13*4882a593Smuzhiyun:AX.25:    dg3kq@db0ach.#nrw.deu.eu
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunLast update: April 7, 1998
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun1. What is 6pack, and what are the advantages to KISS?
18*4882a593Smuzhiyun======================================================
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun6pack is a transmission protocol for data exchange between the PC and
21*4882a593Smuzhiyunthe TNC over a serial line. It can be used as an alternative to KISS.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun6pack has two major advantages:
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun- The PC is given full control over the radio
26*4882a593Smuzhiyun  channel. Special control data is exchanged between the PC and the TNC so
27*4882a593Smuzhiyun  that the PC knows at any time if the TNC is receiving data, if a TNC
28*4882a593Smuzhiyun  buffer underrun or overrun has occurred, if the PTT is
29*4882a593Smuzhiyun  set and so on. This control data is processed at a higher priority than
30*4882a593Smuzhiyun  normal data, so a data stream can be interrupted at any time to issue an
31*4882a593Smuzhiyun  important event. This helps to improve the channel access and timing
32*4882a593Smuzhiyun  algorithms as everything is computed in the PC. It would even be possible
33*4882a593Smuzhiyun  to experiment with something completely different from the known CSMA and
34*4882a593Smuzhiyun  DAMA channel access methods.
35*4882a593Smuzhiyun  This kind of real-time control is especially important to supply several
36*4882a593Smuzhiyun  TNCs that are connected between each other and the PC by a daisy chain
37*4882a593Smuzhiyun  (however, this feature is not supported yet by the Linux 6pack driver).
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun- Each packet transferred over the serial line is supplied with a checksum,
40*4882a593Smuzhiyun  so it is easy to detect errors due to problems on the serial line.
41*4882a593Smuzhiyun  Received packets that are corrupt are not passed on to the AX.25 layer.
42*4882a593Smuzhiyun  Damaged packets that the TNC has received from the PC are not transmitted.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunMore details about 6pack are described in the file 6pack.ps that is located
45*4882a593Smuzhiyunin the doc directory of the AX.25 utilities package.
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun2. Who has developed the 6pack protocol?
48*4882a593Smuzhiyun========================================
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunThe 6pack protocol has been developed by Ekki Plicht DF4OR, Henning Rech
51*4882a593SmuzhiyunDF9IC and Gunter Jost DK7WJ. A driver for 6pack, written by Gunter Jost and
52*4882a593SmuzhiyunMatthias Welwarsky DG2FEF, comes along with the PC version of FlexNet.
53*4882a593SmuzhiyunThey have also written a firmware for TNCs to perform the 6pack
54*4882a593Smuzhiyunprotocol (see section 4 below).
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun3. Where can I get the latest version of 6pack for LinuX?
57*4882a593Smuzhiyun=========================================================
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunAt the moment, the 6pack stuff can obtained via anonymous ftp from
60*4882a593Smuzhiyundb0bm.automation.fh-aachen.de. In the directory /incoming/dg3kq,
61*4882a593Smuzhiyunthere is a file named 6pack.tgz.
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun4. Preparing the TNC for 6pack operation
64*4882a593Smuzhiyun========================================
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunTo be able to use 6pack, a special firmware for the TNC is needed. The EPROM
67*4882a593Smuzhiyunof a newly bought TNC does not contain 6pack, so you will have to
68*4882a593Smuzhiyunprogram an EPROM yourself. The image file for 6pack EPROMs should be
69*4882a593Smuzhiyunavailable on any packet radio box where PC/FlexNet can be found. The name of
70*4882a593Smuzhiyunthe file is 6pack.bin. This file is copyrighted and maintained by the FlexNet
71*4882a593Smuzhiyunteam. It can be used under the terms of the license that comes along
72*4882a593Smuzhiyunwith PC/FlexNet. Please do not ask me about the internals of this file as I
73*4882a593Smuzhiyundon't know anything about it. I used a textual description of the 6pack
74*4882a593Smuzhiyunprotocol to program the Linux driver.
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunTNCs contain a 64kByte EPROM, the lower half of which is used for
77*4882a593Smuzhiyunthe firmware/KISS. The upper half is either empty or is sometimes
78*4882a593Smuzhiyunprogrammed with software called TAPR. In the latter case, the TNC
79*4882a593Smuzhiyunis supplied with a DIP switch so you can easily change between the
80*4882a593Smuzhiyuntwo systems. When programming a new EPROM, one of the systems is replaced
81*4882a593Smuzhiyunby 6pack. It is useful to replace TAPR, as this software is rarely used
82*4882a593Smuzhiyunnowadays. If your TNC is not equipped with the switch mentioned above, you
83*4882a593Smuzhiyuncan build in one yourself that switches over the highest address pin
84*4882a593Smuzhiyunof the EPROM between HIGH and LOW level. After having inserted the new EPROM
85*4882a593Smuzhiyunand switched to 6pack, apply power to the TNC for a first test. The connect
86*4882a593Smuzhiyunand the status LED are lit for about a second if the firmware initialises
87*4882a593Smuzhiyunthe TNC correctly.
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun5. Building and installing the 6pack driver
90*4882a593Smuzhiyun===========================================
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunThe driver has been tested with kernel version 2.1.90. Use with older
93*4882a593Smuzhiyunkernels may lead to a compilation error because the interface to a kernel
94*4882a593Smuzhiyunfunction has been changed in the 2.1.8x kernels.
95*4882a593Smuzhiyun
96*4882a593SmuzhiyunHow to turn on 6pack support:
97*4882a593Smuzhiyun=============================
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun- In the linux kernel configuration program, select the code maturity level
100*4882a593Smuzhiyun  options menu and turn on the prompting for development drivers.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun- Select the amateur radio support menu and turn on the serial port 6pack
103*4882a593Smuzhiyun  driver.
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun- Compile and install the kernel and the modules.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunTo use the driver, the kissattach program delivered with the AX.25 utilities
108*4882a593Smuzhiyunhas to be modified.
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun- Do a cd to the directory that holds the kissattach sources. Edit the
111*4882a593Smuzhiyun  kissattach.c file. At the top, insert the following lines::
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun    #ifndef N_6PACK
114*4882a593Smuzhiyun    #define N_6PACK (N_AX25+1)
115*4882a593Smuzhiyun    #endif
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun  Then find the line:
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun    int disc = N_AX25;
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun  and replace N_AX25 by N_6PACK.
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun- Recompile kissattach. Rename it to spattach to avoid confusions.
124*4882a593Smuzhiyun
125*4882a593SmuzhiyunInstalling the driver:
126*4882a593Smuzhiyun----------------------
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun- Do an insmod 6pack. Look at your /var/log/messages file to check if the
129*4882a593Smuzhiyun  module has printed its initialization message.
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun- Do a spattach as you would launch kissattach when starting a KISS port.
132*4882a593Smuzhiyun  Check if the kernel prints the message '6pack: TNC found'.
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun- From here, everything should work as if you were setting up a KISS port.
135*4882a593Smuzhiyun  The only difference is that the network device that represents
136*4882a593Smuzhiyun  the 6pack port is called sp instead of sl or ax. So, sp0 would be the
137*4882a593Smuzhiyun  first 6pack port.
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunAlthough the driver has been tested on various platforms, I still declare it
140*4882a593SmuzhiyunALPHA. BE CAREFUL! Sync your disks before insmoding the 6pack module
141*4882a593Smuzhiyunand spattaching. Watch out if your computer behaves strangely. Read section
142*4882a593Smuzhiyun6 of this file about known problems.
143*4882a593Smuzhiyun
144*4882a593SmuzhiyunNote that the connect and status LEDs of the TNC are controlled in a
145*4882a593Smuzhiyundifferent way than they are when the TNC is used with PC/FlexNet. When using
146*4882a593SmuzhiyunFlexNet, the connect LED is on if there is a connection; the status LED is
147*4882a593Smuzhiyunon if there is data in the buffer of the PC's AX.25 engine that has to be
148*4882a593Smuzhiyuntransmitted. Under Linux, the 6pack layer is beyond the AX.25 layer,
149*4882a593Smuzhiyunso the 6pack driver doesn't know anything about connects or data that
150*4882a593Smuzhiyunhas not yet been transmitted. Therefore the LEDs are controlled
151*4882a593Smuzhiyunas they are in KISS mode: The connect LED is turned on if data is transferred
152*4882a593Smuzhiyunfrom the PC to the TNC over the serial line, the status LED if data is
153*4882a593Smuzhiyunsent to the PC.
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun6. Known problems
156*4882a593Smuzhiyun=================
157*4882a593Smuzhiyun
158*4882a593SmuzhiyunWhen testing the driver with 2.0.3x kernels and
159*4882a593Smuzhiyunoperating with data rates on the radio channel of 9600 Baud or higher,
160*4882a593Smuzhiyunthe driver may, on certain systems, sometimes print the message '6pack:
161*4882a593Smuzhiyunbad checksum', which is due to data loss if the other station sends two
162*4882a593Smuzhiyunor more subsequent packets. I have been told that this is due to a problem
163*4882a593Smuzhiyunwith the serial driver of 2.0.3x kernels. I don't know yet if the problem
164*4882a593Smuzhiyunstill exists with 2.1.x kernels, as I have heard that the serial driver
165*4882a593Smuzhiyuncode has been changed with 2.1.x.
166*4882a593Smuzhiyun
167*4882a593SmuzhiyunWhen shutting down the sp interface with ifconfig, the kernel crashes if
168*4882a593Smuzhiyunthere is still an AX.25 connection left over which an IP connection was
169*4882a593Smuzhiyunrunning, even if that IP connection is already closed. The problem does not
170*4882a593Smuzhiyunoccur when there is a bare AX.25 connection still running. I don't know if
171*4882a593Smuzhiyunthis is a problem of the 6pack driver or something else in the kernel.
172*4882a593Smuzhiyun
173*4882a593SmuzhiyunThe driver has been tested as a module, not yet as a kernel-builtin driver.
174*4882a593Smuzhiyun
175*4882a593SmuzhiyunThe 6pack protocol supports daisy-chaining of TNCs in a token ring, which is
176*4882a593Smuzhiyunconnected to one serial port of the PC. This feature is not implemented
177*4882a593Smuzhiyunand at least at the moment I won't be able to do it because I do not have
178*4882a593Smuzhiyunthe opportunity to build a TNC daisy-chain and test it.
179*4882a593Smuzhiyun
180*4882a593SmuzhiyunSome of the comments in the source code are inaccurate. They are left from
181*4882a593Smuzhiyunthe SLIP/KISS driver, from which the 6pack driver has been derived.
182*4882a593SmuzhiyunI haven't modified or removed them yet -- sorry! The code itself needs
183*4882a593Smuzhiyunsome cleaning and optimizing. This will be done in a later release.
184*4882a593Smuzhiyun
185*4882a593SmuzhiyunIf you encounter a bug or if you have a question or suggestion concerning the
186*4882a593Smuzhiyundriver, feel free to mail me, using the addresses given at the beginning of
187*4882a593Smuzhiyunthis file.
188*4882a593Smuzhiyun
189*4882a593SmuzhiyunHave fun!
190*4882a593Smuzhiyun
191*4882a593SmuzhiyunAndreas
192