Commit Graph

6 Commits

Author SHA1 Message Date
Vadim Yanitskiy 06922fad6c isdn: add a lookup table with E1/E2/E3 bits from Table 5/V.110
Let's make those E1/E2/E3 bit combinations publicly available in
form of a lookup table (key is enum osmo_v100_sync_ra1_rate).
Add convenience macros for setting and comparing these bits.
This lookup table will be used by osmocom-bb.git.

Change-Id: I6d2f8e250df31c233a2741163113dc07515409ae
Related: OS#4396
2024-01-16 20:04:00 +07:00
Vadim Yanitskiy 85554db38d isdn: initial implementation of the V.110 TA
ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions
for the connection of Terminal Equipment (TE) having standard V-series
interfaces to the ISDN.  This patch brings "software" implementation
of the TA to libosmoisdn.

The primary user for this soft-TA is the mobile-side implementation
of CSD (Circuit Switched Data) in osmocom-bb.  CSD is heavily based
on V.110, which is not surprising given that GSM is a "wireless ISDN".
Nevertheless, this code will likely also be useful in the context
of retro-networking.

Similarly to the existing V.110 code in libosmoisdn, the present
implementation aims to be functional and correct, rather than
efficient in any way.  It also has several limitations, which are
not critical for the CSD use case, but eventually may be a problem
for other use cases in the context of retro-networking.

Therefore, the V.110 TA API should be considered _unstable_,
and may be subject to change in the future.

  +-------+      +------+   B-channel   +------+      +-------+
  |  TE1  |------|  TA  |~~~~~~~~~~~~~~~|  TA  |------|  TE2  |
  +-------+      +------+               +------+      +-------+

TE (also known as DTE) is basically a computer, having a V-series
(usually RS-232) connection to TA (also known as DCE).  The TA acts
like a regular analog modem, except that it is not performing any
kind of modulation or demodulation itself.

The TE-TA interface is implemented by the user supplied callback
functions, configured during the allocation of a TA instance:

* .rx_cb() - receive call-back of the application,
* .tx_cb() - transmit call-back of the application,
* .status_update_cb() - status line update call-back.

In addition to that, the application (TE) can interact with the
V.24 status lines (circuits) using the following API:

* osmo_v110_ta_{get,set}_status(),
* osmo_v110_ta_{get,set}_circuit().

The Rx and Tx between TE and TA is always driven by the TA itself,
as a result of an interaction with the lower layer implementing
the B-channel interface.  There is currently no buffering and thus
no way for TE to initiate transmission or pull data on its own.

The TA-TA (B-channel) interface is implemented by the following
functions, which are meant to be called by the lower layer
transmitting and receiving V.110 frames over certain medium:

* osmo_v110_ta_frame_in() - indicate a received V.110 frame,
* osmo_v110_ta_frame_out() - pull a V.110 frame for transmission,
* osmo_v110_ta_[de]sync_ind() - indicate a synchronization event.

The lower layer is responsible for finding the synchronization
pattern (if needed), aligning to the frame boundaries, and doing
the V.110 frame coding.

The D-channel signalling is behind the scope of this module.

Initial (Work-in-Progress) implementation by Harald Welte,
completed and co-authored by Vadim Yanitskiy.

Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f
Related: OS#4396
2024-01-09 13:11:04 +00:00
Andreas Eversberg 49b7087360 LAPD: Add support for RTS based polling and T200
The T200 timer is started when the current frame is polled at
PH-READY-TO-SEND event.

A flag is used to enable this feature. The user of LAPD core must track
frame numbers to check the timeout condition. Then it must call the
external timeout function.

Related: OS#4074
Change-Id: Ib961b5a44911b99b0487641533301749c0286995
2023-11-27 16:25:53 +00:00
Harald Welte 065dab866e isdn: Add V.110 encoder/decoder
V.110 defines a B-channel protocol for transmission of synchronous and
asynchronous serial data of V-series interfaces via terminal adapters
over ISDN.

Let's add (unoptimized but easy to debug) functions for encoding and
decoding of V.110 frames for various bit-rates.

Related: OS#1572
Change-Id: I1b5fd3847d3bfb0a0f763e0574893962ec699680
2023-03-08 20:43:15 +01:00
Philipp Maier 54e1782e71 i460_mux: make osmo_i460_subchan_count public
There may be situations where we must check if there are still I.460
subchannels active, so lets make the function osmo_i460_subchan_count
public

Change-Id: I0454ffe5809f21504c1e263a781c06596d452d4b
Related: OS#5198
2023-02-18 08:38:00 +00:00
Harald Welte d55a209d1c create libosmoisdn sub-library
There are some parts of libosmogsm which are not really GSM specific,
but rather ISDN bits that were inherited by GSM.  This includes the
I.460 multiplex as well as the core LAPD protocol.

Let's move those bits to its own libosmoisdn library, before we add
more ISDN specific bits to the wrong place.

Backwards-compatibility is created by making libosmogsm depend on
libosmoisdn, and by providing wrapper include files for source
compatibility.

Change-Id: Ib1a6c762322fd5047be3188b1df22408ef06aa50
2023-01-21 22:41:57 +01:00