Commit dd8d4bc2 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

net: remove ax25 and amateur radio (hamradio) subsystem

Remove the amateur radio (AX.25, NET/ROM, ROSE) protocol implementation
and all associated hamradio device drivers from the kernel tree.
This set of protocols has long been a huge bug/syzbot magnet,
and since nobody stepped up to help us deal with the influx
of the AI-generated bug reports we need to move it out of tree
to protect our sanity.

The code is moved to an out-of-tree repo:
https://github.com/linux-netdev/mod-orphan


if it's cleaned up and reworked there we can accept it back.

Minimal stub headers are kept for include/net/ax25.h (AX25_P_IP,
AX25_ADDR_LEN, ax25_address) and include/net/rose.h (ROSE_ADDR_LEN)
so that the conditional integration code in arp.c and tun.c continues
to compile and work when the out-of-tree modules are loaded.

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Acked-by: default avatarCarlos Bilbao <carlos.bilbao@kernel.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260421021824.1293976-1-kuba@kernel.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4f10f1df
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -783,7 +783,6 @@ namespaces/compatibility-list admin-guide/namespaces/compatibility-list
namespaces/index admin-guide/namespaces/index
namespaces/resource-control admin-guide/namespaces/resource-control
networking/altera_tse networking/device_drivers/ethernet/altera/altera_tse
networking/baycom networking/device_drivers/hamradio/baycom
networking/bpf_flow_dissector bpf/prog_flow_dissector
networking/cxacru networking/device_drivers/atm/cxacru
networking/defza networking/device_drivers/fddi/defza
@@ -848,7 +847,6 @@ networking/ixgbe networking/device_drivers/ethernet/intel/ixgbe
networking/ixgbevf networking/device_drivers/ethernet/intel/ixgbevf
networking/netdev-FAQ process/maintainer-netdev
networking/skfp networking/device_drivers/fddi/skfp
networking/z8530drv networking/device_drivers/hamradio/z8530drv
nfc/index driver-api/nfc/index
nfc/nfc-hci driver-api/nfc/nfc-hci
nfc/nfc-pn544 driver-api/nfc/nfc-pn544
+0 −18
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
	APPARMOR AppArmor support is enabled.
	ARM	ARM architecture is enabled.
	ARM64	ARM64 architecture is enabled.
	AX25	Appropriate AX.25 support is enabled.
	CLK	Common clock infrastructure is enabled.
	CMA	Contiguous Memory Area support is enabled.
	DRM	Direct Rendering Management support is enabled.
@@ -633,23 +632,6 @@ Kernel parameters
			1 - Enable the BAU.
			unset - Disable the BAU.

	baycom_epp=	[HW,AX25]
			Format: <io>,<mode>

	baycom_par=	[HW,AX25] BayCom Parallel Port AX.25 Modem
			Format: <io>,<mode>
			See header of drivers/net/hamradio/baycom_par.c.

	baycom_ser_fdx=	[HW,AX25]
			BayCom Serial Port AX.25 Modem (Full Duplex Mode)
			Format: <io>,<irq>,<mode>[,<baud>]
			See header of drivers/net/hamradio/baycom_ser_fdx.c.

	baycom_ser_hdx=	[HW,AX25]
			BayCom Serial Port AX.25 Modem (Half Duplex Mode)
			Format: <io>,<irq>,<mode>
			See header of drivers/net/hamradio/baycom_ser_hdx.c.

	bdev_allow_write_mounted=
			Format: <bool>
			Control the ability to open a mounted block device
+0 −191
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

==============
6pack Protocol
==============

This is the 6pack-mini-HOWTO, written by

Andreas Könsgen DG3KQ

:Internet: ajk@comnets.uni-bremen.de
:AMPR-net: dg3kq@db0pra.ampr.org
:AX.25:    dg3kq@db0ach.#nrw.deu.eu

Last update: April 7, 1998

1. What is 6pack, and what are the advantages to KISS?
======================================================

6pack is a transmission protocol for data exchange between the PC and
the TNC over a serial line. It can be used as an alternative to KISS.

6pack has two major advantages:

- The PC is given full control over the radio
  channel. Special control data is exchanged between the PC and the TNC so
  that the PC knows at any time if the TNC is receiving data, if a TNC
  buffer underrun or overrun has occurred, if the PTT is
  set and so on. This control data is processed at a higher priority than
  normal data, so a data stream can be interrupted at any time to issue an
  important event. This helps to improve the channel access and timing
  algorithms as everything is computed in the PC. It would even be possible
  to experiment with something completely different from the known CSMA and
  DAMA channel access methods.
  This kind of real-time control is especially important to supply several
  TNCs that are connected between each other and the PC by a daisy chain
  (however, this feature is not supported yet by the Linux 6pack driver).

