Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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