- Each packet transferred over the serial line is supplied with a checksum,
  so it is easy to detect errors due to problems on the serial line.
  Received packets that are corrupt are not passed on to the AX.25 layer.
  Damaged packets that the TNC has received from the PC are not transmitted.

More details about 6pack are described in the file 6pack.ps that is located
in the doc directory of the AX.25 utilities package.

2. Who has developed the 6pack protocol?
========================================

The 6pack protocol has been developed by Ekki Plicht DF4OR, Henning Rech
DF9IC and Gunter Jost DK7WJ. A driver for 6pack, written by Gunter Jost and
Matthias Welwarsky DG2FEF, comes along with the PC version of FlexNet.
They have also written a firmware for TNCs to perform the 6pack
protocol (see section 4 below).

3. Where can I get the latest version of 6pack for LinuX?
=========================================================

At the moment, the 6pack stuff can obtained via anonymous ftp from
db0bm.automation.fh-aachen.de. In the directory /incoming/dg3kq,
there is a file named 6pack.tgz.

4. Preparing the TNC for 6pack operation
========================================

To be able to use 6pack, a special firmware for the TNC is needed. The EPROM
of a newly bought TNC does not contain 6pack, so you will have to
program an EPROM yourself. The image file for 6pack EPROMs should be
available on any packet radio box where PC/FlexNet can be found. The name of
the file is 6pack.bin. This file is copyrighted and maintained by the FlexNet
team. It can be used under the terms of the license that comes along
with PC/FlexNet. Please do not ask me about the internals of this file as I
don't know anything about it. I used a textual description of the 6pack
protocol to program the Linux driver.

TNCs contain a 64kByte EPROM, the lower half of which is used for
the firmware/KISS. The upper half is either empty or is sometimes
programmed with software called TAPR. In the latter case, the TNC
is supplied with a DIP switch so you can easily change between the
two systems. When programming a new EPROM, one of the systems is replaced
by 6pack. It is useful to replace TAPR, as this software is rarely used
nowadays. If your TNC is not equipped with the switch mentioned above, you
can build in one yourself that switches over the highest address pin
of the EPROM between HIGH and LOW level. After having inserted the new EPROM
and switched to 6pack, apply power to the TNC for a first test. The connect
and the status LED are lit for about a second if the firmware initialises
the TNC correctly.

5. Building and installing the 6pack driver
===========================================

The driver has been tested with kernel version 2.1.90. Use with older
kernels may lead to a compilation error because the interface to a kernel
function has been changed in the 2.1.8x kernels.

How to turn on 6pack support:
-----------------------------

- In the linux kernel configuration program, select the code maturity level
  options menu and turn on the prompting for development drivers.

- Select the amateur radio support menu and turn on the serial port 6pack
  driver.

- Compile and install the kernel and the modules.

To use the driver, the kissattach program delivered with the AX.25 utilities
has to be modified.

- Do a cd to the directory that holds the kissattach sources. Edit the
  kissattach.c file. At the top, insert the following lines::

    #ifndef N_6PACK
    #define N_6PACK (N_AX25+1)
    #endif

  Then find the line:

    int disc = N_AX25;

  and replace N_AX25 by N_6PACK.

- Recompile kissattach. Rename it to spattach to avoid confusions.

Installing the driver:
----------------------

- Do an insmod 6pack. Look at your /var/log/messages file to check if the
  module has printed its initialization message.

- Do a spattach as you would launch kissattach when starting a KISS port.
  Check if the kernel prints the message '6pack: TNC found'.

- From here, everything should work as if you were setting up a KISS port.
  The only difference is that the network device that represents
  the 6pack port is called sp instead of sl or ax. So, sp0 would be the
  first 6pack port.

Although the driver has been tested on various platforms, I still declare it
ALPHA. BE CAREFUL! Sync your disks before insmoding the 6pack module
and spattaching. Watch out if your computer behaves strangely. Read section
6 of this file about known problems.

Note that the connect and status LEDs of the TNC are controlled in a
different way than they are when the TNC is used with PC/FlexNet. When using
FlexNet, the connect LED is on if there is a connection; the status LED is
on if there is data in the buffer of the PC's AX.25 engine that has to be
transmitted. Under Linux, the 6pack layer is beyond the AX.25 layer,
so the 6pack driver doesn't know anything about connects or data that
has not yet been transmitted. Therefore the LEDs are controlled
as they are in KISS mode: The connect LED is turned on if data is transferred
from the PC to the TNC over the serial line, the status LED if data is
sent to the PC.

6. Known problems
=================

When testing the driver with 2.0.3x kernels and
operating with data rates on the radio channel of 9600 Baud or higher,
the driver may, on certain systems, sometimes print the message '6pack:
bad checksum', which is due to data loss if the other station sends two
or more subsequent packets. I have been told that this is due to a problem
with the serial driver of 2.0.3x kernels. I don't know yet if the problem
still exists with 2.1.x kernels, as I have heard that the serial driver
code has been changed with 2.1.x.

When shutting down the sp interface with ifconfig, the kernel crashes if
there is still an AX.25 connection left over which an IP connection was
running, even if that IP connection is already closed. The problem does not
occur when there is a bare AX.25 connection still running. I don't know if
this is a problem of the 6pack driver or something else in the kernel.

The driver has been tested as a module, not yet as a kernel-builtin driver.

The 6pack protocol supports daisy-chaining of TNCs in a token ring, which is
connected to one serial port of the PC. This feature is not implemented
and at least at the moment I won't be able to do it because I do not have
the opportunity to build a TNC daisy-chain and test it.

Some of the comments in the source code are inaccurate. They are left from
the SLIP/KISS driver, from which the 6pack driver has been derived.
I haven't modified or removed them yet -- sorry! The code itself needs
some cleaning and optimizing. This will be done in a later release.

If you encounter a bug or if you have a question or suggestion concerning the
driver, feel free to mail me, using the addresses given at the beginning of
this file.

Have fun!

Andreas

Documentation/networking/ax25.rst

deleted100644 → 0
+0 −17
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

=====
AX.25
=====

To use the amateur radio protocols within Linux you will need to get a
suitable copy of the AX.25 Utilities. More detailed information about
AX.25, NET/ROM and ROSE, associated programs and utilities can be
found on https://linux-ax25.in-berlin.de.

There is a mailing list for discussing Linux amateur radio matters
called linux-hams@vger.kernel.org. To subscribe to it, send a message to
linux-hams+subscribe@vger.kernel.org or use the web interface at
https://vger.kernel.org. The subject and body of the message are
ignored.  You don't need to be subscribed to post but of course that
means you might miss an answer.
+0 −174
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

===============================
Linux Drivers for Baycom Modems
===============================

Thomas M. Sailer, HB9JNX/AE4WA, <sailer@ife.ee.ethz.ch>

The drivers for the baycom modems have been split into
separate drivers as they did not share any code, and the driver
and device names have changed.

This document describes the Linux Kernel Drivers for simple Baycom style
amateur radio modems.

The following drivers are available:
====================================

baycom_ser_fdx:
  This driver supports the SER12 modems either full or half duplex.
  Its baud rate may be changed via the ``baud`` module parameter,
  therefore it supports just about every bit bang modem on a
  serial port. Its devices are called bcsf0 through bcsf3.
  This is the recommended driver for SER12 type modems,
  however if you have a broken UART clone that does not have working
  delta status bits, you may try baycom_ser_hdx.

baycom_ser_hdx:
  This is an alternative driver for SER12 type modems.
  It only supports half duplex, and only 1200 baud. Its devices
  are called bcsh0 through bcsh3. Use this driver only if baycom_ser_fdx
  does not work with your UART.

baycom_par:
  This driver supports the par96 and picpar modems.
  Its devices are called bcp0 through bcp3.

baycom_epp:
  This driver supports the EPP modem.
  Its devices are called bce0 through bce3.
  This driver is work-in-progress.

The following modems are supported:

======= ========================================================================
ser12   This is a very simple 1200 baud AFSK modem. The modem consists only
	of a modulator/demodulator chip, usually a TI TCM3105. The computer
	is responsible for regenerating the receiver bit clock, as well as
	for handling the HDLC protocol. The modem connects to a serial port,
	hence the name. Since the serial port is not used as an async serial
	port, the kernel driver for serial ports cannot be used, and this
	driver only supports standard serial hardware (8250, 16450, 16550)

par96   This is a modem for 9600 baud FSK compatible to the G3RUH standard.
	The modem does all the filtering and regenerates the receiver clock.
	Data is transferred from and to the PC via a shift register.
	The shift register is filled with 16 bits and an interrupt is signalled.
	The PC then empties the shift register in a burst. This modem connects
	to the parallel port, hence the name. The modem leaves the
	implementation of the HDLC protocol and the scrambler polynomial to
	the PC.

picpar  This is a redesign of the par96 modem by Henning Rech, DF9IC. The modem
	is protocol compatible to par96, but uses only three low power ICs
	and can therefore be fed from the parallel port and does not require
	an additional power supply. Furthermore, it incorporates a carrier
	detect circuitry.

EPP     This is a high-speed modem adaptor that connects to an enhanced parallel
	port.

	Its target audience is users working over a high speed hub (76.8kbit/s).

eppfpga This is a redesign of the EPP adaptor.
======= ========================================================================

All of the above modems only support half duplex communications. However,
the driver supports the KISS (see below) fullduplex command. It then simply
starts to send as soon as there's a packet to transmit and does not care
about DCD, i.e. it starts to send even if there's someone else on the channel.
This command is required by some implementations of the DAMA channel
access protocol.


The Interface of the drivers
============================

Unlike previous drivers, these drivers are no longer character devices,
but they are now true kernel network interfaces. Installation is therefore
simple. Once installed, four interfaces named bc{sf,sh,p,e}[0-3] are available.
sethdlc from the ax25 utilities may be used to set driver states etc.
Users of userland AX.25 stacks may use the net2kiss utility (also available
in the ax25 utilities package) to convert packets of a network interface
to a KISS stream on a pseudo tty. There's also a patch available from
me for WAMPES which allows attaching a kernel network interface directly.


Configuring the driver
======================

Every time a driver is inserted into the kernel, it has to know which
modems it should access at which ports. This can be done with the setbaycom
utility. If you are only using one modem, you can also configure the
driver from the insmod command line (or by means of an option line in
``/etc/modprobe.d/*.conf``).

Examples::

  modprobe baycom_ser_fdx mode="ser12*" iobase=0x3f8 irq=4
  sethdlc -i bcsf0 -p mode "ser12*" io 0x3f8 irq 4

Both lines configure the first port to drive a ser12 modem at the first
serial port (COM1 under DOS). The * in the mode parameter instructs the driver
to use the software DCD algorithm (see below)::

  insmod baycom_par mode="picpar" iobase=0x378
  sethdlc -i bcp0 -p mode "picpar" io 0x378

Both lines configure the first port to drive a picpar modem at the
first parallel port (LPT1 under DOS). (Note: picpar implies
hardware DCD, par96 implies software DCD).

The channel access parameters can be set with sethdlc -a or kissparms.
Note that both utilities interpret the values slightly differently.


Hardware DCD versus Software DCD
================================

To avoid collisions on the air, the driver must know when the channel is
busy. This is the task of the DCD circuitry/software. The driver may either
utilise a software DCD algorithm (options=1) or use a DCD signal from
the hardware (options=0).

======= =================================================================
ser12   if software DCD is utilised, the radio's squelch should always be
	open. It is highly recommended to use the software DCD algorithm,
	as it is much faster than most hardware squelch circuitry. The
	disadvantage is a slightly higher load on the system.

par96   the software DCD algorithm for this type of modem is rather poor.
	The modem simply does not provide enough information to implement
	a reasonable DCD algorithm in software. Therefore, if your radio
	feeds the DCD input of the PAR96 modem, the use of the hardware
	DCD circuitry is recommended.

picpar  the picpar modem features a builtin DCD hardware, which is highly
	recommended.
======= =================================================================



Compatibility with the rest of the Linux kernel
===============================================

The serial driver and the baycom serial drivers compete
for the same hardware resources. Of course only one driver can access a given
interface at a time. The serial driver grabs all interfaces it can find at
startup time. Therefore the baycom drivers subsequently won't be able to
access a serial port. You might therefore find it necessary to release
a port owned by the serial driver with 'setserial /dev/ttyS# uart none', where
# is the number of the interface. The baycom drivers do not reserve any
ports at startup, unless one is specified on the 'insmod' command line. Another
method to solve the problem is to compile all drivers as modules and
leave it to kmod to load the correct driver depending on the application.

The parallel port drivers (baycom_par, baycom_epp) now use the parport subsystem
to arbitrate the ports between different client drivers.

vy 73s de

Tom Sailer, sailer@ife.ee.ethz.ch

hb9jnx @ hb9w.ampr.org
Loading